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

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

                Author: ASF GitHub Bot
            Created on: 06/Sep/18 08:46
            Start Date: 06/Sep/18 08:46
    Worklog Time Spent: 10m 
      Work Description: mxm commented on a change in pull request #6341: 
[BEAM-4130] Fixing bug in flink job server creation
URL: https://github.com/apache/beam/pull/6341#discussion_r215541807
 
 

 ##########
 File path: 
runners/flink/src/main/java/org/apache/beam/runners/flink/FlinkJobServerDriver.java
 ##########
 @@ -107,12 +107,19 @@ public static FlinkJobServerDriver 
fromConfig(ServerConfiguration configuration)
         new 
ThreadFactoryBuilder().setNameFormat("flink-runner-job-server").setDaemon(true).build();
     ListeningExecutorService executor =
         
MoreExecutors.listeningDecorator(Executors.newCachedThreadPool(threadFactory));
-    ServerFactory jobServerFactory = ServerFactory.createWithPortSupplier(() 
-> configuration.port);
+    ServerFactory jobServerFactory =
+        ServerFactory.createWithPortSupplier(() -> getPort(configuration.host, 
configuration.port));
     ServerFactory artifactServerFactory =
-        ServerFactory.createWithPortSupplier(() -> configuration.artifactPort);
+        ServerFactory.createWithPortSupplier(
+            () -> getPort(configuration.host, configuration.artifactPort));
     return create(configuration, executor, jobServerFactory, 
artifactServerFactory);
   }
 
+  private static int getPort(String host, int port) {
+    // If host is empty then use dynamic port
+    return Strings.isNullOrEmpty(host) ? 0 : port;
 
 Review comment:
   Why do we not use the provided port when the host is null? I think it would 
make sense that the user doesn't care about the host name but wants to bind to 
a specific port.

----------------------------------------------------------------
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: 141674)
    Time Spent: 8.5h  (was: 8h 20m)

> Portable Flink runner JobService entry point in a Docker container
> ------------------------------------------------------------------
>
>                 Key: BEAM-4130
>                 URL: https://issues.apache.org/jira/browse/BEAM-4130
>             Project: Beam
>          Issue Type: New Feature
>          Components: runner-flink
>            Reporter: Ben Sidhom
>            Assignee: Maximilian Michels
>            Priority: Minor
>             Fix For: 2.7.0
>
>          Time Spent: 8.5h
>  Remaining Estimate: 0h
>
> The portable Flink runner exists as a Job Service that runs somewhere. We 
> need a main entry point that itself spins up the job service (and artifact 
> staging service). The main program itself should be packaged into an uberjar 
> such that it can be run locally or submitted to a Flink deployment via `flink 
> run`.



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

Reply via email to