Skip to content

Commit de480d6

Browse files
committed
HDFS-8623. Refactor NameNode handling of invalid, corrupt, and under-recovery blocks. Contributed by Zhe Zhang.
1 parent 1b764a0 commit de480d6

File tree

13 files changed

+361
-302
lines changed

13 files changed

+361
-302
lines changed

hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,9 @@ Release 2.8.0 - UNRELEASED
679679
HDFS-8651. Make hadoop-hdfs-project Native code -Wall-clean (Alan Burlison
680680
via Colin P. McCabe)
681681

682+
HDFS-8623. Refactor NameNode handling of invalid, corrupt, and under-recovery
683+
blocks. (Zhe Zhang via jing9)
684+
682685
OPTIMIZATIONS
683686

684687
HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockInfo.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,19 +172,23 @@ public int getCapacity() {
172172
public abstract int numNodes();
173173

174174
/**
175-
* Add a {@link DatanodeStorageInfo} location for a block.
175+
* Add a {@link DatanodeStorageInfo} location for a block
176+
* @param storage The storage to add
177+
* @param reportedBlock The block reported from the datanode. This is only
178+
* used by erasure coded blocks, this block's id contains
179+
* information indicating the index of the block in the
180+
* corresponding block group.
176181
*/
177-
abstract boolean addStorage(DatanodeStorageInfo storage);
182+
abstract boolean addStorage(DatanodeStorageInfo storage, Block reportedBlock);
178183

179184
/**
180185
* Remove {@link DatanodeStorageInfo} location for a block
181186
*/
182187
abstract boolean removeStorage(DatanodeStorageInfo storage);
183188

184-
185189
/**
186190
* Replace the current BlockInfo with the new one in corresponding
187-
* DatanodeStorageInfo's linked list
191+
* DatanodeStorageInfo's linked list.
188192
*/
189193
abstract void replaceBlock(BlockInfo newBlock);
190194

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockInfoContiguous.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected BlockInfoContiguous(BlockInfo from) {
4545
}
4646

4747
@Override
48-
boolean addStorage(DatanodeStorageInfo storage) {
48+
boolean addStorage(DatanodeStorageInfo storage, Block reportedBlock) {
4949
return ContiguousBlockStorageOp.addStorage(this, storage);
5050
}
5151

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockInfoUnderConstructionContiguous.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public BlockInfoContiguous convertToCompleteBlock() {
6969
}
7070

7171
@Override
72-
boolean addStorage(DatanodeStorageInfo storage) {
72+
boolean addStorage(DatanodeStorageInfo storage, Block reportedBlock) {
7373
return ContiguousBlockStorageOp.addStorage(this, storage);
7474
}
7575

0 commit comments

Comments
 (0)