@Before public void before() throws IOException { mgr = new MockNodeLabelManager(); conf = new Configuration(); conf.setBoolean(YarnConfiguration.NODE_LABELS_ENABLED, true); File tempDir = File.createTempFile("nlb", ".tmp"); tempDir.delete(); tempDir.mkdirs(); tempDir.deleteOnExit(); conf.set(YarnConfiguration.FS_NODE_LABELS_STORE_ROOT_DIR, tempDir.getAbsolutePath()); mgr.init(conf); mgr.start(); }
@Before public void before() throws IOException { mgr = new MockNodeLabelManager(); conf = new Configuration(); conf.setBoolean(YarnConfiguration.NODE_LABELS_ENABLED, true); conf.set(YarnConfiguration.FS_NODE_LABELS_STORE_IMPL_CLASS, storeClassName); File tempDir = File.createTempFile("nlb", ".tmp"); tempDir.delete(); tempDir.mkdirs(); tempDir.deleteOnExit(); conf.set(YarnConfiguration.FS_NODE_LABELS_STORE_ROOT_DIR, tempDir.getAbsolutePath()); mgr.init(conf); mgr.start(); }
@Before public void before() throws IOException { mgr = new MockNodeLabelManager(); conf = new Configuration(); conf.setBoolean(YarnConfiguration.NODE_LABELS_ENABLED, true); conf.set(YarnConfiguration.FS_NODE_LABELS_STORE_IMPL_CLASS, storeClassName); File tempDir = File.createTempFile("nlb", ".tmp"); tempDir.delete(); tempDir.mkdirs(); tempDir.deleteOnExit(); conf.set(YarnConfiguration.FS_NODE_LABELS_STORE_ROOT_DIR, tempDir.getAbsolutePath()); mgr.init(conf); mgr.start(); }
mgr = new MockNodeLabelManager(); mgr.init(conf); mgr.start(); mgr = new MockNodeLabelManager(); mgr.init(conf); mgr.start(); mgr = new MockNodeLabelManager(); mgr.init(conf); mgr.start(); mgr = new MockNodeLabelManager(); mgr.init(conf); mgr.start();
mgr = new MockNodeLabelManager(); mgr.init(conf); mgr.start(); mgr = new MockNodeLabelManager(); mgr.init(conf); mgr.start(); mgr = new MockNodeLabelManager(); mgr.init(conf); mgr.start(); mgr = new MockNodeLabelManager(); mgr.init(conf); mgr.start();
mgr = new MockNodeLabelManager(); mgr.init(conf); mgr.start(); mgr = new MockNodeLabelManager(); mgr.init(conf); mgr.start(); mgr = new MockNodeLabelManager(); mgr.init(conf); mgr.start(); mgr = new MockNodeLabelManager(); mgr.init(conf); mgr.start();
mgr = new MockNodeLabelManager(); mgr.init(conf); mgr.start(); mgr = new MockNodeLabelManager(); mgr.init(conf); mgr.start();
mgr = new MockNodeLabelManager(); mgr.init(conf); mgr.start(); mgr = new MockNodeLabelManager(); mgr.init(conf); mgr.start();
mgr = new MockNodeLabelManager(); mgr.init(conf); mgr.start(); mgr = new MockNodeLabelManager(); mgr.init(conf); mgr.start();
mgr = new MockNodeLabelManager(); mgr.init(conf); mgr.start();
mgr = new MockNodeLabelManager(); mgr.init(conf); mgr.start();
mgr = new MockNodeLabelManager(); mgr.init(conf); mgr.start();
@SuppressWarnings({ "unchecked", "rawtypes" }) @Test(timeout = 10000) public void testRecoverWithDistributedNodeLabels() throws Exception { mgr.addToCluserNodeLabelsWithDefaultExclusivity(toSet("p1", "p2", "p3")); mgr.addToCluserNodeLabelsWithDefaultExclusivity(toSet("p4")); mgr.addToCluserNodeLabelsWithDefaultExclusivity(toSet("p5", "p6")); mgr.replaceLabelsOnNode((Map) ImmutableMap.of(toNodeId("n1"), toSet("p1"), toNodeId("n2"), toSet("p2"))); mgr.replaceLabelsOnNode((Map) ImmutableMap.of(toNodeId("n3"), toSet("p3"), toNodeId("n4"), toSet("p4"), toNodeId("n5"), toSet("p5"), toNodeId("n6"), toSet("p6"), toNodeId("n7"), toSet("p6"))); mgr.removeFromClusterNodeLabels(toSet("p1")); mgr.removeFromClusterNodeLabels(Arrays.asList("p3", "p5")); mgr.stop(); mgr = new MockNodeLabelManager(); Configuration cf = new Configuration(conf); cf.set(YarnConfiguration.NODELABEL_CONFIGURATION_TYPE, YarnConfiguration.DISTRIBUTED_NODELABEL_CONFIGURATION_TYPE); mgr.init(cf); mgr.start(); // check variables Assert.assertEquals(3, mgr.getClusterNodeLabels().size()); Assert.assertTrue(mgr.getClusterNodeLabelNames().containsAll( Arrays.asList("p2", "p4", "p6"))); Assert.assertTrue("During recovery in distributed node-labels setup, " + "node to labels mapping should not be recovered ", mgr .getNodeLabels().size() == 0); mgr.stop(); }
@SuppressWarnings({ "unchecked", "rawtypes" }) @Test(timeout = 10000) public void testRecoverWithDistributedNodeLabels() throws Exception { mgr.addToCluserNodeLabelsWithDefaultExclusivity(toSet("p1", "p2", "p3")); mgr.addToCluserNodeLabelsWithDefaultExclusivity(toSet("p4")); mgr.addToCluserNodeLabelsWithDefaultExclusivity(toSet("p5", "p6")); mgr.replaceLabelsOnNode((Map) ImmutableMap.of(toNodeId("n1"), toSet("p1"), toNodeId("n2"), toSet("p2"))); mgr.replaceLabelsOnNode((Map) ImmutableMap.of(toNodeId("n3"), toSet("p3"), toNodeId("n4"), toSet("p4"), toNodeId("n5"), toSet("p5"), toNodeId("n6"), toSet("p6"), toNodeId("n7"), toSet("p6"))); mgr.removeFromClusterNodeLabels(toSet("p1")); mgr.removeFromClusterNodeLabels(Arrays.asList("p3", "p5")); mgr.stop(); mgr = new MockNodeLabelManager(); Configuration cf = new Configuration(conf); cf.set(YarnConfiguration.NODELABEL_CONFIGURATION_TYPE, YarnConfiguration.DISTRIBUTED_NODELABEL_CONFIGURATION_TYPE); mgr.init(cf); mgr.start(); // check variables Assert.assertEquals(3, mgr.getClusterNodeLabels().size()); Assert.assertTrue(mgr.getClusterNodeLabelNames().containsAll( Arrays.asList("p2", "p4", "p6"))); Assert.assertTrue("During recovery in distributed node-labels setup, " + "node to labels mapping should not be recovered ", mgr .getNodeLabels().size() == 0); mgr.stop(); }