[ 
https://issues.apache.org/jira/browse/BEAM-8137?focusedWorklogId=608001&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-608001
 ]

ASF GitHub Bot logged work on BEAM-8137:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 07/Jun/21 17:07
            Start Date: 07/Jun/21 17:07
    Worklog Time Spent: 10m 
      Work Description: kw2542 commented on a change in pull request #14942:
URL: https://github.com/apache/beam/pull/14942#discussion_r646786141



##########
File path: 
runners/portability/java/src/main/java/org/apache/beam/runners/portability/ExternalWorkerService.java
##########
@@ -90,10 +97,44 @@ public void stopWorker(
   public void close() {}
 
   public GrpcFnServer<ExternalWorkerService> start() throws Exception {
-    GrpcFnServer<ExternalWorkerService> server =
-        GrpcFnServer.allocatePortAndCreateFor(this, serverFactory);
+    final String externalServiceAddress =
+        
Environments.getExternalServiceAddress(options.as(PortablePipelineOptions.class));
+    GrpcFnServer<ExternalWorkerService> server;
+    if (externalServiceAddress.isEmpty()) {
+      server = GrpcFnServer.allocatePortAndCreateFor(this, serverFactory);
+    } else {
+      server =
+          GrpcFnServer.create(
+              this,
+              
Endpoints.ApiServiceDescriptor.newBuilder().setUrl(externalServiceAddress).build(),
+              serverFactory);
+    }
     LOG.debug(
         "Listening for worker start requests at {}.", 
server.getApiServiceDescriptor().getUrl());
     return server;
   }
+
+  public static void main(String[] args) throws Exception {

Review comment:
       Got you, I will update the javadoc.
   
   In addition, I am planning to have a separate PR out to update the 
`java/container/boot.go` to accept `worker_pool` option, just like 
`python/container/boot.go` so that `boot.go` can start `ExternalWorkerService` 
instead of `FnHarness` like `java -cp xxx 
org.apache.beam.runners.portability.ExternalWorkerService` 
   
   Do you think this aligns your thoughts on how java should support worker 
pool ?




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 608001)
    Time Spent: 1h 50m  (was: 1h 40m)

> Worker pool option for Java SDK container
> -----------------------------------------
>
>                 Key: BEAM-8137
>                 URL: https://issues.apache.org/jira/browse/BEAM-8137
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-java-harness
>            Reporter: Thomas Weise
>            Priority: P3
>              Labels: Clarified
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> The worker pool option was added to the Python SDK container in BEAM-7980. 
> Support in the Java SDK container is simpler since it can rely on threading 
> and it should be added for feature parity.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to