Class BlockRecoveryWorker.RecoveryTaskStriped

java.lang.Object
org.apache.hadoop.hdfs.server.datanode.BlockRecoveryWorker.RecoveryTaskStriped
Enclosing class:
BlockRecoveryWorker

public class BlockRecoveryWorker.RecoveryTaskStriped extends Object
blk_0 blk_1 blk_2 blk_3 blk_4 blk_5 blk_6 blk_7 blk_8 64k 64k 64k 64k 64k 64k 64k 64k 64k <-- stripe_0 64k 64k 64k 64k 64k 64k 64k 64k 64k 64k 64k 64k 64k 64k 64k 64k 61k <-- startStripeIdx 64k 64k 64k 64k 64k 64k 64k 64k 64k 64k 64k 64k 64k 59k 64k 64k 64k 64k 64k 64k 64k 64k 64k 64k 64k 64k <-- last full stripe 64k 64k 13k 64k 55k 3k <-- target last stripe 64k 64k 64k 1k 64k 64k 58k 64k 64k 64k 19k 64k <-- total visible stripe Due to different speed of streamers, the internal blocks in a block group could have different lengths when the block group isn't ended normally. The purpose of this class is to recover the UnderConstruction block group, so all internal blocks end at the same stripe. The steps: 1. get all blocks lengths from DataNodes. 2. calculate safe length, which is at the target last stripe. 3. decode and feed blk_6~8, make them end at last full stripe. (the last full stripe means the last decodable stripe.) 4. encode the target last stripe, with the remaining sequential data. In this case, the sequential data is 64k+64k+13k. Feed blk_6~8 the parity cells. Overwrite the parity cell if have to. 5. truncate the stripes from visible stripe, to target last stripe. TODO: implement step 3,4