protected void createHostIfNonExisted(String hostName) { Host host = nodeCollections.get(hostName); if (null == host) { host = new Host(); nodeCollections.put(hostName, host); } }
private Map<String, Host> cloneNodeMap(Set<NodeId> nodesToCopy) { Map<String, Host> map = new HashMap<String, Host>(); for (NodeId nodeId : nodesToCopy) { if (!map.containsKey(nodeId.getHost())) { Host originalN = nodeCollections.get(nodeId.getHost()); if (null == originalN) { continue; } Host n = originalN.copy(); n.nms.clear(); map.put(nodeId.getHost(), n); } Host n = map.get(nodeId.getHost()); if (WILDCARD_PORT == nodeId.getPort()) { for (Entry<NodeId, Node> entry : nodeCollections .get(nodeId.getHost()).nms.entrySet()) { n.nms.put(entry.getKey(), entry.getValue().copy()); } } else { Node nm = getNMInNodeSet(nodeId); if (null != nm) { n.nms.put(nodeId, nm.copy()); } } } return map; }
private Map<String, Host> cloneNodeMap(Set<NodeId> nodesToCopy) { Map<String, Host> map = new HashMap<String, Host>(); for (NodeId nodeId : nodesToCopy) { if (!map.containsKey(nodeId.getHost())) { Host originalN = nodeCollections.get(nodeId.getHost()); if (null == originalN) { continue; } Host n = originalN.copy(); n.nms.clear(); map.put(nodeId.getHost(), n); } Host n = map.get(nodeId.getHost()); if (WILDCARD_PORT == nodeId.getPort()) { for (Entry<NodeId, Node> entry : nodeCollections .get(nodeId.getHost()).nms.entrySet()) { n.nms.put(entry.getKey(), entry.getValue().copy()); } } else { Node nm = getNMInNodeSet(nodeId); if (null != nm) { n.nms.put(nodeId, nm.copy()); } } } return map; }
private Map<String, Host> cloneNodeMap(Set<NodeId> nodesToCopy) { Map<String, Host> map = new HashMap<String, Host>(); for (NodeId nodeId : nodesToCopy) { if (!map.containsKey(nodeId.getHost())) { Host originalN = nodeCollections.get(nodeId.getHost()); if (null == originalN) { continue; } Host n = originalN.copy(); n.nms.clear(); map.put(nodeId.getHost(), n); } Host n = map.get(nodeId.getHost()); if (WILDCARD_PORT == nodeId.getPort()) { for (Entry<NodeId, Node> entry : nodeCollections .get(nodeId.getHost()).nms.entrySet()) { n.nms.put(entry.getKey(), entry.getValue().copy()); } } else { Node nm = getNMInNodeSet(nodeId); if (null != nm) { n.nms.put(nodeId, nm.copy()); } } } return map; }
public Host copy() { Host c = new Host(); c.labels = new HashSet<String>(labels); for (Entry<NodeId, Node> entry : nms.entrySet()) { c.nms.put(entry.getKey(), entry.getValue().copy()); } return c; } }
protected void createHostIfNonExisted(String hostName) { Host host = nodeCollections.get(hostName); if (null == host) { host = new Host(); nodeCollections.put(hostName, host); } }
public Host copy() { Host c = new Host(); c.labels = new HashSet<String>(labels); for (Entry<NodeId, Node> entry : nms.entrySet()) { c.nms.put(entry.getKey(), entry.getValue().copy()); } return c; } }
public Host copy() { Host c = new Host(); c.labels = new HashSet<String>(labels); for (Entry<NodeId, Node> entry : nms.entrySet()) { c.nms.put(entry.getKey(), entry.getValue().copy()); } return c; } }
protected void createHostIfNonExisted(String hostName) { Host host = nodeCollections.get(hostName); if (null == host) { host = new Host(); nodeCollections.put(hostName, host); } }