Skip to content

Commit

Permalink
minor optimization (according to Intellij)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristian Goina committed Oct 31, 2024
1 parent af2b8cd commit 05fafd8
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,12 @@ public EMCDMatchesExporter(CachedDataHelper jacsDataHelper,
public void runExport() {
long startProcessingTime = System.currentTimeMillis();
Collection<String> masks = neuronMatchesReader.listMatchesLocations(Collections.singletonList(dataSourceParam));
List<CompletableFuture<Void>> allExportsJobs = ItemsHandling.partitionCollection(masks, processingPartitionSize)
CompletableFuture.allOf(ItemsHandling.partitionCollection(masks, processingPartitionSize)
.entrySet().stream()
.map(indexedPartition -> CompletableFuture.<Void>supplyAsync(() -> {
runExportForMaskIds(indexedPartition.getKey(), indexedPartition.getValue());
return null;
}, executor))
.collect(Collectors.toList());
CompletableFuture.allOf(allExportsJobs.toArray(new CompletableFuture<?>[0])).join();
}, executor)).toArray(CompletableFuture<?>[]::new)).join();
LOG.info("Finished all exports in {}s", (System.currentTimeMillis()-startProcessingTime)/1000.);
}

Expand Down

0 comments on commit 05fafd8

Please sign in to comment.