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

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

                Author: ASF GitHub Bot
            Created on: 03/Dec/18 20:22
            Start Date: 03/Dec/18 20:22
    Worklog Time Spent: 10m 
      Work Description: lukecwik commented on a change in pull request #7168: 
[BEAM-6160] Use service server rather than service
URL: https://github.com/apache/beam/pull/7168#discussion_r238421400
 
 

 ##########
 File path: 
runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/ServerFactory.java
 ##########
 @@ -153,22 +153,109 @@ private static Server 
createServer(List<BindableService> services, InetSocketAdd
                           service, 
GrpcContextHeaderAccessorProvider.interceptor())));
       return builder.build().start();
     }
+  }
+
+  /**
+   * Creates a {@link Server gRPC Server} using a Unix domain socket. Note 
that this requires <a
+   * href="http://netty.io/wiki/forked-tomcat-native.html";>Netty TcNative</a> 
available to be able
+   * to provide a {@link EpollServerDomainSocketChannel}.
+   *
+   * <p>The unix domain socket is located at 
${java.io.tmpdir}/fnapi${random[0-10000)}.sock
+   */
+  private static class EpollDomainSocket extends ServerFactory {
+    private static File getFileForPort(int port) {
+      return new File(System.getProperty("java.io.tmpdir"), 
String.format("fnapi%d.sock", port));
+    }
 
-    private static Server createServer(BindableService service, 
InetSocketAddress socket)
+    @Override
+    public Server allocatePortAndCreate(
 
 Review comment:
   Note that "allocatePort" is the wrong terminology here.
   
   Either in this PR or in a follow-up please rename this method to 
allocateAddressAndCreate and update the javadoc comment for the ServerFactory 
along the lines that the allocation is server type dependent, e.g. it could be 
a port for some servers and for others it may be a file path.

----------------------------------------------------------------
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: 171699)
    Time Spent: 1h 50m  (was: 1h 40m)

> Simplify service and server creation in dataflow runner harness
> ---------------------------------------------------------------
>
>                 Key: BEAM-6160
>                 URL: https://issues.apache.org/jira/browse/BEAM-6160
>             Project: Beam
>          Issue Type: Sub-task
>          Components: runner-dataflow
>            Reporter: Boyuan Zhang
>            Assignee: Boyuan Zhang
>            Priority: Major
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>




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

Reply via email to