/** * Update the length for the last block * * @param lastBlockLength * The length of the last block reported from client * @throws IOException */ void updateLengthOfLastBlock(INodeFile f, long lastBlockLength) throws IOException { BlockInfoContiguous lastBlock = f.getLastBlock(); assert (lastBlock != null) : "The last block for path " + f.getFullPathName() + " is null when updating its length"; assert (lastBlock instanceof BlockInfoContiguousUnderConstruction) : "The last block for path " + f.getFullPathName() + " is not a BlockInfoUnderConstruction when updating its length"; lastBlock.setNumBytes(lastBlockLength); }
/** * Update the length for the last block * * @param lastBlockLength * The length of the last block reported from client * @throws IOException */ void updateLengthOfLastBlock(INodeFile f, long lastBlockLength) throws IOException { BlockInfoContiguous lastBlock = f.getLastBlock(); assert (lastBlock != null) : "The last block for path " + f.getFullPathName() + " is null when updating its length"; assert (lastBlock instanceof BlockInfoContiguousUnderConstruction) : "The last block for path " + f.getFullPathName() + " is not a BlockInfoUnderConstruction when updating its length"; lastBlock.setNumBytes(lastBlockLength); }
storedBlock.setNumBytes(newlength);
storedBlock.setNumBytes(newlength);
final BlockInfoContiguous[] blocks = node.getBlocks(); assertEquals(blocks.length, 1); blocks[0].setNumBytes(-1L); // set the block length to be negative
lastBlock.setNumBytes(len); return lastBlock;
oldBlock.setNumBytes(newBlock.getNumBytes()); boolean changeMade = oldBlock.getGenerationStamp() != newBlock.getGenerationStamp();
oldBlock.setNumBytes(newBlock.getNumBytes()); boolean changeMade = oldBlock.getGenerationStamp() != newBlock.getGenerationStamp();