use of org.apache.flink.client.cli.RunOptions in project flink by apache.
the class CliFrontendYarnAddressConfigurationTest method testResumeFromYarnPropertiesFile.
/**
* Test that the CliFrontend is able to pick up the .yarn-properties file from a specified location.
*/
@Test
public void testResumeFromYarnPropertiesFile() throws Exception {
File directoryPath = writeYarnPropertiesFile(validPropertiesFile);
// start CLI Frontend
TestCLI frontend = new CustomYarnTestCLI(directoryPath.getAbsolutePath());
RunOptions options = CliFrontendParser.parseRunCommand(new String[] {});
frontend.retrieveClient(options);
checkJobManagerAddress(frontend.getConfiguration(), TEST_YARN_JOB_MANAGER_ADDRESS, TEST_YARN_JOB_MANAGER_PORT);
}
use of org.apache.flink.client.cli.RunOptions in project flink by apache.
the class CliFrontendYarnAddressConfigurationTest method testManualOptionsOverridesYarn.
@Test
public void testManualOptionsOverridesYarn() throws Exception {
File emptyFolder = temporaryFolder.newFolder();
File testConfFile = new File(emptyFolder.getAbsolutePath(), "flink-conf.yaml");
Files.createFile(testConfFile.toPath());
TestCLI frontend = new TestCLI(emptyFolder.getAbsolutePath());
RunOptions options = CliFrontendParser.parseRunCommand(new String[] { "-m", "10.221.130.22:7788" });
frontend.retrieveClient(options);
Configuration config = frontend.getConfiguration();
InetSocketAddress expectedAddress = InetSocketAddress.createUnresolved("10.221.130.22", 7788);
checkJobManagerAddress(config, expectedAddress.getHostName(), expectedAddress.getPort());
}
use of org.apache.flink.client.cli.RunOptions in project flink by apache.
the class CliFrontendYarnAddressConfigurationTest method testResumeFromYarnIDZookeeperNamespace.
@Test
public void testResumeFromYarnIDZookeeperNamespace() throws Exception {
File directoryPath = writeYarnPropertiesFile(validPropertiesFile);
// start CLI Frontend
TestCLI frontend = new CustomYarnTestCLI(directoryPath.getAbsolutePath());
RunOptions options = CliFrontendParser.parseRunCommand(new String[] { "-yid", TEST_YARN_APPLICATION_ID.toString() });
frontend.retrieveClient(options);
String zkNs = frontend.getConfiguration().getValue(HighAvailabilityOptions.HA_CLUSTER_ID);
Assert.assertTrue(zkNs.matches("application_\\d+_0042"));
}
use of org.apache.flink.client.cli.RunOptions in project flink by apache.
the class CliFrontendYarnAddressConfigurationTest method testYarnIDOverridesPropertiesFile.
@Test
public void testYarnIDOverridesPropertiesFile() throws Exception {
File directoryPath = writeYarnPropertiesFile(invalidPropertiesFile);
// start CLI Frontend
TestCLI frontend = new CustomYarnTestCLI(directoryPath.getAbsolutePath());
RunOptions options = CliFrontendParser.parseRunCommand(new String[] { "-yid", TEST_YARN_APPLICATION_ID.toString() });
frontend.retrieveClient(options);
checkJobManagerAddress(frontend.getConfiguration(), TEST_YARN_JOB_MANAGER_ADDRESS, TEST_YARN_JOB_MANAGER_PORT);
}
use of org.apache.flink.client.cli.RunOptions in project flink by apache.
the class CliFrontendYarnAddressConfigurationTest method testInvalidYarnPropertiesFile.
@Test(expected = IllegalConfigurationException.class)
public void testInvalidYarnPropertiesFile() throws Exception {
File directoryPath = writeYarnPropertiesFile(invalidPropertiesFile);
TestCLI frontend = new CustomYarnTestCLI(directoryPath.getAbsolutePath());
RunOptions options = CliFrontendParser.parseRunCommand(new String[] {});
frontend.retrieveClient(options);
Configuration config = frontend.getConfiguration();
checkJobManagerAddress(config, TEST_JOB_MANAGER_ADDRESS, TEST_JOB_MANAGER_PORT);
}
Aggregations