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

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

                Author: ASF GitHub Bot
            Created on: 20/Apr/18 19:00
            Start Date: 20/Apr/18 19:00
    Worklog Time Spent: 10m 
      Work Description: bsidhom commented on a change in pull request #5189: 
[BEAM-3327] Basic Docker environment factory
URL: https://github.com/apache/beam/pull/5189#discussion_r183142327
 
 

 ##########
 File path: 
runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/control/ControlClientPool.java
 ##########
 @@ -17,16 +17,31 @@
  */
 package org.apache.beam.runners.fnexecution.control;
 
-import org.apache.beam.sdk.fn.function.ThrowingConsumer;
-import org.apache.beam.sdk.util.ThrowingSupplier;
+/**
+ * A pool of control clients that brokers incoming SDK harness connections (in 
the form of {@link
+ * InstructionRequestHandler InstructionRequestHandlers}.
+ *
+ * <p>Incoming instruction handlers usually come from the control plane gRPC 
service. Typical use:
+ *
+ * <pre>
+ *   // Within owner of the pool, who may or may not own the control plane 
server as well
+ *   ControlClientPool pool = ...
+ *   FnApiControlClientPoolService service =
+ *       FnApiControlClientPoolService.offeringClientsToSink(pool.getSink(), 
headerAccessor)
+ *   // Incoming gRPC control connections will now be added to the client pool.
+ *
+ *   // Within code that interacts with the instruction handler. The get call 
blocks until an
+ *   // incoming client is available:
+ *   ControlClientSource clientSource = ... InstructionRequestHandler
+ *   instructionHandler = clientSource.get("worker-id");
+ * </pre>
+ */
+public interface ControlClientPool {
 
-/** Control client pool that exposes a source and sink of control clients. */
-public interface ControlClientPool<T extends InstructionRequestHandler> {
+  /** Sink for control clients. */
+  ControlClientSink getSink();
 
 Review comment:
   <!--thread_id:cc_182923874_t; 
commit:fb7d2bd7ba1bb27186e8d2dda861acd08666a0c1; resolved:1-->
   <!--section:context-quote-->
   > **jkff** wrote:
   > I think it used to be this way (Function) before, but I like the concrete 
interfaces more.
   > Also, I think terminology "sink pool" and "source pool" would not reflect 
what this does - this is not a pool of sources/sinks, it rather is a sink into 
the pool (a handle for adding to the pool) or a source from the pool (a handle 
for retrieving from the pool). I'd be in favor of keeping this part as-is.
   
   <!--section:body-->
   We previously used the generic functional types, but this makes it difficult 
to understand the expected function of the functions themselves when passed 
around. I'll include it as a subinterface as Eugene suggested earlier, since 
tying it into the pool explicitly should make this clearer.

----------------------------------------------------------------
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:
[email protected]


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

    Worklog Id:     (was: 93377)
    Time Spent: 13.5h  (was: 13h 20m)

> Add abstractions to manage Environment Instance lifecycles.
> -----------------------------------------------------------
>
>                 Key: BEAM-3327
>                 URL: https://issues.apache.org/jira/browse/BEAM-3327
>             Project: Beam
>          Issue Type: New Feature
>          Components: runner-core
>            Reporter: Thomas Groh
>            Assignee: Ben Sidhom
>            Priority: Major
>              Labels: portability
>          Time Spent: 13.5h
>  Remaining Estimate: 0h
>
> This permits remote stage execution for arbitrary environments



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

Reply via email to