use of org.apache.flink.client.cli.RunOptions in project flink by apache.
the class CliFrontendYarnAddressConfigurationTest method testResumeFromInvalidYarnID.
@Test(expected = IllegalConfigurationException.class)
public void testResumeFromInvalidYarnID() throws Exception {
File directoryPath = writeYarnPropertiesFile(validPropertiesFile);
// start CLI Frontend
TestCLI frontend = new CustomYarnTestCLI(directoryPath.getAbsolutePath(), FinalApplicationStatus.SUCCEEDED);
RunOptions options = CliFrontendParser.parseRunCommand(new String[] { "-yid", ApplicationId.newInstance(0, 666).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 FlinkYarnSessionCliTest method testZookeeperNamespaceProperty.
@Test
public void testZookeeperNamespaceProperty() throws Exception {
File confFile = tmp.newFile("flink-conf.yaml");
File jarFile = tmp.newFile("test.jar");
new CliFrontend(tmp.getRoot().getAbsolutePath());
String zkNamespaceCliInput = "flink_test_namespace";
String[] params = new String[] { "-yn", "2", "-yz", zkNamespaceCliInput, jarFile.getAbsolutePath() };
RunOptions runOptions = CliFrontendParser.parseRunCommand(params);
FlinkYarnSessionCli yarnCLI = new TestCLI("y", "yarn");
AbstractYarnClusterDescriptor descriptor = yarnCLI.createDescriptor("", runOptions.getCommandLine());
Assert.assertEquals(zkNamespaceCliInput, descriptor.getZookeeperNamespace());
}
use of org.apache.flink.client.cli.RunOptions in project flink by apache.
the class FlinkYarnSessionCliTest method testNotEnoughTaskSlots.
@Test
public void testNotEnoughTaskSlots() throws Exception {
File confFile = tmp.newFile("flink-conf.yaml");
File jarFile = tmp.newFile("test.jar");
new CliFrontend(tmp.getRoot().getAbsolutePath());
String[] params = new String[] { "-yn", "2", "-ys", "3", "-p", "7", jarFile.getAbsolutePath() };
RunOptions runOptions = CliFrontendParser.parseRunCommand(params);
FlinkYarnSessionCli yarnCLI = new TestCLI("y", "yarn");
AbstractYarnClusterDescriptor descriptor = yarnCLI.createDescriptor("", runOptions.getCommandLine());
// each task manager has 3 slots but the parallelism is 7. Thus the slots should be increased.
Assert.assertEquals(4, descriptor.getTaskManagerSlots());
Assert.assertEquals(2, descriptor.getTaskManagerCount());
}
Aggregations