You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/04/01 22:52:23 UTC

[GitHub] [beam] lukecwik commented on a change in pull request #11235: [BEAM-9618] Pull bundle descriptors.

lukecwik commented on a change in pull request #11235: [BEAM-9618] Pull bundle descriptors.
URL: https://github.com/apache/beam/pull/11235#discussion_r401945553
 
 

 ##########
 File path: runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/control/FnApiControlClientPoolService.java
 ##########
 @@ -105,12 +105,38 @@ public static FnApiControlClientPoolService offeringClientsToPool(
     return newClient.asResponseObserver();
   }
 
+  @Override
+  public void getProcessBundleDescriptor(
+      BeamFnApi.GetProcessBundleDescriptorRequest request,
+      StreamObserver<BeamFnApi.ProcessBundleDescriptor> responseObserver) {
+    final String workerId = headerAccessor.getSdkWorkerId();
+    if (Strings.isNullOrEmpty(workerId)) {
+      // TODO(BEAM-4149): Enforce proper worker id.
+      LOG.warn("No worker_id header provided in getProcessBundleDescriptor request");
+    }
+
+    LOG.info("getProcessBundleDescriptor request with id {}", workerId);
+
+    FnApiControlClient client;
+    synchronized (lock) {
+      client = vendedClients.get(workerId);
+    }
+    LOG.warn("getProcessBundleDescriptor client {}", client);
+    LOG.warn("getProcessBundleDescriptor id {}", request.getProcessBundleDescriptorId());
+    LOG.warn(
+        "getProcessBundleDescriptor result {}",
+        client.getProcessBundleDescriptor(request.getProcessBundleDescriptorId()));
+    responseObserver.onNext(
+        client.getProcessBundleDescriptor(request.getProcessBundleDescriptorId()));
 
 Review comment:
   Please return the NOT_FOUND status error if the process bundle descriptor is null.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services