@Test public void testParseNameNodes() throws Exception { final String expectedServiceName = "serviceOne"; Map<String, String> hdfsSiteConfigMap = new HashMap<String, String>(); hdfsSiteConfigMap.put("dfs.ha.namenodes." + expectedServiceName, "node1"); String[] result = BlueprintConfigurationProcessor.parseNameNodes(expectedServiceName, hdfsSiteConfigMap); assertNotNull("Resulting array was null", result); assertEquals("Incorrect array size", 1, result.length); assertEquals("Incorrect value for returned name nodes", "node1", result[0]); hdfsSiteConfigMap.put("dfs.ha.namenodes." + expectedServiceName, " nodeSeven, nodeEight, nodeNine"); String[] resultTwo = BlueprintConfigurationProcessor.parseNameNodes(expectedServiceName, hdfsSiteConfigMap); assertNotNull("Resulting array was null", resultTwo); assertEquals("Incorrect array size", 3, resultTwo.length); assertEquals("Incorrect value for returned name node", "nodeSeven", resultTwo[0]); assertEquals("Incorrect value for returned name node", "nodeEight", resultTwo[1]); assertEquals("Incorrect value for returned name node", "nodeNine", resultTwo[2]); }
static String[] parseNameNodes(String nameService, Map<String, String> properties) { final String nameNodes = properties.get("dfs.ha.namenodes." + nameService); return splitAndTrimStrings(nameNodes); }
BlueprintConfigurationProcessor { static String[] parseNameNodes(String nameService, Map<String, String> properties) { final String nameNodes = properties.get("dfs.ha.namenodes." + nameService); return splitAndTrimStrings(nameNodes); } }
BlueprintConfigurationProcessor { static String[] parseNameNodes(String nameService, Map<String, String> properties) { final String nameNodes = properties.get("dfs.ha.namenodes." + nameService); return splitAndTrimStrings(nameNodes); } BlueprintConfigurationProcessor(ClusterTopology clusterTopology); }
BlueprintConfigurationProcessor { static String[] parseNameNodes(String nameService, Map<String, String> properties) { final String nameNodes = properties.get("dfs.ha.namenodes." + nameService); return splitAndTrimStrings(nameNodes); } BlueprintConfigurationProcessor(ClusterTopology clusterTopology); Map<String, Map<String, PropertyUpdater>> getRemovePropertyUpdaters(); void initRemovePropertyUpdaters(); Collection<String> getRequiredHostGroups(); Set<String> doUpdateForClusterCreate(); void doUpdateForBlueprintExport(); void doNameNodeHAUpdate(); void doYarnResourceManagerHAUpdate(); void doOozieServerHAUpdate(); }
BlueprintConfigurationProcessor { static String[] parseNameNodes(String nameService, Map<String, String> properties) { final String nameNodes = properties.get("dfs.ha.namenodes." + nameService); return splitAndTrimStrings(nameNodes); } BlueprintConfigurationProcessor(ClusterTopology clusterTopology); Map<String, Map<String, PropertyUpdater>> getRemovePropertyUpdaters(); void initRemovePropertyUpdaters(); Collection<String> getRequiredHostGroups(); Set<String> doUpdateForClusterCreate(); void doUpdateForBlueprintExport(); void doNameNodeHAUpdate(); void doYarnResourceManagerHAUpdate(); void doOozieServerHAUpdate();  }