Skip to content

Commit

Permalink
ADH-5241
Browse files Browse the repository at this point in the history
- minor refactoring
  • Loading branch information
VitekArkhipov committed Nov 28, 2024
1 parent 9cabe0a commit f5b0722
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,12 @@ public GpfdistPageSink(ContextManager<WriteContext> writeContextManager,
@Override
public CompletableFuture<?> appendPage(Page page)
{
pageProcessingFuture = CompletableFuture.supplyAsync(() -> {
pageProcessingFuture = CompletableFuture.runAsync(() -> {
waitForProcessors();
if (writeContext.getAdbQueryException().get() == null) {
PageProcessor pageProcessor = writeContext.getPageProcessors().poll();
writeContext.getPageProcessors().offer(pageProcessor);
pageProcessor.process(page);
return null;
}
else {
throw writeContext.getAdbQueryException().get();
Expand Down Expand Up @@ -110,10 +109,7 @@ public CompletableFuture<Collection<Slice>> finish()

private CompletableFuture<Void> closeCtx()
{
return CompletableFuture.supplyAsync(() -> {
writeContext.close();
return null;
});
return CompletableFuture.runAsync(writeContext::close);
}

private Collection<Slice> createFinishResult()
Expand Down

0 comments on commit f5b0722

Please sign in to comment.