public boolean isExcess(DatanodeDescriptor dn, BlockInfo blk) { return excessRedundancyMap.contains(dn, blk); }
@VisibleForTesting int getExcessSize4Testing(String dnUuid) { return excessRedundancyMap.getSize4Testing(dnUuid); }
/** Used by metrics */ public long getExcessBlocksCount() { return excessRedundancyMap.size(); } /** Used by metrics */
public void removeBlockFromMap(BlockInfo block) { for(DatanodeStorageInfo info : blocksMap.getStorages(block)) { excessRedundancyMap.remove(info.getDatanodeDescriptor(), block); } blocksMap.removeBlock(block); // If block is removed from blocksMap remove it from corruptReplicasMap corruptReplicas.removeFromCorruptReplicasMap(block); }
/** * Clear all queues that hold decisions previously made by * this NameNode. */ public void clearQueues() { neededReconstruction.clear(); pendingReconstruction.clear(); excessRedundancyMap.clear(); invalidateBlocks.clear(); datanodeManager.clearPendingQueues(); postponedMisreplicatedBlocks.clear(); };
private void processChosenExcessRedundancy( final Collection<DatanodeStorageInfo> nonExcess, final DatanodeStorageInfo chosen, BlockInfo storedBlock) { nonExcess.remove(chosen); excessRedundancyMap.add(chosen.getDatanodeDescriptor(), storedBlock); // // The 'excessblocks' tracks blocks until we get confirmation // that the datanode has deleted them; the only way we remove them // is when we get a "removeBlock" message. // // The 'invalidate' list is used to inform the datanode the block // should be deleted. Items are removed from the invalidate list // upon giving instructions to the datanodes. // final Block blockToInvalidate = getBlockOnStorage(storedBlock, chosen); addToInvalidates(blockToInvalidate, chosen.getDatanodeDescriptor()); blockLog.debug("BLOCK* chooseExcessRedundancies: " + "({}, {}) is added to invalidated blocks set", chosen, storedBlock); }
excessRedundancyMap.remove(node, storedBlock); corruptReplicas.removeFromCorruptReplicasMap(storedBlock, node);