HDFS-7603. The background replication queue initialization may not let others run. Contributed by Kihwal Lee.
This commit is contained in:
parent
342efa110a
commit
89b07490f8
|
@ -561,6 +561,9 @@ Release 2.7.0 - UNRELEASED
|
|||
|
||||
HDFS-7675. Remove unused member DFSClient#spanReceiverHost (cmccabe)
|
||||
|
||||
HDFS-7603. The background replication queue initialization may not let
|
||||
others run (kihwal)
|
||||
|
||||
OPTIMIZATIONS
|
||||
|
||||
HDFS-7454. Reduce memory footprint for AclEntries in NameNode.
|
||||
|
|
|
@ -2612,6 +2612,9 @@ public class BlockManager {
|
|||
long totalBlocks = blocksMap.size();
|
||||
replicationQueuesInitProgress = 0;
|
||||
long totalProcessed = 0;
|
||||
long sleepDuration =
|
||||
Math.max(1, Math.min(numBlocksPerIteration/1000, 10000));
|
||||
|
||||
while (namesystem.isRunning() && !Thread.currentThread().isInterrupted()) {
|
||||
int processed = 0;
|
||||
namesystem.writeLockInterruptibly();
|
||||
|
@ -2668,6 +2671,8 @@ public class BlockManager {
|
|||
}
|
||||
} finally {
|
||||
namesystem.writeUnlock();
|
||||
// Make sure it is out of the write lock for sufficiently long time.
|
||||
Thread.sleep(sleepDuration);
|
||||
}
|
||||
}
|
||||
if (Thread.currentThread().isInterrupted()) {
|
||||
|
|
Loading…
Reference in New Issue