ihji commented on a change in pull request #11521:
URL: https://github.com/apache/beam/pull/11521#discussion_r421047427



##########
File path: 
runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/GrpcFnServer.java
##########
@@ -39,6 +43,59 @@
     return new GrpcFnServer<>(server, service, apiServiceDescriptor.build());
   }
 
+  /**
+   * Create a {@link GrpcFnServer}s for the provided {@link FnService}s 
running on an arbitrary
+   * port.
+   */
+  public static List<GrpcFnServer<? extends FnService>> 
allocatePortAndCreateFor(
+      List<? extends FnService> services, ServerFactory factory) throws 
IOException {
+    ApiServiceDescriptor.Builder apiServiceDescriptor = 
ApiServiceDescriptor.newBuilder();
+    Server server =
+        factory.allocateAddressAndCreate(
+            Collections.unmodifiableList(services), apiServiceDescriptor);
+    AtomicInteger countdown = new AtomicInteger(services.size());
+    return Lists.transform(
+        services,
+        service ->
+            new SharedGrpcFnServer<>(server, service, 
apiServiceDescriptor.build(), countdown));
+  }
+
+  /**
+   * Create a {@link GrpcFnServer}s for the provided {@link FnService}s 
running on a specified port.

Review comment:
       `Create {@link GrpcFnServer}s`?

##########
File path: 
runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/GrpcFnServer.java
##########
@@ -39,6 +43,59 @@
     return new GrpcFnServer<>(server, service, apiServiceDescriptor.build());
   }
 
+  /**
+   * Create a {@link GrpcFnServer}s for the provided {@link FnService}s 
running on an arbitrary

Review comment:
       `Create {@link GrpcFnServer}s`?

##########
File path: 
runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/control/DefaultJobBundleFactory.java
##########
@@ -613,7 +620,7 @@ public synchronized void close() {
       // These will be closed in the reverse creation order:
       try (AutoCloseable envCloser = environment;
           AutoCloseable provisioningServer = 
serverInfo.getProvisioningServer();
-          AutoCloseable retrievalServer = serverInfo.getRetrievalServer();
+          AutoCloseable retrievalServer = 
serverInfo.getLegacyRetrievalServer();

Review comment:
       Shouldn't we also close `retrievalServer`?




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


Reply via email to