From a428e6f0432556e369c05b7ab1b429c2d4f9137a Mon Sep 17 00:00:00 2001 From: Sooraj Sinha <81695996+soosinha@users.noreply.github.com> Date: Mon, 5 Jul 2021 11:13:36 +0530 Subject: [PATCH] Pass interceptor to super constructor (#876) Signed-off-by: Sooraj Sinha --- .../reindex/AbstractAsyncBulkByScrollAction.java | 15 ++++++++++++--- .../org/opensearch/index/reindex/Reindexer.java | 3 +-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/modules/reindex/src/main/java/org/opensearch/index/reindex/AbstractAsyncBulkByScrollAction.java b/modules/reindex/src/main/java/org/opensearch/index/reindex/AbstractAsyncBulkByScrollAction.java index 58277179611..9b031e98700 100644 --- a/modules/reindex/src/main/java/org/opensearch/index/reindex/AbstractAsyncBulkByScrollAction.java +++ b/modules/reindex/src/main/java/org/opensearch/index/reindex/AbstractAsyncBulkByScrollAction.java @@ -114,7 +114,7 @@ public abstract class AbstractAsyncBulkByScrollAction interceptor; + protected final Optional interceptor; /** * The request for this action. Named mainRequest because we create lots of request variables all representing child @@ -138,10 +138,19 @@ public abstract class AbstractAsyncBulkByScrollAction, ScrollableHitSource.Hit, RequestWrapper> scriptApplier; private int lastBatchSize; + AbstractAsyncBulkByScrollAction(BulkByScrollTask task, boolean needsSourceDocumentVersions, + boolean needsSourceDocumentSeqNoAndPrimaryTerm, Logger logger, ParentTaskAssigningClient client, + ThreadPool threadPool, Request mainRequest, ActionListener listener, + @Nullable ScriptService scriptService, @Nullable ReindexSslConfig sslConfig) { + this(task, needsSourceDocumentVersions, needsSourceDocumentSeqNoAndPrimaryTerm, logger, client, + threadPool, mainRequest, listener, scriptService, sslConfig, Optional.empty()); + } + AbstractAsyncBulkByScrollAction(BulkByScrollTask task, boolean needsSourceDocumentVersions, boolean needsSourceDocumentSeqNoAndPrimaryTerm, Logger logger, ParentTaskAssigningClient client, ThreadPool threadPool, Request mainRequest, ActionListener listener, - @Nullable ScriptService scriptService, @Nullable ReindexSslConfig sslConfig) { + @Nullable ScriptService scriptService, @Nullable ReindexSslConfig sslConfig, + Optional interceptor) { this.task = task; this.scriptService = scriptService; this.sslConfig = sslConfig; @@ -155,7 +164,7 @@ public abstract class AbstractAsyncBulkByScrollAction