[ 
https://issues.apache.org/jira/browse/FLINK-8328?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16308117#comment-16308117
 ] 

ASF GitHub Bot commented on FLINK-8328:
---------------------------------------

Github user GJL commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5215#discussion_r159230885
  
    --- Diff: 
flink-yarn/src/main/java/org/apache/flink/yarn/cli/FlinkYarnSessionCli.java ---
    @@ -743,6 +690,142 @@ private void logAndSysout(String message) {
                System.out.println(message);
        }
     
    +   public static void main(final String[] args) throws Exception {
    +           final FlinkYarnSessionCli cli = new FlinkYarnSessionCli("", 
""); // no prefix for the YARN session
    +
    +           final String configurationDirectory = 
CliFrontend.getConfigurationDirectoryFromEnv();
    +
    +           final Configuration flinkConfiguration = 
GlobalConfiguration.loadConfiguration();
    +           SecurityUtils.install(new 
SecurityConfiguration(flinkConfiguration));
    +           int retCode = 
SecurityUtils.getInstalledContext().runSecured(new Callable<Integer>() {
    +                   @Override
    +                   public Integer call() {
    +                           return cli.run(args, flinkConfiguration, 
configurationDirectory);
    +                   }
    +           });
    +           System.exit(retCode);
    +   }
    +
    +   private static void runInteractiveCli(
    +           YarnClusterClient clusterClient,
    +           YarnApplicationStatusMonitor yarnApplicationStatusMonitor,
    +           boolean readConsoleInput) {
    +           try (BufferedReader in = new BufferedReader(new 
InputStreamReader(System.in))) {
    +                   boolean continueRepl = true;
    +                   int numTaskmanagers = 0;
    +                   long unknownStatusSince = System.currentTimeMillis();
    --- End diff --
    
    nit: `System.nanoTime()` should be preferred to measure elapsed time 
because it does not depend on wall clock, i.e., it is not affected by the user 
changing the system's time: https://stackoverflow.com/a/351571
    However, if you use `nanoTime()`, the trick in line `729` with negative 
`unknownStatusSince` won't work.


> Pull Yarn ApplicationStatus polling out of YarnClusterClient
> ------------------------------------------------------------
>
>                 Key: FLINK-8328
>                 URL: https://issues.apache.org/jira/browse/FLINK-8328
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Client
>    Affects Versions: 1.5.0
>            Reporter: Till Rohrmann
>            Assignee: Till Rohrmann
>              Labels: flip-6
>             Fix For: 1.5.0
>
>
> In order to make the {{FlinkYarnSessionCli}} work with Flip-6, we have to 
> pull the Yarn {{ApplicationStatus}} polling out of the {{YarnClusterClient}}. 
> I propose to introduce a dedicated {{YarnApplicationStatusMonitor}}. This has 
> also the benefit of separating concerns better.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to