synchronized List<Block> invalidateWork(final DatanodeDescriptor dn) { final long delay = getInvalidationDelay(); if (delay > 0) { BlockManager.LOG .debug("Block deletion is delayed during NameNode startup. " + "The deletion will start after {} ms.", delay); return null; } int remainingLimit = blockInvalidateLimit; final List<Block> toInvalidate = new ArrayList<>(); if (nodeToBlocks.get(dn) != null) { remainingLimit = getBlocksToInvalidateByLimit(nodeToBlocks.get(dn), toInvalidate, numBlocks, remainingLimit); } if ((remainingLimit > 0) && (nodeToECBlocks.get(dn) != null)) { getBlocksToInvalidateByLimit(nodeToECBlocks.get(dn), toInvalidate, numECBlocks, remainingLimit); } if (toInvalidate.size() > 0) { if (getBlockSetsSize(dn) == 0) { remove(dn); } dn.addBlocksToBeInvalidated(toInvalidate); } return toInvalidate; }
/** Remove the blocks associated to the given DatanodeStorageInfo. */ void removeBlocksAssociatedTo(final DatanodeStorageInfo storageInfo) { assert namesystem.hasWriteLock(); final Iterator<BlockInfo> it = storageInfo.getBlockIterator(); DatanodeDescriptor node = storageInfo.getDatanodeDescriptor(); Collection<BlockInfo> toRemove = new ArrayList<>(); while (it.hasNext()) { toRemove.add(it.next()); } for (BlockInfo block : toRemove) { removeStoredBlock(block, node); final Block b = getBlockOnStorage(block, storageInfo); if (b != null) { invalidateBlocks.remove(node, b); } } checkSafeMode(); LOG.info("Removed blocks associated with storage {} from DataNode {}", storageInfo, node); }
/** Remove the blocks associated to the given datanode. */ void removeBlocksAssociatedTo(final DatanodeDescriptor node) { providedStorageMap.removeDatanode(node); for (DatanodeStorageInfo storage : node.getStorageInfos()) { final Iterator<BlockInfo> it = storage.getBlockIterator(); //add the BlockInfos to a new collection as the //returned iterator is not modifiable. Collection<BlockInfo> toRemove = new ArrayList<>(); while (it.hasNext()) { toRemove.add(it.next()); } for (BlockInfo b : toRemove) { removeStoredBlock(b, node); } } // Remove all pending DN messages referencing this DN. pendingDNMessages.removeAllMessagesForDatanode(node); node.resetBlocks(); invalidateBlocks.remove(node); }
LOG.warn("DataNode {} cannot be found with UUID {}" + ", removing block invalidation work.", dn, dn.getDatanodeUuid()); invalidateBlocks.remove(dn); return 0;
/** Remove the block from the specified storage. */ synchronized void remove(final DatanodeInfo dn, final Block block) { final LightWeightHashSet<Block> v = getBlocksSet(dn, block); if (v != null && v.remove(block)) { if (blockIdManager.isStripedBlock(block)) { numECBlocks.decrement(); } else { numBlocks.decrement(); } if (v.isEmpty() && getBlockSetsSize(dn) == 0) { remove(dn); } } }
/** * Remove all block invalidation tasks under this datanode UUID; * used when a datanode registers with a new UUID and the old one * is wiped. */ void removeFromInvalidates(final DatanodeInfo datanode) { if (!namesystem.isPopulatingReplQueues()) { return; } invalidateBlocks.remove(datanode); }
/** * Remove all block invalidation tasks under this datanode UUID; * used when a datanode registers with a new UUID and the old one * is wiped. */ void removeFromInvalidates(final DatanodeInfo datanode) { if (!namesystem.isPopulatingReplQueues()) { return; } invalidateBlocks.remove(datanode); }
/** Remove the blocks associated to the given datanode. */ void removeBlocksAssociatedTo(final DatanodeDescriptor node) { final Iterator<? extends Block> it = node.getBlockIterator(); while(it.hasNext()) { removeStoredBlock(it.next(), node); } // Remove all pending DN messages referencing this DN. pendingDNMessages.removeAllMessagesForDatanode(node); node.resetBlocks(); invalidateBlocks.remove(node); }
/** Remove the blocks associated to the given datanode. */ void removeBlocksAssociatedTo(final DatanodeDescriptor node) { final Iterator<? extends Block> it = node.getBlockIterator(); while(it.hasNext()) { removeStoredBlock(it.next(), node); } // Remove all pending DN messages referencing this DN. pendingDNMessages.removeAllMessagesForDatanode(node); node.resetBlocks(); invalidateBlocks.remove(node); }
final Block b = getBlockOnStorage(lastBlock, storage); if (b != null) { invalidateBlocks.remove(storage.getDatanodeDescriptor(), b);
/** Remove the blocks associated to the given DatanodeStorageInfo. */ void removeBlocksAssociatedTo(final DatanodeStorageInfo storageInfo) { assert namesystem.hasWriteLock(); final Iterator<? extends Block> it = storageInfo.getBlockIterator(); DatanodeDescriptor node = storageInfo.getDatanodeDescriptor(); while(it.hasNext()) { Block block = it.next(); removeStoredBlock(block, node); invalidateBlocks.remove(node, block); } namesystem.checkSafeMode(); LOG.info("Removed blocks associated with storage {} from DataNode {}", storageInfo, node); }
synchronized List<Block> invalidateWork(final DatanodeDescriptor dn) { final long delay = getInvalidationDelay(); if (delay > 0) { if (BlockManager.LOG.isDebugEnabled()) { BlockManager.LOG .debug("Block deletion is delayed during NameNode startup. " + "The deletion will start after " + delay + " ms."); } return null; } final LightWeightHashSet<Block> set = node2blocks.get(dn); if (set == null) { return null; } // # blocks that can be sent in one message is limited final int limit = blockInvalidateLimit; final List<Block> toInvalidate = set.pollN(limit); // If we send everything in this message, remove this node entry if (set.isEmpty()) { remove(dn); } dn.addBlocksToBeInvalidated(toInvalidate); numBlocks -= toInvalidate.size(); return toInvalidate; }
/** Remove the blocks associated to the given DatanodeStorageInfo. */ void removeBlocksAssociatedTo(final DatanodeStorageInfo storageInfo) { assert namesystem.hasWriteLock(); final Iterator<? extends Block> it = storageInfo.getBlockIterator(); DatanodeDescriptor node = storageInfo.getDatanodeDescriptor(); while(it.hasNext()) { Block block = it.next(); removeStoredBlock(block, node); invalidateBlocks.remove(node, block); } namesystem.checkSafeMode(); LOG.info("Removed blocks associated with storage {} from DataNode {}", storageInfo, node); }
LOG.warn("DataNode " + dn + " cannot be found with UUID " + dn.getDatanodeUuid() + ", removing block invalidation work."); invalidateBlocks.remove(dn); return 0;
synchronized List<Block> invalidateWork(final DatanodeDescriptor dn) { final long delay = getInvalidationDelay(); if (delay > 0) { if (BlockManager.LOG.isDebugEnabled()) { BlockManager.LOG .debug("Block deletion is delayed during NameNode startup. " + "The deletion will start after " + delay + " ms."); } return null; } final LightWeightHashSet<Block> set = node2blocks.get(dn); if (set == null) { return null; } // # blocks that can be sent in one message is limited final int limit = blockInvalidateLimit; final List<Block> toInvalidate = set.pollN(limit); // If we send everything in this message, remove this node entry if (set.isEmpty()) { remove(dn); } dn.addBlocksToBeInvalidated(toInvalidate); numBlocks -= toInvalidate.size(); return toInvalidate; }
LOG.warn("DataNode " + dn + " cannot be found with UUID " + dn.getDatanodeUuid() + ", removing block invalidation work."); invalidateBlocks.remove(dn); return 0;
invalidateBlocks.remove(storage.getDatanodeDescriptor(), oldBlock);
invalidateBlocks.remove(storage.getDatanodeDescriptor(), oldBlock);