Skip to content

Commit

Permalink
pass counter to each fsimage loading threads
Browse files Browse the repository at this point in the history
  • Loading branch information
Sungdong Kim committed Jan 19, 2025
1 parent 06d36f5 commit 9c9d747
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 9c9d747

Please sign in to comment.