Skip to content

Commit

Permalink
Revert changes in UpdateMatchingStatsMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
jnsrnhld committed Oct 31, 2024
1 parent c850c4e commit 5be35d6
Showing 1 changed file with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,11 @@ public class UpdateMatchingStatsMessage extends WorkerMessage {

@Override
public void react(Worker worker) throws Exception {
worker.getJobManager().addSlowJob(new UpdateMatchingStatsWorkerJob(worker, concepts));
worker.getJobManager().addSlowJob(new UpdateMatchingStatsJob(worker, concepts));
}

@Slf4j
@RequiredArgsConstructor
public static class UpdateMatchingStatsWorkerJob extends Job {
private static class UpdateMatchingStatsJob extends Job {
private final Worker worker;
private final Collection<ConceptId> concepts;

Expand All @@ -70,17 +69,19 @@ public void execute() throws Exception {
final Map<? extends ConceptId, CompletableFuture<Void>>
subJobs =
concepts.stream()
.collect(Collectors.toMap(
Functions.identity(),
concept -> CompletableFuture.runAsync(() -> {
final Concept<?> resolved = concept.resolve();
final Map<ConceptElementId<?>, MatchingStats.Entry> matchingStats = new HashMap<>(resolved.countElements());
.collect(Collectors.toMap(Functions.identity(),
concept -> CompletableFuture.runAsync(() -> {
final Concept<?> resolved = concept.resolve();
final Map<ConceptElementId<?>, MatchingStats.Entry>
matchingStats =
new HashMap<>(resolved.countElements());

calculateConceptMatches(resolved, matchingStats, worker);
worker.send(new UpdateElementMatchingStats(worker.getInfo().getId(), matchingStats));
calculateConceptMatches(resolved, matchingStats, worker);

progressReporter.report(1);
}, worker.getJobsExecutorService())
worker.send(new UpdateElementMatchingStats(worker.getInfo().getId(), matchingStats));

progressReporter.report(1);
}, worker.getJobsExecutorService())
));


Expand Down

0 comments on commit 5be35d6

Please sign in to comment.