use of org.apache.flink.yarn.cli.FlinkYarnSessionCli in project flink by apache.
the class FlinkYarnSessionCliTest method testResumeFromYarnID.
@Test
public void testResumeFromYarnID() throws Exception {
final FlinkYarnSessionCli flinkYarnSessionCli = createFlinkYarnSessionCli();
final CommandLine commandLine = flinkYarnSessionCli.parseCommandLineOptions(new String[] { "-yid", TEST_YARN_APPLICATION_ID.toString() }, true);
final Configuration executorConfig = flinkYarnSessionCli.toConfiguration(commandLine);
final ClusterClientFactory<ApplicationId> clientFactory = getClusterClientFactory(executorConfig);
final ApplicationId clusterId = clientFactory.getClusterId(executorConfig);
assertEquals(TEST_YARN_APPLICATION_ID, clusterId);
}
use of org.apache.flink.yarn.cli.FlinkYarnSessionCli in project flink by apache.
the class FlinkYarnSessionCliTest method testZookeeperNamespaceProperty.
@Test
public void testZookeeperNamespaceProperty() throws Exception {
String zkNamespaceCliInput = "flink_test_namespace";
String[] params = new String[] { "-yz", zkNamespaceCliInput };
FlinkYarnSessionCli yarnCLI = createFlinkYarnSessionCli();
CommandLine commandLine = yarnCLI.parseCommandLineOptions(params, true);
Configuration executorConfig = yarnCLI.toConfiguration(commandLine);
assertThat(executorConfig.get(HighAvailabilityOptions.HA_CLUSTER_ID), is(zkNamespaceCliInput));
}
use of org.apache.flink.yarn.cli.FlinkYarnSessionCli in project flink by apache.
the class FlinkYarnSessionCliTest method testResumeFromYarnIDZookeeperNamespaceOverride.
@Test
public void testResumeFromYarnIDZookeeperNamespaceOverride() throws Exception {
final FlinkYarnSessionCli flinkYarnSessionCli = createFlinkYarnSessionCli();
final String overrideZkNamespace = "my_cluster";
final CommandLine commandLine = flinkYarnSessionCli.parseCommandLineOptions(new String[] { "-yid", TEST_YARN_APPLICATION_ID.toString(), "-yz", overrideZkNamespace }, true);
final Configuration executorConfig = flinkYarnSessionCli.toConfiguration(commandLine);
final ClusterClientFactory<ApplicationId> clientFactory = getClusterClientFactory(executorConfig);
final YarnClusterDescriptor clusterDescriptor = (YarnClusterDescriptor) clientFactory.createClusterDescriptor(executorConfig);
final Configuration clusterDescriptorConfiguration = clusterDescriptor.getFlinkConfiguration();
final String clusterId = clusterDescriptorConfiguration.getValue(HighAvailabilityOptions.HA_CLUSTER_ID);
assertEquals(overrideZkNamespace, clusterId);
}
Aggregations