RMAdminCLI extends HAAdmin { private int addToClusterNodeLabels(String args) throws IOException, YarnException { Set<String> labels = new HashSet<String>(); for (String p : args.split(",")) { labels.add(p); } return addToClusterNodeLabels(labels); } RMAdminCLI();  RMAdminCLI(Configuration conf); @Override int run(String[] args); @Override void setConf(Configuration conf); static void main(String[] args);  }
@Test public void testAddToClusterNodeLabels() throws Exception { String[] args = { "-addToClusterNodeLabels", "x", "-directlyAccessNodeLabelStore" }; assertEquals(0, rmAdminCLI.run(args)); assertTrue(dummyNodeLabelsManager.getClusterNodeLabels().containsAll( ImmutableSet.of("x"))); args = new String[] { "-addToClusterNodeLabels" }; assertTrue(0 != rmAdminCLI.run(args)); args = new String[] { "-addToClusterNodeLabels", "-directlyAccessNodeLabelStore" }; assertTrue(0 != rmAdminCLI.run(args)); }