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

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

                Author: ASF GitHub Bot
            Created on: 03/Apr/18 21:40
            Start Date: 03/Apr/18 21:40
    Worklog Time Spent: 10m 
      Work Description: bsidhom commented on a change in pull request #5008: 
[BEAM-3994] Use typed client pool sinks and sources
URL: https://github.com/apache/beam/pull/5008#discussion_r178970567
 
 

 ##########
 File path: 
runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/control/ControlClientPool.java
 ##########
 @@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.beam.runners.fnexecution.control;
+
+/** Control client pool that exposes a source and sink of control clients. */
+public interface ControlClientPool<T extends InstructionRequestHandler> {
+
+  /** Source of control clients. */
+  ClientSource<T> getSource();
+
+  /** Sink for control clients. */
+  ClientSink<T> getSink();
+
+  /** A source of control clients. */
+  @FunctionalInterface
+  interface ClientSource<T> {
+      T take() throws Exception;
+  }
+
+  /** A sink for control clients. */
+  @FunctionalInterface
+  interface ClientSink<T> {
 
 Review comment:
   Just checked. The problem is `ThrowingConsumer`, which lives under the 
`sdks/java/harness`. Is it safe to add a dependency there or should the class 
be moved elsewhere? This was actually the motivation for 
[BEAM-3966](https://issues.apache.org/jira/browse/BEAM-3966).

----------------------------------------------------------------
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: 87291)
    Time Spent: 1h 10m  (was: 1h)

> Use typed sinks and sources for FnApiControlClientPoolService
> -------------------------------------------------------------
>
>                 Key: BEAM-3994
>                 URL: https://issues.apache.org/jira/browse/BEAM-3994
>             Project: Beam
>          Issue Type: Bug
>          Components: runner-core
>            Reporter: Ben Sidhom
>            Assignee: Ben Sidhom
>            Priority: Minor
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> We operate with blocking queues directly when managing control clients with 
> the FnApiControlClientPoolService. This makes interactions with the client 
> pool difficult to understand. We should instead make client sources and sinks 
> explicit.



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

Reply via email to