Skip to content

Commit

Permalink
HDFS-17711: Change fsimage loading progress percentage discontinuous …
Browse files Browse the repository at this point in the history
…to continuous

Co-authored-by: Sungdong Kim <[email protected]>
Signed-off-by: Chris Nauroth <[email protected]>
  • Loading branch information
Last-remote11 and Sungdong Kim authored Jan 23, 2025
1 parent 2343bd7 commit 7ce4ea5
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ void loadINodeSectionInParallel(ExecutorService service,
CountDownLatch latch = new CountDownLatch(sections.size());
AtomicInteger totalLoaded = new AtomicInteger(0);
final List<IOException> exceptions = Collections.synchronizedList(new ArrayList<>());
Counter counter = prog.getCounter(Phase.LOADING_FSIMAGE, currentStep);

for (int i=0; i < sections.size(); i++) {
FileSummary.Section s = sections.get(i);
Expand All @@ -433,9 +434,7 @@ void loadINodeSectionInParallel(ExecutorService service,
}
service.submit(() -> {
try {
totalLoaded.addAndGet(loadINodesInSection(ins, null));
prog.setCount(Phase.LOADING_FSIMAGE, currentStep,
totalLoaded.get());
totalLoaded.addAndGet(loadINodesInSection(ins, counter));
} catch (Exception e) {
LOG.error("An exception occurred loading INodes in parallel", e);
exceptions.add(new IOException(e));
Expand Down

0 comments on commit 7ce4ea5

Please sign in to comment.