LOG.debug("BlockGS after " + blocks.get(randIndex).getGenerationStamp());
LOG.debug("Done corrupting GS of " + corruptedBlock.getBlockName());
cluster.getNameNode().blockReport(
cluster.getDataNodes().get(DN_N1).dnRegistration,
new BlockListAsLongs(blocks, null).getBlockListAsLongs());
printStats();
assertEquals("Wrong number of Corrupted blocks",
1, cluster.getNamesystem().getCorruptReplicaBlocks() +
// the following might have to be added into the equation if
// the same block could be in two different states at the same time
// and then the expected number of has to be changed to '2'
// cluster.getNamesystem().getPendingReplicationBlocks() +
cluster.getNamesystem().getPendingDeletionBlocks());
// Get another block and screw its length to be less than original
if (randIndex == 0)
randIndex++;
else
randIndex--;
corruptedBlock = blocks.get(randIndex);
corruptBlockLen(corruptedBlock);
LOG.debug("Done corrupting length of " + corruptedBlock.getBlockName());
cluster.getNameNode().blockReport(
cluster.getDataNodes().get(DN_N1).dnRegistration,
new BlockListAsLongs(blocks, null).getBlockListAsLongs());
printStats();
assertEquals("Wrong number of Corrupted blocks",
2, cluster.getNamesystem().getCorruptReplicaBlocks() +
cluster.getNamesystem().getPendingReplicationBlocks() +