|
@@ -104,7 +104,7 @@ final class FSDirTruncateOp {
|
|
|
final BlockInfo last = file.getLastBlock();
|
|
|
if (last != null && last.getBlockUCState()
|
|
|
== BlockUCState.UNDER_RECOVERY) {
|
|
|
- final Block truncatedBlock = last.getUnderConstructionFeature()
|
|
|
+ final BlockInfo truncatedBlock = last.getUnderConstructionFeature()
|
|
|
.getTruncateBlock();
|
|
|
if (truncatedBlock != null) {
|
|
|
final long truncateLength = file.computeFileSize(false, false)
|
|
@@ -259,7 +259,8 @@ final class FSDirTruncateOp {
|
|
|
oldBlock = file.getLastBlock();
|
|
|
assert !oldBlock.isComplete() : "oldBlock should be under construction";
|
|
|
BlockUnderConstructionFeature uc = oldBlock.getUnderConstructionFeature();
|
|
|
- uc.setTruncateBlock(new Block(oldBlock));
|
|
|
+ uc.setTruncateBlock(new BlockInfoContiguous(oldBlock,
|
|
|
+ oldBlock.getReplication()));
|
|
|
uc.getTruncateBlock().setNumBytes(oldBlock.getNumBytes() - lastBlockDelta);
|
|
|
uc.getTruncateBlock().setGenerationStamp(newBlock.getGenerationStamp());
|
|
|
truncatedBlockUC = oldBlock;
|