DFSAdmin extends FsShell { int getReconfigurableProperties(final String nodeType, final String address, final PrintStream out, final PrintStream err) throws IOException { String outMsg = null; String errMsg = null; List<String> properties = null; try { properties = getReconfigurablePropertiesDispatch(nodeType, address, out, err); outMsg = String.format("Node [%s] Reconfigurable properties:", address); } catch (IOException e) { errMsg = String.format("Node [%s] reconfiguration: %s.", address, e.toString()); } if (errMsg != null) { err.println(errMsg); return 1; } else if (properties == null) { return 1; } else { out.println(outMsg); for (String name : properties) { out.println(name); } return 0; } } DFSAdmin();  DFSAdmin(Configuration conf); void report(String[] argv, int i); void setSafeMode(String[] argv, int idx); int triggerBlockReport(String[] argv); void allowSnapshot(String[] argv); void disallowSnapshot(String[] argv); void provisionSnapshotTrash(String[] argv); int saveNamespace(String[] argv); int rollEdits(); int restoreFailedStorage(String arg); int refreshNodes(); int listOpenFiles(String[] argv); int setBalancerBandwidth(String[] argv, int idx); int getBalancerBandwidth(String[] argv, int idx); int fetchImage(final String[] argv, final int idx); int finalizeUpgrade(); int getUpgradeStatus(); int upgrade(String arg); int metaSave(String[] argv, int idx); int printTopology(); int refreshServiceAcl(); int refreshUserToGroupsMappings(); int refreshSuperUserGroupsConfiguration(); int refreshCallQueue(); int reconfig(String[] argv, int i); int genericRefresh(String[] argv, int i); @Override int run(String[] argv); static void main(String[] argv);  }
@Test(timeout = 30000) public void testDataNodeGetReconfigurableProperties() throws IOException { final int port = datanode.getIpcPort(); final String address = "localhost:" + port; final List<String> outs = Lists.newArrayList(); final List<String> errs = Lists.newArrayList(); getReconfigurableProperties("datanode", address, outs, errs); assertEquals(3, outs.size()); assertEquals(DFSConfigKeys.DFS_DATANODE_DATA_DIR_KEY, outs.get(1)); }
@Test(timeout = 30000) public void testNameNodeGetReconfigurableProperties() throws IOException { final String address = namenode.getHostAndPort(); final List<String> outs = Lists.newArrayList(); final List<String> errs = Lists.newArrayList(); getReconfigurableProperties("namenode", address, outs, errs); assertEquals(12, outs.size()); assertEquals(DFS_BLOCK_PLACEMENT_EC_CLASSNAME_KEY, outs.get(1)); assertEquals(DFS_BLOCK_REPLICATOR_CLASSNAME_KEY, outs.get(2)); assertEquals(DFS_HEARTBEAT_INTERVAL_KEY, outs.get(3)); assertEquals(DFS_NAMENODE_HEARTBEAT_RECHECK_INTERVAL_KEY, outs.get(4)); assertEquals(errs.size(), 0); }