Skip to content

Commit e1cd3dc

Browse files
committed
Removed null check before setting status page
1 parent 1c1922c commit e1cd3dc

2 files changed

Lines changed: 21 additions & 22 deletions

File tree

runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/StreamingDataflowWorker.java

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ private StreamingDataflowWorker(
228228
this.workUnitExecutor = workUnitExecutor;
229229
this.harnessSwitchExecutor =
230230
Executors.newSingleThreadExecutor(
231-
new ThreadFactoryBuilder().setNameFormat("HarnessSwtichExecutor").build());
231+
new ThreadFactoryBuilder().setNameFormat("HarnessSwitchExecutor").build());
232232
this.clock = clock;
233233
this.memoryMonitor = BackgroundMemoryMonitor.create(memoryMonitor);
234234
this.numCommitThreads =
@@ -527,26 +527,25 @@ private void switchStreamingWorkerHarness(ConnectivityType connectivityType) {
527527
streamingWorkerHarness.get().start();
528528
LOG.debug("Started SingleSourceWorkerHarness");
529529
}
530-
if (newHarnessFactoryOutput != null) {
531-
this.statusPages.set(
532-
createStatusPageBuilder(
533-
this.options, this.windmillStreamFactory, this.memoryMonitor.memoryMonitor())
534-
.setClock(this.clock)
535-
.setClientId(this.clientId)
536-
.setIsRunning(this.running)
537-
.setStateCache(this.stateCache)
538-
.setComputationStateCache(this.computationStateCache)
539-
.setWorkUnitExecutor(this.workUnitExecutor)
540-
.setGlobalConfigHandle(this.configFetcher.getGlobalConfigHandle())
541-
.setChannelzServlet(newHarnessFactoryOutput.channelzServlet())
542-
.setGetDataStatusProvider(newHarnessFactoryOutput.getDataStatusProvider())
543-
.setCurrentActiveCommitBytes(
544-
newHarnessFactoryOutput.currentActiveCommitBytesProvider())
545-
.setChannelCache(newHarnessFactoryOutput.channelCache())
546-
.build());
547-
this.statusPages.get().start(this.options);
548-
LOG.info("Started new StreamingWorkerStatusPages instance.");
549-
}
530+
this.statusPages.set(
531+
createStatusPageBuilder(
532+
this.options, this.windmillStreamFactory, this.memoryMonitor.memoryMonitor())
533+
.setClock(this.clock)
534+
.setClientId(this.clientId)
535+
.setIsRunning(this.running)
536+
.setStateCache(this.stateCache)
537+
.setComputationStateCache(this.computationStateCache)
538+
.setWorkUnitExecutor(this.workUnitExecutor)
539+
.setGlobalConfigHandle(this.configFetcher.getGlobalConfigHandle())
540+
.setChannelzServlet(newHarnessFactoryOutput.channelzServlet())
541+
.setGetDataStatusProvider(newHarnessFactoryOutput.getDataStatusProvider())
542+
.setCurrentActiveCommitBytes(
543+
newHarnessFactoryOutput.currentActiveCommitBytesProvider())
544+
.setChannelCache(newHarnessFactoryOutput.channelCache())
545+
.build());
546+
this.statusPages.get().start(this.options);
547+
LOG.info("Started new StreamingWorkerStatusPages instance.");
548+
550549
}
551550

552551
private static StreamingWorkerStatusPages.Builder createStatusPageBuilder(

runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/streaming/harness/StreamingWorkerStatusPages.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public final class StreamingWorkerStatusPages {
8080
private final @Nullable GrpcWindmillStreamFactory windmillStreamFactory;
8181
private final DebugCapture.@Nullable Manager debugCapture;
8282
private final @Nullable ChannelzServlet channelzServlet;
83-
private @Nullable ChannelCache channelCache;
83+
private final @Nullable ChannelCache channelCache;
8484

8585
private final AtomicReference<StreamingGlobalConfig> globalConfig = new AtomicReference<>();
8686

0 commit comments

Comments
 (0)