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

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

                Author: ASF GitHub Bot
            Created on: 03/Apr/18 20:56
            Start Date: 03/Apr/18 20:56
    Worklog Time Spent: 10m 
      Work Description: tgroh 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_r178959436
 
 

 ##########
 File path: 
runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/control/QueueControlClientPool.java
 ##########
 @@ -0,0 +1,54 @@
+/*
+ * 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;
+
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.SynchronousQueue;
+
+/** Control client pool backed by a blocking queue. */
+public class QueueControlClientPool<T extends InstructionRequestHandler>
+    implements ControlClientPool {
+
+  private final BlockingQueue<T> queue;
+
+  /** Creates a client pool backed by a {@link SynchronousQueue}. */
+  public static QueueControlClientPool createSynchronous() {
+      return new QueueControlClientPool<>(new SynchronousQueue<>(true));
+  }
+
+  /** Creates a client pool backed by an unbounded {@link 
LinkedBlockingQueue}. */
+  public static QueueControlClientPool createLinked() {
 
 Review comment:
   I don't consider the `Linked` to be the interesting part of this 
implementation - but I'm not 100% on a better name.

----------------------------------------------------------------
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: 87271)
    Time Spent: 40m  (was: 0.5h)

> 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: 40m
>  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