HDFS-16909. Improve ReplicaMap#mergeAll method. (#5353). Contributed by ZhangHB.

Reviewed-by: zhangshuyan <zqingchai@gmail.com>
Signed-off-by: He Xiaoqiao <hexiaoqiao@apache.org>
This commit is contained in:
hfutatzhanghb 2023-05-21 19:08:58 +08:00 committed by GitHub
parent af933f3a4f
commit 5b22dc6ace
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -178,13 +178,13 @@ class ReplicaMap {
for (ReplicaInfo replicaInfo : replicaInfos) {
replicaSet.add(replicaInfo);
}
if (curSet == null && !replicaSet.isEmpty()) {
// Add an entry for block pool if it does not exist already
curSet = new LightWeightResizableGSet<>();
map.put(bp, curSet);
}
for (ReplicaInfo replicaInfo : replicaSet) {
checkBlock(replicaInfo);
if (curSet == null) {
// Add an entry for block pool if it does not exist already
curSet = new LightWeightResizableGSet<>();
map.put(bp, curSet);
}
curSet.put(replicaInfo);
}
}