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

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

                Author: ASF GitHub Bot
            Created on: 04/Jun/18 18:47
            Start Date: 04/Jun/18 18:47
    Worklog Time Spent: 10m 
      Work Description: angoenka commented on a change in pull request #5456: 
[BEAM-4145] Populate the worker_id metadata in the Java SDK Harness
URL: https://github.com/apache/beam/pull/5456#discussion_r192269204
 
 

 ##########
 File path: 
sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/channel/ManagedChannelFactory.java
 ##########
 @@ -70,13 +92,42 @@ public ManagedChannel forDescriptor(ApiServiceDescriptor 
apiServiceDescriptor) {
    */
   private static class Default extends ManagedChannelFactory {
     @Override
-    public ManagedChannel forDescriptor(ApiServiceDescriptor 
apiServiceDescriptor) {
+    public ManagedChannel forDescriptor(
+        ApiServiceDescriptor apiServiceDescriptor, List<ClientInterceptor> 
interceptors) {
       return ManagedChannelBuilder.forTarget(apiServiceDescriptor.getUrl())
           .usePlaintext(true)
           // Set the message size to max value here. The actual size is 
governed by the
           // buffer size in the layers above.
           .maxInboundMessageSize(Integer.MAX_VALUE)
+          .intercept(interceptors)
           .build();
     }
   }
+
+  private static class InterceptedManagedChannelFactory extends 
ManagedChannelFactory {
+    private final ManagedChannelFactory channelFactory;
+    private final List<ClientInterceptor> interceptors;
+
+    private InterceptedManagedChannelFactory(
+        ManagedChannelFactory managedChannelFactory, List<ClientInterceptor> 
interceptors) {
+      this.channelFactory = managedChannelFactory;
+      this.interceptors = interceptors;
+    }
+
+    @Override
+    protected ManagedChannel forDescriptorOnly(ApiServiceDescriptor 
apiServiceDescriptor) {
+      return forDescriptor(apiServiceDescriptor, interceptors);
+    }
+
+    @Override
+    protected ManagedChannel forDescriptor(
+        ApiServiceDescriptor apiServiceDescriptor, List<ClientInterceptor> 
interceptors) {
+      return channelFactory.forDescriptor(apiServiceDescriptor, interceptors);
+    }
+
+    @Override
+    public ManagedChannelFactory withInterceptors(List<ClientInterceptor> 
interceptors) {
+      return new InterceptedManagedChannelFactory(channelFactory, 
interceptors);
 
 Review comment:
   We are loosing the original list of interceptors here.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

    Worklog Id:     (was: 108698)
    Time Spent: 3.5h  (was: 3h 20m)

> Java SDK Harness populates control request headers with worker id
> -----------------------------------------------------------------
>
>                 Key: BEAM-4145
>                 URL: https://issues.apache.org/jira/browse/BEAM-4145
>             Project: Beam
>          Issue Type: New Feature
>          Components: sdk-java-harness
>            Reporter: Ben Sidhom
>            Assignee: Thomas Groh
>            Priority: Minor
>          Time Spent: 3.5h
>  Remaining Estimate: 0h
>
> Runner code needs to be able to identify incoming harness connections by the 
> worker ids that it assigns to them on creation. This is currently done by the 
> go boot code when the harness runs in a docker container. However, in-process 
> harnesses never specify worker ids. This prevents in-process harnesses from 
> being multiplexed by a runner (most likely the ULR and test code).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to