/** * Defines if a replica needs to be copied on truncate or * can be truncated in place. */ private static boolean shouldCopyOnTruncate(FSNamesystem fsn, INodeFile file, BlockInfo blk) { if (!fsn.isUpgradeFinalized()) { return true; } if (fsn.isRollingUpgrade()) { return true; } return file.isBlockInLatestSnapshot(blk); }
if(copyTruncate) { closeFileCommitBlocks(src, iFile, truncatedBlock); if(!iFile.isBlockInLatestSnapshot(storedBlock)) { blockManager.removeBlock(storedBlock);
"Should be the same block."; if (oldBlock.getBlockId() != tBlk.getBlockId() && !file.isBlockInLatestSnapshot(oldBlock)) { oldBlock.delete(); fsd.getBlockManager().removeBlockFromMap(oldBlock);
/** * Defines if a replica needs to be copied on truncate or * can be truncated in place. */ boolean shouldCopyOnTruncate(INodeFile file, BlockInfoContiguous blk) { if(!isUpgradeFinalized()) { return true; } if (isRollingUpgrade()) { return true; } return file.isBlockInLatestSnapshot(blk); }
/** * Defines if a replica needs to be copied on truncate or * can be truncated in place. */ boolean shouldCopyOnTruncate(INodeFile file, BlockInfoContiguous blk) { if(!isUpgradeFinalized()) { return true; } if (isRollingUpgrade()) { return true; } return file.isBlockInLatestSnapshot(blk); }
if(copyTruncate) { closeFileCommitBlocks(src, iFile, truncatedBlock); if(!iFile.isBlockInLatestSnapshot(storedBlock)) { blockManager.removeBlock(storedBlock);
if(copyTruncate) { closeFileCommitBlocks(src, iFile, truncatedBlock); if(!iFile.isBlockInLatestSnapshot(storedBlock)) { blockManager.removeBlock(storedBlock);
"Should be the same block."; if(oldBlock.getBlockId() != tBlk.getBlockId() && !file.isBlockInLatestSnapshot(oldBlock)) { getBlockManager().removeBlockFromMap(oldBlock);
"Should be the same block."; if(oldBlock.getBlockId() != tBlk.getBlockId() && !file.isBlockInLatestSnapshot(oldBlock)) { getBlockManager().removeBlockFromMap(oldBlock);
file = iip.getLastINode().asFile(); file.recordModification(iip.getLatestSnapshotId(), true); assertThat(file.isBlockInLatestSnapshot(file.getLastBlock()), is(true)); initialGenStamp = file.getLastBlock().getGenerationStamp();