BlockCollection bc = getBlockCollection((BlockInfo)block); String fileName = (bc == null) ? "[orphaned]" : bc.getName(); out.print(fileName + ": ");
/** * Returns whether the given block is one pointed-to by a file. */ private boolean isValidBlock(Block b) { return (blockManager.getBlockCollection(b) != null); } }
/** * Returns whether the given block is one pointed-to by a file. */ private boolean isValidBlock(Block b) { return (blockManager.getBlockCollection(b) != null); } }
private void chooseExcessRedundancies( final Collection<DatanodeStorageInfo> nonExcess, BlockInfo storedBlock, short replication, DatanodeDescriptor addedNode, DatanodeDescriptor delNodeHint) { assert namesystem.hasWriteLock(); // first form a rack to datanodes map and BlockCollection bc = getBlockCollection(storedBlock); if (storedBlock.isStriped()) { chooseExcessRedundancyStriped(bc, nonExcess, storedBlock, delNodeHint); } else { final BlockStoragePolicy storagePolicy = storagePolicySuite.getPolicy( bc.getStoragePolicyID()); final List<StorageType> excessTypes = storagePolicy.chooseExcess( replication, DatanodeStorageInfo.toStorageTypes(nonExcess)); chooseExcessRedundancyContiguous(nonExcess, storedBlock, replication, addedNode, delNodeHint, excessTypes); } }
final BlockCollection bc = getBlockCollection(block); if (block.isStriped()) { if (pendingNum > 0) {
final BlockCollection bc = blockManager.getBlockCollection(block); final NumberReplicas num = blockManager.countNodes(block); final int liveReplicas = num.liveReplicas();
final INode inode = (INode)blockManager.getBlockCollection(blk); skip++; if (inode != null && blockManager.countNodes(blk).liveReplicas() == 0) {
return; BlockCollection bc = bm.getBlockCollection(blockInfo); INode iNode = (INode) bc; NumberReplicas numberReplicas= bm.countNodes(block);
return; BlockCollection bc = bm.getBlockCollection(blockInfo); INode iNode = (INode) bc; NumberReplicas numberReplicas= bm.countNodes(block);
final INode inode = (INode)blockManager.getBlockCollection(blk); skip++; if (inode != null && blockManager.countNodes(blk).liveReplicas() == 0) {
private void chooseExcessReplicates( final Collection<DatanodeStorageInfo> nonExcess, Block b, short replication, DatanodeDescriptor addedNode, DatanodeDescriptor delNodeHint) { assert namesystem.hasWriteLock(); // first form a rack to datanodes map and BlockCollection bc = getBlockCollection(b); final BlockStoragePolicy storagePolicy = storagePolicySuite.getPolicy( bc.getStoragePolicyID()); final List<StorageType> excessTypes = storagePolicy.chooseExcess( replication, DatanodeStorageInfo.toStorageTypes(nonExcess)); List<DatanodeStorageInfo> replicasToDelete = blockplacement .chooseReplicasToDelete(nonExcess, replication, excessTypes, addedNode, delNodeHint); for (DatanodeStorageInfo choosenReplica : replicasToDelete) { processChosenExcessReplica(nonExcess, choosenReplica, b); } }
private void chooseExcessReplicates( final Collection<DatanodeStorageInfo> nonExcess, Block b, short replication, DatanodeDescriptor addedNode, DatanodeDescriptor delNodeHint) { assert namesystem.hasWriteLock(); // first form a rack to datanodes map and BlockCollection bc = getBlockCollection(b); final BlockStoragePolicy storagePolicy = storagePolicySuite.getPolicy( bc.getStoragePolicyID()); final List<StorageType> excessTypes = storagePolicy.chooseExcess( replication, DatanodeStorageInfo.toStorageTypes(nonExcess)); List<DatanodeStorageInfo> replicasToDelete = blockplacement .chooseReplicasToDelete(nonExcess, replication, excessTypes, addedNode, delNodeHint); for (DatanodeStorageInfo choosenReplica : replicasToDelete) { processChosenExcessReplica(nonExcess, choosenReplica, b); } }
static void assertBlockCollection(final BlockManager blkManager, final INodeFile file, final BlockInfoContiguous b) { Assert.assertSame(b, blkManager.getStoredBlock(b)); Assert.assertSame(file, blkManager.getBlockCollection(b)); Assert.assertSame(file, b.getBlockCollection()); }
assertNull(blockmanager.getBlockCollection(b)); assertNotNull(blockmanager.getBlockCollection(b)); assertNotNull(blockmanager.getBlockCollection(b));
.getBlockManager().getBlockCollection(eb.getLocalBlock()) .getBlocks()[0].getDatanode(0); cluster.getNameNode().getNamesystem().getBlockManager()
assertNull(blockmanager.getBlockCollection(b));
assertNull(blockmanager.getBlockCollection(b)); assertNull(blockmanager.getBlockCollection(b));
assertFalse(hdfs.exists(file15_s1)); for (BlockInfoContiguous b : blocks_14) { assertNull(blockmanager.getBlockCollection(b));