use of com.cloudera.kitten.client.YarnClientParameters in project kitten by cloudera.
the class BasicLuaConfigTest method testBasicClient.
@Test
public void testBasicClient() throws Exception {
File tmpFile = File.createTempFile("kitten", ".lua");
Files.copy(newInputStreamSupplier(getResource("lua/test1.lua")), tmpFile);
tmpFile.deleteOnExit();
YarnClientParameters params = new LuaYarnClientParameters(tmpFile.getAbsolutePath(), "distshell", conf);
assertEquals("Distributed Shell", params.getApplicationName());
assertEquals(86400L, params.getClientTimeoutMillis());
assertEquals("default", params.getQueue());
ContainerLaunchParameters clp = params.getApplicationMasterParameters(null);
assertEquals(1, clp.getPriority());
// clusterMax = 90 < 100
assertEquals(clusterMax, clp.getContainerResource(clusterMax));
Map<String, String> expEnv = ImmutableMap.of("zs", "10", "a", "b", "fiz", "faz", "foo", "foo", "biz", "baz");
Map<String, String> actEnv = clp.getEnvironment();
for (Map.Entry<String, String> e : expEnv.entrySet()) {
assertEquals(e.getValue(), actEnv.get(e.getKey()));
}
}
Aggregations