HDFS-6511. BlockManager#computeInvalidateWork() could do nothing. Contributed by Juan Yu.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1607736 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3470a34c22
commit
e6e5417134
|
@ -10,6 +10,8 @@ Release 2.6.0 - UNRELEASED
|
||||||
|
|
||||||
HDFS-6613. Improve logging in caching classes. (wang)
|
HDFS-6613. Improve logging in caching classes. (wang)
|
||||||
|
|
||||||
|
HDFS-6511. BlockManager#computeInvalidateWork() could do nothing. (Juan Yu via wang)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
BUG FIXES
|
BUG FIXES
|
||||||
|
|
|
@ -1226,8 +1226,14 @@ public class BlockManager {
|
||||||
nodesToProcess = Math.min(nodes.size(), nodesToProcess);
|
nodesToProcess = Math.min(nodes.size(), nodesToProcess);
|
||||||
|
|
||||||
int blockCnt = 0;
|
int blockCnt = 0;
|
||||||
for(int nodeCnt = 0; nodeCnt < nodesToProcess; nodeCnt++ ) {
|
for (DatanodeInfo dnInfo : nodes) {
|
||||||
blockCnt += invalidateWorkForOneNode(nodes.get(nodeCnt));
|
int blocks = invalidateWorkForOneNode(dnInfo);
|
||||||
|
if (blocks > 0) {
|
||||||
|
blockCnt += blocks;
|
||||||
|
if (--nodesToProcess == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return blockCnt;
|
return blockCnt;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue