From 5be35d63c66c48f9318a5c4f4b046a9dbaea3197 Mon Sep 17 00:00:00 2001 From: Jonas Arnhold Date: Thu, 31 Oct 2024 11:45:08 +0100 Subject: [PATCH] Revert changes in UpdateMatchingStatsMessage --- .../specific/UpdateMatchingStatsMessage.java | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/backend/src/main/java/com/bakdata/conquery/models/messages/namespaces/specific/UpdateMatchingStatsMessage.java b/backend/src/main/java/com/bakdata/conquery/models/messages/namespaces/specific/UpdateMatchingStatsMessage.java index 1113510eed..19f54c8d13 100644 --- a/backend/src/main/java/com/bakdata/conquery/models/messages/namespaces/specific/UpdateMatchingStatsMessage.java +++ b/backend/src/main/java/com/bakdata/conquery/models/messages/namespaces/specific/UpdateMatchingStatsMessage.java @@ -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 concepts; @@ -70,17 +69,19 @@ public void execute() throws Exception { final Map> subJobs = concepts.stream() - .collect(Collectors.toMap( - Functions.identity(), - concept -> CompletableFuture.runAsync(() -> { - final Concept resolved = concept.resolve(); - final Map, MatchingStats.Entry> matchingStats = new HashMap<>(resolved.countElements()); + .collect(Collectors.toMap(Functions.identity(), + concept -> CompletableFuture.runAsync(() -> { + final Concept resolved = concept.resolve(); + final Map, 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()) ));