private enum NodeNotChosenReason { NOT_IN_SERVICE("the node is not in service"), NODE_STALE("the node is stale"), NODE_TOO_BUSY("the node is too busy"), TOO_MANY_NODES_ON_RACK("the rack has too many chosen nodes"), NOT_ENOUGH_STORAGE_SPACE("not enough storage space to place the block"); private final String text; NodeNotChosenReason(final String logText) { text = logText; } private String getText() { return text; } }
if (localStorage != null) { addToExcludedNodes(localDatanode, excludedNodes); int num = entry.getValue(); if (num == 1) {
addToExcludedNodes(chosenNode, excludedNodes); int num = entry.getValue(); if (num == 1) {
addToExcludedNodes(storage.getDatanodeDescriptor(), excludedNodes);
for (DatanodeStorageInfo storage : results) { addToExcludedNodes(storage.getDatanodeDescriptor(), favoriteAndExcludedNodes);
/** * If the given storage is a good target, add it to the result list and * update the set of excluded nodes. * @return -1 if the given is not a good target; * otherwise, return the number of nodes added to excludedNodes set. */ int addIfIsGoodTarget(DatanodeStorageInfo storage, Set<Node> excludedNodes, long blockSize, int maxNodesPerRack, boolean considerLoad, List<DatanodeStorageInfo> results, boolean avoidStaleNodes, StorageType storageType) { if (isGoodTarget(storage, blockSize, maxNodesPerRack, considerLoad, results, avoidStaleNodes, storageType)) { results.add(storage); // add node and related nodes to excludedNode return addToExcludedNodes(storage.getDatanodeDescriptor(), excludedNodes); } else { return -1; } }
/** * If the given storage is a good target, add it to the result list and * update the set of excluded nodes. * @return -1 if the given is not a good target; * otherwise, return the number of nodes added to excludedNodes set. */ int addIfIsGoodTarget(DatanodeStorageInfo storage, Set<Node> excludedNodes, long blockSize, int maxNodesPerRack, boolean considerLoad, List<DatanodeStorageInfo> results, boolean avoidStaleNodes, StorageType storageType) { if (isGoodTarget(storage, blockSize, maxNodesPerRack, considerLoad, results, avoidStaleNodes, storageType)) { results.add(storage); // add node and related nodes to excludedNode return addToExcludedNodes(storage.getDatanodeDescriptor(), excludedNodes); } else { return -1; } }
for (DatanodeStorageInfo storage : chosenStorage) { addToExcludedNodes(storage.getDatanodeDescriptor(), excludedNodes);
for (DatanodeStorageInfo storage : chosenStorage) { addToExcludedNodes(storage.getDatanodeDescriptor(), excludedNodes);
addToExcludedNodes(resultStorage.getDatanodeDescriptor(), oldExcludedNodes); addToExcludedNodes(resultStorage.getDatanodeDescriptor(), oldExcludedNodes);
addToExcludedNodes(resultStorage.getDatanodeDescriptor(), oldExcludedNodes); addToExcludedNodes(resultStorage.getDatanodeDescriptor(), oldExcludedNodes);