FsImageValidation { static void setHaConf(String nsId, Configuration conf) { conf.set(DFSConfigKeys.DFS_NAMESERVICES, nsId); final String haNNKey = DFS_HA_NAMENODES_KEY_PREFIX + "." + nsId; conf.set(haNNKey, "nn0,nn1"); final String rpcKey = DFS_NAMENODE_RPC_ADDRESS_KEY + "." + nsId + "."; conf.set(rpcKey + "nn0", "127.0.0.1:8080"); conf.set(rpcKey + "nn1", "127.0.0.1:8080"); } FsImageValidation(File fsImageFile); static int validate(FSNamesystem namesystem); static void validate(File path, AtomicInteger errorCount); static void main(String[] args);  }
@Test public void testHaConf() { final Configuration conf = new Configuration(); final String nsId = "cluster0"; FsImageValidation.setHaConf(nsId, conf); Assert.assertTrue(HAUtil.isHAEnabled(conf, nsId)); }