parallelize adding blocks in first block report
@@ -2265,7 +2265,14 @@ public ReportStatistics processReport(final DatanodeStorageInfo storage,final Bl
int numBlocksLogged = 0;
for (final BlockInfo b : toAdd) {
if (firstBlockReport) {
- addStoredBlockImmediateTx(b, storage, numBlocksLogged < maxNumBlocksToLog);
+ final boolean logIt = numBlocksLogged < maxNumBlocksToLog;
+ addTasks.add(new Callable<Object>() {
+ @Override
+ public Object call() throws Exception {
+ addStoredBlockImmediateTx(b, storage, logIt);
+ return null;
+ }
+ });
} else {
final boolean logIt = numBlocksLogged < maxNumBlocksToLog;
addTasks.add(new Callable<Object>() {
