Search in sources :

Example 1 with CliFrontend

use of org.apache.flink.client.CliFrontend 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());
}
Also used : CliFrontend(org.apache.flink.client.CliFrontend) File(java.io.File) RunOptions(org.apache.flink.client.cli.RunOptions) FlinkYarnSessionCli(org.apache.flink.yarn.cli.FlinkYarnSessionCli) Test(org.junit.Test)

Aggregations

File (java.io.File)1 CliFrontend (org.apache.flink.client.CliFrontend)1 RunOptions (org.apache.flink.client.cli.RunOptions)1 FlinkYarnSessionCli (org.apache.flink.yarn.cli.FlinkYarnSessionCli)1 Test (org.junit.Test)1