flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-8338) Make CustomCommandLines non static in CliFrontend
Date Thu, 04 Jan 2018 13:26:05 GMT

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

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

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

    https://github.com/apache/flink/pull/5224#discussion_r159650780
  
    --- Diff: flink-yarn-tests/src/test/java/org/apache/flink/yarn/CliFrontendYarnAddressConfigurationTest.java
---
    @@ -191,27 +213,47 @@ public void testResumeFromYarnID() throws Exception {
     	@Test
     	public void testResumeFromYarnIDZookeeperNamespace() throws Exception {
     		File directoryPath = writeYarnPropertiesFile(validPropertiesFile);
    +
     		// start CLI Frontend
    -		TestCLI frontend = new CustomYarnTestCLI(directoryPath.getAbsolutePath());
    +		TestCLI frontend = new CustomYarnTestCLI(new Configuration(), directoryPath.getAbsolutePath());
     
    -		RunOptions options =
    -				CliFrontendParser.parseRunCommand(new String[] {"-yid", TEST_YARN_APPLICATION_ID.toString()});
    +		FlinkYarnSessionCli cli = new FlinkYarnSessionCli("y", "yarn");
     
    -		frontend.retrieveClient(options);
    +		Options options = CliFrontendParser.getRunCommandOptions();
    +		cli.addGeneralOptions(options);
    +		cli.addRunOptions(options);
    +
    +		final CommandLine commandLine = CliFrontendParser.parse(options, new String[] {"-yid",
TEST_YARN_APPLICATION_ID.toString()}, true);
    +
    +		RunOptions runOptions = new RunOptions(commandLine);
    +
    +		frontend.retrieveClient(runOptions);
     		String zkNs = frontend.getConfiguration().getValue(HighAvailabilityOptions.HA_CLUSTER_ID);
     		Assert.assertTrue(zkNs.matches("application_\\d+_0042"));
     	}
     
     	@Test
     	public void testResumeFromYarnIDZookeeperNamespaceOverride() throws Exception {
     		File directoryPath = writeYarnPropertiesFile(validPropertiesFile);
    +
    +		final Configuration configuration = new Configuration();
    +		configuration.setString(YarnConfigOptions.PROPERTIES_FILE_LOCATION, directoryPath.getAbsolutePath());
    +
     		// start CLI Frontend
    -		TestCLI frontend = new CustomYarnTestCLI(directoryPath.getAbsolutePath());
    +		TestCLI frontend = new CustomYarnTestCLI(configuration, directoryPath.getAbsolutePath());
     		String overrideZkNamespace = "my_cluster";
    -		RunOptions options =
    -				CliFrontendParser.parseRunCommand(new String[] {"-yid", TEST_YARN_APPLICATION_ID.toString(),
"-yz", overrideZkNamespace});
     
    -		frontend.retrieveClient(options);
    +		FlinkYarnSessionCli cli = new FlinkYarnSessionCli("y", "yarn");
    --- End diff --
    
    There is redundancy in how `FlinkYarnSessionCli` and `Options` are created. Maybe it makes
sense to extract something to instance variables.
      


> Make CustomCommandLines non static in CliFrontend
> -------------------------------------------------
>
>                 Key: FLINK-8338
>                 URL: https://issues.apache.org/jira/browse/FLINK-8338
>             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
>
>
> For better testability and maintainability we should make the {{CustomCommandLine}} registration
non-static in {{CliFrontend}}.



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

Mime
View raw message