From f5b072200b6fd89fcac1c51457103bf9ad041192 Mon Sep 17 00:00:00 2001 From: avv Date: Thu, 28 Nov 2024 18:02:20 +0500 Subject: [PATCH] ADH-5241 - minor refactoring --- .../protocol/gpfdist/load/process/GpfdistPageSink.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/plugin/trino-adb/src/main/java/io/trino/plugin/adb/connector/protocol/gpfdist/load/process/GpfdistPageSink.java b/plugin/trino-adb/src/main/java/io/trino/plugin/adb/connector/protocol/gpfdist/load/process/GpfdistPageSink.java index 3bf47aa7530d..4de726c4acdf 100644 --- a/plugin/trino-adb/src/main/java/io/trino/plugin/adb/connector/protocol/gpfdist/load/process/GpfdistPageSink.java +++ b/plugin/trino-adb/src/main/java/io/trino/plugin/adb/connector/protocol/gpfdist/load/process/GpfdistPageSink.java @@ -56,13 +56,12 @@ public GpfdistPageSink(ContextManager 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(); @@ -110,10 +109,7 @@ public CompletableFuture> finish() private CompletableFuture closeCtx() { - return CompletableFuture.supplyAsync(() -> { - writeContext.close(); - return null; - }); + return CompletableFuture.runAsync(writeContext::close); } private Collection createFinishResult()