public final void printPartitionMap() { for (Entry<String,Partitions> entry : partitionMap.entrySet()) { String namespace = entry.getKey(); Partitions partitions = entry.getValue(); AtomicReferenceArray<Node>[] replicas = partitions.replicas; for (int i = 0; i < replicas.length; i++) { AtomicReferenceArray<Node> nodeArray = replicas[i]; int max = nodeArray.length(); for (int j = 0; j < max; j++) { Node node = nodeArray.get(j); if (node != null) { Log.info(namespace + ',' + i + ',' + j + ',' + node); } } } } }
/** * Add nodes using copy on write semantics. */ private final void addNodes(HashMap<String,Node> nodesToAdd) { // Add all nodes at once to avoid copying entire array multiple times. // Create temporary nodes array. Node[] nodeArray = new Node[nodes.length + nodesToAdd.size()]; int count = 0; // Add existing nodes. for (Node node : nodes) { nodeArray[count++] = node; } // Add new nodes. for (Node node : nodesToAdd.values()) { if (Log.infoEnabled()) { Log.info("Add node " + node); } nodeArray[count++] = node; nodesMap.put(node.getName(), node); // Add node's aliases to global alias set. // Aliases are only used in tend thread, so synchronization is not necessary. for (Host alias : node.aliases) { aliases.put(alias, node); } } // Replace nodes with copy. nodes = nodeArray; }
/** * Add nodes using copy on write semantics. */ private final void addNodes(HashMap<String,Node> nodesToAdd) { // Add all nodes at once to avoid copying entire array multiple times. // Create temporary nodes array. Node[] nodeArray = new Node[nodes.length + nodesToAdd.size()]; int count = 0; // Add existing nodes. for (Node node : nodes) { nodeArray[count++] = node; } // Add new nodes. for (Node node : nodesToAdd.values()) { if (Log.infoEnabled()) { Log.info("Add node " + node); } nodeArray[count++] = node; nodesMap.put(node.getName(), node); // Add node's aliases to global alias set. // Aliases are only used in tend thread, so synchronization is not necessary. for (Host alias : node.aliases) { aliases.put(alias, node); } } // Replace nodes with copy. nodes = nodeArray; }
public final void printPartitionMap() { for (Entry<String,Partitions> entry : partitionMap.entrySet()) { String namespace = entry.getKey(); Partitions partitions = entry.getValue(); AtomicReferenceArray<Node>[] replicas = partitions.replicas; for (int i = 0; i < replicas.length; i++) { AtomicReferenceArray<Node> nodeArray = replicas[i]; int max = nodeArray.length(); for (int j = 0; j < max; j++) { Node node = nodeArray.get(j); if (node != null) { Log.info(namespace + ',' + i + ',' + j + ',' + node); } } } } }
if (findNode(node, nodesToRemove)) { if (Log.infoEnabled()) { Log.info("Remove node " + node);
if (findNode(node, nodesToRemove)) { if (Log.infoEnabled()) { Log.info("Remove node " + node);
if (!regimeError) { if (Log.infoEnabled()) { Log.info(node.toString() + " regime(" + regime + ") < old regime(" + regimeOld + ")");
if (!regimeError) { if (Log.infoEnabled()) { Log.info(node.toString() + " regime(" + regime + ") < old regime(" + regimeOld + ")");
Log.info("Namespace " + namespace + " replication factor changed from " + partitions.replicas.length + " to " + replicaCount);
Log.info("Namespace " + namespace + " replication factor changed from " + partitions.replicas.length + " to " + replicaCount);
Log.info("Invalid address " + result + ". access-address is probably not configured on server.");
Log.info("Invalid address " + result + ". access-address is probably not configured on server.");