From 70567bd6fc95939d4a88b09cbf1a39c904b12024 Mon Sep 17 00:00:00 2001 From: Michael Froh Date: Fri, 27 Oct 2023 19:26:45 +0000 Subject: [PATCH] Rename async methods (put async at end) Signed-off-by: Michael Froh --- .../main/java/org/opensearch/search/pipeline/Pipeline.java | 4 ++-- .../opensearch/search/pipeline/SearchRequestProcessor.java | 2 +- .../opensearch/search/pipeline/SearchResponseProcessor.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/src/main/java/org/opensearch/search/pipeline/Pipeline.java b/server/src/main/java/org/opensearch/search/pipeline/Pipeline.java index 2699f18d6f037..8bab961423f91 100644 --- a/server/src/main/java/org/opensearch/search/pipeline/Pipeline.java +++ b/server/src/main/java/org/opensearch/search/pipeline/Pipeline.java @@ -147,7 +147,7 @@ void transformRequest(SearchRequest request, ActionListener reque currentListener = ActionListener.wrap(r -> { long start = relativeTimeSupplier.getAsLong(); beforeRequestProcessor(processor); - processor.asyncProcessRequest(r, ActionListener.wrap(rr -> { + processor.processRequestAsync(r, ActionListener.wrap(rr -> { long took = TimeUnit.NANOSECONDS.toMillis(relativeTimeSupplier.getAsLong() - start); afterRequestProcessor(processor, took); nextListener.onResponse(rr); @@ -219,7 +219,7 @@ ActionListener transformResponseListener(SearchRequest request, responseListener = ActionListener.wrap(r -> { beforeResponseProcessor(processor); final long start = relativeTimeSupplier.getAsLong(); - processor.asyncProcessResponse(request, r, ActionListener.wrap(rr -> { + processor.processResponseAsync(request, r, ActionListener.wrap(rr -> { long took = TimeUnit.NANOSECONDS.toMillis(relativeTimeSupplier.getAsLong() - start); afterResponseProcessor(processor, took); currentFinalListener.onResponse(rr); diff --git a/server/src/main/java/org/opensearch/search/pipeline/SearchRequestProcessor.java b/server/src/main/java/org/opensearch/search/pipeline/SearchRequestProcessor.java index 0501d1ee45403..427c9e4ab694c 100644 --- a/server/src/main/java/org/opensearch/search/pipeline/SearchRequestProcessor.java +++ b/server/src/main/java/org/opensearch/search/pipeline/SearchRequestProcessor.java @@ -35,7 +35,7 @@ public interface SearchRequestProcessor extends Processor { * @param request the executed {@link SearchRequest} * @param requestListener callback to be invoked on successful processing or on failure */ - default void asyncProcessRequest(SearchRequest request, ActionListener requestListener) { + default void processRequestAsync(SearchRequest request, ActionListener requestListener) { try { requestListener.onResponse(processRequest(request)); } catch (Exception e) { diff --git a/server/src/main/java/org/opensearch/search/pipeline/SearchResponseProcessor.java b/server/src/main/java/org/opensearch/search/pipeline/SearchResponseProcessor.java index f577c4ae19d6c..21136ce208fee 100644 --- a/server/src/main/java/org/opensearch/search/pipeline/SearchResponseProcessor.java +++ b/server/src/main/java/org/opensearch/search/pipeline/SearchResponseProcessor.java @@ -36,7 +36,7 @@ public interface SearchResponseProcessor extends Processor { * @param response the current {@link SearchResponse}, possibly modified by earlier processors * @param responseListener callback to be invoked on successful processing or on failure */ - default void asyncProcessResponse(SearchRequest request, SearchResponse response, ActionListener responseListener) { + default void processResponseAsync(SearchRequest request, SearchResponse response, ActionListener responseListener) { try { responseListener.onResponse(processResponse(request, response)); } catch (Exception e) {