acrites commented on code in PR #29963:
URL: https://github.com/apache/beam/pull/29963#discussion_r1462301676
##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/StreamingDataflowWorker.java:
##########
@@ -496,17 +497,23 @@ public static void main(String[] args) throws Exception {
public static StreamingDataflowWorker fromDataflowWorkerHarnessOptions(
DataflowWorkerHarnessOptions options) throws IOException {
- return new StreamingDataflowWorker(
- Collections.emptyList(),
- IntrinsicMapTaskExecutorFactory.defaultFactory(),
- new DataflowWorkUnitClient(options, LOG),
- options.as(StreamingDataflowWorkerOptions.class),
- true,
- new HotKeyLogger(),
- Instant::now,
- (threadName) ->
- Executors.newSingleThreadScheduledExecutor(
- new ThreadFactoryBuilder().setNameFormat(threadName).build()));
+ StreamingDataflowWorker worker =
+ new StreamingDataflowWorker(
+ Collections.emptyList(),
+ IntrinsicMapTaskExecutorFactory.defaultFactory(),
+ new DataflowWorkUnitClient(options, LOG),
+ options.as(StreamingDataflowWorkerOptions.class),
+ true,
+ new HotKeyLogger(),
+ Instant::now,
+ (threadName) ->
+ Executors.newSingleThreadScheduledExecutor(
+ new
ThreadFactoryBuilder().setNameFormat(threadName).build()));
+ options
+ .as(StreamingDataflowWorkerOptions.class)
+ .getWindmillServerStub()
+ .setProcessHeartbeatResponses(worker::handleHeartbeatResponses);
Review Comment:
Done. Seems a lot nicer this way.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]