List of usage examples for org.apache.hadoop.yarn.conf YarnConfiguration RM_NM_EXPIRY_INTERVAL_MS
String RM_NM_EXPIRY_INTERVAL_MS
To view the source code for org.apache.hadoop.yarn.conf YarnConfiguration RM_NM_EXPIRY_INTERVAL_MS.
Click Source Link
From source file:com.cloudera.llama.am.yarn.TestLlamaAMWithYarn.java
License:Apache License
@Test public void testClusterNMChanges() throws Exception { try {/*from w ww. j a v a2 s. c om*/ Configuration conf = createMiniYarnConfig(true); conf.setInt(YarnConfiguration.RM_NM_EXPIRY_INTERVAL_MS, 1000); startYarn(conf, 2); LlamaAM llama = LlamaAM.create(getLlamaConfiguration()); MyListener listener = new MyListener(); try { llama.start(); llama.addListener(listener); List<NodeInfo> nodes = llama.getNodes(); Assert.assertEquals(2, nodes.size()); miniYarn.getNodeManager(0).stop(); long startTime = System.currentTimeMillis(); while (llama.getNodes().size() != 1 && System.currentTimeMillis() - startTime < 10000) { Thread.sleep(100); } nodes = llama.getNodes(); Assert.assertEquals(1, nodes.size()); } finally { llama.stop(); } } finally { stopYarn(); } }