From f41d6a407103cd144509f5dda221affe4025d584 Mon Sep 17 00:00:00 2001 From: Nicholas Walter Knize Date: Mon, 21 Mar 2022 23:48:27 -0500 Subject: [PATCH 001/514] [2.x] Bump Version 2.0 to 2.1 Signed-off-by: Nicholas Walter Knize --- .ci/bwcVersions | 1 + buildSrc/version.properties | 2 +- server/src/main/java/org/opensearch/Version.java | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.ci/bwcVersions b/.ci/bwcVersions index ddc36af48d674..e012f178ea5b8 100644 --- a/.ci/bwcVersions +++ b/.ci/bwcVersions @@ -39,3 +39,4 @@ BWC_VERSION: - "1.3.0" - "1.3.1" - "1.4.0" + - "2.0.0" diff --git a/buildSrc/version.properties b/buildSrc/version.properties index b5e14cd24bd93..c745e5bfc2eb1 100644 --- a/buildSrc/version.properties +++ b/buildSrc/version.properties @@ -1,4 +1,4 @@ -opensearch = 2.0.0 +opensearch = 2.1.0 lucene = 9.1.0-snapshot-ea989fe8f30 bundled_jdk_vendor = adoptium diff --git a/server/src/main/java/org/opensearch/Version.java b/server/src/main/java/org/opensearch/Version.java index f74e529c442bb..ac4df5986917a 100644 --- a/server/src/main/java/org/opensearch/Version.java +++ b/server/src/main/java/org/opensearch/Version.java @@ -82,7 +82,8 @@ public class Version implements Comparable, ToXContentFragment { public static final Version V_1_3_1 = new Version(1030199, org.apache.lucene.util.Version.LUCENE_8_10_1); public static final Version V_1_4_0 = new Version(1040099, org.apache.lucene.util.Version.LUCENE_8_10_1); public static final Version V_2_0_0 = new Version(2000099, org.apache.lucene.util.Version.LUCENE_9_1_0); - public static final Version CURRENT = V_2_0_0; + public static final Version V_2_1_0 = new Version(2010099, org.apache.lucene.util.Version.LUCENE_9_1_0); + public static final Version CURRENT = V_2_1_0; public static Version readVersion(StreamInput in) throws IOException { return fromId(in.readVInt()); From 11dd394f98d5caff41bdfa5840b6ec6719effa7e Mon Sep 17 00:00:00 2001 From: Nicholas Walter Knize Date: Wed, 23 Mar 2022 09:06:50 -0500 Subject: [PATCH 002/514] remove cancelled 1.4 version Signed-off-by: Nicholas Walter Knize --- .ci/bwcVersions | 1 - server/src/main/java/org/opensearch/Version.java | 1 - 2 files changed, 2 deletions(-) diff --git a/.ci/bwcVersions b/.ci/bwcVersions index e012f178ea5b8..081fe1e794169 100644 --- a/.ci/bwcVersions +++ b/.ci/bwcVersions @@ -38,5 +38,4 @@ BWC_VERSION: - "1.2.5" - "1.3.0" - "1.3.1" - - "1.4.0" - "2.0.0" diff --git a/server/src/main/java/org/opensearch/Version.java b/server/src/main/java/org/opensearch/Version.java index ac4df5986917a..c6c2f0806afb6 100644 --- a/server/src/main/java/org/opensearch/Version.java +++ b/server/src/main/java/org/opensearch/Version.java @@ -80,7 +80,6 @@ public class Version implements Comparable, ToXContentFragment { public static final Version V_1_2_5 = new Version(1020599, org.apache.lucene.util.Version.LUCENE_8_10_1); public static final Version V_1_3_0 = new Version(1030099, org.apache.lucene.util.Version.LUCENE_8_10_1); public static final Version V_1_3_1 = new Version(1030199, org.apache.lucene.util.Version.LUCENE_8_10_1); - public static final Version V_1_4_0 = new Version(1040099, org.apache.lucene.util.Version.LUCENE_8_10_1); public static final Version V_2_0_0 = new Version(2000099, org.apache.lucene.util.Version.LUCENE_9_1_0); public static final Version V_2_1_0 = new Version(2010099, org.apache.lucene.util.Version.LUCENE_9_1_0); public static final Version CURRENT = V_2_1_0; From 388b02b5aac630f7a4514bfe6f6bdf084003118a Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 24 Mar 2022 12:47:33 -0500 Subject: [PATCH 003/514] [Backport 2.x] [Bug] Fix InboundDecoder version compat check (#2574) Change InboundDecoder ensureVersionCompatibility check for onOrAfter V_2_0_0 instead of explicit version check. This way bug fix and minor versions will correctly handshake in a mixed 1.x Cluster. Also fixes version filtering and warning handling for bwc testing. Signed-off-by: Nicholas Walter Knize (cherry picked from commit 511ac884fe49e6d97738d42a67ffa1819396ca2a) --- .../test/java/org/opensearch/backwards/ExceptionIT.java | 8 +++++++- .../java/org/opensearch/transport/InboundDecoder.java | 2 +- .../src/main/java/org/opensearch/test/VersionUtils.java | 2 +- .../test/java/org/opensearch/test/VersionUtilsTests.java | 6 ++++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/qa/mixed-cluster/src/test/java/org/opensearch/backwards/ExceptionIT.java b/qa/mixed-cluster/src/test/java/org/opensearch/backwards/ExceptionIT.java index e0246870181c0..d8207ecb9b5c5 100644 --- a/qa/mixed-cluster/src/test/java/org/opensearch/backwards/ExceptionIT.java +++ b/qa/mixed-cluster/src/test/java/org/opensearch/backwards/ExceptionIT.java @@ -47,7 +47,13 @@ public void testOpensearchException() throws Exception { private void logClusterNodes() throws IOException { ObjectPath objectPath = ObjectPath.createFromResponse(client().performRequest(new Request("GET", "_nodes"))); Map nodes = objectPath.evaluate("nodes"); - String master = EntityUtils.toString(client().performRequest(new Request("GET", "_cat/master?h=id")).getEntity()).trim(); + Request request = new Request("GET", "_cat/master?h=id"); + String inclusiveWarning = "[GET /_cat/master] is deprecated! Use [GET /_cat/cluster_manager] instead."; + request.setOptions(expectVersionSpecificWarnings(v -> { + v.current(inclusiveWarning); + v.compatible(inclusiveWarning); + })); + String master = EntityUtils.toString(client().performRequest(request).getEntity()).trim(); logger.info("cluster discovered: master id='{}'", master); for (String id : nodes.keySet()) { logger.info("{}: id='{}', name='{}', version={}", diff --git a/server/src/main/java/org/opensearch/transport/InboundDecoder.java b/server/src/main/java/org/opensearch/transport/InboundDecoder.java index bd1d384fd37da..9cfb4a79161e7 100644 --- a/server/src/main/java/org/opensearch/transport/InboundDecoder.java +++ b/server/src/main/java/org/opensearch/transport/InboundDecoder.java @@ -217,7 +217,7 @@ static IllegalStateException ensureVersionCompatibility(Version remoteVersion, V // handshake. This looks odd but it's required to establish the connection correctly we check for real compatibility // once the connection is established final Version compatibilityVersion = isHandshake ? currentVersion.minimumCompatibilityVersion() : currentVersion; - if ((currentVersion.equals(Version.V_2_0_0) && remoteVersion.equals(Version.fromId(6079999))) == false + if ((currentVersion.onOrAfter(Version.V_2_0_0) && remoteVersion.equals(Version.fromId(6079999))) == false && remoteVersion.isCompatible(compatibilityVersion) == false) { final Version minCompatibilityVersion = isHandshake ? compatibilityVersion : compatibilityVersion.minimumCompatibilityVersion(); String msg = "Received " + (isHandshake ? "handshake " : "") + "message from unsupported version: ["; diff --git a/test/framework/src/main/java/org/opensearch/test/VersionUtils.java b/test/framework/src/main/java/org/opensearch/test/VersionUtils.java index 1e6807189f947..0f8525285fd08 100644 --- a/test/framework/src/main/java/org/opensearch/test/VersionUtils.java +++ b/test/framework/src/main/java/org/opensearch/test/VersionUtils.java @@ -89,7 +89,7 @@ static Tuple, List> resolveReleasedVersions(Version curre stableVersions = previousMajor; // remove current moveLastToUnreleased(currentMajor, unreleasedVersions); - } else if (current.major != 1 && current.major != 2) { + } else if (current.major != 1) { // on a stable or release branch, ie N.x stableVersions = currentMajor; // remove the next maintenance bugfix diff --git a/test/framework/src/test/java/org/opensearch/test/VersionUtilsTests.java b/test/framework/src/test/java/org/opensearch/test/VersionUtilsTests.java index 7d8fb4a318621..de1f650aff20c 100644 --- a/test/framework/src/test/java/org/opensearch/test/VersionUtilsTests.java +++ b/test/framework/src/test/java/org/opensearch/test/VersionUtilsTests.java @@ -284,7 +284,6 @@ public void testResolveReleasedVersionsAtNewMinorBranchIn2x() { Arrays.asList( TestNewMinorBranchIn6x.V_1_6_0, TestNewMinorBranchIn6x.V_1_6_1, - TestNewMinorBranchIn6x.V_1_6_2, TestNewMinorBranchIn6x.V_2_0_0, TestNewMinorBranchIn6x.V_2_0_1, TestNewMinorBranchIn6x.V_2_1_0, @@ -292,7 +291,10 @@ public void testResolveReleasedVersionsAtNewMinorBranchIn2x() { ) ) ); - assertThat(unreleased, equalTo(Arrays.asList(TestNewMinorBranchIn6x.V_2_1_2, TestNewMinorBranchIn6x.V_2_2_0))); + assertThat( + unreleased, + equalTo(Arrays.asList(TestNewMinorBranchIn6x.V_1_6_2, TestNewMinorBranchIn6x.V_2_1_2, TestNewMinorBranchIn6x.V_2_2_0)) + ); } /** From c6195d07366b0e7d7b862957dc414a8ffe776894 Mon Sep 17 00:00:00 2001 From: Nick Knize Date: Thu, 24 Mar 2022 14:48:35 -0500 Subject: [PATCH 004/514] [Upgrade] Lucene 9.1 release (#2560) (#2566) Upgrades to the official 9.1 release Signed-off-by: Nicholas Walter Knize --- buildSrc/version.properties | 2 +- .../lucene-expressions-9.1.0-snapshot-ea989fe8f30.jar.sha1 | 1 - .../lang-expression/licenses/lucene-expressions-9.1.0.jar.sha1 | 1 + .../lucene-analysis-icu-9.1.0-snapshot-ea989fe8f30.jar.sha1 | 1 - .../analysis-icu/licenses/lucene-analysis-icu-9.1.0.jar.sha1 | 1 + ...lucene-analysis-kuromoji-9.1.0-snapshot-ea989fe8f30.jar.sha1 | 1 - .../licenses/lucene-analysis-kuromoji-9.1.0.jar.sha1 | 1 + .../lucene-analysis-nori-9.1.0-snapshot-ea989fe8f30.jar.sha1 | 1 - .../analysis-nori/licenses/lucene-analysis-nori-9.1.0.jar.sha1 | 1 + ...lucene-analysis-phonetic-9.1.0-snapshot-ea989fe8f30.jar.sha1 | 1 - .../licenses/lucene-analysis-phonetic-9.1.0.jar.sha1 | 1 + .../lucene-analysis-smartcn-9.1.0-snapshot-ea989fe8f30.jar.sha1 | 1 - .../licenses/lucene-analysis-smartcn-9.1.0.jar.sha1 | 1 + .../lucene-analysis-stempel-9.1.0-snapshot-ea989fe8f30.jar.sha1 | 1 - .../licenses/lucene-analysis-stempel-9.1.0.jar.sha1 | 1 + ...cene-analysis-morfologik-9.1.0-snapshot-ea989fe8f30.jar.sha1 | 1 - .../licenses/lucene-analysis-morfologik-9.1.0.jar.sha1 | 1 + .../lucene-analysis-common-9.1.0-snapshot-ea989fe8f30.jar.sha1 | 1 - server/licenses/lucene-analysis-common-9.1.0.jar.sha1 | 1 + .../lucene-backward-codecs-9.1.0-snapshot-ea989fe8f30.jar.sha1 | 1 - server/licenses/lucene-backward-codecs-9.1.0.jar.sha1 | 1 + server/licenses/lucene-core-9.1.0-snapshot-ea989fe8f30.jar.sha1 | 1 - server/licenses/lucene-core-9.1.0.jar.sha1 | 1 + .../lucene-grouping-9.1.0-snapshot-ea989fe8f30.jar.sha1 | 1 - server/licenses/lucene-grouping-9.1.0.jar.sha1 | 1 + .../lucene-highlighter-9.1.0-snapshot-ea989fe8f30.jar.sha1 | 1 - server/licenses/lucene-highlighter-9.1.0.jar.sha1 | 1 + server/licenses/lucene-join-9.1.0-snapshot-ea989fe8f30.jar.sha1 | 1 - server/licenses/lucene-join-9.1.0.jar.sha1 | 1 + .../licenses/lucene-memory-9.1.0-snapshot-ea989fe8f30.jar.sha1 | 1 - server/licenses/lucene-memory-9.1.0.jar.sha1 | 1 + server/licenses/lucene-misc-9.1.0-snapshot-ea989fe8f30.jar.sha1 | 1 - server/licenses/lucene-misc-9.1.0.jar.sha1 | 1 + .../licenses/lucene-queries-9.1.0-snapshot-ea989fe8f30.jar.sha1 | 1 - server/licenses/lucene-queries-9.1.0.jar.sha1 | 1 + .../lucene-queryparser-9.1.0-snapshot-ea989fe8f30.jar.sha1 | 1 - server/licenses/lucene-queryparser-9.1.0.jar.sha1 | 1 + .../licenses/lucene-sandbox-9.1.0-snapshot-ea989fe8f30.jar.sha1 | 1 - server/licenses/lucene-sandbox-9.1.0.jar.sha1 | 1 + .../lucene-spatial-extras-9.1.0-snapshot-ea989fe8f30.jar.sha1 | 1 - server/licenses/lucene-spatial-extras-9.1.0.jar.sha1 | 1 + .../lucene-spatial3d-9.1.0-snapshot-ea989fe8f30.jar.sha1 | 1 - server/licenses/lucene-spatial3d-9.1.0.jar.sha1 | 1 + .../licenses/lucene-suggest-9.1.0-snapshot-ea989fe8f30.jar.sha1 | 1 - server/licenses/lucene-suggest-9.1.0.jar.sha1 | 1 + 45 files changed, 23 insertions(+), 23 deletions(-) delete mode 100644 modules/lang-expression/licenses/lucene-expressions-9.1.0-snapshot-ea989fe8f30.jar.sha1 create mode 100644 modules/lang-expression/licenses/lucene-expressions-9.1.0.jar.sha1 delete mode 100644 plugins/analysis-icu/licenses/lucene-analysis-icu-9.1.0-snapshot-ea989fe8f30.jar.sha1 create mode 100644 plugins/analysis-icu/licenses/lucene-analysis-icu-9.1.0.jar.sha1 delete mode 100644 plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.1.0-snapshot-ea989fe8f30.jar.sha1 create mode 100644 plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.1.0.jar.sha1 delete mode 100644 plugins/analysis-nori/licenses/lucene-analysis-nori-9.1.0-snapshot-ea989fe8f30.jar.sha1 create mode 100644 plugins/analysis-nori/licenses/lucene-analysis-nori-9.1.0.jar.sha1 delete mode 100644 plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.1.0-snapshot-ea989fe8f30.jar.sha1 create mode 100644 plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.1.0.jar.sha1 delete mode 100644 plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.1.0-snapshot-ea989fe8f30.jar.sha1 create mode 100644 plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.1.0.jar.sha1 delete mode 100644 plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.1.0-snapshot-ea989fe8f30.jar.sha1 create mode 100644 plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.1.0.jar.sha1 delete mode 100644 plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.1.0-snapshot-ea989fe8f30.jar.sha1 create mode 100644 plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.1.0.jar.sha1 delete mode 100644 server/licenses/lucene-analysis-common-9.1.0-snapshot-ea989fe8f30.jar.sha1 create mode 100644 server/licenses/lucene-analysis-common-9.1.0.jar.sha1 delete mode 100644 server/licenses/lucene-backward-codecs-9.1.0-snapshot-ea989fe8f30.jar.sha1 create mode 100644 server/licenses/lucene-backward-codecs-9.1.0.jar.sha1 delete mode 100644 server/licenses/lucene-core-9.1.0-snapshot-ea989fe8f30.jar.sha1 create mode 100644 server/licenses/lucene-core-9.1.0.jar.sha1 delete mode 100644 server/licenses/lucene-grouping-9.1.0-snapshot-ea989fe8f30.jar.sha1 create mode 100644 server/licenses/lucene-grouping-9.1.0.jar.sha1 delete mode 100644 server/licenses/lucene-highlighter-9.1.0-snapshot-ea989fe8f30.jar.sha1 create mode 100644 server/licenses/lucene-highlighter-9.1.0.jar.sha1 delete mode 100644 server/licenses/lucene-join-9.1.0-snapshot-ea989fe8f30.jar.sha1 create mode 100644 server/licenses/lucene-join-9.1.0.jar.sha1 delete mode 100644 server/licenses/lucene-memory-9.1.0-snapshot-ea989fe8f30.jar.sha1 create mode 100644 server/licenses/lucene-memory-9.1.0.jar.sha1 delete mode 100644 server/licenses/lucene-misc-9.1.0-snapshot-ea989fe8f30.jar.sha1 create mode 100644 server/licenses/lucene-misc-9.1.0.jar.sha1 delete mode 100644 server/licenses/lucene-queries-9.1.0-snapshot-ea989fe8f30.jar.sha1 create mode 100644 server/licenses/lucene-queries-9.1.0.jar.sha1 delete mode 100644 server/licenses/lucene-queryparser-9.1.0-snapshot-ea989fe8f30.jar.sha1 create mode 100644 server/licenses/lucene-queryparser-9.1.0.jar.sha1 delete mode 100644 server/licenses/lucene-sandbox-9.1.0-snapshot-ea989fe8f30.jar.sha1 create mode 100644 server/licenses/lucene-sandbox-9.1.0.jar.sha1 delete mode 100644 server/licenses/lucene-spatial-extras-9.1.0-snapshot-ea989fe8f30.jar.sha1 create mode 100644 server/licenses/lucene-spatial-extras-9.1.0.jar.sha1 delete mode 100644 server/licenses/lucene-spatial3d-9.1.0-snapshot-ea989fe8f30.jar.sha1 create mode 100644 server/licenses/lucene-spatial3d-9.1.0.jar.sha1 delete mode 100644 server/licenses/lucene-suggest-9.1.0-snapshot-ea989fe8f30.jar.sha1 create mode 100644 server/licenses/lucene-suggest-9.1.0.jar.sha1 diff --git a/buildSrc/version.properties b/buildSrc/version.properties index c745e5bfc2eb1..2c064b11a2739 100644 --- a/buildSrc/version.properties +++ b/buildSrc/version.properties @@ -1,5 +1,5 @@ opensearch = 2.1.0 -lucene = 9.1.0-snapshot-ea989fe8f30 +lucene = 9.1.0 bundled_jdk_vendor = adoptium bundled_jdk = 17.0.2+8 diff --git a/modules/lang-expression/licenses/lucene-expressions-9.1.0-snapshot-ea989fe8f30.jar.sha1 b/modules/lang-expression/licenses/lucene-expressions-9.1.0-snapshot-ea989fe8f30.jar.sha1 deleted file mode 100644 index fb85ff4827c36..0000000000000 --- a/modules/lang-expression/licenses/lucene-expressions-9.1.0-snapshot-ea989fe8f30.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -c7317bb4e72b820a516e0c8a90beac5acc82c2e2 \ No newline at end of file diff --git a/modules/lang-expression/licenses/lucene-expressions-9.1.0.jar.sha1 b/modules/lang-expression/licenses/lucene-expressions-9.1.0.jar.sha1 new file mode 100644 index 0000000000000..c825e197188fc --- /dev/null +++ b/modules/lang-expression/licenses/lucene-expressions-9.1.0.jar.sha1 @@ -0,0 +1 @@ +2711abb758d101fc738c35a6867ee7559da5308b \ No newline at end of file diff --git a/plugins/analysis-icu/licenses/lucene-analysis-icu-9.1.0-snapshot-ea989fe8f30.jar.sha1 b/plugins/analysis-icu/licenses/lucene-analysis-icu-9.1.0-snapshot-ea989fe8f30.jar.sha1 deleted file mode 100644 index 2f0a6ad50e337..0000000000000 --- a/plugins/analysis-icu/licenses/lucene-analysis-icu-9.1.0-snapshot-ea989fe8f30.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -77930f802430648980eded22ca6ed47fedaeaba4 \ No newline at end of file diff --git a/plugins/analysis-icu/licenses/lucene-analysis-icu-9.1.0.jar.sha1 b/plugins/analysis-icu/licenses/lucene-analysis-icu-9.1.0.jar.sha1 new file mode 100644 index 0000000000000..b7733cfa9a00a --- /dev/null +++ b/plugins/analysis-icu/licenses/lucene-analysis-icu-9.1.0.jar.sha1 @@ -0,0 +1 @@ +e9b429da553560fa0c363ffc04c774f957c56e14 \ No newline at end of file diff --git a/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.1.0-snapshot-ea989fe8f30.jar.sha1 b/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.1.0-snapshot-ea989fe8f30.jar.sha1 deleted file mode 100644 index a0d112dd733ab..0000000000000 --- a/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.1.0-snapshot-ea989fe8f30.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -c66f568fa9138c6ab6f3abf1efbfab3c7b5991d4 \ No newline at end of file diff --git a/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.1.0.jar.sha1 b/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.1.0.jar.sha1 new file mode 100644 index 0000000000000..f5b818a206e7a --- /dev/null +++ b/plugins/analysis-kuromoji/licenses/lucene-analysis-kuromoji-9.1.0.jar.sha1 @@ -0,0 +1 @@ +b247f8a877237b4663e4ab7d86fae21c68a58ea5 \ No newline at end of file diff --git a/plugins/analysis-nori/licenses/lucene-analysis-nori-9.1.0-snapshot-ea989fe8f30.jar.sha1 b/plugins/analysis-nori/licenses/lucene-analysis-nori-9.1.0-snapshot-ea989fe8f30.jar.sha1 deleted file mode 100644 index a3f939bfe9e05..0000000000000 --- a/plugins/analysis-nori/licenses/lucene-analysis-nori-9.1.0-snapshot-ea989fe8f30.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -e8c47600ea859b999a5f5647341b0350b03dafcd \ No newline at end of file diff --git a/plugins/analysis-nori/licenses/lucene-analysis-nori-9.1.0.jar.sha1 b/plugins/analysis-nori/licenses/lucene-analysis-nori-9.1.0.jar.sha1 new file mode 100644 index 0000000000000..4d22255d10316 --- /dev/null +++ b/plugins/analysis-nori/licenses/lucene-analysis-nori-9.1.0.jar.sha1 @@ -0,0 +1 @@ +30e24b42fb0440911e702a531f4373bf397eb8c6 \ No newline at end of file diff --git a/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.1.0-snapshot-ea989fe8f30.jar.sha1 b/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.1.0-snapshot-ea989fe8f30.jar.sha1 deleted file mode 100644 index e2006546433fd..0000000000000 --- a/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.1.0-snapshot-ea989fe8f30.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -6f0f5c71052beee26e4ce99e1147ce406234f417 \ No newline at end of file diff --git a/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.1.0.jar.sha1 b/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.1.0.jar.sha1 new file mode 100644 index 0000000000000..a0607e6158cdd --- /dev/null +++ b/plugins/analysis-phonetic/licenses/lucene-analysis-phonetic-9.1.0.jar.sha1 @@ -0,0 +1 @@ +18a321d93836ea2856a5302d192e9dc99c647c6e \ No newline at end of file diff --git a/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.1.0-snapshot-ea989fe8f30.jar.sha1 b/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.1.0-snapshot-ea989fe8f30.jar.sha1 deleted file mode 100644 index e675c5774f5a4..0000000000000 --- a/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.1.0-snapshot-ea989fe8f30.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -32aad8b8491df3c9862e7fe75e98bccdb6a25bda \ No newline at end of file diff --git a/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.1.0.jar.sha1 b/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.1.0.jar.sha1 new file mode 100644 index 0000000000000..bff959139a86c --- /dev/null +++ b/plugins/analysis-smartcn/licenses/lucene-analysis-smartcn-9.1.0.jar.sha1 @@ -0,0 +1 @@ +41c847f39a15bb8495be8c9d8a098974be15f74b \ No newline at end of file diff --git a/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.1.0-snapshot-ea989fe8f30.jar.sha1 b/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.1.0-snapshot-ea989fe8f30.jar.sha1 deleted file mode 100644 index 053f5c97d65dc..0000000000000 --- a/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.1.0-snapshot-ea989fe8f30.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -ef546cfaaf727d93c4e86ddc7f77b525af135623 \ No newline at end of file diff --git a/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.1.0.jar.sha1 b/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.1.0.jar.sha1 new file mode 100644 index 0000000000000..39d25d7872ea9 --- /dev/null +++ b/plugins/analysis-stempel/licenses/lucene-analysis-stempel-9.1.0.jar.sha1 @@ -0,0 +1 @@ +ee7995231b181aa0a01f5aef8775562e269f5ef7 \ No newline at end of file diff --git a/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.1.0-snapshot-ea989fe8f30.jar.sha1 b/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.1.0-snapshot-ea989fe8f30.jar.sha1 deleted file mode 100644 index e5a2a0b0b4ab3..0000000000000 --- a/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.1.0-snapshot-ea989fe8f30.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -21c3511469f67019804e41a8d83ffc5c36de6479 \ No newline at end of file diff --git a/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.1.0.jar.sha1 b/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.1.0.jar.sha1 new file mode 100644 index 0000000000000..9f07f122205d9 --- /dev/null +++ b/plugins/analysis-ukrainian/licenses/lucene-analysis-morfologik-9.1.0.jar.sha1 @@ -0,0 +1 @@ +575c458431396baa7f01a546173807f27b12a087 \ No newline at end of file diff --git a/server/licenses/lucene-analysis-common-9.1.0-snapshot-ea989fe8f30.jar.sha1 b/server/licenses/lucene-analysis-common-9.1.0-snapshot-ea989fe8f30.jar.sha1 deleted file mode 100644 index 6ef0f1eafc345..0000000000000 --- a/server/licenses/lucene-analysis-common-9.1.0-snapshot-ea989fe8f30.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -bafd720282a371efe7b0e7238f9dee7e2ad3a586 \ No newline at end of file diff --git a/server/licenses/lucene-analysis-common-9.1.0.jar.sha1 b/server/licenses/lucene-analysis-common-9.1.0.jar.sha1 new file mode 100644 index 0000000000000..4d2a9cf9451cc --- /dev/null +++ b/server/licenses/lucene-analysis-common-9.1.0.jar.sha1 @@ -0,0 +1 @@ +240e3997fb139ff001e022124c89b686b5a8498d \ No newline at end of file diff --git a/server/licenses/lucene-backward-codecs-9.1.0-snapshot-ea989fe8f30.jar.sha1 b/server/licenses/lucene-backward-codecs-9.1.0-snapshot-ea989fe8f30.jar.sha1 deleted file mode 100644 index 017333945a866..0000000000000 --- a/server/licenses/lucene-backward-codecs-9.1.0-snapshot-ea989fe8f30.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -597fe288a252a14c0876451c97afee2b4529f85a \ No newline at end of file diff --git a/server/licenses/lucene-backward-codecs-9.1.0.jar.sha1 b/server/licenses/lucene-backward-codecs-9.1.0.jar.sha1 new file mode 100644 index 0000000000000..b6df56db28cd6 --- /dev/null +++ b/server/licenses/lucene-backward-codecs-9.1.0.jar.sha1 @@ -0,0 +1 @@ +de23bdacb09e8b39cbe876ff79c7a5b2ecc1faa6 \ No newline at end of file diff --git a/server/licenses/lucene-core-9.1.0-snapshot-ea989fe8f30.jar.sha1 b/server/licenses/lucene-core-9.1.0-snapshot-ea989fe8f30.jar.sha1 deleted file mode 100644 index a2ba0f0ffa43c..0000000000000 --- a/server/licenses/lucene-core-9.1.0-snapshot-ea989fe8f30.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -80cd2fff33ced89924771c7079d42bf82f1266f6 \ No newline at end of file diff --git a/server/licenses/lucene-core-9.1.0.jar.sha1 b/server/licenses/lucene-core-9.1.0.jar.sha1 new file mode 100644 index 0000000000000..45e7ae47dae3e --- /dev/null +++ b/server/licenses/lucene-core-9.1.0.jar.sha1 @@ -0,0 +1 @@ +0375603f1dacd8266526404faf0088a2ac8ec2ff \ No newline at end of file diff --git a/server/licenses/lucene-grouping-9.1.0-snapshot-ea989fe8f30.jar.sha1 b/server/licenses/lucene-grouping-9.1.0-snapshot-ea989fe8f30.jar.sha1 deleted file mode 100644 index ac0c1be0f952b..0000000000000 --- a/server/licenses/lucene-grouping-9.1.0-snapshot-ea989fe8f30.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -7059f47668a2942c60ad03b1d58eca8dcb010e4e \ No newline at end of file diff --git a/server/licenses/lucene-grouping-9.1.0.jar.sha1 b/server/licenses/lucene-grouping-9.1.0.jar.sha1 new file mode 100644 index 0000000000000..be423fdde04f7 --- /dev/null +++ b/server/licenses/lucene-grouping-9.1.0.jar.sha1 @@ -0,0 +1 @@ +703308505e62fa7dcb0bf64fdb6d95d335941bdc \ No newline at end of file diff --git a/server/licenses/lucene-highlighter-9.1.0-snapshot-ea989fe8f30.jar.sha1 b/server/licenses/lucene-highlighter-9.1.0-snapshot-ea989fe8f30.jar.sha1 deleted file mode 100644 index fa08ed63f7c44..0000000000000 --- a/server/licenses/lucene-highlighter-9.1.0-snapshot-ea989fe8f30.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -3c841ca23eb08a939fa49ba4af249c3b6d849c42 \ No newline at end of file diff --git a/server/licenses/lucene-highlighter-9.1.0.jar.sha1 b/server/licenses/lucene-highlighter-9.1.0.jar.sha1 new file mode 100644 index 0000000000000..c130c27ed4c37 --- /dev/null +++ b/server/licenses/lucene-highlighter-9.1.0.jar.sha1 @@ -0,0 +1 @@ +7f1925f6ef985000399a277ca17b8f67d3056838 \ No newline at end of file diff --git a/server/licenses/lucene-join-9.1.0-snapshot-ea989fe8f30.jar.sha1 b/server/licenses/lucene-join-9.1.0-snapshot-ea989fe8f30.jar.sha1 deleted file mode 100644 index 2a3e2a9107a60..0000000000000 --- a/server/licenses/lucene-join-9.1.0-snapshot-ea989fe8f30.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -4984e041ae68f5939c01e41b2c9648ae2c021340 \ No newline at end of file diff --git a/server/licenses/lucene-join-9.1.0.jar.sha1 b/server/licenses/lucene-join-9.1.0.jar.sha1 new file mode 100644 index 0000000000000..b678051ddaf26 --- /dev/null +++ b/server/licenses/lucene-join-9.1.0.jar.sha1 @@ -0,0 +1 @@ +e7d39da8e623c99ee8da8bcc0185b2d908aca4b3 \ No newline at end of file diff --git a/server/licenses/lucene-memory-9.1.0-snapshot-ea989fe8f30.jar.sha1 b/server/licenses/lucene-memory-9.1.0-snapshot-ea989fe8f30.jar.sha1 deleted file mode 100644 index eefd08d222ef8..0000000000000 --- a/server/licenses/lucene-memory-9.1.0-snapshot-ea989fe8f30.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -fead9467ce65469579168eb0f47e014fdb3c63d9 \ No newline at end of file diff --git a/server/licenses/lucene-memory-9.1.0.jar.sha1 b/server/licenses/lucene-memory-9.1.0.jar.sha1 new file mode 100644 index 0000000000000..a07b052e9c332 --- /dev/null +++ b/server/licenses/lucene-memory-9.1.0.jar.sha1 @@ -0,0 +1 @@ +209166fd48dae3261ccf26990fe600332b8fb373 \ No newline at end of file diff --git a/server/licenses/lucene-misc-9.1.0-snapshot-ea989fe8f30.jar.sha1 b/server/licenses/lucene-misc-9.1.0-snapshot-ea989fe8f30.jar.sha1 deleted file mode 100644 index 226f97cf6f3bc..0000000000000 --- a/server/licenses/lucene-misc-9.1.0-snapshot-ea989fe8f30.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -d98ab1966b8ca53b70fe071281bcea27d602ec30 \ No newline at end of file diff --git a/server/licenses/lucene-misc-9.1.0.jar.sha1 b/server/licenses/lucene-misc-9.1.0.jar.sha1 new file mode 100644 index 0000000000000..8627e481c6214 --- /dev/null +++ b/server/licenses/lucene-misc-9.1.0.jar.sha1 @@ -0,0 +1 @@ +905d93b6389060cf4b0cb464ffa8fa2db81b60e7 \ No newline at end of file diff --git a/server/licenses/lucene-queries-9.1.0-snapshot-ea989fe8f30.jar.sha1 b/server/licenses/lucene-queries-9.1.0-snapshot-ea989fe8f30.jar.sha1 deleted file mode 100644 index c151e6b76e21a..0000000000000 --- a/server/licenses/lucene-queries-9.1.0-snapshot-ea989fe8f30.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -895e27127ae55031e35e152da8be941bd55f7f6a \ No newline at end of file diff --git a/server/licenses/lucene-queries-9.1.0.jar.sha1 b/server/licenses/lucene-queries-9.1.0.jar.sha1 new file mode 100644 index 0000000000000..9e81da7ca5c15 --- /dev/null +++ b/server/licenses/lucene-queries-9.1.0.jar.sha1 @@ -0,0 +1 @@ +c50fc971573910ea239ee6f275e9257b6b6bdd48 \ No newline at end of file diff --git a/server/licenses/lucene-queryparser-9.1.0-snapshot-ea989fe8f30.jar.sha1 b/server/licenses/lucene-queryparser-9.1.0-snapshot-ea989fe8f30.jar.sha1 deleted file mode 100644 index b73b7152aed05..0000000000000 --- a/server/licenses/lucene-queryparser-9.1.0-snapshot-ea989fe8f30.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -1433392237ea01ef35f4e2ffc52f496b0669624c \ No newline at end of file diff --git a/server/licenses/lucene-queryparser-9.1.0.jar.sha1 b/server/licenses/lucene-queryparser-9.1.0.jar.sha1 new file mode 100644 index 0000000000000..fb04adf2051d0 --- /dev/null +++ b/server/licenses/lucene-queryparser-9.1.0.jar.sha1 @@ -0,0 +1 @@ +383eb69b12f9d9c98c44237155f50c870c9a34b9 \ No newline at end of file diff --git a/server/licenses/lucene-sandbox-9.1.0-snapshot-ea989fe8f30.jar.sha1 b/server/licenses/lucene-sandbox-9.1.0-snapshot-ea989fe8f30.jar.sha1 deleted file mode 100644 index d441dd2f8cb31..0000000000000 --- a/server/licenses/lucene-sandbox-9.1.0-snapshot-ea989fe8f30.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -b0688963ca8288f5a3e47ca6e4b38bc2fde780e7 \ No newline at end of file diff --git a/server/licenses/lucene-sandbox-9.1.0.jar.sha1 b/server/licenses/lucene-sandbox-9.1.0.jar.sha1 new file mode 100644 index 0000000000000..429a84de46f3c --- /dev/null +++ b/server/licenses/lucene-sandbox-9.1.0.jar.sha1 @@ -0,0 +1 @@ +0c728684e750a63f881998fbe27afd897f739762 \ No newline at end of file diff --git a/server/licenses/lucene-spatial-extras-9.1.0-snapshot-ea989fe8f30.jar.sha1 b/server/licenses/lucene-spatial-extras-9.1.0-snapshot-ea989fe8f30.jar.sha1 deleted file mode 100644 index 5ffa78a6e7d87..0000000000000 --- a/server/licenses/lucene-spatial-extras-9.1.0-snapshot-ea989fe8f30.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -206e8918a726710c8a6fb927e59adf26c6ad5bed \ No newline at end of file diff --git a/server/licenses/lucene-spatial-extras-9.1.0.jar.sha1 b/server/licenses/lucene-spatial-extras-9.1.0.jar.sha1 new file mode 100644 index 0000000000000..7078cbc05fff7 --- /dev/null +++ b/server/licenses/lucene-spatial-extras-9.1.0.jar.sha1 @@ -0,0 +1 @@ +94d7d107c399cd11d407b94fa62f5677fe86f63b \ No newline at end of file diff --git a/server/licenses/lucene-spatial3d-9.1.0-snapshot-ea989fe8f30.jar.sha1 b/server/licenses/lucene-spatial3d-9.1.0-snapshot-ea989fe8f30.jar.sha1 deleted file mode 100644 index 8c4bb08303c34..0000000000000 --- a/server/licenses/lucene-spatial3d-9.1.0-snapshot-ea989fe8f30.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -3d1e26c37b45bdf2ef598d16468220ab33983a8f \ No newline at end of file diff --git a/server/licenses/lucene-spatial3d-9.1.0.jar.sha1 b/server/licenses/lucene-spatial3d-9.1.0.jar.sha1 new file mode 100644 index 0000000000000..604e8ed054ac1 --- /dev/null +++ b/server/licenses/lucene-spatial3d-9.1.0.jar.sha1 @@ -0,0 +1 @@ +7717b300bc14dfa9eb4b7d5970d8e25a60010e64 \ No newline at end of file diff --git a/server/licenses/lucene-suggest-9.1.0-snapshot-ea989fe8f30.jar.sha1 b/server/licenses/lucene-suggest-9.1.0-snapshot-ea989fe8f30.jar.sha1 deleted file mode 100644 index 3c8d9b87da0e5..0000000000000 --- a/server/licenses/lucene-suggest-9.1.0-snapshot-ea989fe8f30.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -69ab05339614766c732fef7c037cc5b676bd40dc \ No newline at end of file diff --git a/server/licenses/lucene-suggest-9.1.0.jar.sha1 b/server/licenses/lucene-suggest-9.1.0.jar.sha1 new file mode 100644 index 0000000000000..4562a19706634 --- /dev/null +++ b/server/licenses/lucene-suggest-9.1.0.jar.sha1 @@ -0,0 +1 @@ +957fca507eba94dbc3ef0d02377839be49bbe619 \ No newline at end of file From 8db6e491afe25d97010caa8cda1e81bba29f24a6 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 24 Mar 2022 21:26:31 -0500 Subject: [PATCH 005/514] [Type removal] Remove deprecation warning on use of _type in doc scripts (#2564) (#2567) Signed-off-by: Suraj Singh signed-off-by: Nicholas Walter Knize (cherry picked from commit c1d5491baf02b5ea0223d3075a5e1fc288d54bcf) --- .../java/org/opensearch/search/lookup/LeafDocLookup.java | 9 --------- 1 file changed, 9 deletions(-) diff --git a/server/src/main/java/org/opensearch/search/lookup/LeafDocLookup.java b/server/src/main/java/org/opensearch/search/lookup/LeafDocLookup.java index 82daa94d92146..716476101ac48 100644 --- a/server/src/main/java/org/opensearch/search/lookup/LeafDocLookup.java +++ b/server/src/main/java/org/opensearch/search/lookup/LeafDocLookup.java @@ -33,7 +33,6 @@ import org.apache.lucene.index.LeafReaderContext; import org.opensearch.ExceptionsHelper; -import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.index.fielddata.IndexFieldData; import org.opensearch.index.fielddata.ScriptDocValues; import org.opensearch.index.mapper.MappedFieldType; @@ -50,10 +49,6 @@ public class LeafDocLookup implements Map> { - private static final DeprecationLogger DEPRECATION_LOGGER = DeprecationLogger.getLogger(LeafDocLookup.class); - static final String TYPES_DEPRECATION_KEY = "type-field-doc-lookup"; - static final String TYPES_DEPRECATION_MESSAGE = "[types removal] Looking up doc types [_type] in scripts is deprecated."; - private final Map> localCacheFieldData = new HashMap<>(4); private final MapperService mapperService; @@ -78,10 +73,6 @@ public void setDocument(int docId) { @Override public ScriptDocValues get(Object key) { - // deprecate _type - if ("_type".equals(key)) { - DEPRECATION_LOGGER.deprecate(TYPES_DEPRECATION_KEY, TYPES_DEPRECATION_MESSAGE); - } // assume its a string... String fieldName = key.toString(); ScriptDocValues scriptValues = localCacheFieldData.get(fieldName); From abd5ce7c8ea155d90e06ea79aa0a1d6a07e2a808 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Fri, 25 Mar 2022 00:10:10 -0500 Subject: [PATCH 006/514] Concurrent Searching (Experimental) (#1500) (#2584) Signed-off-by: Andriy Redko (cherry picked from commit b6ca0d1f78e765f509d6b52af8f488548fdddf94) --- .../plugins/concurrent-search/build.gradle | 42 + .../search/ConcurrentSegmentSearchPlugin.java | 53 + .../org/opensearch/search/package-info.java | 12 + .../query/ConcurrentQueryPhaseSearcher.java | 119 ++ .../opensearch/search/query/package-info.java | 12 + .../profile/query/QueryProfilerTests.java | 316 ++++ .../search/query/QueryPhaseTests.java | 1335 +++++++++++++++++ .../search/query/QueryProfilePhaseTests.java | 1182 +++++++++++++++ .../common/lucene/MinimumScoreCollector.java | 4 + .../lucene/search/FilteredCollector.java | 4 + .../search/DefaultSearchContext.java | 8 +- .../search/aggregations/AggregationPhase.java | 42 +- .../search/internal/ContextIndexSearcher.java | 33 +- .../internal/FilteredSearchContext.java | 6 +- .../search/internal/SearchContext.java | 6 +- .../opensearch/search/profile/Profilers.java | 2 +- .../InternalProfileCollectorManager.java | 89 ++ .../query/ProfileCollectorManager.java | 17 + .../query/EarlyTerminatingCollector.java | 4 + .../EarlyTerminatingCollectorManager.java | 74 + .../query/EarlyTerminatingListener.java | 22 + .../query/FilteredCollectorManager.java | 45 + .../search/query/MinimumCollectorManager.java | 44 + .../search/query/MultiCollectorWrapper.java | 58 + .../search/query/QueryCollectorContext.java | 71 +- .../query/QueryCollectorManagerContext.java | 99 ++ .../opensearch/search/query/QueryPhase.java | 4 +- .../search/query/ReduceableSearchResult.java | 23 + .../search/query/TopDocsCollectorContext.java | 338 ++++- .../query/TotalHitCountCollectorManager.java | 106 ++ .../search/DefaultSearchContextTests.java | 38 +- .../search/SearchCancellationTests.java | 9 +- .../internal/ContextIndexSearcherTests.java | 3 +- .../profile/query/QueryProfilerTests.java | 32 +- .../search/query/QueryPhaseTests.java | 285 +++- .../search/query/QueryProfilePhaseTests.java | 1158 ++++++++++++++ .../aggregations/AggregatorTestCase.java | 3 +- .../opensearch/test/TestSearchContext.java | 36 +- 38 files changed, 5563 insertions(+), 171 deletions(-) create mode 100644 sandbox/plugins/concurrent-search/build.gradle create mode 100644 sandbox/plugins/concurrent-search/src/main/java/org/opensearch/search/ConcurrentSegmentSearchPlugin.java create mode 100644 sandbox/plugins/concurrent-search/src/main/java/org/opensearch/search/package-info.java create mode 100644 sandbox/plugins/concurrent-search/src/main/java/org/opensearch/search/query/ConcurrentQueryPhaseSearcher.java create mode 100644 sandbox/plugins/concurrent-search/src/main/java/org/opensearch/search/query/package-info.java create mode 100644 sandbox/plugins/concurrent-search/src/test/java/org/opensearch/search/profile/query/QueryProfilerTests.java create mode 100644 sandbox/plugins/concurrent-search/src/test/java/org/opensearch/search/query/QueryPhaseTests.java create mode 100644 sandbox/plugins/concurrent-search/src/test/java/org/opensearch/search/query/QueryProfilePhaseTests.java create mode 100644 server/src/main/java/org/opensearch/search/profile/query/InternalProfileCollectorManager.java create mode 100644 server/src/main/java/org/opensearch/search/profile/query/ProfileCollectorManager.java create mode 100644 server/src/main/java/org/opensearch/search/query/EarlyTerminatingCollectorManager.java create mode 100644 server/src/main/java/org/opensearch/search/query/EarlyTerminatingListener.java create mode 100644 server/src/main/java/org/opensearch/search/query/FilteredCollectorManager.java create mode 100644 server/src/main/java/org/opensearch/search/query/MinimumCollectorManager.java create mode 100644 server/src/main/java/org/opensearch/search/query/MultiCollectorWrapper.java create mode 100644 server/src/main/java/org/opensearch/search/query/QueryCollectorManagerContext.java create mode 100644 server/src/main/java/org/opensearch/search/query/ReduceableSearchResult.java create mode 100644 server/src/main/java/org/opensearch/search/query/TotalHitCountCollectorManager.java create mode 100644 server/src/test/java/org/opensearch/search/query/QueryProfilePhaseTests.java diff --git a/sandbox/plugins/concurrent-search/build.gradle b/sandbox/plugins/concurrent-search/build.gradle new file mode 100644 index 0000000000000..acc3cb5092cd8 --- /dev/null +++ b/sandbox/plugins/concurrent-search/build.gradle @@ -0,0 +1,42 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +apply plugin: 'opensearch.opensearchplugin' +apply plugin: 'opensearch.yaml-rest-test' + +opensearchplugin { + name 'concurrent-search' + description 'The experimental plugin which implements concurrent search over Apache Lucene segments' + classname 'org.opensearch.search.ConcurrentSegmentSearchPlugin' + licenseFile rootProject.file('licenses/APACHE-LICENSE-2.0.txt') + noticeFile rootProject.file('NOTICE.txt') +} + +yamlRestTest.enabled = false; +testingConventions.enabled = false; \ No newline at end of file diff --git a/sandbox/plugins/concurrent-search/src/main/java/org/opensearch/search/ConcurrentSegmentSearchPlugin.java b/sandbox/plugins/concurrent-search/src/main/java/org/opensearch/search/ConcurrentSegmentSearchPlugin.java new file mode 100644 index 0000000000000..da999e40f0f07 --- /dev/null +++ b/sandbox/plugins/concurrent-search/src/main/java/org/opensearch/search/ConcurrentSegmentSearchPlugin.java @@ -0,0 +1,53 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.search; + +import org.opensearch.common.settings.Settings; +import org.opensearch.common.util.concurrent.OpenSearchExecutors; +import org.opensearch.plugins.Plugin; +import org.opensearch.plugins.SearchPlugin; +import org.opensearch.search.query.ConcurrentQueryPhaseSearcher; +import org.opensearch.search.query.QueryPhaseSearcher; +import org.opensearch.threadpool.ExecutorBuilder; +import org.opensearch.threadpool.FixedExecutorBuilder; +import org.opensearch.threadpool.ThreadPool; + +import java.util.Collections; +import java.util.List; +import java.util.Optional; + +/** + * The experimental plugin which implements the concurrent search over Apache Lucene segments. + */ +public class ConcurrentSegmentSearchPlugin extends Plugin implements SearchPlugin { + private static final String INDEX_SEARCHER = "index_searcher"; + + /** + * Default constructor + */ + public ConcurrentSegmentSearchPlugin() {} + + @Override + public Optional getQueryPhaseSearcher() { + return Optional.of(new ConcurrentQueryPhaseSearcher()); + } + + @Override + public List> getExecutorBuilders(Settings settings) { + final int allocatedProcessors = OpenSearchExecutors.allocatedProcessors(settings); + return Collections.singletonList( + new FixedExecutorBuilder(settings, INDEX_SEARCHER, allocatedProcessors, 1000, "thread_pool." + INDEX_SEARCHER) + ); + } + + @Override + public Optional getIndexSearcherExecutorProvider() { + return Optional.of((ThreadPool threadPool) -> threadPool.executor(INDEX_SEARCHER)); + } +} diff --git a/sandbox/plugins/concurrent-search/src/main/java/org/opensearch/search/package-info.java b/sandbox/plugins/concurrent-search/src/main/java/org/opensearch/search/package-info.java new file mode 100644 index 0000000000000..041f914fab7d7 --- /dev/null +++ b/sandbox/plugins/concurrent-search/src/main/java/org/opensearch/search/package-info.java @@ -0,0 +1,12 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** + * The implementation of the experimental plugin which implements the concurrent search over Apache Lucene segments. + */ +package org.opensearch.search; diff --git a/sandbox/plugins/concurrent-search/src/main/java/org/opensearch/search/query/ConcurrentQueryPhaseSearcher.java b/sandbox/plugins/concurrent-search/src/main/java/org/opensearch/search/query/ConcurrentQueryPhaseSearcher.java new file mode 100644 index 0000000000000..65f339838a40b --- /dev/null +++ b/sandbox/plugins/concurrent-search/src/main/java/org/opensearch/search/query/ConcurrentQueryPhaseSearcher.java @@ -0,0 +1,119 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.search.query; + +import static org.opensearch.search.query.TopDocsCollectorContext.createTopDocsCollectorContext; + +import java.io.IOException; +import java.util.LinkedList; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.apache.lucene.search.Collector; +import org.apache.lucene.search.CollectorManager; +import org.apache.lucene.search.Query; +import org.opensearch.search.internal.ContextIndexSearcher; +import org.opensearch.search.internal.SearchContext; +import org.opensearch.search.profile.query.ProfileCollectorManager; +import org.opensearch.search.query.QueryPhase.DefaultQueryPhaseSearcher; +import org.opensearch.search.query.QueryPhase.TimeExceededException; + +/** + * The implementation of the {@link QueryPhaseSearcher} which attempts to use concurrent + * search of Apache Lucene segments if it has been enabled. + */ +public class ConcurrentQueryPhaseSearcher extends DefaultQueryPhaseSearcher { + private static final Logger LOGGER = LogManager.getLogger(ConcurrentQueryPhaseSearcher.class); + + /** + * Default constructor + */ + public ConcurrentQueryPhaseSearcher() {} + + @Override + protected boolean searchWithCollector( + SearchContext searchContext, + ContextIndexSearcher searcher, + Query query, + LinkedList collectors, + boolean hasFilterCollector, + boolean hasTimeout + ) throws IOException { + boolean couldUseConcurrentSegmentSearch = allowConcurrentSegmentSearch(searcher); + + // TODO: support aggregations + if (searchContext.aggregations() != null) { + couldUseConcurrentSegmentSearch = false; + LOGGER.debug("Unable to use concurrent search over index segments (experimental): aggregations are present"); + } + + if (couldUseConcurrentSegmentSearch) { + LOGGER.debug("Using concurrent search over index segments (experimental)"); + return searchWithCollectorManager(searchContext, searcher, query, collectors, hasFilterCollector, hasTimeout); + } else { + return super.searchWithCollector(searchContext, searcher, query, collectors, hasFilterCollector, hasTimeout); + } + } + + private static boolean searchWithCollectorManager( + SearchContext searchContext, + ContextIndexSearcher searcher, + Query query, + LinkedList collectorContexts, + boolean hasFilterCollector, + boolean timeoutSet + ) throws IOException { + // create the top docs collector last when the other collectors are known + final TopDocsCollectorContext topDocsFactory = createTopDocsCollectorContext(searchContext, hasFilterCollector); + // add the top docs collector, the first collector context in the chain + collectorContexts.addFirst(topDocsFactory); + + final QuerySearchResult queryResult = searchContext.queryResult(); + final CollectorManager collectorManager; + + // TODO: support aggregations in concurrent segment search flow + if (searchContext.aggregations() != null) { + throw new UnsupportedOperationException("The concurrent segment search does not support aggregations yet"); + } + + if (searchContext.getProfilers() != null) { + final ProfileCollectorManager profileCollectorManager = + QueryCollectorManagerContext.createQueryCollectorManagerWithProfiler(collectorContexts); + searchContext.getProfilers().getCurrentQueryProfiler().setCollector(profileCollectorManager); + collectorManager = profileCollectorManager; + } else { + // Create multi collector manager instance + collectorManager = QueryCollectorManagerContext.createMultiCollectorManager(collectorContexts); + } + + try { + final ReduceableSearchResult result = searcher.search(query, collectorManager); + result.reduce(queryResult); + } catch (EarlyTerminatingCollector.EarlyTerminationException e) { + queryResult.terminatedEarly(true); + } catch (TimeExceededException e) { + assert timeoutSet : "TimeExceededException thrown even though timeout wasn't set"; + if (searchContext.request().allowPartialSearchResults() == false) { + // Can't rethrow TimeExceededException because not serializable + throw new QueryPhaseExecutionException(searchContext.shardTarget(), "Time exceeded"); + } + queryResult.searchTimedOut(true); + } + if (searchContext.terminateAfter() != SearchContext.DEFAULT_TERMINATE_AFTER && queryResult.terminatedEarly() == null) { + queryResult.terminatedEarly(false); + } + + return topDocsFactory.shouldRescore(); + } + + private static boolean allowConcurrentSegmentSearch(final ContextIndexSearcher searcher) { + return (searcher.getExecutor() != null); + } + +} diff --git a/sandbox/plugins/concurrent-search/src/main/java/org/opensearch/search/query/package-info.java b/sandbox/plugins/concurrent-search/src/main/java/org/opensearch/search/query/package-info.java new file mode 100644 index 0000000000000..0f98ae7682a84 --- /dev/null +++ b/sandbox/plugins/concurrent-search/src/main/java/org/opensearch/search/query/package-info.java @@ -0,0 +1,12 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** + * {@link org.opensearch.search.query.QueryPhaseSearcher} implementation for concurrent search + */ +package org.opensearch.search.query; diff --git a/sandbox/plugins/concurrent-search/src/test/java/org/opensearch/search/profile/query/QueryProfilerTests.java b/sandbox/plugins/concurrent-search/src/test/java/org/opensearch/search/profile/query/QueryProfilerTests.java new file mode 100644 index 0000000000000..51cb3c8c0cddc --- /dev/null +++ b/sandbox/plugins/concurrent-search/src/test/java/org/opensearch/search/profile/query/QueryProfilerTests.java @@ -0,0 +1,316 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.search.profile.query; + +import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; + +import org.apache.lucene.document.Document; +import org.apache.lucene.document.Field.Store; +import org.apache.lucene.document.StringField; +import org.apache.lucene.index.DirectoryReader; +import org.apache.lucene.index.IndexReader; +import org.apache.lucene.index.IndexWriter; +import org.apache.lucene.index.LeafReaderContext; +import org.apache.lucene.index.Term; +import org.apache.lucene.search.Explanation; +import org.apache.lucene.search.IndexSearcher; +import org.apache.lucene.search.LRUQueryCache; +import org.apache.lucene.search.LeafCollector; +import org.apache.lucene.search.Query; +import org.apache.lucene.search.QueryCachingPolicy; +import org.apache.lucene.search.QueryVisitor; +import org.apache.lucene.search.ScoreMode; +import org.apache.lucene.search.Scorer; +import org.apache.lucene.search.ScorerSupplier; +import org.apache.lucene.search.Sort; +import org.apache.lucene.search.TermQuery; +import org.apache.lucene.search.TotalHitCountCollector; +import org.apache.lucene.search.Weight; +import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.tests.search.RandomApproximationQuery; +import org.apache.lucene.tests.util.TestUtil; +import org.opensearch.core.internal.io.IOUtils; +import org.opensearch.search.internal.ContextIndexSearcher; +import org.opensearch.search.profile.ProfileResult; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.threadpool.ThreadPool; +import org.junit.After; +import org.junit.Before; + +import java.io.IOException; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; + +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.greaterThan; + +public class QueryProfilerTests extends OpenSearchTestCase { + + private Directory dir; + private IndexReader reader; + private ContextIndexSearcher searcher; + private ExecutorService executor; + + @ParametersFactory + public static Collection concurrency() { + return Arrays.asList(new Integer[] { 0 }, new Integer[] { 5 }); + } + + public QueryProfilerTests(int concurrency) { + this.executor = (concurrency > 0) ? Executors.newFixedThreadPool(concurrency) : null; + } + + @Before + public void setUp() throws Exception { + super.setUp(); + + dir = newDirectory(); + RandomIndexWriter w = new RandomIndexWriter(random(), dir); + final int numDocs = TestUtil.nextInt(random(), 1, 20); + for (int i = 0; i < numDocs; ++i) { + final int numHoles = random().nextInt(5); + for (int j = 0; j < numHoles; ++j) { + w.addDocument(new Document()); + } + Document doc = new Document(); + doc.add(new StringField("foo", "bar", Store.NO)); + w.addDocument(doc); + } + reader = w.getReader(); + w.close(); + searcher = new ContextIndexSearcher( + reader, + IndexSearcher.getDefaultSimilarity(), + IndexSearcher.getDefaultQueryCache(), + ALWAYS_CACHE_POLICY, + true, + executor + ); + } + + @After + public void tearDown() throws Exception { + super.tearDown(); + + LRUQueryCache cache = (LRUQueryCache) searcher.getQueryCache(); + assertThat(cache.getHitCount(), equalTo(0L)); + assertThat(cache.getCacheCount(), equalTo(0L)); + assertThat(cache.getTotalCount(), equalTo(cache.getMissCount())); + assertThat(cache.getCacheSize(), equalTo(0L)); + + if (executor != null) { + ThreadPool.terminate(executor, 10, TimeUnit.SECONDS); + } + + IOUtils.close(reader, dir); + dir = null; + reader = null; + searcher = null; + } + + public void testBasic() throws IOException { + QueryProfiler profiler = new QueryProfiler(executor != null); + searcher.setProfiler(profiler); + Query query = new TermQuery(new Term("foo", "bar")); + searcher.search(query, 1); + List results = profiler.getTree(); + assertEquals(1, results.size()); + Map breakdown = results.get(0).getTimeBreakdown(); + assertThat(breakdown.get(QueryTimingType.CREATE_WEIGHT.toString()), greaterThan(0L)); + assertThat(breakdown.get(QueryTimingType.BUILD_SCORER.toString()), greaterThan(0L)); + assertThat(breakdown.get(QueryTimingType.NEXT_DOC.toString()), greaterThan(0L)); + assertThat(breakdown.get(QueryTimingType.ADVANCE.toString()), equalTo(0L)); + assertThat(breakdown.get(QueryTimingType.SCORE.toString()), greaterThan(0L)); + assertThat(breakdown.get(QueryTimingType.MATCH.toString()), equalTo(0L)); + + assertThat(breakdown.get(QueryTimingType.CREATE_WEIGHT.toString() + "_count"), greaterThan(0L)); + assertThat(breakdown.get(QueryTimingType.BUILD_SCORER.toString() + "_count"), greaterThan(0L)); + assertThat(breakdown.get(QueryTimingType.NEXT_DOC.toString() + "_count"), greaterThan(0L)); + assertThat(breakdown.get(QueryTimingType.ADVANCE.toString() + "_count"), equalTo(0L)); + assertThat(breakdown.get(QueryTimingType.SCORE.toString() + "_count"), greaterThan(0L)); + assertThat(breakdown.get(QueryTimingType.MATCH.toString() + "_count"), equalTo(0L)); + + long rewriteTime = profiler.getRewriteTime(); + assertThat(rewriteTime, greaterThan(0L)); + } + + public void testNoScoring() throws IOException { + QueryProfiler profiler = new QueryProfiler(executor != null); + searcher.setProfiler(profiler); + Query query = new TermQuery(new Term("foo", "bar")); + searcher.search(query, 1, Sort.INDEXORDER); // scores are not needed + List results = profiler.getTree(); + assertEquals(1, results.size()); + Map breakdown = results.get(0).getTimeBreakdown(); + assertThat(breakdown.get(QueryTimingType.CREATE_WEIGHT.toString()), greaterThan(0L)); + assertThat(breakdown.get(QueryTimingType.BUILD_SCORER.toString()), greaterThan(0L)); + assertThat(breakdown.get(QueryTimingType.NEXT_DOC.toString()), greaterThan(0L)); + assertThat(breakdown.get(QueryTimingType.ADVANCE.toString()), equalTo(0L)); + assertThat(breakdown.get(QueryTimingType.SCORE.toString()), equalTo(0L)); + assertThat(breakdown.get(QueryTimingType.MATCH.toString()), equalTo(0L)); + + assertThat(breakdown.get(QueryTimingType.CREATE_WEIGHT.toString() + "_count"), greaterThan(0L)); + assertThat(breakdown.get(QueryTimingType.BUILD_SCORER.toString() + "_count"), greaterThan(0L)); + assertThat(breakdown.get(QueryTimingType.NEXT_DOC.toString() + "_count"), greaterThan(0L)); + assertThat(breakdown.get(QueryTimingType.ADVANCE.toString() + "_count"), equalTo(0L)); + assertThat(breakdown.get(QueryTimingType.SCORE.toString() + "_count"), equalTo(0L)); + assertThat(breakdown.get(QueryTimingType.MATCH.toString() + "_count"), equalTo(0L)); + + long rewriteTime = profiler.getRewriteTime(); + assertThat(rewriteTime, greaterThan(0L)); + } + + public void testUseIndexStats() throws IOException { + QueryProfiler profiler = new QueryProfiler(executor != null); + searcher.setProfiler(profiler); + Query query = new TermQuery(new Term("foo", "bar")); + searcher.count(query); // will use index stats + List results = profiler.getTree(); + assertEquals(1, results.size()); + ProfileResult result = results.get(0); + assertEquals(0, (long) result.getTimeBreakdown().get("build_scorer_count")); + + long rewriteTime = profiler.getRewriteTime(); + assertThat(rewriteTime, greaterThan(0L)); + } + + public void testApproximations() throws IOException { + QueryProfiler profiler = new QueryProfiler(executor != null); + searcher.setProfiler(profiler); + Query query = new RandomApproximationQuery(new TermQuery(new Term("foo", "bar")), random()); + searcher.count(query); + List results = profiler.getTree(); + assertEquals(1, results.size()); + Map breakdown = results.get(0).getTimeBreakdown(); + assertThat(breakdown.get(QueryTimingType.CREATE_WEIGHT.toString()), greaterThan(0L)); + assertThat(breakdown.get(QueryTimingType.BUILD_SCORER.toString()), greaterThan(0L)); + assertThat(breakdown.get(QueryTimingType.NEXT_DOC.toString()), greaterThan(0L)); + assertThat(breakdown.get(QueryTimingType.ADVANCE.toString()), equalTo(0L)); + assertThat(breakdown.get(QueryTimingType.SCORE.toString()), equalTo(0L)); + assertThat(breakdown.get(QueryTimingType.MATCH.toString()), greaterThan(0L)); + + assertThat(breakdown.get(QueryTimingType.CREATE_WEIGHT.toString() + "_count"), greaterThan(0L)); + assertThat(breakdown.get(QueryTimingType.BUILD_SCORER.toString() + "_count"), greaterThan(0L)); + assertThat(breakdown.get(QueryTimingType.NEXT_DOC.toString() + "_count"), greaterThan(0L)); + assertThat(breakdown.get(QueryTimingType.ADVANCE.toString() + "_count"), equalTo(0L)); + assertThat(breakdown.get(QueryTimingType.SCORE.toString() + "_count"), equalTo(0L)); + assertThat(breakdown.get(QueryTimingType.MATCH.toString() + "_count"), greaterThan(0L)); + + long rewriteTime = profiler.getRewriteTime(); + assertThat(rewriteTime, greaterThan(0L)); + } + + public void testCollector() throws IOException { + TotalHitCountCollector collector = new TotalHitCountCollector(); + ProfileCollector profileCollector = new ProfileCollector(collector); + assertEquals(0, profileCollector.getTime()); + final LeafCollector leafCollector = profileCollector.getLeafCollector(reader.leaves().get(0)); + assertThat(profileCollector.getTime(), greaterThan(0L)); + long time = profileCollector.getTime(); + leafCollector.setScorer(null); + assertThat(profileCollector.getTime(), greaterThan(time)); + time = profileCollector.getTime(); + leafCollector.collect(0); + assertThat(profileCollector.getTime(), greaterThan(time)); + } + + private static class DummyQuery extends Query { + + @Override + public String toString(String field) { + return getClass().getSimpleName(); + } + + @Override + public boolean equals(Object obj) { + return this == obj; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws IOException { + return new Weight(this) { + @Override + public Explanation explain(LeafReaderContext context, int doc) throws IOException { + throw new UnsupportedOperationException(); + } + + @Override + public Scorer scorer(LeafReaderContext context) throws IOException { + throw new UnsupportedOperationException(); + } + + @Override + public ScorerSupplier scorerSupplier(LeafReaderContext context) throws IOException { + return new ScorerSupplier() { + + @Override + public Scorer get(long loadCost) throws IOException { + throw new UnsupportedOperationException(); + } + + @Override + public long cost() { + return 42; + } + }; + } + + @Override + public boolean isCacheable(LeafReaderContext ctx) { + return true; + } + }; + } + + @Override + public void visit(QueryVisitor visitor) { + visitor.visitLeaf(this); + } + } + + public void testScorerSupplier() throws IOException { + Directory dir = newDirectory(); + IndexWriter w = new IndexWriter(dir, newIndexWriterConfig()); + w.addDocument(new Document()); + DirectoryReader reader = DirectoryReader.open(w); + w.close(); + IndexSearcher s = newSearcher(reader); + s.setQueryCache(null); + Weight weight = s.createWeight(s.rewrite(new DummyQuery()), randomFrom(ScoreMode.values()), 1f); + // exception when getting the scorer + expectThrows(UnsupportedOperationException.class, () -> weight.scorer(s.getIndexReader().leaves().get(0))); + // no exception, means scorerSupplier is delegated + weight.scorerSupplier(s.getIndexReader().leaves().get(0)); + reader.close(); + dir.close(); + } + + private static final QueryCachingPolicy ALWAYS_CACHE_POLICY = new QueryCachingPolicy() { + + @Override + public void onUse(Query query) {} + + @Override + public boolean shouldCache(Query query) throws IOException { + return true; + } + + }; +} diff --git a/sandbox/plugins/concurrent-search/src/test/java/org/opensearch/search/query/QueryPhaseTests.java b/sandbox/plugins/concurrent-search/src/test/java/org/opensearch/search/query/QueryPhaseTests.java new file mode 100644 index 0000000000000..83a0a63a6a5c8 --- /dev/null +++ b/sandbox/plugins/concurrent-search/src/test/java/org/opensearch/search/query/QueryPhaseTests.java @@ -0,0 +1,1335 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +package org.opensearch.search.query; + +import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; + +import org.apache.lucene.analysis.standard.StandardAnalyzer; +import org.apache.lucene.document.Document; +import org.apache.lucene.document.Field.Store; +import org.apache.lucene.document.LatLonDocValuesField; +import org.apache.lucene.document.LatLonPoint; +import org.apache.lucene.document.LongPoint; +import org.apache.lucene.document.NumericDocValuesField; +import org.apache.lucene.document.SortedDocValuesField; +import org.apache.lucene.document.SortedSetDocValuesField; +import org.apache.lucene.document.StringField; +import org.apache.lucene.document.TextField; +import org.apache.lucene.index.DirectoryReader; +import org.apache.lucene.index.IndexReader; +import org.apache.lucene.index.IndexWriter; +import org.apache.lucene.index.IndexWriterConfig; +import org.apache.lucene.index.LeafReaderContext; +import org.apache.lucene.index.NoMergePolicy; +import org.apache.lucene.index.Term; +import org.apache.lucene.search.BooleanClause; +import org.apache.lucene.search.BooleanClause.Occur; +import org.apache.lucene.search.BooleanQuery; +import org.apache.lucene.search.Collector; +import org.apache.lucene.search.CollectorManager; +import org.apache.lucene.search.ConstantScoreQuery; +import org.apache.lucene.search.DocValuesFieldExistsQuery; +import org.apache.lucene.search.FieldComparator; +import org.apache.lucene.search.FieldDoc; +import org.apache.lucene.search.FilterCollector; +import org.apache.lucene.search.FilterLeafCollector; +import org.apache.lucene.search.IndexSearcher; +import org.apache.lucene.search.LeafCollector; +import org.apache.lucene.search.MatchAllDocsQuery; +import org.apache.lucene.search.MatchNoDocsQuery; +import org.apache.lucene.search.MultiTermQuery; +import org.apache.lucene.search.PrefixQuery; +import org.apache.lucene.search.Query; +import org.apache.lucene.search.ScoreDoc; +import org.apache.lucene.search.Sort; +import org.apache.lucene.search.SortField; +import org.apache.lucene.search.TermQuery; +import org.apache.lucene.search.TopDocs; +import org.apache.lucene.search.TopFieldDocs; +import org.apache.lucene.search.TotalHitCountCollector; +import org.apache.lucene.search.TotalHits; +import org.apache.lucene.search.Weight; +import org.apache.lucene.search.grouping.CollapseTopFieldDocs; +import org.apache.lucene.search.join.BitSetProducer; +import org.apache.lucene.search.join.ScoreMode; +import org.apache.lucene.queries.spans.SpanNearQuery; +import org.apache.lucene.queries.spans.SpanTermQuery; +import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.util.BytesRef; +import org.apache.lucene.util.FixedBitSet; +import org.opensearch.action.search.SearchShardTask; +import org.opensearch.common.settings.Settings; +import org.opensearch.index.mapper.DateFieldMapper; +import org.opensearch.index.mapper.MappedFieldType; +import org.opensearch.index.mapper.MapperService; +import org.opensearch.index.mapper.NumberFieldMapper; +import org.opensearch.index.mapper.NumberFieldMapper.NumberFieldType; +import org.opensearch.index.mapper.NumberFieldMapper.NumberType; +import org.opensearch.index.query.ParsedQuery; +import org.opensearch.index.query.QueryShardContext; +import org.opensearch.index.search.OpenSearchToParentBlockJoinQuery; +import org.opensearch.index.shard.IndexShard; +import org.opensearch.index.shard.IndexShardTestCase; +import org.opensearch.lucene.queries.MinDocQuery; +import org.opensearch.search.DocValueFormat; +import org.opensearch.search.collapse.CollapseBuilder; +import org.opensearch.search.internal.ContextIndexSearcher; +import org.opensearch.search.internal.ScrollContext; +import org.opensearch.search.internal.SearchContext; +import org.opensearch.search.sort.SortAndFormats; +import org.opensearch.tasks.TaskCancelledException; +import org.opensearch.test.TestSearchContext; +import org.opensearch.threadpool.ThreadPool; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; + +import static org.opensearch.search.query.TopDocsCollectorContext.hasInfMaxScore; +import static org.hamcrest.Matchers.anyOf; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.greaterThan; +import static org.hamcrest.Matchers.greaterThanOrEqualTo; +import static org.hamcrest.Matchers.instanceOf; +import static org.hamcrest.Matchers.lessThanOrEqualTo; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; +import static org.mockito.Mockito.spy; + +public class QueryPhaseTests extends IndexShardTestCase { + + private IndexShard indexShard; + private final ExecutorService executor; + private final QueryPhaseSearcher queryPhaseSearcher; + + @ParametersFactory + public static Collection concurrency() { + return Arrays.asList( + new Object[] { 0, QueryPhase.DEFAULT_QUERY_PHASE_SEARCHER }, + new Object[] { 5, new ConcurrentQueryPhaseSearcher() } + ); + } + + public QueryPhaseTests(int concurrency, QueryPhaseSearcher queryPhaseSearcher) { + this.executor = (concurrency > 0) ? Executors.newFixedThreadPool(concurrency) : null; + this.queryPhaseSearcher = queryPhaseSearcher; + } + + @Override + public Settings threadPoolSettings() { + return Settings.builder().put(super.threadPoolSettings()).put("thread_pool.search.min_queue_size", 10).build(); + } + + @Override + public void setUp() throws Exception { + super.setUp(); + indexShard = newShard(true); + } + + @Override + public void tearDown() throws Exception { + super.tearDown(); + closeShards(indexShard); + + if (executor != null) { + ThreadPool.terminate(executor, 10, TimeUnit.SECONDS); + } + } + + private void countTestCase(Query query, IndexReader reader, boolean shouldCollectSearch, boolean shouldCollectCount) throws Exception { + ContextIndexSearcher searcher = shouldCollectSearch + ? newContextSearcher(reader, executor) + : newEarlyTerminationContextSearcher(reader, 0, executor); + TestSearchContext context = new TestSearchContext(null, indexShard, searcher); + context.parsedQuery(new ParsedQuery(query)); + context.setSize(0); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + final boolean rescore = QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertFalse(rescore); + + ContextIndexSearcher countSearcher = shouldCollectCount + ? newContextSearcher(reader, executor) + : newEarlyTerminationContextSearcher(reader, 0, executor); + assertEquals(countSearcher.count(query), context.queryResult().topDocs().topDocs.totalHits.value); + } + + private void countTestCase(boolean withDeletions) throws Exception { + Directory dir = newDirectory(); + IndexWriterConfig iwc = newIndexWriterConfig().setMergePolicy(NoMergePolicy.INSTANCE); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + final int numDocs = scaledRandomIntBetween(600, 900); + for (int i = 0; i < numDocs; ++i) { + Document doc = new Document(); + if (randomBoolean()) { + doc.add(new StringField("foo", "bar", Store.NO)); + doc.add(new SortedSetDocValuesField("foo", new BytesRef("bar"))); + doc.add(new SortedSetDocValuesField("docValuesOnlyField", new BytesRef("bar"))); + doc.add(new LatLonDocValuesField("latLonDVField", 1.0, 1.0)); + doc.add(new LatLonPoint("latLonDVField", 1.0, 1.0)); + } + if (randomBoolean()) { + doc.add(new StringField("foo", "baz", Store.NO)); + doc.add(new SortedSetDocValuesField("foo", new BytesRef("baz"))); + } + if (withDeletions && (rarely() || i == 0)) { + doc.add(new StringField("delete", "yes", Store.NO)); + } + w.addDocument(doc); + } + if (withDeletions) { + w.deleteDocuments(new Term("delete", "yes")); + } + final IndexReader reader = w.getReader(); + Query matchAll = new MatchAllDocsQuery(); + Query matchAllCsq = new ConstantScoreQuery(matchAll); + Query tq = new TermQuery(new Term("foo", "bar")); + Query tCsq = new ConstantScoreQuery(tq); + Query dvfeq = new DocValuesFieldExistsQuery("foo"); + Query dvfeq_points = new DocValuesFieldExistsQuery("latLonDVField"); + Query dvfeqCsq = new ConstantScoreQuery(dvfeq); + // field with doc-values but not indexed will need to collect + Query dvOnlyfeq = new DocValuesFieldExistsQuery("docValuesOnlyField"); + BooleanQuery bq = new BooleanQuery.Builder().add(matchAll, Occur.SHOULD).add(tq, Occur.MUST).build(); + + countTestCase(matchAll, reader, false, false); + countTestCase(matchAllCsq, reader, false, false); + countTestCase(tq, reader, withDeletions, withDeletions); + countTestCase(tCsq, reader, withDeletions, withDeletions); + countTestCase(dvfeq, reader, withDeletions, true); + countTestCase(dvfeq_points, reader, withDeletions, true); + countTestCase(dvfeqCsq, reader, withDeletions, true); + countTestCase(dvOnlyfeq, reader, true, true); + countTestCase(bq, reader, true, true); + reader.close(); + w.close(); + dir.close(); + } + + public void testCountWithoutDeletions() throws Exception { + countTestCase(false); + } + + public void testCountWithDeletions() throws Exception { + countTestCase(true); + } + + public void testPostFilterDisablesCountOptimization() throws Exception { + Directory dir = newDirectory(); + final Sort sort = new Sort(new SortField("rank", SortField.Type.INT)); + IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(sort); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + Document doc = new Document(); + w.addDocument(doc); + w.close(); + + IndexReader reader = DirectoryReader.open(dir); + + TestSearchContext context = new TestSearchContext(null, indexShard, newEarlyTerminationContextSearcher(reader, 0, executor)); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + context.parsedQuery(new ParsedQuery(new MatchAllDocsQuery())); + + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertEquals(1, context.queryResult().topDocs().topDocs.totalHits.value); + + context.setSearcher(newContextSearcher(reader, executor)); + context.parsedPostFilter(new ParsedQuery(new MatchNoDocsQuery())); + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertEquals(0, context.queryResult().topDocs().topDocs.totalHits.value); + reader.close(); + dir.close(); + } + + public void testTerminateAfterWithFilter() throws Exception { + Directory dir = newDirectory(); + final Sort sort = new Sort(new SortField("rank", SortField.Type.INT)); + IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(sort); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + Document doc = new Document(); + for (int i = 0; i < 10; i++) { + doc.add(new StringField("foo", Integer.toString(i), Store.NO)); + } + w.addDocument(doc); + w.close(); + + IndexReader reader = DirectoryReader.open(dir); + + TestSearchContext context = new TestSearchContext(null, indexShard, newContextSearcher(reader, executor)); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + + context.parsedQuery(new ParsedQuery(new MatchAllDocsQuery())); + context.terminateAfter(1); + context.setSize(10); + for (int i = 0; i < 10; i++) { + context.parsedPostFilter(new ParsedQuery(new TermQuery(new Term("foo", Integer.toString(i))))); + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertEquals(1, context.queryResult().topDocs().topDocs.totalHits.value); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); + } + reader.close(); + dir.close(); + } + + public void testMinScoreDisablesCountOptimization() throws Exception { + Directory dir = newDirectory(); + final Sort sort = new Sort(new SortField("rank", SortField.Type.INT)); + IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(sort); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + Document doc = new Document(); + w.addDocument(doc); + w.close(); + + IndexReader reader = DirectoryReader.open(dir); + TestSearchContext context = new TestSearchContext(null, indexShard, newEarlyTerminationContextSearcher(reader, 0, executor)); + context.parsedQuery(new ParsedQuery(new MatchAllDocsQuery())); + context.setSize(0); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertEquals(1, context.queryResult().topDocs().topDocs.totalHits.value); + + context.minimumScore(100); + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertEquals(0, context.queryResult().topDocs().topDocs.totalHits.value); + assertEquals(TotalHits.Relation.EQUAL_TO, context.queryResult().topDocs().topDocs.totalHits.relation); + reader.close(); + dir.close(); + } + + public void testQueryCapturesThreadPoolStats() throws Exception { + Directory dir = newDirectory(); + IndexWriterConfig iwc = newIndexWriterConfig(); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + final int numDocs = scaledRandomIntBetween(600, 900); + for (int i = 0; i < numDocs; ++i) { + w.addDocument(new Document()); + } + w.close(); + IndexReader reader = DirectoryReader.open(dir); + TestSearchContext context = new TestSearchContext(null, indexShard, newContextSearcher(reader, executor)); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + context.parsedQuery(new ParsedQuery(new MatchAllDocsQuery())); + + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + QuerySearchResult results = context.queryResult(); + assertThat(results.serviceTimeEWMA(), greaterThanOrEqualTo(0L)); + assertThat(results.nodeQueueSize(), greaterThanOrEqualTo(0)); + reader.close(); + dir.close(); + } + + public void testInOrderScrollOptimization() throws Exception { + Directory dir = newDirectory(); + final Sort sort = new Sort(new SortField("rank", SortField.Type.INT)); + IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(sort); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + final int numDocs = scaledRandomIntBetween(600, 900); + for (int i = 0; i < numDocs; ++i) { + w.addDocument(new Document()); + } + w.close(); + IndexReader reader = DirectoryReader.open(dir); + ScrollContext scrollContext = new ScrollContext(); + TestSearchContext context = new TestSearchContext(null, indexShard, newContextSearcher(reader, executor), scrollContext); + context.parsedQuery(new ParsedQuery(new MatchAllDocsQuery())); + scrollContext.lastEmittedDoc = null; + scrollContext.maxScore = Float.NaN; + scrollContext.totalHits = null; + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + int size = randomIntBetween(2, 5); + context.setSize(size); + + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); + assertNull(context.queryResult().terminatedEarly()); + assertThat(context.terminateAfter(), equalTo(0)); + assertThat(context.queryResult().getTotalHits().value, equalTo((long) numDocs)); + + context.setSearcher(newEarlyTerminationContextSearcher(reader, size, executor)); + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); + assertThat(context.terminateAfter(), equalTo(size)); + assertThat(context.queryResult().getTotalHits().value, equalTo((long) numDocs)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs[0].doc, greaterThanOrEqualTo(size)); + reader.close(); + dir.close(); + } + + public void testTerminateAfterEarlyTermination() throws Exception { + Directory dir = newDirectory(); + IndexWriterConfig iwc = newIndexWriterConfig(); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + final int numDocs = scaledRandomIntBetween(600, 900); + for (int i = 0; i < numDocs; ++i) { + Document doc = new Document(); + if (randomBoolean()) { + doc.add(new StringField("foo", "bar", Store.NO)); + } + if (randomBoolean()) { + doc.add(new StringField("foo", "baz", Store.NO)); + } + doc.add(new NumericDocValuesField("rank", numDocs - i)); + w.addDocument(doc); + } + w.close(); + final IndexReader reader = DirectoryReader.open(dir); + TestSearchContext context = new TestSearchContext(null, indexShard, newContextSearcher(reader, executor)); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + context.parsedQuery(new ParsedQuery(new MatchAllDocsQuery())); + + context.terminateAfter(numDocs); + { + context.setSize(10); + final TestTotalHitCountCollectorManager manager = TestTotalHitCountCollectorManager.create(executor); + context.queryCollectorManagers().put(TotalHitCountCollector.class, manager); + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertFalse(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(10)); + assertThat(manager.getTotalHits(), equalTo(numDocs)); + } + + context.terminateAfter(1); + { + context.setSize(1); + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertTrue(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(1L)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); + + context.setSize(0); + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertTrue(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(1L)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(0)); + } + + { + context.setSize(1); + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertTrue(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(1L)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); + } + { + context.setSize(1); + BooleanQuery bq = new BooleanQuery.Builder().add(new TermQuery(new Term("foo", "bar")), Occur.SHOULD) + .add(new TermQuery(new Term("foo", "baz")), Occur.SHOULD) + .build(); + context.parsedQuery(new ParsedQuery(bq)); + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertTrue(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(1L)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); + + context.setSize(0); + context.parsedQuery(new ParsedQuery(bq)); + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertTrue(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(1L)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(0)); + } + { + context.setSize(1); + final TestTotalHitCountCollectorManager manager = TestTotalHitCountCollectorManager.create(executor, 1); + context.queryCollectorManagers().put(TotalHitCountCollector.class, manager); + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertTrue(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(1L)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); + assertThat(manager.getTotalHits(), equalTo(1)); + context.queryCollectorManagers().clear(); + } + { + context.setSize(0); + final TestTotalHitCountCollectorManager manager = TestTotalHitCountCollectorManager.create(executor, 1); + context.queryCollectorManagers().put(TotalHitCountCollector.class, manager); + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertTrue(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(1L)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(0)); + assertThat(manager.getTotalHits(), equalTo(1)); + } + + // tests with trackTotalHits and terminateAfter + context.terminateAfter(10); + context.setSize(0); + for (int trackTotalHits : new int[] { -1, 3, 76, 100 }) { + context.trackTotalHitsUpTo(trackTotalHits); + final TestTotalHitCountCollectorManager manager = TestTotalHitCountCollectorManager.create(executor); + context.queryCollectorManagers().put(TotalHitCountCollector.class, manager); + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertTrue(context.queryResult().terminatedEarly()); + if (trackTotalHits == -1) { + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(0L)); + } else { + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) Math.min(trackTotalHits, 10))); + } + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(0)); + // The concurrent search terminates the collection when the number of hits is reached by each + // concurrent collector. In this case, in general, the number of results are multiplied by the number of + // slices (as the unit of concurrency). To address that, we have to use the shared global state, + // much as HitsThresholdChecker does. + if (executor == null) { + assertThat(manager.getTotalHits(), equalTo(10)); + } + } + + context.terminateAfter(7); + context.setSize(10); + for (int trackTotalHits : new int[] { -1, 3, 75, 100 }) { + context.trackTotalHitsUpTo(trackTotalHits); + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertTrue(context.queryResult().terminatedEarly()); + if (trackTotalHits == -1) { + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(0L)); + } else { + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(7L)); + } + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(7)); + } + reader.close(); + dir.close(); + } + + public void testIndexSortingEarlyTermination() throws Exception { + Directory dir = newDirectory(); + final Sort sort = new Sort(new SortField("rank", SortField.Type.INT)); + IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(sort); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + final int numDocs = scaledRandomIntBetween(600, 900); + for (int i = 0; i < numDocs; ++i) { + Document doc = new Document(); + if (randomBoolean()) { + doc.add(new StringField("foo", "bar", Store.NO)); + } + if (randomBoolean()) { + doc.add(new StringField("foo", "baz", Store.NO)); + } + doc.add(new NumericDocValuesField("rank", numDocs - i)); + w.addDocument(doc); + } + w.close(); + + final IndexReader reader = DirectoryReader.open(dir); + TestSearchContext context = new TestSearchContext(null, indexShard, newContextSearcher(reader, executor)); + context.parsedQuery(new ParsedQuery(new MatchAllDocsQuery())); + context.setSize(1); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + context.sort(new SortAndFormats(sort, new DocValueFormat[] { DocValueFormat.RAW })); + + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs[0], instanceOf(FieldDoc.class)); + FieldDoc fieldDoc = (FieldDoc) context.queryResult().topDocs().topDocs.scoreDocs[0]; + assertThat(fieldDoc.fields[0], equalTo(1)); + + { + context.parsedPostFilter(new ParsedQuery(new MinDocQuery(1))); + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertNull(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(numDocs - 1L)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs[0], instanceOf(FieldDoc.class)); + assertThat(fieldDoc.fields[0], anyOf(equalTo(1), equalTo(2))); + context.parsedPostFilter(null); + + final TestTotalHitCountCollectorManager manager = TestTotalHitCountCollectorManager.create(executor, sort); + context.queryCollectorManagers().put(TotalHitCountCollector.class, manager); + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertNull(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs[0], instanceOf(FieldDoc.class)); + assertThat(fieldDoc.fields[0], anyOf(equalTo(1), equalTo(2))); + // When searching concurrently, each executors short-circuits when "size" is reached, + // including total hits collector + assertThat(manager.getTotalHits(), lessThanOrEqualTo(numDocs)); + + context.queryCollectorManagers().clear(); + } + + { + context.setSearcher(newEarlyTerminationContextSearcher(reader, 1, executor)); + context.trackTotalHitsUpTo(SearchContext.TRACK_TOTAL_HITS_DISABLED); + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertNull(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs[0], instanceOf(FieldDoc.class)); + assertThat(fieldDoc.fields[0], anyOf(equalTo(1), equalTo(2))); + + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertNull(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs[0], instanceOf(FieldDoc.class)); + assertThat(fieldDoc.fields[0], anyOf(equalTo(1), equalTo(2))); + } + reader.close(); + dir.close(); + } + + public void testIndexSortScrollOptimization() throws Exception { + Directory dir = newDirectory(); + final Sort indexSort = new Sort(new SortField("rank", SortField.Type.INT), new SortField("tiebreaker", SortField.Type.INT)); + IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(indexSort); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + final int numDocs = scaledRandomIntBetween(600, 900); + for (int i = 0; i < numDocs; ++i) { + Document doc = new Document(); + doc.add(new NumericDocValuesField("rank", random().nextInt())); + doc.add(new NumericDocValuesField("tiebreaker", i)); + w.addDocument(doc); + } + if (randomBoolean()) { + w.forceMerge(randomIntBetween(1, 10)); + } + w.close(); + + final IndexReader reader = DirectoryReader.open(dir); + List searchSortAndFormats = new ArrayList<>(); + searchSortAndFormats.add(new SortAndFormats(indexSort, new DocValueFormat[] { DocValueFormat.RAW, DocValueFormat.RAW })); + // search sort is a prefix of the index sort + searchSortAndFormats.add(new SortAndFormats(new Sort(indexSort.getSort()[0]), new DocValueFormat[] { DocValueFormat.RAW })); + for (SortAndFormats searchSortAndFormat : searchSortAndFormats) { + ScrollContext scrollContext = new ScrollContext(); + TestSearchContext context = new TestSearchContext(null, indexShard, newContextSearcher(reader, executor), scrollContext); + context.parsedQuery(new ParsedQuery(new MatchAllDocsQuery())); + scrollContext.lastEmittedDoc = null; + scrollContext.maxScore = Float.NaN; + scrollContext.totalHits = null; + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + context.setSize(10); + context.sort(searchSortAndFormat); + + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); + assertNull(context.queryResult().terminatedEarly()); + assertThat(context.terminateAfter(), equalTo(0)); + assertThat(context.queryResult().getTotalHits().value, equalTo((long) numDocs)); + int sizeMinus1 = context.queryResult().topDocs().topDocs.scoreDocs.length - 1; + FieldDoc lastDoc = (FieldDoc) context.queryResult().topDocs().topDocs.scoreDocs[sizeMinus1]; + + context.setSearcher(newEarlyTerminationContextSearcher(reader, 10, executor)); + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertNull(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); + assertThat(context.terminateAfter(), equalTo(0)); + assertThat(context.queryResult().getTotalHits().value, equalTo((long) numDocs)); + FieldDoc firstDoc = (FieldDoc) context.queryResult().topDocs().topDocs.scoreDocs[0]; + for (int i = 0; i < searchSortAndFormat.sort.getSort().length; i++) { + @SuppressWarnings("unchecked") + FieldComparator comparator = (FieldComparator) searchSortAndFormat.sort.getSort()[i].getComparator( + i, + false + ); + int cmp = comparator.compareValues(firstDoc.fields[i], lastDoc.fields[i]); + if (cmp == 0) { + continue; + } + assertThat(cmp, equalTo(1)); + break; + } + } + reader.close(); + dir.close(); + } + + public void testDisableTopScoreCollection() throws Exception { + Directory dir = newDirectory(); + IndexWriterConfig iwc = newIndexWriterConfig(new StandardAnalyzer()); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + Document doc = new Document(); + final int numDocs = 2 * scaledRandomIntBetween(50, 450); + for (int i = 0; i < numDocs; i++) { + doc.clear(); + if (i % 2 == 0) { + doc.add(new TextField("title", "foo bar", Store.NO)); + } else { + doc.add(new TextField("title", "foo", Store.NO)); + } + w.addDocument(doc); + } + w.close(); + + IndexReader reader = DirectoryReader.open(dir); + TestSearchContext context = new TestSearchContext(null, indexShard, newContextSearcher(reader, executor)); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + Query q = new SpanNearQuery.Builder("title", true).addClause(new SpanTermQuery(new Term("title", "foo"))) + .addClause(new SpanTermQuery(new Term("title", "bar"))) + .build(); + + context.parsedQuery(new ParsedQuery(q)); + context.setSize(3); + context.trackTotalHitsUpTo(3); + TopDocsCollectorContext topDocsContext = TopDocsCollectorContext.createTopDocsCollectorContext(context, false); + assertEquals(topDocsContext.create(null).scoreMode(), org.apache.lucene.search.ScoreMode.COMPLETE); + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertEquals(numDocs / 2, context.queryResult().topDocs().topDocs.totalHits.value); + assertEquals(context.queryResult().topDocs().topDocs.totalHits.relation, TotalHits.Relation.EQUAL_TO); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(3)); + + context.sort(new SortAndFormats(new Sort(new SortField("other", SortField.Type.INT)), new DocValueFormat[] { DocValueFormat.RAW })); + topDocsContext = TopDocsCollectorContext.createTopDocsCollectorContext(context, false); + assertEquals(topDocsContext.create(null).scoreMode(), org.apache.lucene.search.ScoreMode.TOP_DOCS); + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertEquals(numDocs / 2, context.queryResult().topDocs().topDocs.totalHits.value); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(3)); + assertEquals(context.queryResult().topDocs().topDocs.totalHits.relation, TotalHits.Relation.GREATER_THAN_OR_EQUAL_TO); + + reader.close(); + dir.close(); + } + + public void testEnhanceSortOnNumeric() throws Exception { + final String fieldNameLong = "long-field"; + final String fieldNameDate = "date-field"; + MappedFieldType fieldTypeLong = new NumberFieldMapper.NumberFieldType(fieldNameLong, NumberFieldMapper.NumberType.LONG); + MappedFieldType fieldTypeDate = new DateFieldMapper.DateFieldType(fieldNameDate); + MapperService mapperService = mock(MapperService.class); + when(mapperService.fieldType(fieldNameLong)).thenReturn(fieldTypeLong); + when(mapperService.fieldType(fieldNameDate)).thenReturn(fieldTypeDate); + // enough docs to have a tree with several leaf nodes + final int numDocs = 3500 * 5; + Directory dir = newDirectory(); + IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig(null)); + long firstValue = randomLongBetween(-10000000L, 10000000L); + long longValue = firstValue; + long dateValue = randomLongBetween(0, 3000000000000L); + for (int i = 1; i <= numDocs; ++i) { + Document doc = new Document(); + + doc.add(new LongPoint(fieldNameLong, longValue)); + doc.add(new NumericDocValuesField(fieldNameLong, longValue)); + + doc.add(new LongPoint(fieldNameDate, dateValue)); + doc.add(new NumericDocValuesField(fieldNameDate, dateValue)); + writer.addDocument(doc); + longValue++; + dateValue++; + if (i % 3500 == 0) writer.commit(); + } + writer.close(); + final IndexReader reader = DirectoryReader.open(dir); + final SortField sortFieldLong = new SortField(fieldNameLong, SortField.Type.LONG); + sortFieldLong.setMissingValue(Long.MAX_VALUE); + final SortField sortFieldDate = new SortField(fieldNameDate, SortField.Type.LONG); + sortFieldDate.setMissingValue(Long.MAX_VALUE); + DocValueFormat dateFormat = fieldTypeDate.docValueFormat(null, null); + final Sort longSort = new Sort(sortFieldLong); + final Sort longDateSort = new Sort(sortFieldLong, sortFieldDate); + final Sort dateSort = new Sort(sortFieldDate); + final Sort dateLongSort = new Sort(sortFieldDate, sortFieldLong); + SortAndFormats longSortAndFormats = new SortAndFormats(longSort, new DocValueFormat[] { DocValueFormat.RAW }); + SortAndFormats longDateSortAndFormats = new SortAndFormats(longDateSort, new DocValueFormat[] { DocValueFormat.RAW, dateFormat }); + SortAndFormats dateSortAndFormats = new SortAndFormats(dateSort, new DocValueFormat[] { dateFormat }); + SortAndFormats dateLongSortAndFormats = new SortAndFormats(dateLongSort, new DocValueFormat[] { dateFormat, DocValueFormat.RAW }); + ParsedQuery query = new ParsedQuery(new MatchAllDocsQuery()); + SearchShardTask task = new SearchShardTask(123L, "", "", "", null, Collections.emptyMap()); + + // 1. Test a sort on long field + { + TestSearchContext searchContext = spy(new TestSearchContext(null, indexShard, newContextSearcher(reader, executor))); + when(searchContext.mapperService()).thenReturn(mapperService); + searchContext.sort(longSortAndFormats); + searchContext.parsedQuery(query); + searchContext.setTask(task); + searchContext.setSize(10); + QueryPhase.executeInternal(searchContext.withCleanQueryResult(), queryPhaseSearcher); + assertSortResults(searchContext.queryResult().topDocs().topDocs, (long) numDocs, false); + } + + // 2. Test a sort on long field + date field + { + TestSearchContext searchContext = spy(new TestSearchContext(null, indexShard, newContextSearcher(reader, executor))); + when(searchContext.mapperService()).thenReturn(mapperService); + searchContext.sort(longDateSortAndFormats); + searchContext.parsedQuery(query); + searchContext.setTask(task); + searchContext.setSize(10); + QueryPhase.executeInternal(searchContext.withCleanQueryResult(), queryPhaseSearcher); + assertSortResults(searchContext.queryResult().topDocs().topDocs, (long) numDocs, true); + } + + // 3. Test a sort on date field + { + TestSearchContext searchContext = spy(new TestSearchContext(null, indexShard, newContextSearcher(reader, executor))); + when(searchContext.mapperService()).thenReturn(mapperService); + searchContext.sort(dateSortAndFormats); + searchContext.parsedQuery(query); + searchContext.setTask(task); + searchContext.setSize(10); + QueryPhase.executeInternal(searchContext.withCleanQueryResult(), queryPhaseSearcher); + assertSortResults(searchContext.queryResult().topDocs().topDocs, (long) numDocs, false); + } + + // 4. Test a sort on date field + long field + { + TestSearchContext searchContext = spy(new TestSearchContext(null, indexShard, newContextSearcher(reader, executor))); + when(searchContext.mapperService()).thenReturn(mapperService); + searchContext.sort(dateLongSortAndFormats); + searchContext.parsedQuery(query); + searchContext.setTask(task); + searchContext.setSize(10); + QueryPhase.executeInternal(searchContext.withCleanQueryResult(), queryPhaseSearcher); + assertSortResults(searchContext.queryResult().topDocs().topDocs, (long) numDocs, true); + } + + // 5. Test that sort optimization is run when from > 0 and size = 0 + { + TestSearchContext searchContext = spy(new TestSearchContext(null, indexShard, newContextSearcher(reader, executor))); + when(searchContext.mapperService()).thenReturn(mapperService); + searchContext.sort(longSortAndFormats); + searchContext.parsedQuery(query); + searchContext.setTask(task); + searchContext.from(5); + searchContext.setSize(0); + QueryPhase.executeInternal(searchContext.withCleanQueryResult(), queryPhaseSearcher); + assertSortResults(searchContext.queryResult().topDocs().topDocs, (long) numDocs, false); + } + + // 6. Test that sort optimization works with from = 0 and size= 0 + { + TestSearchContext searchContext = spy(new TestSearchContext(null, indexShard, newContextSearcher(reader, executor))); + when(searchContext.mapperService()).thenReturn(mapperService); + searchContext.sort(longSortAndFormats); + searchContext.parsedQuery(query); + searchContext.setTask(task); + searchContext.setSize(0); + QueryPhase.executeInternal(searchContext.withCleanQueryResult(), queryPhaseSearcher); + } + + // 7. Test that sort optimization works with search after + { + TestSearchContext searchContext = spy(new TestSearchContext(null, indexShard, newContextSearcher(reader, executor))); + when(searchContext.mapperService()).thenReturn(mapperService); + int afterDocument = (int) randomLongBetween(0, 50); + long afterValue = firstValue + afterDocument; + FieldDoc after = new FieldDoc(afterDocument, Float.NaN, new Long[] { afterValue }); + searchContext.searchAfter(after); + searchContext.sort(longSortAndFormats); + searchContext.parsedQuery(query); + searchContext.setTask(task); + searchContext.setSize(10); + QueryPhase.executeInternal(searchContext.withCleanQueryResult(), queryPhaseSearcher); + final TopDocs topDocs = searchContext.queryResult().topDocs().topDocs; + long topValue = (long) ((FieldDoc) topDocs.scoreDocs[0]).fields[0]; + assertThat(topValue, greaterThan(afterValue)); + assertSortResults(topDocs, (long) numDocs, false); + + final TotalHits totalHits = topDocs.totalHits; + assertEquals(TotalHits.Relation.EQUAL_TO, totalHits.relation); + assertEquals(numDocs, totalHits.value); + } + + reader.close(); + dir.close(); + } + + public void testMaxScoreQueryVisitor() { + BitSetProducer producer = context -> new FixedBitSet(1); + Query query = new OpenSearchToParentBlockJoinQuery(new MatchAllDocsQuery(), producer, ScoreMode.Avg, "nested"); + assertTrue(hasInfMaxScore(query)); + + query = new OpenSearchToParentBlockJoinQuery(new MatchAllDocsQuery(), producer, ScoreMode.None, "nested"); + assertFalse(hasInfMaxScore(query)); + + for (Occur occur : Occur.values()) { + query = new BooleanQuery.Builder().add( + new OpenSearchToParentBlockJoinQuery(new MatchAllDocsQuery(), producer, ScoreMode.Avg, "nested"), + occur + ).build(); + if (occur == Occur.MUST) { + assertTrue(hasInfMaxScore(query)); + } else { + assertFalse(hasInfMaxScore(query)); + } + + query = new BooleanQuery.Builder().add( + new BooleanQuery.Builder().add( + new OpenSearchToParentBlockJoinQuery(new MatchAllDocsQuery(), producer, ScoreMode.Avg, "nested"), + occur + ).build(), + occur + ).build(); + if (occur == Occur.MUST) { + assertTrue(hasInfMaxScore(query)); + } else { + assertFalse(hasInfMaxScore(query)); + } + + query = new BooleanQuery.Builder().add( + new BooleanQuery.Builder().add( + new OpenSearchToParentBlockJoinQuery(new MatchAllDocsQuery(), producer, ScoreMode.Avg, "nested"), + occur + ).build(), + Occur.FILTER + ).build(); + assertFalse(hasInfMaxScore(query)); + + query = new BooleanQuery.Builder().add( + new BooleanQuery.Builder().add(new SpanTermQuery(new Term("field", "foo")), occur) + .add(new OpenSearchToParentBlockJoinQuery(new MatchAllDocsQuery(), producer, ScoreMode.Avg, "nested"), occur) + .build(), + occur + ).build(); + if (occur == Occur.MUST) { + assertTrue(hasInfMaxScore(query)); + } else { + assertFalse(hasInfMaxScore(query)); + } + } + } + + // assert score docs are in order and their number is as expected + private void assertSortResults(TopDocs topDocs, long expectedNumDocs, boolean isDoubleSort) { + if (topDocs.totalHits.relation == TotalHits.Relation.GREATER_THAN_OR_EQUAL_TO) { + assertThat(topDocs.totalHits.value, lessThanOrEqualTo(expectedNumDocs)); + } else { + assertEquals(topDocs.totalHits.value, expectedNumDocs); + } + long cur1, cur2; + long prev1 = Long.MIN_VALUE; + long prev2 = Long.MIN_VALUE; + for (ScoreDoc scoreDoc : topDocs.scoreDocs) { + cur1 = (long) ((FieldDoc) scoreDoc).fields[0]; + assertThat(cur1, greaterThanOrEqualTo(prev1)); // test that docs are properly sorted on the first sort + if (isDoubleSort) { + cur2 = (long) ((FieldDoc) scoreDoc).fields[1]; + if (cur1 == prev1) { + assertThat(cur2, greaterThanOrEqualTo(prev2)); // test that docs are properly sorted on the secondary sort + } + prev2 = cur2; + } + prev1 = cur1; + } + } + + public void testMinScore() throws Exception { + Directory dir = newDirectory(); + IndexWriterConfig iwc = newIndexWriterConfig(); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + for (int i = 0; i < 10; i++) { + Document doc = new Document(); + doc.add(new StringField("foo", "bar", Store.NO)); + doc.add(new StringField("filter", "f1", Store.NO)); + w.addDocument(doc); + } + w.close(); + + IndexReader reader = DirectoryReader.open(dir); + TestSearchContext context = new TestSearchContext(null, indexShard, newContextSearcher(reader, executor)); + context.parsedQuery( + new ParsedQuery( + new BooleanQuery.Builder().add(new TermQuery(new Term("foo", "bar")), Occur.MUST) + .add(new TermQuery(new Term("filter", "f1")), Occur.SHOULD) + .build() + ) + ); + context.minimumScore(0.01f); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + context.setSize(1); + context.trackTotalHitsUpTo(5); + + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertEquals(10, context.queryResult().topDocs().topDocs.totalHits.value); + + reader.close(); + dir.close(); + } + + public void testMaxScore() throws Exception { + Directory dir = newDirectory(); + final Sort sort = new Sort(new SortField("filter", SortField.Type.STRING)); + IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(sort); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + + final int numDocs = scaledRandomIntBetween(600, 900); + for (int i = 0; i < numDocs; i++) { + Document doc = new Document(); + doc.add(new StringField("foo", "bar", Store.NO)); + doc.add(new StringField("filter", "f1" + ((i > 0) ? " " + Integer.toString(i) : ""), Store.NO)); + doc.add(new SortedDocValuesField("filter", newBytesRef("f1" + ((i > 0) ? " " + Integer.toString(i) : "")))); + w.addDocument(doc); + } + w.close(); + + IndexReader reader = DirectoryReader.open(dir); + TestSearchContext context = new TestSearchContext(null, indexShard, newContextSearcher(reader, executor)); + context.trackScores(true); + context.parsedQuery( + new ParsedQuery( + new BooleanQuery.Builder().add(new TermQuery(new Term("foo", "bar")), Occur.MUST) + .add(new TermQuery(new Term("filter", "f1")), Occur.SHOULD) + .build() + ) + ); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + context.setSize(1); + context.trackTotalHitsUpTo(5); + + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertFalse(Float.isNaN(context.queryResult().getMaxScore())); + assertEquals(1, context.queryResult().topDocs().topDocs.scoreDocs.length); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, greaterThanOrEqualTo(6L)); + + context.sort(new SortAndFormats(sort, new DocValueFormat[] { DocValueFormat.RAW })); + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertFalse(Float.isNaN(context.queryResult().getMaxScore())); + assertEquals(1, context.queryResult().topDocs().topDocs.scoreDocs.length); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, greaterThanOrEqualTo(6L)); + + context.trackScores(false); + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertTrue(Float.isNaN(context.queryResult().getMaxScore())); + assertEquals(1, context.queryResult().topDocs().topDocs.scoreDocs.length); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, greaterThanOrEqualTo(6L)); + + reader.close(); + dir.close(); + } + + public void testCollapseQuerySearchResults() throws Exception { + Directory dir = newDirectory(); + final Sort sort = new Sort(new SortField("user", SortField.Type.INT)); + IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(sort); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + + // Always end up with uneven buckets so collapsing is predictable + final int numDocs = 2 * scaledRandomIntBetween(600, 900) - 1; + for (int i = 0; i < numDocs; i++) { + Document doc = new Document(); + doc.add(new StringField("foo", "bar", Store.NO)); + doc.add(new NumericDocValuesField("user", i & 1)); + w.addDocument(doc); + } + w.close(); + + IndexReader reader = DirectoryReader.open(dir); + QueryShardContext queryShardContext = mock(QueryShardContext.class); + when(queryShardContext.fieldMapper("user")).thenReturn( + new NumberFieldType("user", NumberType.INTEGER, true, false, true, false, null, Collections.emptyMap()) + ); + + TestSearchContext context = new TestSearchContext(queryShardContext, indexShard, newContextSearcher(reader, executor)); + context.collapse(new CollapseBuilder("user").build(context.getQueryShardContext())); + context.trackScores(true); + context.parsedQuery(new ParsedQuery(new TermQuery(new Term("foo", "bar")))); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + context.setSize(2); + context.trackTotalHitsUpTo(5); + + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertFalse(Float.isNaN(context.queryResult().getMaxScore())); + assertEquals(2, context.queryResult().topDocs().topDocs.scoreDocs.length); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); + assertThat(context.queryResult().topDocs().topDocs, instanceOf(CollapseTopFieldDocs.class)); + + CollapseTopFieldDocs topDocs = (CollapseTopFieldDocs) context.queryResult().topDocs().topDocs; + assertThat(topDocs.collapseValues.length, equalTo(2)); + assertThat(topDocs.collapseValues[0], equalTo(0L)); // user == 0 + assertThat(topDocs.collapseValues[1], equalTo(1L)); // user == 1 + + context.sort(new SortAndFormats(sort, new DocValueFormat[] { DocValueFormat.RAW })); + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertFalse(Float.isNaN(context.queryResult().getMaxScore())); + assertEquals(2, context.queryResult().topDocs().topDocs.scoreDocs.length); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); + assertThat(context.queryResult().topDocs().topDocs, instanceOf(CollapseTopFieldDocs.class)); + + topDocs = (CollapseTopFieldDocs) context.queryResult().topDocs().topDocs; + assertThat(topDocs.collapseValues.length, equalTo(2)); + assertThat(topDocs.collapseValues[0], equalTo(0L)); // user == 0 + assertThat(topDocs.collapseValues[1], equalTo(1L)); // user == 1 + + context.trackScores(false); + QueryPhase.executeInternal(context.withCleanQueryResult(), queryPhaseSearcher); + assertTrue(Float.isNaN(context.queryResult().getMaxScore())); + assertEquals(2, context.queryResult().topDocs().topDocs.scoreDocs.length); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); + assertThat(context.queryResult().topDocs().topDocs, instanceOf(CollapseTopFieldDocs.class)); + + topDocs = (CollapseTopFieldDocs) context.queryResult().topDocs().topDocs; + assertThat(topDocs.collapseValues.length, equalTo(2)); + assertThat(topDocs.collapseValues[0], equalTo(0L)); // user == 0 + assertThat(topDocs.collapseValues[1], equalTo(1L)); // user == 1 + + reader.close(); + dir.close(); + } + + public void testCancellationDuringPreprocess() throws IOException { + try (Directory dir = newDirectory(); RandomIndexWriter w = new RandomIndexWriter(random(), dir, newIndexWriterConfig())) { + + for (int i = 0; i < 10; i++) { + Document doc = new Document(); + StringBuilder sb = new StringBuilder(); + for (int j = 0; j < i; j++) { + sb.append('a'); + } + doc.add(new StringField("foo", sb.toString(), Store.NO)); + w.addDocument(doc); + } + w.flush(); + w.close(); + + try (IndexReader reader = DirectoryReader.open(dir)) { + TestSearchContext context = new TestSearchContextWithRewriteAndCancellation( + null, + indexShard, + newContextSearcher(reader, executor) + ); + PrefixQuery prefixQuery = new PrefixQuery(new Term("foo", "a")); + prefixQuery.setRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_REWRITE); + context.parsedQuery(new ParsedQuery(prefixQuery)); + SearchShardTask task = mock(SearchShardTask.class); + when(task.isCancelled()).thenReturn(true); + context.setTask(task); + expectThrows(TaskCancelledException.class, () -> new QueryPhase().preProcess(context)); + } + } + } + + private static class TestSearchContextWithRewriteAndCancellation extends TestSearchContext { + + private TestSearchContextWithRewriteAndCancellation( + QueryShardContext queryShardContext, + IndexShard indexShard, + ContextIndexSearcher searcher + ) { + super(queryShardContext, indexShard, searcher); + } + + @Override + public void preProcess(boolean rewrite) { + try { + searcher().rewrite(query()); + } catch (IOException e) { + fail("IOException shouldn't be thrown"); + } + } + + @Override + public boolean lowLevelCancellation() { + return true; + } + } + + private static ContextIndexSearcher newContextSearcher(IndexReader reader, ExecutorService executor) throws IOException { + return new ContextIndexSearcher( + reader, + IndexSearcher.getDefaultSimilarity(), + IndexSearcher.getDefaultQueryCache(), + IndexSearcher.getDefaultQueryCachingPolicy(), + true, + executor + ); + } + + private static ContextIndexSearcher newEarlyTerminationContextSearcher(IndexReader reader, int size, ExecutorService executor) + throws IOException { + return new ContextIndexSearcher( + reader, + IndexSearcher.getDefaultSimilarity(), + IndexSearcher.getDefaultQueryCache(), + IndexSearcher.getDefaultQueryCachingPolicy(), + true, + executor + ) { + + @Override + public void search(List leaves, Weight weight, Collector collector) throws IOException { + final Collector in = new AssertingEarlyTerminationFilterCollector(collector, size); + super.search(leaves, weight, in); + } + }; + } + + // used to check that numeric long or date sort optimization was run + private static ContextIndexSearcher newOptimizedContextSearcher(IndexReader reader, int queryType, ExecutorService executor) + throws IOException { + return new ContextIndexSearcher( + reader, + IndexSearcher.getDefaultSimilarity(), + IndexSearcher.getDefaultQueryCache(), + IndexSearcher.getDefaultQueryCachingPolicy(), + true, + executor + ) { + + @Override + public void search( + Query query, + CollectorManager manager, + QuerySearchResult result, + DocValueFormat[] formats, + TotalHits totalHits + ) throws IOException { + assertTrue(query instanceof BooleanQuery); + List clauses = ((BooleanQuery) query).clauses(); + assertTrue(clauses.size() == 2); + assertTrue(clauses.get(0).getOccur() == Occur.FILTER); + assertTrue(clauses.get(1).getOccur() == Occur.SHOULD); + if (queryType == 0) { + assertTrue( + clauses.get(1).getQuery().getClass() == LongPoint.newDistanceFeatureQuery("random_field", 1, 1, 1).getClass() + ); + } + if (queryType == 1) assertTrue(clauses.get(1).getQuery() instanceof DocValuesFieldExistsQuery); + super.search(query, manager, result, formats, totalHits); + } + + @Override + public void search( + List leaves, + Weight weight, + @SuppressWarnings("rawtypes") CollectorManager manager, + QuerySearchResult result, + DocValueFormat[] formats, + TotalHits totalHits + ) throws IOException { + final Query query = weight.getQuery(); + assertTrue(query instanceof BooleanQuery); + List clauses = ((BooleanQuery) query).clauses(); + assertTrue(clauses.size() == 2); + assertTrue(clauses.get(0).getOccur() == Occur.FILTER); + assertTrue(clauses.get(1).getOccur() == Occur.SHOULD); + if (queryType == 0) { + assertTrue( + clauses.get(1).getQuery().getClass() == LongPoint.newDistanceFeatureQuery("random_field", 1, 1, 1).getClass() + ); + } + if (queryType == 1) assertTrue(clauses.get(1).getQuery() instanceof DocValuesFieldExistsQuery); + super.search(leaves, weight, manager, result, formats, totalHits); + } + + @Override + public void search(List leaves, Weight weight, Collector collector) throws IOException { + if (getExecutor() == null) { + assert (false); // should not be there, expected to search with CollectorManager + } else { + super.search(leaves, weight, collector); + } + } + }; + } + + private static class TestTotalHitCountCollectorManager extends TotalHitCountCollectorManager { + private int totalHits; + private final TotalHitCountCollector collector; + private final Integer teminateAfter; + + static TestTotalHitCountCollectorManager create(final ExecutorService executor) { + return create(executor, null, null); + } + + static TestTotalHitCountCollectorManager create(final ExecutorService executor, final Integer teminateAfter) { + return create(executor, null, teminateAfter); + } + + static TestTotalHitCountCollectorManager create(final ExecutorService executor, final Sort sort) { + return create(executor, sort, null); + } + + static TestTotalHitCountCollectorManager create(final ExecutorService executor, final Sort sort, final Integer teminateAfter) { + if (executor == null) { + return new TestTotalHitCountCollectorManager(new TotalHitCountCollector(), sort); + } else { + return new TestTotalHitCountCollectorManager(sort, teminateAfter); + } + } + + private TestTotalHitCountCollectorManager(final TotalHitCountCollector collector, final Sort sort) { + super(sort); + this.collector = collector; + this.teminateAfter = null; + } + + private TestTotalHitCountCollectorManager(final Sort sort, final Integer teminateAfter) { + super(sort); + this.collector = null; + this.teminateAfter = teminateAfter; + } + + @Override + public TotalHitCountCollector newCollector() throws IOException { + return (collector == null) ? super.newCollector() : collector; + } + + @Override + public ReduceableSearchResult reduce(Collection collectors) throws IOException { + final ReduceableSearchResult result = super.reduce(collectors); + totalHits = collectors.stream().mapToInt(TotalHitCountCollector::getTotalHits).sum(); + + if (teminateAfter != null) { + assertThat(totalHits, greaterThanOrEqualTo(teminateAfter)); + totalHits = Math.min(totalHits, teminateAfter); + } + + return result; + } + + public int getTotalHits() { + return (collector == null) ? totalHits : collector.getTotalHits(); + } + } + + private static class AssertingEarlyTerminationFilterCollector extends FilterCollector { + private final int size; + + AssertingEarlyTerminationFilterCollector(Collector in, int size) { + super(in); + this.size = size; + } + + @Override + public LeafCollector getLeafCollector(LeafReaderContext context) throws IOException { + final LeafCollector in = super.getLeafCollector(context); + return new FilterLeafCollector(in) { + int collected; + + @Override + public void collect(int doc) throws IOException { + assert collected <= size : "should not collect more than " + size + " doc per segment, got " + collected; + ++collected; + super.collect(doc); + } + }; + } + } +} diff --git a/sandbox/plugins/concurrent-search/src/test/java/org/opensearch/search/query/QueryProfilePhaseTests.java b/sandbox/plugins/concurrent-search/src/test/java/org/opensearch/search/query/QueryProfilePhaseTests.java new file mode 100644 index 0000000000000..d2cb77f529793 --- /dev/null +++ b/sandbox/plugins/concurrent-search/src/test/java/org/opensearch/search/query/QueryProfilePhaseTests.java @@ -0,0 +1,1182 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.search.query; + +import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; + +import org.apache.lucene.analysis.standard.StandardAnalyzer; +import org.apache.lucene.document.Document; +import org.apache.lucene.document.Field.Store; +import org.apache.lucene.document.NumericDocValuesField; +import org.apache.lucene.document.SortedDocValuesField; +import org.apache.lucene.document.StringField; +import org.apache.lucene.document.TextField; +import org.apache.lucene.index.DirectoryReader; +import org.apache.lucene.index.IndexReader; +import org.apache.lucene.index.IndexWriterConfig; +import org.apache.lucene.index.LeafReaderContext; +import org.apache.lucene.index.Term; +import org.apache.lucene.queries.spans.SpanNearQuery; +import org.apache.lucene.queries.spans.SpanTermQuery; +import org.apache.lucene.search.BooleanClause.Occur; +import org.apache.lucene.search.grouping.CollapseTopFieldDocs; +import org.apache.lucene.search.BooleanQuery; +import org.apache.lucene.search.Collector; +import org.apache.lucene.search.FieldComparator; +import org.apache.lucene.search.FieldDoc; +import org.apache.lucene.search.FilterCollector; +import org.apache.lucene.search.FilterLeafCollector; +import org.apache.lucene.search.IndexSearcher; +import org.apache.lucene.search.LeafCollector; +import org.apache.lucene.search.MatchAllDocsQuery; +import org.apache.lucene.search.MatchNoDocsQuery; +import org.apache.lucene.search.Query; +import org.apache.lucene.search.Sort; +import org.apache.lucene.search.SortField; +import org.apache.lucene.search.TermQuery; +import org.apache.lucene.search.TotalHits; +import org.apache.lucene.search.Weight; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.store.Directory; +import org.opensearch.action.search.SearchShardTask; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.json.JsonXContent; +import org.opensearch.index.mapper.NumberFieldMapper.NumberFieldType; +import org.opensearch.index.mapper.NumberFieldMapper.NumberType; +import org.opensearch.index.query.ParsedQuery; +import org.opensearch.index.query.QueryShardContext; +import org.opensearch.index.shard.IndexShard; +import org.opensearch.index.shard.IndexShardTestCase; +import org.opensearch.lucene.queries.MinDocQuery; +import org.opensearch.search.DocValueFormat; +import org.opensearch.search.collapse.CollapseBuilder; +import org.opensearch.search.internal.ContextIndexSearcher; +import org.opensearch.search.internal.ScrollContext; +import org.opensearch.search.internal.SearchContext; +import org.opensearch.search.profile.ProfileResult; +import org.opensearch.search.profile.ProfileShardResult; +import org.opensearch.search.profile.SearchProfileShardResults; +import org.opensearch.search.profile.query.CollectorResult; +import org.opensearch.search.profile.query.QueryProfileShardResult; +import org.opensearch.search.sort.SortAndFormats; +import org.opensearch.test.TestSearchContext; +import org.opensearch.threadpool.ThreadPool; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import java.util.function.Consumer; + +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.CoreMatchers.nullValue; +import static org.hamcrest.Matchers.anyOf; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.empty; +import static org.hamcrest.Matchers.greaterThan; +import static org.hamcrest.Matchers.greaterThanOrEqualTo; +import static org.hamcrest.Matchers.instanceOf; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; +import static org.hamcrest.Matchers.hasSize; + +public class QueryProfilePhaseTests extends IndexShardTestCase { + + private IndexShard indexShard; + private final ExecutorService executor; + private final QueryPhaseSearcher queryPhaseSearcher; + + @ParametersFactory + public static Collection concurrency() { + return Arrays.asList( + new Object[] { 0, QueryPhase.DEFAULT_QUERY_PHASE_SEARCHER }, + new Object[] { 5, new ConcurrentQueryPhaseSearcher() } + ); + } + + public QueryProfilePhaseTests(int concurrency, QueryPhaseSearcher queryPhaseSearcher) { + this.executor = (concurrency > 0) ? Executors.newFixedThreadPool(concurrency) : null; + this.queryPhaseSearcher = queryPhaseSearcher; + } + + @Override + public Settings threadPoolSettings() { + return Settings.builder().put(super.threadPoolSettings()).put("thread_pool.search.min_queue_size", 10).build(); + } + + @Override + public void setUp() throws Exception { + super.setUp(); + indexShard = newShard(true); + } + + @Override + public void tearDown() throws Exception { + super.tearDown(); + closeShards(indexShard); + + if (executor != null) { + ThreadPool.terminate(executor, 10, TimeUnit.SECONDS); + } + } + + public void testPostFilterDisablesCountOptimization() throws Exception { + Directory dir = newDirectory(); + final Sort sort = new Sort(new SortField("rank", SortField.Type.INT)); + IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(sort); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + Document doc = new Document(); + w.addDocument(doc); + w.close(); + + IndexReader reader = DirectoryReader.open(dir); + + TestSearchContext context = new TestSearchContext(null, indexShard, newEarlyTerminationContextSearcher(reader, 0, executor)); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + context.parsedQuery(new ParsedQuery(new MatchAllDocsQuery())); + + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers(), queryPhaseSearcher); + assertEquals(1, context.queryResult().topDocs().topDocs.totalHits.value); + assertProfileData(context, "MatchAllDocsQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_count")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), empty()); + }); + + context.setSearcher(newContextSearcher(reader, executor)); + context.parsedPostFilter(new ParsedQuery(new MatchNoDocsQuery())); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers(), queryPhaseSearcher); + assertEquals(0, context.queryResult().topDocs().topDocs.totalHits.value); + assertProfileData(context, collector -> { + assertThat(collector.getReason(), equalTo("search_post_filter")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), hasSize(1)); + assertThat(collector.getProfiledChildren().get(0).getReason(), equalTo("search_count")); + assertThat(collector.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + }, (query) -> { + assertThat(query.getQueryName(), equalTo("MatchNoDocsQuery")); + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, (query) -> { + assertThat(query.getQueryName(), equalTo("MatchAllDocsQuery")); + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }); + + reader.close(); + dir.close(); + } + + public void testTerminateAfterWithFilter() throws Exception { + Directory dir = newDirectory(); + final Sort sort = new Sort(new SortField("rank", SortField.Type.INT)); + IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(sort); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + Document doc = new Document(); + for (int i = 0; i < 10; i++) { + doc.add(new StringField("foo", Integer.toString(i), Store.NO)); + } + w.addDocument(doc); + w.close(); + + IndexReader reader = DirectoryReader.open(dir); + + TestSearchContext context = new TestSearchContext(null, indexShard, newContextSearcher(reader, executor)); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + + context.parsedQuery(new ParsedQuery(new MatchAllDocsQuery())); + context.terminateAfter(1); + context.setSize(10); + for (int i = 0; i < 10; i++) { + context.parsedPostFilter(new ParsedQuery(new TermQuery(new Term("foo", Integer.toString(i))))); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers(), queryPhaseSearcher); + assertEquals(1, context.queryResult().topDocs().topDocs.totalHits.value); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); + assertProfileData(context, collector -> { + assertThat(collector.getReason(), equalTo("search_post_filter")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), hasSize(1)); + assertThat(collector.getProfiledChildren().get(0).getReason(), equalTo("search_terminate_after_count")); + assertThat(collector.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren().get(0).getProfiledChildren(), hasSize(1)); + assertThat(collector.getProfiledChildren().get(0).getProfiledChildren().get(0).getReason(), equalTo("search_top_hits")); + assertThat(collector.getProfiledChildren().get(0).getProfiledChildren().get(0).getTime(), greaterThan(0L)); + }, (query) -> { + assertThat(query.getQueryName(), equalTo("TermQuery")); + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, (query) -> { + assertThat(query.getQueryName(), equalTo("MatchAllDocsQuery")); + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(1L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }); + } + reader.close(); + dir.close(); + } + + public void testMinScoreDisablesCountOptimization() throws Exception { + Directory dir = newDirectory(); + final Sort sort = new Sort(new SortField("rank", SortField.Type.INT)); + IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(sort); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + Document doc = new Document(); + w.addDocument(doc); + w.close(); + + IndexReader reader = DirectoryReader.open(dir); + TestSearchContext context = new TestSearchContext(null, indexShard, newEarlyTerminationContextSearcher(reader, 0, executor)); + context.parsedQuery(new ParsedQuery(new MatchAllDocsQuery())); + context.setSize(0); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers(), queryPhaseSearcher); + assertEquals(1, context.queryResult().topDocs().topDocs.totalHits.value); + assertProfileData(context, "MatchAllDocsQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_count")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), empty()); + }); + + context.minimumScore(100); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers(), queryPhaseSearcher); + assertEquals(0, context.queryResult().topDocs().topDocs.totalHits.value); + assertEquals(TotalHits.Relation.EQUAL_TO, context.queryResult().topDocs().topDocs.totalHits.relation); + assertProfileData(context, "MatchAllDocsQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), greaterThanOrEqualTo(100L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(1L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_min_score")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), hasSize(1)); + assertThat(collector.getProfiledChildren().get(0).getReason(), equalTo("search_count")); + assertThat(collector.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + }); + + reader.close(); + dir.close(); + } + + public void testInOrderScrollOptimization() throws Exception { + Directory dir = newDirectory(); + final Sort sort = new Sort(new SortField("rank", SortField.Type.INT)); + IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(sort); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + final int numDocs = scaledRandomIntBetween(600, 900); + for (int i = 0; i < numDocs; ++i) { + w.addDocument(new Document()); + } + w.close(); + IndexReader reader = DirectoryReader.open(dir); + ScrollContext scrollContext = new ScrollContext(); + TestSearchContext context = new TestSearchContext(null, indexShard, newContextSearcher(reader, executor), scrollContext); + context.parsedQuery(new ParsedQuery(new MatchAllDocsQuery())); + scrollContext.lastEmittedDoc = null; + scrollContext.maxScore = Float.NaN; + scrollContext.totalHits = null; + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + int size = randomIntBetween(2, 5); + context.setSize(size); + + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers(), queryPhaseSearcher); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); + assertNull(context.queryResult().terminatedEarly()); + assertThat(context.terminateAfter(), equalTo(0)); + assertThat(context.queryResult().getTotalHits().value, equalTo((long) numDocs)); + assertProfileData(context, "MatchAllDocsQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_top_hits")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), empty()); + }); + + context.setSearcher(newEarlyTerminationContextSearcher(reader, size, executor)); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers(), queryPhaseSearcher); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); + assertThat(context.terminateAfter(), equalTo(size)); + assertThat(context.queryResult().getTotalHits().value, equalTo((long) numDocs)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs[0].doc, greaterThanOrEqualTo(size)); + assertProfileData(context, "ConstantScoreQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_terminate_after_count")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), hasSize(1)); + assertThat(collector.getProfiledChildren().get(0).getReason(), equalTo("search_top_hits")); + assertThat(collector.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + }); + + reader.close(); + dir.close(); + } + + public void testTerminateAfterEarlyTermination() throws Exception { + Directory dir = newDirectory(); + IndexWriterConfig iwc = newIndexWriterConfig(); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + final int numDocs = scaledRandomIntBetween(600, 900); + for (int i = 0; i < numDocs; ++i) { + Document doc = new Document(); + if (randomBoolean()) { + doc.add(new StringField("foo", "bar", Store.NO)); + } + if (randomBoolean()) { + doc.add(new StringField("foo", "baz", Store.NO)); + } + doc.add(new NumericDocValuesField("rank", numDocs - i)); + w.addDocument(doc); + } + w.close(); + final IndexReader reader = DirectoryReader.open(dir); + TestSearchContext context = new TestSearchContext(null, indexShard, newContextSearcher(reader, executor)); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + context.parsedQuery(new ParsedQuery(new MatchAllDocsQuery())); + + context.terminateAfter(1); + { + context.setSize(1); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers(), queryPhaseSearcher); + assertTrue(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(1L)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); + assertProfileData(context, "MatchAllDocsQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_terminate_after_count")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), hasSize(1)); + assertThat(collector.getProfiledChildren().get(0).getReason(), equalTo("search_top_hits")); + assertThat(collector.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + }); + + context.setSize(0); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers(), queryPhaseSearcher); + assertTrue(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(1L)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(0)); + assertProfileData(context, "MatchAllDocsQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_terminate_after_count")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), hasSize(1)); + assertThat(collector.getProfiledChildren().get(0).getReason(), equalTo("search_count")); + assertThat(collector.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + }); + } + + { + context.setSize(1); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers(), queryPhaseSearcher); + assertTrue(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(1L)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); + assertProfileData(context, "MatchAllDocsQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_terminate_after_count")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), hasSize(1)); + assertThat(collector.getProfiledChildren().get(0).getReason(), equalTo("search_top_hits")); + assertThat(collector.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + }); + } + { + context.setSize(1); + BooleanQuery bq = new BooleanQuery.Builder().add(new TermQuery(new Term("foo", "bar")), Occur.SHOULD) + .add(new TermQuery(new Term("foo", "baz")), Occur.SHOULD) + .build(); + context.parsedQuery(new ParsedQuery(bq)); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers(), queryPhaseSearcher); + assertTrue(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(1L)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); + assertProfileData(context, "BooleanQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + + assertThat(query.getProfiledChildren(), hasSize(2)); + assertThat(query.getProfiledChildren().get(0).getQueryName(), equalTo("TermQuery")); + assertThat(query.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + + assertThat(query.getProfiledChildren().get(1).getQueryName(), equalTo("TermQuery")); + assertThat(query.getProfiledChildren().get(1).getTime(), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_terminate_after_count")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), hasSize(1)); + assertThat(collector.getProfiledChildren().get(0).getReason(), equalTo("search_top_hits")); + assertThat(collector.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + }); + context.setSize(0); + context.parsedQuery(new ParsedQuery(bq)); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers(), queryPhaseSearcher); + assertTrue(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(1L)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(0)); + + assertProfileData(context, "BooleanQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + + assertThat(query.getProfiledChildren(), hasSize(2)); + assertThat(query.getProfiledChildren().get(0).getQueryName(), equalTo("TermQuery")); + assertThat(query.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("score_count"), equalTo(0L)); + + assertThat(query.getProfiledChildren().get(1).getQueryName(), equalTo("TermQuery")); + assertThat(query.getProfiledChildren().get(1).getTime(), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("score_count"), equalTo(0L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_terminate_after_count")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), hasSize(1)); + assertThat(collector.getProfiledChildren().get(0).getReason(), equalTo("search_count")); + assertThat(collector.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + }); + } + + context.terminateAfter(7); + context.setSize(10); + for (int trackTotalHits : new int[] { -1, 3, 75, 100 }) { + context.trackTotalHitsUpTo(trackTotalHits); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers(), queryPhaseSearcher); + assertTrue(context.queryResult().terminatedEarly()); + if (trackTotalHits == -1) { + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(0L)); + } else { + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(7L)); + } + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(7)); + assertProfileData(context, "BooleanQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), greaterThanOrEqualTo(7L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + + assertThat(query.getProfiledChildren(), hasSize(2)); + assertThat(query.getProfiledChildren().get(0).getQueryName(), equalTo("TermQuery")); + assertThat(query.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("score_count"), greaterThan(0L)); + + assertThat(query.getProfiledChildren().get(1).getQueryName(), equalTo("TermQuery")); + assertThat(query.getProfiledChildren().get(1).getTime(), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("score_count"), greaterThan(0L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_terminate_after_count")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), hasSize(1)); + assertThat(collector.getProfiledChildren().get(0).getReason(), equalTo("search_top_hits")); + assertThat(collector.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + }); + } + + reader.close(); + dir.close(); + } + + public void testIndexSortingEarlyTermination() throws Exception { + Directory dir = newDirectory(); + final Sort sort = new Sort(new SortField("rank", SortField.Type.INT)); + IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(sort); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + final int numDocs = scaledRandomIntBetween(600, 900); + for (int i = 0; i < numDocs; ++i) { + Document doc = new Document(); + if (randomBoolean()) { + doc.add(new StringField("foo", "bar", Store.NO)); + } + if (randomBoolean()) { + doc.add(new StringField("foo", "baz", Store.NO)); + } + doc.add(new NumericDocValuesField("rank", numDocs - i)); + w.addDocument(doc); + } + w.close(); + + final IndexReader reader = DirectoryReader.open(dir); + TestSearchContext context = new TestSearchContext(null, indexShard, newContextSearcher(reader, executor)); + context.parsedQuery(new ParsedQuery(new MatchAllDocsQuery())); + context.setSize(1); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + context.sort(new SortAndFormats(sort, new DocValueFormat[] { DocValueFormat.RAW })); + + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers(), queryPhaseSearcher); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs[0], instanceOf(FieldDoc.class)); + FieldDoc fieldDoc = (FieldDoc) context.queryResult().topDocs().topDocs.scoreDocs[0]; + assertThat(fieldDoc.fields[0], equalTo(1)); + assertProfileData(context, "MatchAllDocsQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_top_hits")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), empty()); + }); + + { + context.parsedPostFilter(new ParsedQuery(new MinDocQuery(1))); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers(), queryPhaseSearcher); + assertNull(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(numDocs - 1L)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs[0], instanceOf(FieldDoc.class)); + assertThat(fieldDoc.fields[0], anyOf(equalTo(1), equalTo(2))); + assertProfileData(context, collector -> { + assertThat(collector.getReason(), equalTo("search_post_filter")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), hasSize(1)); + assertThat(collector.getProfiledChildren().get(0).getReason(), equalTo("search_top_hits")); + assertThat(collector.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + }, (query) -> { + assertThat(query.getQueryName(), equalTo("MinDocQuery")); + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, (query) -> { + assertThat(query.getQueryName(), equalTo("MatchAllDocsQuery")); + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }); + context.parsedPostFilter(null); + } + + { + context.setSearcher(newEarlyTerminationContextSearcher(reader, 1, executor)); + context.trackTotalHitsUpTo(SearchContext.TRACK_TOTAL_HITS_DISABLED); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers(), queryPhaseSearcher); + assertNull(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs[0], instanceOf(FieldDoc.class)); + assertThat(fieldDoc.fields[0], anyOf(equalTo(1), equalTo(2))); + assertProfileData(context, "MatchAllDocsQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_top_hits")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), empty()); + }); + + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers(), queryPhaseSearcher); + assertNull(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs[0], instanceOf(FieldDoc.class)); + assertThat(fieldDoc.fields[0], anyOf(equalTo(1), equalTo(2))); + assertProfileData(context, "MatchAllDocsQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_top_hits")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), empty()); + }); + } + + reader.close(); + dir.close(); + } + + public void testIndexSortScrollOptimization() throws Exception { + Directory dir = newDirectory(); + final Sort indexSort = new Sort(new SortField("rank", SortField.Type.INT), new SortField("tiebreaker", SortField.Type.INT)); + IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(indexSort); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + final int numDocs = scaledRandomIntBetween(600, 900); + for (int i = 0; i < numDocs; ++i) { + Document doc = new Document(); + doc.add(new NumericDocValuesField("rank", random().nextInt())); + doc.add(new NumericDocValuesField("tiebreaker", i)); + w.addDocument(doc); + } + if (randomBoolean()) { + w.forceMerge(randomIntBetween(1, 10)); + } + w.close(); + + final IndexReader reader = DirectoryReader.open(dir); + List searchSortAndFormats = new ArrayList<>(); + searchSortAndFormats.add(new SortAndFormats(indexSort, new DocValueFormat[] { DocValueFormat.RAW, DocValueFormat.RAW })); + // search sort is a prefix of the index sort + searchSortAndFormats.add(new SortAndFormats(new Sort(indexSort.getSort()[0]), new DocValueFormat[] { DocValueFormat.RAW })); + for (SortAndFormats searchSortAndFormat : searchSortAndFormats) { + ScrollContext scrollContext = new ScrollContext(); + TestSearchContext context = new TestSearchContext(null, indexShard, newContextSearcher(reader, executor), scrollContext); + context.parsedQuery(new ParsedQuery(new MatchAllDocsQuery())); + scrollContext.lastEmittedDoc = null; + scrollContext.maxScore = Float.NaN; + scrollContext.totalHits = null; + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + context.setSize(10); + context.sort(searchSortAndFormat); + + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers(), queryPhaseSearcher); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); + assertNull(context.queryResult().terminatedEarly()); + assertThat(context.terminateAfter(), equalTo(0)); + assertThat(context.queryResult().getTotalHits().value, equalTo((long) numDocs)); + assertProfileData(context, "MatchAllDocsQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_top_hits")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), empty()); + }); + + int sizeMinus1 = context.queryResult().topDocs().topDocs.scoreDocs.length - 1; + FieldDoc lastDoc = (FieldDoc) context.queryResult().topDocs().topDocs.scoreDocs[sizeMinus1]; + + context.setSearcher(newEarlyTerminationContextSearcher(reader, 10, executor)); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers(), queryPhaseSearcher); + assertNull(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); + assertThat(context.terminateAfter(), equalTo(0)); + assertThat(context.queryResult().getTotalHits().value, equalTo((long) numDocs)); + assertProfileData(context, "ConstantScoreQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + + assertThat(query.getProfiledChildren(), hasSize(1)); + assertThat(query.getProfiledChildren().get(0).getQueryName(), equalTo("SearchAfterSortedDocQuery")); + assertThat(query.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_top_hits")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), empty()); + }); + FieldDoc firstDoc = (FieldDoc) context.queryResult().topDocs().topDocs.scoreDocs[0]; + for (int i = 0; i < searchSortAndFormat.sort.getSort().length; i++) { + @SuppressWarnings("unchecked") + FieldComparator comparator = (FieldComparator) searchSortAndFormat.sort.getSort()[i].getComparator(i, true); + int cmp = comparator.compareValues(firstDoc.fields[i], lastDoc.fields[i]); + if (cmp == 0) { + continue; + } + assertThat(cmp, equalTo(1)); + break; + } + } + reader.close(); + dir.close(); + } + + public void testDisableTopScoreCollection() throws Exception { + Directory dir = newDirectory(); + IndexWriterConfig iwc = newIndexWriterConfig(new StandardAnalyzer()); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + Document doc = new Document(); + final int numDocs = 2 * scaledRandomIntBetween(50, 450); + for (int i = 0; i < numDocs; i++) { + doc.clear(); + if (i % 2 == 0) { + doc.add(new TextField("title", "foo bar", Store.NO)); + } else { + doc.add(new TextField("title", "foo", Store.NO)); + } + w.addDocument(doc); + } + w.close(); + + IndexReader reader = DirectoryReader.open(dir); + TestSearchContext context = new TestSearchContext(null, indexShard, newContextSearcher(reader, executor)); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + Query q = new SpanNearQuery.Builder("title", true).addClause(new SpanTermQuery(new Term("title", "foo"))) + .addClause(new SpanTermQuery(new Term("title", "bar"))) + .build(); + + context.parsedQuery(new ParsedQuery(q)); + context.setSize(3); + context.trackTotalHitsUpTo(3); + TopDocsCollectorContext topDocsContext = TopDocsCollectorContext.createTopDocsCollectorContext(context, false); + assertEquals(topDocsContext.create(null).scoreMode(), org.apache.lucene.search.ScoreMode.COMPLETE); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers(), queryPhaseSearcher); + assertEquals(numDocs / 2, context.queryResult().topDocs().topDocs.totalHits.value); + assertEquals(context.queryResult().topDocs().topDocs.totalHits.relation, TotalHits.Relation.EQUAL_TO); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(3)); + assertProfileData(context, "SpanNearQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_top_hits")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), empty()); + }); + + context.sort(new SortAndFormats(new Sort(new SortField("other", SortField.Type.INT)), new DocValueFormat[] { DocValueFormat.RAW })); + topDocsContext = TopDocsCollectorContext.createTopDocsCollectorContext(context, false); + assertEquals(topDocsContext.create(null).scoreMode(), org.apache.lucene.search.ScoreMode.TOP_DOCS); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers(), queryPhaseSearcher); + assertEquals(numDocs / 2, context.queryResult().topDocs().topDocs.totalHits.value); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(3)); + assertEquals(context.queryResult().topDocs().topDocs.totalHits.relation, TotalHits.Relation.GREATER_THAN_OR_EQUAL_TO); + assertProfileData(context, "SpanNearQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_top_hits")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), empty()); + }); + + reader.close(); + dir.close(); + } + + public void testMinScore() throws Exception { + Directory dir = newDirectory(); + IndexWriterConfig iwc = newIndexWriterConfig(); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + for (int i = 0; i < 10; i++) { + Document doc = new Document(); + doc.add(new StringField("foo", "bar", Store.NO)); + doc.add(new StringField("filter", "f1", Store.NO)); + w.addDocument(doc); + } + w.close(); + + IndexReader reader = DirectoryReader.open(dir); + TestSearchContext context = new TestSearchContext(null, indexShard, newContextSearcher(reader, executor)); + context.parsedQuery( + new ParsedQuery( + new BooleanQuery.Builder().add(new TermQuery(new Term("foo", "bar")), Occur.MUST) + .add(new TermQuery(new Term("filter", "f1")), Occur.SHOULD) + .build() + ) + ); + context.minimumScore(0.01f); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + context.setSize(1); + context.trackTotalHitsUpTo(5); + + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers(), queryPhaseSearcher); + assertEquals(10, context.queryResult().topDocs().topDocs.totalHits.value); + assertProfileData(context, "BooleanQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(10L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + + assertThat(query.getProfiledChildren(), hasSize(2)); + assertThat(query.getProfiledChildren().get(0).getQueryName(), equalTo("TermQuery")); + assertThat(query.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + + assertThat(query.getProfiledChildren().get(1).getQueryName(), equalTo("TermQuery")); + assertThat(query.getProfiledChildren().get(1).getTime(), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_min_score")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), hasSize(1)); + assertThat(collector.getProfiledChildren().get(0).getReason(), equalTo("search_top_hits")); + assertThat(collector.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + }); + + reader.close(); + dir.close(); + } + + public void testMaxScore() throws Exception { + Directory dir = newDirectory(); + final Sort sort = new Sort(new SortField("filter", SortField.Type.STRING)); + IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(sort); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + + final int numDocs = scaledRandomIntBetween(600, 900); + for (int i = 0; i < numDocs; i++) { + Document doc = new Document(); + doc.add(new StringField("foo", "bar", Store.NO)); + doc.add(new StringField("filter", "f1" + ((i > 0) ? " " + Integer.toString(i) : ""), Store.NO)); + doc.add(new SortedDocValuesField("filter", newBytesRef("f1" + ((i > 0) ? " " + Integer.toString(i) : "")))); + w.addDocument(doc); + } + w.close(); + + IndexReader reader = DirectoryReader.open(dir); + TestSearchContext context = new TestSearchContext(null, indexShard, newContextSearcher(reader, executor)); + context.trackScores(true); + context.parsedQuery( + new ParsedQuery( + new BooleanQuery.Builder().add(new TermQuery(new Term("foo", "bar")), Occur.MUST) + .add(new TermQuery(new Term("filter", "f1")), Occur.SHOULD) + .build() + ) + ); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + context.setSize(1); + context.trackTotalHitsUpTo(5); + + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers(), queryPhaseSearcher); + assertFalse(Float.isNaN(context.queryResult().getMaxScore())); + assertEquals(1, context.queryResult().topDocs().topDocs.scoreDocs.length); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, greaterThanOrEqualTo(6L)); + assertProfileData(context, "BooleanQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), greaterThanOrEqualTo(6L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + + assertThat(query.getProfiledChildren(), hasSize(2)); + assertThat(query.getProfiledChildren().get(0).getQueryName(), equalTo("TermQuery")); + assertThat(query.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + + assertThat(query.getProfiledChildren().get(1).getQueryName(), equalTo("TermQuery")); + assertThat(query.getProfiledChildren().get(1).getTime(), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_top_hits")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), empty()); + }); + + context.sort(new SortAndFormats(sort, new DocValueFormat[] { DocValueFormat.RAW })); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers(), queryPhaseSearcher); + assertFalse(Float.isNaN(context.queryResult().getMaxScore())); + assertEquals(1, context.queryResult().topDocs().topDocs.scoreDocs.length); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, greaterThanOrEqualTo(6L)); + assertProfileData(context, "BooleanQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), greaterThanOrEqualTo(6L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + + assertThat(query.getProfiledChildren(), hasSize(2)); + assertThat(query.getProfiledChildren().get(0).getQueryName(), equalTo("TermQuery")); + assertThat(query.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + + assertThat(query.getProfiledChildren().get(1).getQueryName(), equalTo("TermQuery")); + assertThat(query.getProfiledChildren().get(1).getTime(), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_top_hits")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), empty()); + }); + + reader.close(); + dir.close(); + } + + public void testCollapseQuerySearchResults() throws Exception { + Directory dir = newDirectory(); + final Sort sort = new Sort(new SortField("user", SortField.Type.INT)); + IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(sort); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + + // Always end up with uneven buckets so collapsing is predictable + final int numDocs = 2 * scaledRandomIntBetween(600, 900) - 1; + for (int i = 0; i < numDocs; i++) { + Document doc = new Document(); + doc.add(new StringField("foo", "bar", Store.NO)); + doc.add(new NumericDocValuesField("user", i & 1)); + w.addDocument(doc); + } + w.close(); + + IndexReader reader = DirectoryReader.open(dir); + QueryShardContext queryShardContext = mock(QueryShardContext.class); + when(queryShardContext.fieldMapper("user")).thenReturn( + new NumberFieldType("user", NumberType.INTEGER, true, false, true, false, null, Collections.emptyMap()) + ); + + TestSearchContext context = new TestSearchContext(queryShardContext, indexShard, newContextSearcher(reader, executor)); + context.collapse(new CollapseBuilder("user").build(context.getQueryShardContext())); + context.trackScores(true); + context.parsedQuery(new ParsedQuery(new TermQuery(new Term("foo", "bar")))); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + context.setSize(2); + context.trackTotalHitsUpTo(5); + + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers(), queryPhaseSearcher); + assertFalse(Float.isNaN(context.queryResult().getMaxScore())); + assertEquals(2, context.queryResult().topDocs().topDocs.scoreDocs.length); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); + assertThat(context.queryResult().topDocs().topDocs, instanceOf(CollapseTopFieldDocs.class)); + + assertProfileData(context, "TermQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), greaterThanOrEqualTo(6L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + assertThat(query.getProfiledChildren(), empty()); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_top_hits")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), empty()); + }); + + context.sort(new SortAndFormats(sort, new DocValueFormat[] { DocValueFormat.RAW })); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers(), queryPhaseSearcher); + assertFalse(Float.isNaN(context.queryResult().getMaxScore())); + assertEquals(2, context.queryResult().topDocs().topDocs.scoreDocs.length); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); + assertThat(context.queryResult().topDocs().topDocs, instanceOf(CollapseTopFieldDocs.class)); + + assertProfileData(context, "TermQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), greaterThanOrEqualTo(6L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + assertThat(query.getProfiledChildren(), empty()); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_top_hits")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), empty()); + }); + + reader.close(); + dir.close(); + } + + private void assertProfileData(SearchContext context, String type, Consumer query, Consumer collector) + throws IOException { + assertProfileData(context, collector, (profileResult) -> { + assertThat(profileResult.getQueryName(), equalTo(type)); + assertThat(profileResult.getTime(), greaterThan(0L)); + query.accept(profileResult); + }); + } + + private void assertProfileData(SearchContext context, Consumer collector, Consumer query1) + throws IOException { + assertProfileData(context, Arrays.asList(query1), collector, false); + } + + private void assertProfileData( + SearchContext context, + Consumer collector, + Consumer query1, + Consumer query2 + ) throws IOException { + assertProfileData(context, Arrays.asList(query1, query2), collector, false); + } + + private final void assertProfileData( + SearchContext context, + List> queries, + Consumer collector, + boolean debug + ) throws IOException { + assertThat(context.getProfilers(), not(nullValue())); + + final ProfileShardResult result = SearchProfileShardResults.buildShardResults(context.getProfilers(), null); + if (debug) { + final SearchProfileShardResults results = new SearchProfileShardResults( + Collections.singletonMap(indexShard.shardId().toString(), result) + ); + + try (final XContentBuilder builder = JsonXContent.contentBuilder().prettyPrint()) { + builder.startObject(); + results.toXContent(builder, ToXContent.EMPTY_PARAMS); + builder.endObject(); + builder.flush(); + + final OutputStream out = builder.getOutputStream(); + assertThat(out, instanceOf(ByteArrayOutputStream.class)); + + logger.info(new String(((ByteArrayOutputStream) out).toByteArray(), StandardCharsets.UTF_8)); + } + } + + assertThat(result.getQueryProfileResults(), hasSize(1)); + + final QueryProfileShardResult queryProfileShardResult = result.getQueryProfileResults().get(0); + assertThat(queryProfileShardResult.getQueryResults(), hasSize(queries.size())); + + for (int i = 0; i < queries.size(); ++i) { + queries.get(i).accept(queryProfileShardResult.getQueryResults().get(i)); + } + + collector.accept(queryProfileShardResult.getCollectorResult()); + } + + private static ContextIndexSearcher newContextSearcher(IndexReader reader, ExecutorService executor) throws IOException { + return new ContextIndexSearcher( + reader, + IndexSearcher.getDefaultSimilarity(), + IndexSearcher.getDefaultQueryCache(), + IndexSearcher.getDefaultQueryCachingPolicy(), + true, + executor + ); + } + + private static ContextIndexSearcher newEarlyTerminationContextSearcher(IndexReader reader, int size, ExecutorService executor) + throws IOException { + return new ContextIndexSearcher( + reader, + IndexSearcher.getDefaultSimilarity(), + IndexSearcher.getDefaultQueryCache(), + IndexSearcher.getDefaultQueryCachingPolicy(), + true, + executor + ) { + + @Override + public void search(List leaves, Weight weight, Collector collector) throws IOException { + final Collector in = new AssertingEarlyTerminationFilterCollector(collector, size); + super.search(leaves, weight, in); + } + }; + } + + private static class AssertingEarlyTerminationFilterCollector extends FilterCollector { + private final int size; + + AssertingEarlyTerminationFilterCollector(Collector in, int size) { + super(in); + this.size = size; + } + + @Override + public LeafCollector getLeafCollector(LeafReaderContext context) throws IOException { + final LeafCollector in = super.getLeafCollector(context); + return new FilterLeafCollector(in) { + int collected; + + @Override + public void collect(int doc) throws IOException { + assert collected <= size : "should not collect more than " + size + " doc per segment, got " + collected; + ++collected; + super.collect(doc); + } + }; + } + } +} diff --git a/server/src/main/java/org/opensearch/common/lucene/MinimumScoreCollector.java b/server/src/main/java/org/opensearch/common/lucene/MinimumScoreCollector.java index 81c98c862d2b2..a883e111f7c95 100644 --- a/server/src/main/java/org/opensearch/common/lucene/MinimumScoreCollector.java +++ b/server/src/main/java/org/opensearch/common/lucene/MinimumScoreCollector.java @@ -55,6 +55,10 @@ public MinimumScoreCollector(Collector collector, float minimumScore) { this.minimumScore = minimumScore; } + public Collector getCollector() { + return collector; + } + @Override public void setScorer(Scorable scorer) throws IOException { if (!(scorer instanceof ScoreCachingWrappingScorer)) { diff --git a/server/src/main/java/org/opensearch/common/lucene/search/FilteredCollector.java b/server/src/main/java/org/opensearch/common/lucene/search/FilteredCollector.java index 331b67a40878f..2dcb0578fd23d 100644 --- a/server/src/main/java/org/opensearch/common/lucene/search/FilteredCollector.java +++ b/server/src/main/java/org/opensearch/common/lucene/search/FilteredCollector.java @@ -53,6 +53,10 @@ public FilteredCollector(Collector collector, Weight filter) { this.filter = filter; } + public Collector getCollector() { + return collector; + } + @Override public LeafCollector getLeafCollector(LeafReaderContext context) throws IOException { final ScorerSupplier filterScorerSupplier = filter.scorerSupplier(context); diff --git a/server/src/main/java/org/opensearch/search/DefaultSearchContext.java b/server/src/main/java/org/opensearch/search/DefaultSearchContext.java index bfe8eed05ea9b..6fd78b834344d 100644 --- a/server/src/main/java/org/opensearch/search/DefaultSearchContext.java +++ b/server/src/main/java/org/opensearch/search/DefaultSearchContext.java @@ -36,6 +36,7 @@ import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.BoostQuery; import org.apache.lucene.search.Collector; +import org.apache.lucene.search.CollectorManager; import org.apache.lucene.search.FieldDoc; import org.apache.lucene.search.MatchNoDocsQuery; import org.apache.lucene.search.Query; @@ -82,6 +83,7 @@ import org.opensearch.search.profile.Profilers; import org.opensearch.search.query.QueryPhaseExecutionException; import org.opensearch.search.query.QuerySearchResult; +import org.opensearch.search.query.ReduceableSearchResult; import org.opensearch.search.rescore.RescoreContext; import org.opensearch.search.slice.SliceBuilder; import org.opensearch.search.sort.SortAndFormats; @@ -163,7 +165,7 @@ final class DefaultSearchContext extends SearchContext { private Profilers profilers; private final Map searchExtBuilders = new HashMap<>(); - private final Map, Collector> queryCollectors = new HashMap<>(); + private final Map, CollectorManager> queryCollectorManagers = new HashMap<>(); private final QueryShardContext queryShardContext; private final FetchPhase fetchPhase; @@ -823,8 +825,8 @@ public long getRelativeTimeInMillis() { } @Override - public Map, Collector> queryCollectors() { - return queryCollectors; + public Map, CollectorManager> queryCollectorManagers() { + return queryCollectorManagers; } @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/AggregationPhase.java b/server/src/main/java/org/opensearch/search/aggregations/AggregationPhase.java index be62b33adb356..5a837a6e14c5a 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/AggregationPhase.java +++ b/server/src/main/java/org/opensearch/search/aggregations/AggregationPhase.java @@ -32,6 +32,7 @@ package org.opensearch.search.aggregations; import org.apache.lucene.search.Collector; +import org.apache.lucene.search.CollectorManager; import org.apache.lucene.search.Query; import org.opensearch.common.inject.Inject; import org.opensearch.common.lucene.search.Queries; @@ -40,9 +41,11 @@ import org.opensearch.search.profile.query.CollectorResult; import org.opensearch.search.profile.query.InternalProfileCollector; import org.opensearch.search.query.QueryPhaseExecutionException; +import org.opensearch.search.query.ReduceableSearchResult; import java.io.IOException; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.List; @@ -68,17 +71,18 @@ public void preProcess(SearchContext context) { } context.aggregations().aggregators(aggregators); if (!collectors.isEmpty()) { - Collector collector = MultiBucketCollector.wrap(collectors); - ((BucketCollector) collector).preCollection(); - if (context.getProfilers() != null) { - collector = new InternalProfileCollector( - collector, - CollectorResult.REASON_AGGREGATION, - // TODO: report on child aggs as well - Collections.emptyList() - ); - } - context.queryCollectors().put(AggregationPhase.class, collector); + final Collector collector = createCollector(context, collectors); + context.queryCollectorManagers().put(AggregationPhase.class, new CollectorManager() { + @Override + public Collector newCollector() throws IOException { + return collector; + } + + @Override + public ReduceableSearchResult reduce(Collection collectors) throws IOException { + throw new UnsupportedOperationException("The concurrent aggregation over index segments is not supported"); + } + }); } } catch (IOException e) { throw new AggregationInitializationException("Could not initialize aggregators", e); @@ -147,6 +151,20 @@ public void execute(SearchContext context) { // disable aggregations so that they don't run on next pages in case of scrolling context.aggregations(null); - context.queryCollectors().remove(AggregationPhase.class); + context.queryCollectorManagers().remove(AggregationPhase.class); + } + + private Collector createCollector(SearchContext context, List collectors) throws IOException { + Collector collector = MultiBucketCollector.wrap(collectors); + ((BucketCollector) collector).preCollection(); + if (context.getProfilers() != null) { + collector = new InternalProfileCollector( + collector, + CollectorResult.REASON_AGGREGATION, + // TODO: report on child aggs as well + Collections.emptyList() + ); + } + return collector; } } diff --git a/server/src/main/java/org/opensearch/search/internal/ContextIndexSearcher.java b/server/src/main/java/org/opensearch/search/internal/ContextIndexSearcher.java index 2cc15d4c65b96..2fb5ababe19ad 100644 --- a/server/src/main/java/org/opensearch/search/internal/ContextIndexSearcher.java +++ b/server/src/main/java/org/opensearch/search/internal/ContextIndexSearcher.java @@ -96,16 +96,6 @@ public class ContextIndexSearcher extends IndexSearcher implements Releasable { private QueryProfiler profiler; private MutableQueryTimeout cancellable; - public ContextIndexSearcher( - IndexReader reader, - Similarity similarity, - QueryCache queryCache, - QueryCachingPolicy queryCachingPolicy, - boolean wrapWithExitableDirectoryReader - ) throws IOException { - this(reader, similarity, queryCache, queryCachingPolicy, new MutableQueryTimeout(), wrapWithExitableDirectoryReader, null); - } - public ContextIndexSearcher( IndexReader reader, Similarity similarity, @@ -233,6 +223,25 @@ public void search( result.topDocs(new TopDocsAndMaxScore(mergedTopDocs, Float.NaN), formats); } + public void search( + Query query, + CollectorManager manager, + QuerySearchResult result, + DocValueFormat[] formats, + TotalHits totalHits + ) throws IOException { + TopFieldDocs mergedTopDocs = search(query, manager); + // Lucene sets shards indexes during merging of topDocs from different collectors + // We need to reset shard index; OpenSearch will set shard index later during reduce stage + for (ScoreDoc scoreDoc : mergedTopDocs.scoreDocs) { + scoreDoc.shardIndex = -1; + } + if (totalHits != null) { // we have already precalculated totalHits for the whole index + mergedTopDocs = new TopFieldDocs(totalHits, mergedTopDocs.scoreDocs, mergedTopDocs.fields); + } + result.topDocs(new TopDocsAndMaxScore(mergedTopDocs, Float.NaN), formats); + } + @Override protected void search(List leaves, Weight weight, Collector collector) throws IOException { for (LeafReaderContext ctx : leaves) { // search each subreader @@ -420,8 +429,4 @@ public void clear() { runnables.clear(); } } - - public boolean allowConcurrentSegmentSearch() { - return (getExecutor() != null); - } } diff --git a/server/src/main/java/org/opensearch/search/internal/FilteredSearchContext.java b/server/src/main/java/org/opensearch/search/internal/FilteredSearchContext.java index 6d77558ec3bd0..961d45b0011ef 100644 --- a/server/src/main/java/org/opensearch/search/internal/FilteredSearchContext.java +++ b/server/src/main/java/org/opensearch/search/internal/FilteredSearchContext.java @@ -33,6 +33,7 @@ package org.opensearch.search.internal; import org.apache.lucene.search.Collector; +import org.apache.lucene.search.CollectorManager; import org.apache.lucene.search.FieldDoc; import org.apache.lucene.search.Query; import org.opensearch.action.search.SearchShardTask; @@ -61,6 +62,7 @@ import org.opensearch.search.fetch.subphase.highlight.SearchHighlightContext; import org.opensearch.search.profile.Profilers; import org.opensearch.search.query.QuerySearchResult; +import org.opensearch.search.query.ReduceableSearchResult; import org.opensearch.search.rescore.RescoreContext; import org.opensearch.search.sort.SortAndFormats; import org.opensearch.search.suggest.SuggestionSearchContext; @@ -492,8 +494,8 @@ public Profilers getProfilers() { } @Override - public Map, Collector> queryCollectors() { - return in.queryCollectors(); + public Map, CollectorManager> queryCollectorManagers() { + return in.queryCollectorManagers(); } @Override diff --git a/server/src/main/java/org/opensearch/search/internal/SearchContext.java b/server/src/main/java/org/opensearch/search/internal/SearchContext.java index 7ff0eaed4be63..0c24fbee76335 100644 --- a/server/src/main/java/org/opensearch/search/internal/SearchContext.java +++ b/server/src/main/java/org/opensearch/search/internal/SearchContext.java @@ -32,6 +32,7 @@ package org.opensearch.search.internal; import org.apache.lucene.search.Collector; +import org.apache.lucene.search.CollectorManager; import org.apache.lucene.search.FieldDoc; import org.apache.lucene.search.Query; import org.opensearch.action.search.SearchShardTask; @@ -66,6 +67,7 @@ import org.opensearch.search.fetch.subphase.highlight.SearchHighlightContext; import org.opensearch.search.profile.Profilers; import org.opensearch.search.query.QuerySearchResult; +import org.opensearch.search.query.ReduceableSearchResult; import org.opensearch.search.rescore.RescoreContext; import org.opensearch.search.sort.SortAndFormats; import org.opensearch.search.suggest.SuggestionSearchContext; @@ -388,8 +390,8 @@ public final boolean hasOnlySuggest() { */ public abstract long getRelativeTimeInMillis(); - /** Return a view of the additional query collectors that should be run for this context. */ - public abstract Map, Collector> queryCollectors(); + /** Return a view of the additional query collector managers that should be run for this context. */ + public abstract Map, CollectorManager> queryCollectorManagers(); public abstract QueryShardContext getQueryShardContext(); diff --git a/server/src/main/java/org/opensearch/search/profile/Profilers.java b/server/src/main/java/org/opensearch/search/profile/Profilers.java index 6b9be0167b50f..3cc9b1710d420 100644 --- a/server/src/main/java/org/opensearch/search/profile/Profilers.java +++ b/server/src/main/java/org/opensearch/search/profile/Profilers.java @@ -57,7 +57,7 @@ public Profilers(ContextIndexSearcher searcher) { /** Switch to a new profile. */ public QueryProfiler addQueryProfiler() { - QueryProfiler profiler = new QueryProfiler(searcher.allowConcurrentSegmentSearch()); + QueryProfiler profiler = new QueryProfiler(searcher.getExecutor() != null); searcher.setProfiler(profiler); queryProfilers.add(profiler); return profiler; diff --git a/server/src/main/java/org/opensearch/search/profile/query/InternalProfileCollectorManager.java b/server/src/main/java/org/opensearch/search/profile/query/InternalProfileCollectorManager.java new file mode 100644 index 0000000000000..a35c22a6a2457 --- /dev/null +++ b/server/src/main/java/org/opensearch/search/profile/query/InternalProfileCollectorManager.java @@ -0,0 +1,89 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.search.profile.query; + +import org.apache.lucene.search.Collector; +import org.apache.lucene.search.CollectorManager; +import org.opensearch.search.query.EarlyTerminatingListener; +import org.opensearch.search.query.ReduceableSearchResult; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +public class InternalProfileCollectorManager + implements + ProfileCollectorManager, + EarlyTerminatingListener { + private final CollectorManager manager; + private final String reason; + private final List children; + private long time = 0; + + public InternalProfileCollectorManager( + CollectorManager manager, + String reason, + List children + ) { + this.manager = manager; + this.reason = reason; + this.children = children; + } + + @Override + public InternalProfileCollector newCollector() throws IOException { + return new InternalProfileCollector(manager.newCollector(), reason, children); + } + + @SuppressWarnings("unchecked") + @Override + public ReduceableSearchResult reduce(Collection collectors) throws IOException { + final Collection subs = new ArrayList<>(); + + for (final InternalProfileCollector collector : collectors) { + subs.add(collector.getCollector()); + time += collector.getTime(); + } + + return ((CollectorManager) manager).reduce(subs); + } + + @Override + public String getReason() { + return reason; + } + + @Override + public long getTime() { + return time; + } + + @Override + public Collection children() { + return children; + } + + @Override + public String getName() { + return manager.getClass().getSimpleName(); + } + + @Override + public CollectorResult getCollectorTree() { + return InternalProfileCollector.doGetCollectorTree(this); + } + + @Override + public void onEarlyTermination(int maxCountHits, boolean forcedTermination) { + if (manager instanceof EarlyTerminatingListener) { + ((EarlyTerminatingListener) manager).onEarlyTermination(maxCountHits, forcedTermination); + } + } +} diff --git a/server/src/main/java/org/opensearch/search/profile/query/ProfileCollectorManager.java b/server/src/main/java/org/opensearch/search/profile/query/ProfileCollectorManager.java new file mode 100644 index 0000000000000..7037988401fce --- /dev/null +++ b/server/src/main/java/org/opensearch/search/profile/query/ProfileCollectorManager.java @@ -0,0 +1,17 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.search.profile.query; + +import org.apache.lucene.search.Collector; +import org.apache.lucene.search.CollectorManager; + +/** + * Collector manager which supports profiling + */ +public interface ProfileCollectorManager extends CollectorManager, InternalProfileComponent {} diff --git a/server/src/main/java/org/opensearch/search/query/EarlyTerminatingCollector.java b/server/src/main/java/org/opensearch/search/query/EarlyTerminatingCollector.java index 3ee8430522891..56cb49835dcc4 100644 --- a/server/src/main/java/org/opensearch/search/query/EarlyTerminatingCollector.java +++ b/server/src/main/java/org/opensearch/search/query/EarlyTerminatingCollector.java @@ -95,6 +95,10 @@ public void collect(int doc) throws IOException { }; } + Collector getCollector() { + return in; + } + /** * Returns true if this collector has early terminated. */ diff --git a/server/src/main/java/org/opensearch/search/query/EarlyTerminatingCollectorManager.java b/server/src/main/java/org/opensearch/search/query/EarlyTerminatingCollectorManager.java new file mode 100644 index 0000000000000..32fbb24d16436 --- /dev/null +++ b/server/src/main/java/org/opensearch/search/query/EarlyTerminatingCollectorManager.java @@ -0,0 +1,74 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.search.query; + +import org.apache.lucene.search.Collector; +import org.apache.lucene.search.CollectorManager; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +public class EarlyTerminatingCollectorManager + implements + CollectorManager, + EarlyTerminatingListener { + + private final CollectorManager manager; + private final int maxCountHits; + private boolean forceTermination; + + EarlyTerminatingCollectorManager(CollectorManager manager, int maxCountHits, boolean forceTermination) { + this.manager = manager; + this.maxCountHits = maxCountHits; + this.forceTermination = forceTermination; + } + + @Override + public EarlyTerminatingCollector newCollector() throws IOException { + return new EarlyTerminatingCollector(manager.newCollector(), maxCountHits, false /* forced termination is not supported */); + } + + @SuppressWarnings("unchecked") + @Override + public ReduceableSearchResult reduce(Collection collectors) throws IOException { + final List innerCollectors = new ArrayList<>(collectors.size()); + + boolean didTerminateEarly = false; + for (EarlyTerminatingCollector collector : collectors) { + innerCollectors.add((C) collector.getCollector()); + if (collector.hasEarlyTerminated()) { + didTerminateEarly = true; + } + } + + if (didTerminateEarly) { + onEarlyTermination(maxCountHits, forceTermination); + + final ReduceableSearchResult result = manager.reduce(innerCollectors); + return new ReduceableSearchResult() { + @Override + public void reduce(QuerySearchResult r) throws IOException { + result.reduce(r); + r.terminatedEarly(true); + } + }; + } + + return manager.reduce(innerCollectors); + } + + @Override + public void onEarlyTermination(int maxCountHits, boolean forcedTermination) { + if (manager instanceof EarlyTerminatingListener) { + ((EarlyTerminatingListener) manager).onEarlyTermination(maxCountHits, forcedTermination); + } + } +} diff --git a/server/src/main/java/org/opensearch/search/query/EarlyTerminatingListener.java b/server/src/main/java/org/opensearch/search/query/EarlyTerminatingListener.java new file mode 100644 index 0000000000000..dd6793266a7ca --- /dev/null +++ b/server/src/main/java/org/opensearch/search/query/EarlyTerminatingListener.java @@ -0,0 +1,22 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.search.query; + +/** + * Early termination event listener. It is used during concurrent segment search + * to propagate the early termination intent. + */ +public interface EarlyTerminatingListener { + /** + * Early termination event notification + * @param maxCountHits desired maximum number of hits + * @param forcedTermination :true" if forced termination has been requested, "false" otherwise + */ + void onEarlyTermination(int maxCountHits, boolean forcedTermination); +} diff --git a/server/src/main/java/org/opensearch/search/query/FilteredCollectorManager.java b/server/src/main/java/org/opensearch/search/query/FilteredCollectorManager.java new file mode 100644 index 0000000000000..ef47cf2a388f3 --- /dev/null +++ b/server/src/main/java/org/opensearch/search/query/FilteredCollectorManager.java @@ -0,0 +1,45 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.search.query; + +import org.apache.lucene.search.Collector; +import org.apache.lucene.search.CollectorManager; +import org.apache.lucene.search.Weight; +import org.opensearch.common.lucene.search.FilteredCollector; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; + +class FilteredCollectorManager implements CollectorManager { + private final CollectorManager manager; + private final Weight filter; + + FilteredCollectorManager(CollectorManager manager, Weight filter) { + this.manager = manager; + this.filter = filter; + } + + @Override + public FilteredCollector newCollector() throws IOException { + return new FilteredCollector(manager.newCollector(), filter); + } + + @Override + @SuppressWarnings("unchecked") + public ReduceableSearchResult reduce(Collection collectors) throws IOException { + final Collection subCollectors = new ArrayList<>(); + + for (final FilteredCollector collector : collectors) { + subCollectors.add(collector.getCollector()); + } + + return ((CollectorManager) manager).reduce(subCollectors); + } +} diff --git a/server/src/main/java/org/opensearch/search/query/MinimumCollectorManager.java b/server/src/main/java/org/opensearch/search/query/MinimumCollectorManager.java new file mode 100644 index 0000000000000..22b25222b639d --- /dev/null +++ b/server/src/main/java/org/opensearch/search/query/MinimumCollectorManager.java @@ -0,0 +1,44 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.search.query; + +import org.apache.lucene.search.Collector; +import org.apache.lucene.search.CollectorManager; +import org.opensearch.common.lucene.MinimumScoreCollector; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; + +class MinimumCollectorManager implements CollectorManager { + private final CollectorManager manager; + private final float minimumScore; + + MinimumCollectorManager(CollectorManager manager, float minimumScore) { + this.manager = manager; + this.minimumScore = minimumScore; + } + + @Override + public MinimumScoreCollector newCollector() throws IOException { + return new MinimumScoreCollector(manager.newCollector(), minimumScore); + } + + @Override + @SuppressWarnings("unchecked") + public ReduceableSearchResult reduce(Collection collectors) throws IOException { + final Collection subCollectors = new ArrayList<>(); + + for (final MinimumScoreCollector collector : collectors) { + subCollectors.add(collector.getCollector()); + } + + return ((CollectorManager) manager).reduce(subCollectors); + } +} diff --git a/server/src/main/java/org/opensearch/search/query/MultiCollectorWrapper.java b/server/src/main/java/org/opensearch/search/query/MultiCollectorWrapper.java new file mode 100644 index 0000000000000..0ee423b48caeb --- /dev/null +++ b/server/src/main/java/org/opensearch/search/query/MultiCollectorWrapper.java @@ -0,0 +1,58 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.search.query; + +import org.apache.lucene.index.LeafReaderContext; +import org.apache.lucene.search.Collector; +import org.apache.lucene.search.LeafCollector; +import org.apache.lucene.search.MultiCollector; +import org.apache.lucene.search.ScoreMode; + +import java.io.IOException; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; + +/** + * Wraps MultiCollector and provide access to underlying collectors. + * Please check out https://github.com/apache/lucene/pull/455. + */ +public class MultiCollectorWrapper implements Collector { + private final MultiCollector delegate; + private final Collection collectors; + + MultiCollectorWrapper(MultiCollector delegate, Collection collectors) { + this.delegate = delegate; + this.collectors = collectors; + } + + @Override + public LeafCollector getLeafCollector(LeafReaderContext context) throws IOException { + return delegate.getLeafCollector(context); + } + + @Override + public ScoreMode scoreMode() { + return delegate.scoreMode(); + } + + public Collection getCollectors() { + return collectors; + } + + public static Collector wrap(Collector... collectors) { + final List collectorsList = Arrays.asList(collectors); + final Collector collector = MultiCollector.wrap(collectorsList); + if (collector instanceof MultiCollector) { + return new MultiCollectorWrapper((MultiCollector) collector, collectorsList); + } else { + return collector; + } + } +} diff --git a/server/src/main/java/org/opensearch/search/query/QueryCollectorContext.java b/server/src/main/java/org/opensearch/search/query/QueryCollectorContext.java index d1ff855888f0b..95ad514adf97d 100644 --- a/server/src/main/java/org/opensearch/search/query/QueryCollectorContext.java +++ b/server/src/main/java/org/opensearch/search/query/QueryCollectorContext.java @@ -33,6 +33,7 @@ package org.opensearch.search.query; import org.apache.lucene.search.Collector; +import org.apache.lucene.search.CollectorManager; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MultiCollector; import org.apache.lucene.search.Query; @@ -42,6 +43,7 @@ import org.opensearch.common.lucene.MinimumScoreCollector; import org.opensearch.common.lucene.search.FilteredCollector; import org.opensearch.search.profile.query.InternalProfileCollector; +import org.opensearch.search.profile.query.InternalProfileCollectorManager; import java.io.IOException; import java.util.ArrayList; @@ -54,7 +56,7 @@ import static org.opensearch.search.profile.query.CollectorResult.REASON_SEARCH_POST_FILTER; import static org.opensearch.search.profile.query.CollectorResult.REASON_SEARCH_TERMINATE_AFTER_COUNT; -abstract class QueryCollectorContext { +public abstract class QueryCollectorContext { private static final Collector EMPTY_COLLECTOR = new SimpleCollector() { @Override public void collect(int doc) {} @@ -77,6 +79,8 @@ public ScoreMode scoreMode() { */ abstract Collector create(Collector in) throws IOException; + abstract CollectorManager createManager(CollectorManager in) throws IOException; + /** * Wraps this collector with a profiler */ @@ -85,6 +89,18 @@ protected InternalProfileCollector createWithProfiler(InternalProfileCollector i return new InternalProfileCollector(collector, profilerName, in != null ? Collections.singletonList(in) : Collections.emptyList()); } + /** + * Wraps this collector manager with a profiler + */ + protected InternalProfileCollectorManager createWithProfiler(InternalProfileCollectorManager in) throws IOException { + final CollectorManager manager = createManager(in); + return new InternalProfileCollectorManager( + manager, + profilerName, + in != null ? Collections.singletonList(in) : Collections.emptyList() + ); + } + /** * Post-process result after search execution. * @@ -126,6 +142,11 @@ static QueryCollectorContext createMinScoreCollectorContext(float minScore) { Collector create(Collector in) { return new MinimumScoreCollector(in, minScore); } + + @Override + CollectorManager createManager(CollectorManager in) throws IOException { + return new MinimumCollectorManager(in, minScore); + } }; } @@ -139,35 +160,58 @@ Collector create(Collector in) throws IOException { final Weight filterWeight = searcher.createWeight(searcher.rewrite(query), ScoreMode.COMPLETE_NO_SCORES, 1f); return new FilteredCollector(in, filterWeight); } + + @Override + CollectorManager createManager(CollectorManager in) throws IOException { + final Weight filterWeight = searcher.createWeight(searcher.rewrite(query), ScoreMode.COMPLETE_NO_SCORES, 1f); + return new FilteredCollectorManager(in, filterWeight); + } }; } /** - * Creates a multi collector from the provided subs + * Creates a multi collector manager from the provided subs */ - static QueryCollectorContext createMultiCollectorContext(Collection subs) { + static QueryCollectorContext createMultiCollectorContext( + Collection> subs + ) { return new QueryCollectorContext(REASON_SEARCH_MULTI) { @Override - Collector create(Collector in) { + Collector create(Collector in) throws IOException { List subCollectors = new ArrayList<>(); subCollectors.add(in); - subCollectors.addAll(subs); + for (CollectorManager manager : subs) { + subCollectors.add(manager.newCollector()); + } return MultiCollector.wrap(subCollectors); } @Override - protected InternalProfileCollector createWithProfiler(InternalProfileCollector in) { + protected InternalProfileCollector createWithProfiler(InternalProfileCollector in) throws IOException { final List subCollectors = new ArrayList<>(); subCollectors.add(in); - if (subs.stream().anyMatch((col) -> col instanceof InternalProfileCollector == false)) { - throw new IllegalArgumentException("non-profiling collector"); - } - for (Collector collector : subs) { + + for (CollectorManager manager : subs) { + final Collector collector = manager.newCollector(); + if (!(collector instanceof InternalProfileCollector)) { + throw new IllegalArgumentException("non-profiling collector"); + } subCollectors.add((InternalProfileCollector) collector); } + final Collector collector = MultiCollector.wrap(subCollectors); return new InternalProfileCollector(collector, REASON_SEARCH_MULTI, subCollectors); } + + @Override + CollectorManager createManager( + CollectorManager in + ) throws IOException { + final List> managers = new ArrayList<>(); + managers.add(in); + managers.addAll(subs); + return QueryCollectorManagerContext.createOpaqueCollectorManager(managers); + } }; } @@ -192,6 +236,13 @@ Collector create(Collector in) { this.collector = MultiCollector.wrap(subCollectors); return collector; } + + @Override + CollectorManager createManager( + CollectorManager in + ) throws IOException { + return new EarlyTerminatingCollectorManager<>(in, numHits, true); + } }; } } diff --git a/server/src/main/java/org/opensearch/search/query/QueryCollectorManagerContext.java b/server/src/main/java/org/opensearch/search/query/QueryCollectorManagerContext.java new file mode 100644 index 0000000000000..c98f4884bb030 --- /dev/null +++ b/server/src/main/java/org/opensearch/search/query/QueryCollectorManagerContext.java @@ -0,0 +1,99 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.search.query; + +import org.apache.lucene.search.Collector; +import org.apache.lucene.search.CollectorManager; +import org.apache.lucene.search.MultiCollectorManager; +import org.opensearch.search.profile.query.InternalProfileCollectorManager; +import org.opensearch.search.profile.query.ProfileCollectorManager; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +public abstract class QueryCollectorManagerContext { + private static class QueryCollectorManager implements CollectorManager { + private final MultiCollectorManager manager; + + private QueryCollectorManager(Collection> managers) { + this.manager = new MultiCollectorManager(managers.toArray(new CollectorManager[0])); + } + + @Override + public Collector newCollector() throws IOException { + return manager.newCollector(); + } + + @Override + public ReduceableSearchResult reduce(Collection collectors) throws IOException { + final Object[] results = manager.reduce(collectors); + + final ReduceableSearchResult[] transformed = new ReduceableSearchResult[results.length]; + for (int i = 0; i < results.length; ++i) { + assert results[i] instanceof ReduceableSearchResult; + transformed[i] = (ReduceableSearchResult) results[i]; + } + + return reduceWith(transformed); + } + + protected ReduceableSearchResult reduceWith(final ReduceableSearchResult[] results) { + return (QuerySearchResult result) -> { + for (final ReduceableSearchResult r : results) { + r.reduce(result); + } + }; + } + } + + private static class OpaqueQueryCollectorManager extends QueryCollectorManager { + private OpaqueQueryCollectorManager(Collection> managers) { + super(managers); + } + + @Override + protected ReduceableSearchResult reduceWith(final ReduceableSearchResult[] results) { + return (QuerySearchResult result) -> {}; + } + } + + public static CollectorManager createOpaqueCollectorManager( + List> managers + ) throws IOException { + return new OpaqueQueryCollectorManager(managers); + } + + public static CollectorManager createMultiCollectorManager( + List collectors + ) throws IOException { + final Collection> managers = new ArrayList<>(); + + CollectorManager manager = null; + for (QueryCollectorContext ctx : collectors) { + manager = ctx.createManager(manager); + managers.add(manager); + } + + return new QueryCollectorManager(managers); + } + + public static ProfileCollectorManager createQueryCollectorManagerWithProfiler( + List collectors + ) throws IOException { + InternalProfileCollectorManager manager = null; + + for (QueryCollectorContext ctx : collectors) { + manager = ctx.createWithProfiler(manager); + } + + return manager; + } +} diff --git a/server/src/main/java/org/opensearch/search/query/QueryPhase.java b/server/src/main/java/org/opensearch/search/query/QueryPhase.java index 3edbc16cd613f..1501067ec7983 100644 --- a/server/src/main/java/org/opensearch/search/query/QueryPhase.java +++ b/server/src/main/java/org/opensearch/search/query/QueryPhase.java @@ -238,9 +238,9 @@ static boolean executeInternal(SearchContext searchContext, QueryPhaseSearcher q // this collector can filter documents during the collection hasFilterCollector = true; } - if (searchContext.queryCollectors().isEmpty() == false) { + if (searchContext.queryCollectorManagers().isEmpty() == false) { // plug in additional collectors, like aggregations - collectors.add(createMultiCollectorContext(searchContext.queryCollectors().values())); + collectors.add(createMultiCollectorContext(searchContext.queryCollectorManagers().values())); } if (searchContext.minimumScore() != null) { // apply the minimum score after multi collector so we filter aggs as well diff --git a/server/src/main/java/org/opensearch/search/query/ReduceableSearchResult.java b/server/src/main/java/org/opensearch/search/query/ReduceableSearchResult.java new file mode 100644 index 0000000000000..48e8d7198ea3b --- /dev/null +++ b/server/src/main/java/org/opensearch/search/query/ReduceableSearchResult.java @@ -0,0 +1,23 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.search.query; + +import java.io.IOException; + +/** + * The search result callback returned by reduce phase of the collector manager. + */ +public interface ReduceableSearchResult { + /** + * Apply the reduce operation to the query search results + * @param result query search results + * @throws IOException exception if reduce operation failed + */ + void reduce(QuerySearchResult result) throws IOException; +} diff --git a/server/src/main/java/org/opensearch/search/query/TopDocsCollectorContext.java b/server/src/main/java/org/opensearch/search/query/TopDocsCollectorContext.java index 9cf7dca3c4caf..5f19462a2c33a 100644 --- a/server/src/main/java/org/opensearch/search/query/TopDocsCollectorContext.java +++ b/server/src/main/java/org/opensearch/search/query/TopDocsCollectorContext.java @@ -44,6 +44,7 @@ import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BoostQuery; import org.apache.lucene.search.Collector; +import org.apache.lucene.search.CollectorManager; import org.apache.lucene.search.ConstantScoreQuery; import org.apache.lucene.search.DocValuesFieldExistsQuery; import org.apache.lucene.search.FieldDoc; @@ -80,6 +81,9 @@ import org.opensearch.search.sort.SortAndFormats; import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; import java.util.Objects; import java.util.function.Supplier; @@ -89,7 +93,7 @@ /** * A {@link QueryCollectorContext} that creates top docs collector */ -abstract class TopDocsCollectorContext extends QueryCollectorContext { +public abstract class TopDocsCollectorContext extends QueryCollectorContext { protected final int numHits; TopDocsCollectorContext(String profilerName, int numHits) { @@ -107,7 +111,7 @@ final int numHits() { /** * Returns true if the top docs should be re-scored after initial search */ - boolean shouldRescore() { + public boolean shouldRescore() { return false; } @@ -115,6 +119,8 @@ static class EmptyTopDocsCollectorContext extends TopDocsCollectorContext { private final Sort sort; private final Collector collector; private final Supplier hitCountSupplier; + private final int trackTotalHitsUpTo; + private final int hitCount; /** * Ctr @@ -132,16 +138,18 @@ private EmptyTopDocsCollectorContext( ) throws IOException { super(REASON_SEARCH_COUNT, 0); this.sort = sortAndFormats == null ? null : sortAndFormats.sort; - if (trackTotalHitsUpTo == SearchContext.TRACK_TOTAL_HITS_DISABLED) { + this.trackTotalHitsUpTo = trackTotalHitsUpTo; + if (this.trackTotalHitsUpTo == SearchContext.TRACK_TOTAL_HITS_DISABLED) { this.collector = new EarlyTerminatingCollector(new TotalHitCountCollector(), 0, false); // for bwc hit count is set to 0, it will be converted to -1 by the coordinating node this.hitCountSupplier = () -> new TotalHits(0, TotalHits.Relation.GREATER_THAN_OR_EQUAL_TO); + this.hitCount = Integer.MIN_VALUE; } else { TotalHitCountCollector hitCountCollector = new TotalHitCountCollector(); // implicit total hit counts are valid only when there is no filter collector in the chain - int hitCount = hasFilterCollector ? -1 : shortcutTotalHitCount(reader, query); - if (hitCount == -1) { - if (trackTotalHitsUpTo == SearchContext.TRACK_TOTAL_HITS_ACCURATE) { + this.hitCount = hasFilterCollector ? -1 : shortcutTotalHitCount(reader, query); + if (this.hitCount == -1) { + if (this.trackTotalHitsUpTo == SearchContext.TRACK_TOTAL_HITS_ACCURATE) { this.collector = hitCountCollector; this.hitCountSupplier = () -> new TotalHits(hitCountCollector.getTotalHits(), TotalHits.Relation.EQUAL_TO); } else { @@ -159,6 +167,39 @@ private EmptyTopDocsCollectorContext( } } + @Override + CollectorManager createManager(CollectorManager in) throws IOException { + assert in == null; + + CollectorManager manager = null; + + if (trackTotalHitsUpTo == SearchContext.TRACK_TOTAL_HITS_DISABLED) { + manager = new EarlyTerminatingCollectorManager<>( + new TotalHitCountCollectorManager.Empty(new TotalHits(0, TotalHits.Relation.GREATER_THAN_OR_EQUAL_TO), sort), + 0, + false + ); + } else { + if (hitCount == -1) { + if (trackTotalHitsUpTo != SearchContext.TRACK_TOTAL_HITS_ACCURATE) { + manager = new EarlyTerminatingCollectorManager<>( + new TotalHitCountCollectorManager(sort), + trackTotalHitsUpTo, + false + ); + } + } else { + manager = new EarlyTerminatingCollectorManager<>( + new TotalHitCountCollectorManager.Empty(new TotalHits(hitCount, TotalHits.Relation.EQUAL_TO), sort), + 0, + false + ); + } + } + + return manager; + } + @Override Collector create(Collector in) { assert in == null; @@ -181,7 +222,11 @@ void postProcess(QuerySearchResult result) { static class CollapsingTopDocsCollectorContext extends TopDocsCollectorContext { private final DocValueFormat[] sortFmt; private final CollapsingTopDocsCollector topDocsCollector; + private final Collector collector; private final Supplier maxScoreSupplier; + private final CollapseContext collapseContext; + private final boolean trackMaxScore; + private final Sort sort; /** * Ctr @@ -199,30 +244,94 @@ private CollapsingTopDocsCollectorContext( super(REASON_SEARCH_TOP_HITS, numHits); assert numHits > 0; assert collapseContext != null; - Sort sort = sortAndFormats == null ? Sort.RELEVANCE : sortAndFormats.sort; + this.sort = sortAndFormats == null ? Sort.RELEVANCE : sortAndFormats.sort; this.sortFmt = sortAndFormats == null ? new DocValueFormat[] { DocValueFormat.RAW } : sortAndFormats.formats; + this.collapseContext = collapseContext; this.topDocsCollector = collapseContext.createTopDocs(sort, numHits); + this.trackMaxScore = trackMaxScore; - MaxScoreCollector maxScoreCollector; + MaxScoreCollector maxScoreCollector = null; if (trackMaxScore) { maxScoreCollector = new MaxScoreCollector(); maxScoreSupplier = maxScoreCollector::getMaxScore; } else { + maxScoreCollector = null; maxScoreSupplier = () -> Float.NaN; } + + this.collector = MultiCollector.wrap(topDocsCollector, maxScoreCollector); } @Override Collector create(Collector in) throws IOException { assert in == null; - return topDocsCollector; + return collector; } @Override void postProcess(QuerySearchResult result) throws IOException { - CollapseTopFieldDocs topDocs = topDocsCollector.getTopDocs(); + final CollapseTopFieldDocs topDocs = topDocsCollector.getTopDocs(); result.topDocs(new TopDocsAndMaxScore(topDocs, maxScoreSupplier.get()), sortFmt); } + + @Override + CollectorManager createManager(CollectorManager in) throws IOException { + return new CollectorManager() { + @Override + public Collector newCollector() throws IOException { + MaxScoreCollector maxScoreCollector = null; + + if (trackMaxScore) { + maxScoreCollector = new MaxScoreCollector(); + } + + return MultiCollectorWrapper.wrap(collapseContext.createTopDocs(sort, numHits), maxScoreCollector); + } + + @Override + public ReduceableSearchResult reduce(Collection collectors) throws IOException { + final Collection subs = new ArrayList<>(); + for (final Collector collector : collectors) { + if (collector instanceof MultiCollectorWrapper) { + subs.addAll(((MultiCollectorWrapper) collector).getCollectors()); + } else { + subs.add(collector); + } + } + + final Collection topFieldDocs = new ArrayList(); + float maxScore = Float.NaN; + + for (final Collector collector : subs) { + if (collector instanceof CollapsingTopDocsCollector) { + topFieldDocs.add(((CollapsingTopDocsCollector) collector).getTopDocs()); + } else if (collector instanceof MaxScoreCollector) { + float score = ((MaxScoreCollector) collector).getMaxScore(); + if (Float.isNaN(maxScore)) { + maxScore = score; + } else { + maxScore = Math.max(maxScore, score); + } + } + } + + return reduceWith(topFieldDocs, maxScore); + } + }; + } + + protected ReduceableSearchResult reduceWith(final Collection topFieldDocs, float maxScore) { + return (QuerySearchResult result) -> { + final CollapseTopFieldDocs topDocs = CollapseTopFieldDocs.merge( + sort, + 0, + numHits, + topFieldDocs.toArray(new CollapseTopFieldDocs[0]), + true + ); + result.topDocs(new TopDocsAndMaxScore(topDocs, maxScore), sortFmt); + }; + } } abstract static class SimpleTopDocsCollectorContext extends TopDocsCollectorContext { @@ -240,11 +349,38 @@ private static TopDocsCollector createCollector( } } + private static CollectorManager, ? extends TopDocs> createCollectorManager( + @Nullable SortAndFormats sortAndFormats, + int numHits, + @Nullable ScoreDoc searchAfter, + int hitCountThreshold + ) { + if (sortAndFormats == null) { + // See please https://github.com/apache/lucene/pull/450, should be fixed in 9.x + if (searchAfter != null) { + return TopScoreDocCollector.createSharedManager( + numHits, + new FieldDoc(searchAfter.doc, searchAfter.score), + hitCountThreshold + ); + } else { + return TopScoreDocCollector.createSharedManager(numHits, null, hitCountThreshold); + } + } else { + return TopFieldCollector.createSharedManager(sortAndFormats.sort, numHits, (FieldDoc) searchAfter, hitCountThreshold); + } + } + protected final @Nullable SortAndFormats sortAndFormats; private final Collector collector; private final Supplier totalHitsSupplier; private final Supplier topDocsSupplier; private final Supplier maxScoreSupplier; + private final ScoreDoc searchAfter; + private final int trackTotalHitsUpTo; + private final boolean trackMaxScore; + private final boolean hasInfMaxScore; + private final int hitCount; /** * Ctr @@ -269,24 +405,30 @@ private SimpleTopDocsCollectorContext( ) throws IOException { super(REASON_SEARCH_TOP_HITS, numHits); this.sortAndFormats = sortAndFormats; + this.searchAfter = searchAfter; + this.trackTotalHitsUpTo = trackTotalHitsUpTo; + this.trackMaxScore = trackMaxScore; + this.hasInfMaxScore = hasInfMaxScore(query); final TopDocsCollector topDocsCollector; - if ((sortAndFormats == null || SortField.FIELD_SCORE.equals(sortAndFormats.sort.getSort()[0])) && hasInfMaxScore(query)) { + if ((sortAndFormats == null || SortField.FIELD_SCORE.equals(sortAndFormats.sort.getSort()[0])) && hasInfMaxScore) { // disable max score optimization since we have a mandatory clause // that doesn't track the maximum score topDocsCollector = createCollector(sortAndFormats, numHits, searchAfter, Integer.MAX_VALUE); topDocsSupplier = new CachedSupplier<>(topDocsCollector::topDocs); totalHitsSupplier = () -> topDocsSupplier.get().totalHits; + hitCount = Integer.MIN_VALUE; } else if (trackTotalHitsUpTo == SearchContext.TRACK_TOTAL_HITS_DISABLED) { // don't compute hit counts via the collector topDocsCollector = createCollector(sortAndFormats, numHits, searchAfter, 1); topDocsSupplier = new CachedSupplier<>(topDocsCollector::topDocs); totalHitsSupplier = () -> new TotalHits(0, TotalHits.Relation.GREATER_THAN_OR_EQUAL_TO); + hitCount = -1; } else { // implicit total hit counts are valid only when there is no filter collector in the chain - final int hitCount = hasFilterCollector ? -1 : shortcutTotalHitCount(reader, query); - if (hitCount == -1) { + this.hitCount = hasFilterCollector ? -1 : shortcutTotalHitCount(reader, query); + if (this.hitCount == -1) { topDocsCollector = createCollector(sortAndFormats, numHits, searchAfter, trackTotalHitsUpTo); topDocsSupplier = new CachedSupplier<>(topDocsCollector::topDocs); totalHitsSupplier = () -> topDocsSupplier.get().totalHits; @@ -294,7 +436,7 @@ private SimpleTopDocsCollectorContext( // don't compute hit counts via the collector topDocsCollector = createCollector(sortAndFormats, numHits, searchAfter, 1); topDocsSupplier = new CachedSupplier<>(topDocsCollector::topDocs); - totalHitsSupplier = () -> new TotalHits(hitCount, TotalHits.Relation.EQUAL_TO); + totalHitsSupplier = () -> new TotalHits(this.hitCount, TotalHits.Relation.EQUAL_TO); } } MaxScoreCollector maxScoreCollector = null; @@ -315,7 +457,98 @@ private SimpleTopDocsCollectorContext( } this.collector = MultiCollector.wrap(topDocsCollector, maxScoreCollector); + } + + private class SimpleTopDocsCollectorManager + implements + CollectorManager, + EarlyTerminatingListener { + private Integer terminatedAfter; + private final CollectorManager, ? extends TopDocs> manager; + + private SimpleTopDocsCollectorManager() { + if ((sortAndFormats == null || SortField.FIELD_SCORE.equals(sortAndFormats.sort.getSort()[0])) && hasInfMaxScore) { + // disable max score optimization since we have a mandatory clause + // that doesn't track the maximum score + manager = createCollectorManager(sortAndFormats, numHits, searchAfter, Integer.MAX_VALUE); + } else if (trackTotalHitsUpTo == SearchContext.TRACK_TOTAL_HITS_DISABLED) { + // don't compute hit counts via the collector + manager = createCollectorManager(sortAndFormats, numHits, searchAfter, 1); + } else { + // implicit total hit counts are valid only when there is no filter collector in the chain + if (hitCount == -1) { + manager = createCollectorManager(sortAndFormats, numHits, searchAfter, trackTotalHitsUpTo); + } else { + // don't compute hit counts via the collector + manager = createCollectorManager(sortAndFormats, numHits, searchAfter, 1); + } + } + } + + @Override + public void onEarlyTermination(int maxCountHits, boolean forcedTermination) { + terminatedAfter = maxCountHits; + } + + @Override + public Collector newCollector() throws IOException { + MaxScoreCollector maxScoreCollector = null; + + if (sortAndFormats != null && trackMaxScore) { + maxScoreCollector = new MaxScoreCollector(); + } + + return MultiCollectorWrapper.wrap(manager.newCollector(), maxScoreCollector); + } + + @SuppressWarnings("unchecked") + @Override + public ReduceableSearchResult reduce(Collection collectors) throws IOException { + final Collection> topDocsCollectors = new ArrayList<>(); + final Collection maxScoreCollectors = new ArrayList<>(); + + for (final Collector collector : collectors) { + if (collector instanceof MultiCollectorWrapper) { + for (final Collector sub : (((MultiCollectorWrapper) collector).getCollectors())) { + if (sub instanceof TopDocsCollector) { + topDocsCollectors.add((TopDocsCollector) sub); + } else if (sub instanceof MaxScoreCollector) { + maxScoreCollectors.add((MaxScoreCollector) sub); + } + } + } else if (collector instanceof TopDocsCollector) { + topDocsCollectors.add((TopDocsCollector) collector); + } else if (collector instanceof MaxScoreCollector) { + maxScoreCollectors.add((MaxScoreCollector) collector); + } + } + + float maxScore = Float.NaN; + for (final MaxScoreCollector collector : maxScoreCollectors) { + float score = collector.getMaxScore(); + if (Float.isNaN(maxScore)) { + maxScore = score; + } else { + maxScore = Math.max(maxScore, score); + } + } + final TopDocs topDocs = ((CollectorManager, ? extends TopDocs>) manager).reduce(topDocsCollectors); + return reduceWith(topDocs, maxScore, terminatedAfter); + } + } + + @Override + CollectorManager createManager(CollectorManager in) throws IOException { + assert in == null; + return new SimpleTopDocsCollectorManager(); + } + + protected ReduceableSearchResult reduceWith(final TopDocs topDocs, final float maxScore, final Integer terminatedAfter) { + return (QuerySearchResult result) -> { + final TopDocsAndMaxScore topDocsAndMaxScore = newTopDocs(topDocs, maxScore, terminatedAfter); + result.topDocs(topDocsAndMaxScore, sortAndFormats == null ? null : sortAndFormats.formats); + }; } @Override @@ -324,6 +557,50 @@ Collector create(Collector in) { return collector; } + TopDocsAndMaxScore newTopDocs(final TopDocs topDocs, final float maxScore, final Integer terminatedAfter) { + TotalHits totalHits = null; + + if ((sortAndFormats == null || SortField.FIELD_SCORE.equals(sortAndFormats.sort.getSort()[0])) && hasInfMaxScore) { + totalHits = topDocs.totalHits; + } else if (trackTotalHitsUpTo == SearchContext.TRACK_TOTAL_HITS_DISABLED) { + // don't compute hit counts via the collector + totalHits = new TotalHits(0, TotalHits.Relation.GREATER_THAN_OR_EQUAL_TO); + } else { + if (hitCount == -1) { + totalHits = topDocs.totalHits; + } else { + totalHits = new TotalHits(hitCount, TotalHits.Relation.EQUAL_TO); + } + } + + // Since we cannot support early forced termination, we have to simulate it by + // artificially reducing the number of total hits and doc scores. + ScoreDoc[] scoreDocs = topDocs.scoreDocs; + if (terminatedAfter != null) { + if (totalHits.value > terminatedAfter) { + totalHits = new TotalHits(terminatedAfter, TotalHits.Relation.GREATER_THAN_OR_EQUAL_TO); + } + + if (scoreDocs != null && scoreDocs.length > terminatedAfter) { + scoreDocs = Arrays.copyOf(scoreDocs, terminatedAfter); + } + } + + final TopDocs newTopDocs; + if (topDocs instanceof TopFieldDocs) { + TopFieldDocs fieldDocs = (TopFieldDocs) topDocs; + newTopDocs = new TopFieldDocs(totalHits, scoreDocs, fieldDocs.fields); + } else { + newTopDocs = new TopDocs(totalHits, scoreDocs); + } + + if (Float.isNaN(maxScore) && newTopDocs.scoreDocs.length > 0 && sortAndFormats == null) { + return new TopDocsAndMaxScore(newTopDocs, newTopDocs.scoreDocs[0].score); + } else { + return new TopDocsAndMaxScore(newTopDocs, maxScore); + } + } + TopDocsAndMaxScore newTopDocs() { TopDocs in = topDocsSupplier.get(); float maxScore = maxScoreSupplier.get(); @@ -373,6 +650,35 @@ private ScrollingTopDocsCollectorContext( this.numberOfShards = numberOfShards; } + @Override + protected ReduceableSearchResult reduceWith(final TopDocs topDocs, final float maxScore, final Integer terminatedAfter) { + return (QuerySearchResult result) -> { + final TopDocsAndMaxScore topDocsAndMaxScore = newTopDocs(topDocs, maxScore, terminatedAfter); + + if (scrollContext.totalHits == null) { + // first round + scrollContext.totalHits = topDocsAndMaxScore.topDocs.totalHits; + scrollContext.maxScore = topDocsAndMaxScore.maxScore; + } else { + // subsequent round: the total number of hits and + // the maximum score were computed on the first round + topDocsAndMaxScore.topDocs.totalHits = scrollContext.totalHits; + topDocsAndMaxScore.maxScore = scrollContext.maxScore; + } + + if (numberOfShards == 1) { + // if we fetch the document in the same roundtrip, we already know the last emitted doc + if (topDocsAndMaxScore.topDocs.scoreDocs.length > 0) { + // set the last emitted doc + scrollContext.lastEmittedDoc = topDocsAndMaxScore.topDocs.scoreDocs[topDocsAndMaxScore.topDocs.scoreDocs.length + - 1]; + } + } + + result.topDocs(topDocsAndMaxScore, sortAndFormats == null ? null : sortAndFormats.formats); + }; + } + @Override void postProcess(QuerySearchResult result) throws IOException { final TopDocsAndMaxScore topDocs = newTopDocs(); @@ -457,7 +763,7 @@ static int shortcutTotalHitCount(IndexReader reader, Query query) throws IOExcep * Creates a {@link TopDocsCollectorContext} from the provided searchContext. * @param hasFilterCollector True if the collector chain contains at least one collector that can filters document. */ - static TopDocsCollectorContext createTopDocsCollectorContext(SearchContext searchContext, boolean hasFilterCollector) + public static TopDocsCollectorContext createTopDocsCollectorContext(SearchContext searchContext, boolean hasFilterCollector) throws IOException { final IndexReader reader = searchContext.searcher().getIndexReader(); final Query query = searchContext.query(); @@ -515,7 +821,7 @@ static TopDocsCollectorContext createTopDocsCollectorContext(SearchContext searc hasFilterCollector ) { @Override - boolean shouldRescore() { + public boolean shouldRescore() { return rescore; } }; diff --git a/server/src/main/java/org/opensearch/search/query/TotalHitCountCollectorManager.java b/server/src/main/java/org/opensearch/search/query/TotalHitCountCollectorManager.java new file mode 100644 index 0000000000000..6d4159c977743 --- /dev/null +++ b/server/src/main/java/org/opensearch/search/query/TotalHitCountCollectorManager.java @@ -0,0 +1,106 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.search.query; + +import org.apache.lucene.search.CollectorManager; +import org.apache.lucene.search.ScoreMode; +import org.apache.lucene.search.Sort; +import org.apache.lucene.search.TopDocs; +import org.apache.lucene.search.TopFieldDocs; +import org.apache.lucene.search.TotalHitCountCollector; +import org.apache.lucene.search.TotalHits; +import org.opensearch.common.lucene.Lucene; +import org.opensearch.common.lucene.search.TopDocsAndMaxScore; + +import java.io.IOException; +import java.util.Collection; + +public class TotalHitCountCollectorManager + implements + CollectorManager, + EarlyTerminatingListener { + + private static final TotalHitCountCollector EMPTY_COLLECTOR = new TotalHitCountCollector() { + @Override + public void collect(int doc) {} + + @Override + public ScoreMode scoreMode() { + return ScoreMode.COMPLETE_NO_SCORES; + } + }; + + private final Sort sort; + private Integer terminatedAfter; + + public TotalHitCountCollectorManager(final Sort sort) { + this.sort = sort; + } + + @Override + public void onEarlyTermination(int maxCountHits, boolean forcedTermination) { + terminatedAfter = maxCountHits; + } + + @Override + public TotalHitCountCollector newCollector() throws IOException { + return new TotalHitCountCollector(); + } + + @Override + public ReduceableSearchResult reduce(Collection collectors) throws IOException { + return (QuerySearchResult result) -> { + final TotalHits.Relation relation = (terminatedAfter != null) + ? TotalHits.Relation.GREATER_THAN_OR_EQUAL_TO + : TotalHits.Relation.EQUAL_TO; + + int totalHits = collectors.stream().mapToInt(TotalHitCountCollector::getTotalHits).sum(); + if (terminatedAfter != null && totalHits > terminatedAfter) { + totalHits = terminatedAfter; + } + + final TotalHits totalHitCount = new TotalHits(totalHits, relation); + final TopDocs topDocs = (sort != null) + ? new TopFieldDocs(totalHitCount, Lucene.EMPTY_SCORE_DOCS, sort.getSort()) + : new TopDocs(totalHitCount, Lucene.EMPTY_SCORE_DOCS); + + result.topDocs(new TopDocsAndMaxScore(topDocs, Float.NaN), null); + }; + } + + static class Empty implements CollectorManager { + private final TotalHits totalHits; + private final Sort sort; + + Empty(final TotalHits totalHits, final Sort sort) { + this.totalHits = totalHits; + this.sort = sort; + } + + @Override + public TotalHitCountCollector newCollector() throws IOException { + return EMPTY_COLLECTOR; + } + + @Override + public ReduceableSearchResult reduce(Collection collectors) throws IOException { + return (QuerySearchResult result) -> { + final TopDocs topDocs; + + if (sort != null) { + topDocs = new TopFieldDocs(totalHits, Lucene.EMPTY_SCORE_DOCS, sort.getSort()); + } else { + topDocs = new TopDocs(totalHits, Lucene.EMPTY_SCORE_DOCS); + } + + result.topDocs(new TopDocsAndMaxScore(topDocs, Float.NaN), null); + }; + } + } +} diff --git a/server/src/test/java/org/opensearch/search/DefaultSearchContextTests.java b/server/src/test/java/org/opensearch/search/DefaultSearchContextTests.java index e1cf74bdd6aeb..f6ca12f1c514c 100644 --- a/server/src/test/java/org/opensearch/search/DefaultSearchContextTests.java +++ b/server/src/test/java/org/opensearch/search/DefaultSearchContextTests.java @@ -32,6 +32,8 @@ package org.opensearch.search; +import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; + import org.apache.lucene.index.IndexReader; import org.apache.lucene.tests.index.RandomIndexWriter; import org.apache.lucene.search.IndexSearcher; @@ -76,7 +78,12 @@ import org.opensearch.threadpool.ThreadPool; import java.io.IOException; +import java.util.Arrays; +import java.util.Collection; import java.util.UUID; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; import java.util.function.Function; import java.util.function.Supplier; @@ -91,6 +98,25 @@ import static org.mockito.Mockito.when; public class DefaultSearchContextTests extends OpenSearchTestCase { + private final ExecutorService executor; + + @ParametersFactory + public static Collection concurrency() { + return Arrays.asList(new Integer[] { 0 }, new Integer[] { 5 }); + } + + public DefaultSearchContextTests(int concurrency) { + this.executor = (concurrency > 0) ? Executors.newFixedThreadPool(concurrency) : null; + } + + @Override + public void tearDown() throws Exception { + super.tearDown(); + + if (executor != null) { + ThreadPool.terminate(executor, 10, TimeUnit.SECONDS); + } + } public void testPreProcess() throws Exception { TimeValue timeout = new TimeValue(randomIntBetween(1, 100)); @@ -183,7 +209,7 @@ protected Engine.Searcher acquireSearcherInternal(String source) { false, Version.CURRENT, false, - null + executor ); contextWithoutScroll.from(300); contextWithoutScroll.close(); @@ -225,7 +251,7 @@ protected Engine.Searcher acquireSearcherInternal(String source) { false, Version.CURRENT, false, - null + executor ); context1.from(300); exception = expectThrows(IllegalArgumentException.class, () -> context1.preProcess(false)); @@ -295,7 +321,7 @@ protected Engine.Searcher acquireSearcherInternal(String source) { false, Version.CURRENT, false, - null + executor ); SliceBuilder sliceBuilder = mock(SliceBuilder.class); @@ -334,7 +360,7 @@ protected Engine.Searcher acquireSearcherInternal(String source) { false, Version.CURRENT, false, - null + executor ); ParsedQuery parsedQuery = ParsedQuery.parsedMatchAllQuery(); context3.sliceBuilder(null).parsedQuery(parsedQuery).preProcess(false); @@ -365,7 +391,7 @@ protected Engine.Searcher acquireSearcherInternal(String source) { false, Version.CURRENT, false, - null + executor ); context4.sliceBuilder(new SliceBuilder(1, 2)).parsedQuery(parsedQuery).preProcess(false); Query query1 = context4.query(); @@ -446,7 +472,7 @@ protected Engine.Searcher acquireSearcherInternal(String source) { false, Version.CURRENT, false, - null + executor ); assertThat(context.searcher().hasCancellations(), is(false)); context.searcher().addQueryCancellation(() -> {}); diff --git a/server/src/test/java/org/opensearch/search/SearchCancellationTests.java b/server/src/test/java/org/opensearch/search/SearchCancellationTests.java index 1927558f94094..f479f3a1b99f1 100644 --- a/server/src/test/java/org/opensearch/search/SearchCancellationTests.java +++ b/server/src/test/java/org/opensearch/search/SearchCancellationTests.java @@ -108,7 +108,8 @@ public void testAddingCancellationActions() throws IOException { IndexSearcher.getDefaultSimilarity(), IndexSearcher.getDefaultQueryCache(), IndexSearcher.getDefaultQueryCachingPolicy(), - true + true, + null ); NullPointerException npe = expectThrows(NullPointerException.class, () -> searcher.addQueryCancellation(null)); assertEquals("cancellation runnable should not be null", npe.getMessage()); @@ -127,7 +128,8 @@ public void testCancellableCollector() throws IOException { IndexSearcher.getDefaultSimilarity(), IndexSearcher.getDefaultQueryCache(), IndexSearcher.getDefaultQueryCachingPolicy(), - true + true, + null ); searcher.search(new MatchAllDocsQuery(), collector1); @@ -154,7 +156,8 @@ public void testExitableDirectoryReader() throws IOException { IndexSearcher.getDefaultSimilarity(), IndexSearcher.getDefaultQueryCache(), IndexSearcher.getDefaultQueryCachingPolicy(), - true + true, + null ); searcher.addQueryCancellation(cancellation); CompiledAutomaton automaton = new CompiledAutomaton(new RegExp("a.*").toAutomaton()); diff --git a/server/src/test/java/org/opensearch/search/internal/ContextIndexSearcherTests.java b/server/src/test/java/org/opensearch/search/internal/ContextIndexSearcherTests.java index de0a31b9dc04b..eb7dde4b0b2ce 100644 --- a/server/src/test/java/org/opensearch/search/internal/ContextIndexSearcherTests.java +++ b/server/src/test/java/org/opensearch/search/internal/ContextIndexSearcherTests.java @@ -258,7 +258,8 @@ public void onRemoval(ShardId shardId, Accountable accountable) { IndexSearcher.getDefaultSimilarity(), IndexSearcher.getDefaultQueryCache(), IndexSearcher.getDefaultQueryCachingPolicy(), - true + true, + null ); for (LeafReaderContext context : searcher.getIndexReader().leaves()) { diff --git a/server/src/test/java/org/opensearch/search/profile/query/QueryProfilerTests.java b/server/src/test/java/org/opensearch/search/profile/query/QueryProfilerTests.java index afaab15e1431e..7f4dcdaed2aa1 100644 --- a/server/src/test/java/org/opensearch/search/profile/query/QueryProfilerTests.java +++ b/server/src/test/java/org/opensearch/search/profile/query/QueryProfilerTests.java @@ -32,8 +32,6 @@ package org.opensearch.search.profile.query; -import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; - import org.apache.lucene.document.Document; import org.apache.lucene.document.Field.Store; import org.apache.lucene.document.StringField; @@ -64,18 +62,12 @@ import org.opensearch.search.internal.ContextIndexSearcher; import org.opensearch.search.profile.ProfileResult; import org.opensearch.test.OpenSearchTestCase; -import org.opensearch.threadpool.ThreadPool; import org.junit.After; import org.junit.Before; import java.io.IOException; -import java.util.Arrays; -import java.util.Collection; import java.util.List; import java.util.Map; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; @@ -85,16 +77,6 @@ public class QueryProfilerTests extends OpenSearchTestCase { private Directory dir; private IndexReader reader; private ContextIndexSearcher searcher; - private ExecutorService executor; - - @ParametersFactory - public static Collection concurrency() { - return Arrays.asList(new Integer[] { 0 }, new Integer[] { 5 }); - } - - public QueryProfilerTests(int concurrency) { - this.executor = (concurrency > 0) ? Executors.newFixedThreadPool(concurrency) : null; - } @Before public void setUp() throws Exception { @@ -120,7 +102,7 @@ public void setUp() throws Exception { IndexSearcher.getDefaultQueryCache(), ALWAYS_CACHE_POLICY, true, - executor + null ); } @@ -134,10 +116,6 @@ public void tearDown() throws Exception { assertThat(cache.getTotalCount(), equalTo(cache.getMissCount())); assertThat(cache.getCacheSize(), equalTo(0L)); - if (executor != null) { - ThreadPool.terminate(executor, 10, TimeUnit.SECONDS); - } - IOUtils.close(reader, dir); dir = null; reader = null; @@ -145,7 +123,7 @@ public void tearDown() throws Exception { } public void testBasic() throws IOException { - QueryProfiler profiler = new QueryProfiler(searcher.allowConcurrentSegmentSearch()); + QueryProfiler profiler = new QueryProfiler(false); searcher.setProfiler(profiler); Query query = new TermQuery(new Term("foo", "bar")); searcher.search(query, 1); @@ -171,7 +149,7 @@ public void testBasic() throws IOException { } public void testNoScoring() throws IOException { - QueryProfiler profiler = new QueryProfiler(searcher.allowConcurrentSegmentSearch()); + QueryProfiler profiler = new QueryProfiler(false); searcher.setProfiler(profiler); Query query = new TermQuery(new Term("foo", "bar")); searcher.search(query, 1, Sort.INDEXORDER); // scores are not needed @@ -197,7 +175,7 @@ public void testNoScoring() throws IOException { } public void testUseIndexStats() throws IOException { - QueryProfiler profiler = new QueryProfiler(searcher.allowConcurrentSegmentSearch()); + QueryProfiler profiler = new QueryProfiler(false); searcher.setProfiler(profiler); Query query = new TermQuery(new Term("foo", "bar")); searcher.count(query); // will use index stats @@ -211,7 +189,7 @@ public void testUseIndexStats() throws IOException { } public void testApproximations() throws IOException { - QueryProfiler profiler = new QueryProfiler(searcher.allowConcurrentSegmentSearch()); + QueryProfiler profiler = new QueryProfiler(false); searcher.setProfiler(profiler); Query query = new RandomApproximationQuery(new TermQuery(new Term("foo", "bar")), random()); searcher.count(query); diff --git a/server/src/test/java/org/opensearch/search/query/QueryPhaseTests.java b/server/src/test/java/org/opensearch/search/query/QueryPhaseTests.java index b87c11dce5be2..1232347edea64 100644 --- a/server/src/test/java/org/opensearch/search/query/QueryPhaseTests.java +++ b/server/src/test/java/org/opensearch/search/query/QueryPhaseTests.java @@ -39,6 +39,7 @@ import org.apache.lucene.document.LatLonPoint; import org.apache.lucene.document.LongPoint; import org.apache.lucene.document.NumericDocValuesField; +import org.apache.lucene.document.SortedDocValuesField; import org.apache.lucene.document.SortedSetDocValuesField; import org.apache.lucene.document.StringField; import org.apache.lucene.document.TextField; @@ -77,6 +78,7 @@ import org.apache.lucene.search.TotalHitCountCollector; import org.apache.lucene.search.TotalHits; import org.apache.lucene.search.Weight; +import org.apache.lucene.search.grouping.CollapseTopFieldDocs; import org.apache.lucene.search.join.BitSetProducer; import org.apache.lucene.search.join.ScoreMode; import org.apache.lucene.store.Directory; @@ -88,12 +90,15 @@ import org.opensearch.index.mapper.MappedFieldType; import org.opensearch.index.mapper.MapperService; import org.opensearch.index.mapper.NumberFieldMapper; +import org.opensearch.index.mapper.NumberFieldMapper.NumberFieldType; +import org.opensearch.index.mapper.NumberFieldMapper.NumberType; import org.opensearch.index.query.ParsedQuery; import org.opensearch.index.query.QueryShardContext; import org.opensearch.index.search.OpenSearchToParentBlockJoinQuery; import org.opensearch.index.shard.IndexShard; import org.opensearch.index.shard.IndexShardTestCase; import org.opensearch.search.DocValueFormat; +import org.opensearch.search.collapse.CollapseBuilder; import org.opensearch.search.internal.ContextIndexSearcher; import org.opensearch.search.internal.ScrollContext; import org.opensearch.search.internal.SearchContext; @@ -144,7 +149,7 @@ private void countTestCase(Query query, IndexReader reader, boolean shouldCollec context.parsedQuery(new ParsedQuery(query)); context.setSize(0); context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); - final boolean rescore = QueryPhase.executeInternal(context); + final boolean rescore = QueryPhase.executeInternal(context.withCleanQueryResult()); assertFalse(rescore); ContextIndexSearcher countSearcher = shouldCollectCount @@ -157,7 +162,7 @@ private void countTestCase(boolean withDeletions) throws Exception { Directory dir = newDirectory(); IndexWriterConfig iwc = newIndexWriterConfig().setMergePolicy(NoMergePolicy.INSTANCE); RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); - final int numDocs = scaledRandomIntBetween(100, 200); + final int numDocs = scaledRandomIntBetween(600, 900); for (int i = 0; i < numDocs; ++i) { Document doc = new Document(); if (randomBoolean()) { @@ -228,12 +233,12 @@ public void testPostFilterDisablesCountOptimization() throws Exception { context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); context.parsedQuery(new ParsedQuery(new MatchAllDocsQuery())); - QueryPhase.executeInternal(context); + QueryPhase.executeInternal(context.withCleanQueryResult()); assertEquals(1, context.queryResult().topDocs().topDocs.totalHits.value); context.setSearcher(newContextSearcher(reader)); context.parsedPostFilter(new ParsedQuery(new MatchNoDocsQuery())); - QueryPhase.executeInternal(context); + QueryPhase.executeInternal(context.withCleanQueryResult()); assertEquals(0, context.queryResult().topDocs().topDocs.totalHits.value); reader.close(); dir.close(); @@ -261,7 +266,7 @@ public void testTerminateAfterWithFilter() throws Exception { context.setSize(10); for (int i = 0; i < 10; i++) { context.parsedPostFilter(new ParsedQuery(new TermQuery(new Term("foo", Integer.toString(i))))); - QueryPhase.executeInternal(context); + QueryPhase.executeInternal(context.withCleanQueryResult()); assertEquals(1, context.queryResult().topDocs().topDocs.totalHits.value); assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); } @@ -283,12 +288,13 @@ public void testMinScoreDisablesCountOptimization() throws Exception { context.parsedQuery(new ParsedQuery(new MatchAllDocsQuery())); context.setSize(0); context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); - QueryPhase.executeInternal(context); + QueryPhase.executeInternal(context.withCleanQueryResult()); assertEquals(1, context.queryResult().topDocs().topDocs.totalHits.value); context.minimumScore(100); - QueryPhase.executeInternal(context); + QueryPhase.executeInternal(context.withCleanQueryResult()); assertEquals(0, context.queryResult().topDocs().topDocs.totalHits.value); + assertEquals(TotalHits.Relation.EQUAL_TO, context.queryResult().topDocs().topDocs.totalHits.relation); reader.close(); dir.close(); } @@ -297,7 +303,7 @@ public void testQueryCapturesThreadPoolStats() throws Exception { Directory dir = newDirectory(); IndexWriterConfig iwc = newIndexWriterConfig(); RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); - final int numDocs = scaledRandomIntBetween(100, 200); + final int numDocs = scaledRandomIntBetween(600, 900); for (int i = 0; i < numDocs; ++i) { w.addDocument(new Document()); } @@ -307,7 +313,7 @@ public void testQueryCapturesThreadPoolStats() throws Exception { context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); context.parsedQuery(new ParsedQuery(new MatchAllDocsQuery())); - QueryPhase.executeInternal(context); + QueryPhase.executeInternal(context.withCleanQueryResult()); QuerySearchResult results = context.queryResult(); assertThat(results.serviceTimeEWMA(), greaterThanOrEqualTo(0L)); assertThat(results.nodeQueueSize(), greaterThanOrEqualTo(0)); @@ -320,7 +326,7 @@ public void testInOrderScrollOptimization() throws Exception { final Sort sort = new Sort(new SortField("rank", SortField.Type.INT)); IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(sort); RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); - final int numDocs = scaledRandomIntBetween(100, 200); + final int numDocs = scaledRandomIntBetween(600, 900); for (int i = 0; i < numDocs; ++i) { w.addDocument(new Document()); } @@ -336,14 +342,14 @@ public void testInOrderScrollOptimization() throws Exception { int size = randomIntBetween(2, 5); context.setSize(size); - QueryPhase.executeInternal(context); + QueryPhase.executeInternal(context.withCleanQueryResult()); assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); assertNull(context.queryResult().terminatedEarly()); assertThat(context.terminateAfter(), equalTo(0)); assertThat(context.queryResult().getTotalHits().value, equalTo((long) numDocs)); context.setSearcher(newEarlyTerminationContextSearcher(reader, size)); - QueryPhase.executeInternal(context); + QueryPhase.executeInternal(context.withCleanQueryResult()); assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); assertThat(context.terminateAfter(), equalTo(size)); assertThat(context.queryResult().getTotalHits().value, equalTo((long) numDocs)); @@ -356,7 +362,7 @@ public void testTerminateAfterEarlyTermination() throws Exception { Directory dir = newDirectory(); IndexWriterConfig iwc = newIndexWriterConfig(); RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); - final int numDocs = scaledRandomIntBetween(100, 200); + final int numDocs = scaledRandomIntBetween(600, 900); for (int i = 0; i < numDocs; ++i) { Document doc = new Document(); if (randomBoolean()) { @@ -377,25 +383,25 @@ public void testTerminateAfterEarlyTermination() throws Exception { context.terminateAfter(numDocs); { context.setSize(10); - TotalHitCountCollector collector = new TotalHitCountCollector(); - context.queryCollectors().put(TotalHitCountCollector.class, collector); - QueryPhase.executeInternal(context); + final TestTotalHitCountCollectorManager manager = TestTotalHitCountCollectorManager.create(); + context.queryCollectorManagers().put(TotalHitCountCollector.class, manager); + QueryPhase.executeInternal(context.withCleanQueryResult()); assertFalse(context.queryResult().terminatedEarly()); assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(10)); - assertThat(collector.getTotalHits(), equalTo(numDocs)); + assertThat(manager.getTotalHits(), equalTo(numDocs)); } context.terminateAfter(1); { context.setSize(1); - QueryPhase.executeInternal(context); + QueryPhase.executeInternal(context.withCleanQueryResult()); assertTrue(context.queryResult().terminatedEarly()); assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(1L)); assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); context.setSize(0); - QueryPhase.executeInternal(context); + QueryPhase.executeInternal(context.withCleanQueryResult()); assertTrue(context.queryResult().terminatedEarly()); assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(1L)); assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(0)); @@ -403,7 +409,7 @@ public void testTerminateAfterEarlyTermination() throws Exception { { context.setSize(1); - QueryPhase.executeInternal(context); + QueryPhase.executeInternal(context.withCleanQueryResult()); assertTrue(context.queryResult().terminatedEarly()); assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(1L)); assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); @@ -414,38 +420,38 @@ public void testTerminateAfterEarlyTermination() throws Exception { .add(new TermQuery(new Term("foo", "baz")), Occur.SHOULD) .build(); context.parsedQuery(new ParsedQuery(bq)); - QueryPhase.executeInternal(context); + QueryPhase.executeInternal(context.withCleanQueryResult()); assertTrue(context.queryResult().terminatedEarly()); assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(1L)); assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); context.setSize(0); context.parsedQuery(new ParsedQuery(bq)); - QueryPhase.executeInternal(context); + QueryPhase.executeInternal(context.withCleanQueryResult()); assertTrue(context.queryResult().terminatedEarly()); assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(1L)); assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(0)); } { context.setSize(1); - TotalHitCountCollector collector = new TotalHitCountCollector(); - context.queryCollectors().put(TotalHitCountCollector.class, collector); - QueryPhase.executeInternal(context); + final TestTotalHitCountCollectorManager manager = TestTotalHitCountCollectorManager.create(); + context.queryCollectorManagers().put(TotalHitCountCollector.class, manager); + QueryPhase.executeInternal(context.withCleanQueryResult()); assertTrue(context.queryResult().terminatedEarly()); assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(1L)); assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); - assertThat(collector.getTotalHits(), equalTo(1)); - context.queryCollectors().clear(); + assertThat(manager.getTotalHits(), equalTo(1)); + context.queryCollectorManagers().clear(); } { context.setSize(0); - TotalHitCountCollector collector = new TotalHitCountCollector(); - context.queryCollectors().put(TotalHitCountCollector.class, collector); - QueryPhase.executeInternal(context); + final TestTotalHitCountCollectorManager manager = TestTotalHitCountCollectorManager.create(); + context.queryCollectorManagers().put(TotalHitCountCollector.class, manager); + QueryPhase.executeInternal(context.withCleanQueryResult()); assertTrue(context.queryResult().terminatedEarly()); assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(1L)); assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(0)); - assertThat(collector.getTotalHits(), equalTo(1)); + assertThat(manager.getTotalHits(), equalTo(1)); } // tests with trackTotalHits and terminateAfter @@ -453,9 +459,9 @@ public void testTerminateAfterEarlyTermination() throws Exception { context.setSize(0); for (int trackTotalHits : new int[] { -1, 3, 76, 100 }) { context.trackTotalHitsUpTo(trackTotalHits); - TotalHitCountCollector collector = new TotalHitCountCollector(); - context.queryCollectors().put(TotalHitCountCollector.class, collector); - QueryPhase.executeInternal(context); + final TestTotalHitCountCollectorManager manager = TestTotalHitCountCollectorManager.create(); + context.queryCollectorManagers().put(TotalHitCountCollector.class, manager); + QueryPhase.executeInternal(context.withCleanQueryResult()); assertTrue(context.queryResult().terminatedEarly()); if (trackTotalHits == -1) { assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(0L)); @@ -463,16 +469,14 @@ public void testTerminateAfterEarlyTermination() throws Exception { assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) Math.min(trackTotalHits, 10))); } assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(0)); - assertThat(collector.getTotalHits(), equalTo(10)); + assertThat(manager.getTotalHits(), equalTo(10)); } context.terminateAfter(7); context.setSize(10); for (int trackTotalHits : new int[] { -1, 3, 75, 100 }) { context.trackTotalHitsUpTo(trackTotalHits); - EarlyTerminatingCollector collector = new EarlyTerminatingCollector(new TotalHitCountCollector(), 1, false); - context.queryCollectors().put(EarlyTerminatingCollector.class, collector); - QueryPhase.executeInternal(context); + QueryPhase.executeInternal(context.withCleanQueryResult()); assertTrue(context.queryResult().terminatedEarly()); if (trackTotalHits == -1) { assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(0L)); @@ -490,7 +494,7 @@ public void testIndexSortingEarlyTermination() throws Exception { final Sort sort = new Sort(new SortField("rank", SortField.Type.INT)); IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(sort); RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); - final int numDocs = scaledRandomIntBetween(100, 200); + final int numDocs = scaledRandomIntBetween(600, 900); for (int i = 0; i < numDocs; ++i) { Document doc = new Document(); if (randomBoolean()) { @@ -511,7 +515,7 @@ public void testIndexSortingEarlyTermination() throws Exception { context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); context.sort(new SortAndFormats(sort, new DocValueFormat[] { DocValueFormat.RAW })); - QueryPhase.executeInternal(context); + QueryPhase.executeInternal(context.withCleanQueryResult()); assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); assertThat(context.queryResult().topDocs().topDocs.scoreDocs[0], instanceOf(FieldDoc.class)); @@ -520,7 +524,7 @@ public void testIndexSortingEarlyTermination() throws Exception { { context.parsedPostFilter(new ParsedQuery(new MinDocQuery(1))); - QueryPhase.executeInternal(context); + QueryPhase.executeInternal(context.withCleanQueryResult()); assertNull(context.queryResult().terminatedEarly()); assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(numDocs - 1L)); assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); @@ -528,28 +532,28 @@ public void testIndexSortingEarlyTermination() throws Exception { assertThat(fieldDoc.fields[0], anyOf(equalTo(1), equalTo(2))); context.parsedPostFilter(null); - final TotalHitCountCollector totalHitCountCollector = new TotalHitCountCollector(); - context.queryCollectors().put(TotalHitCountCollector.class, totalHitCountCollector); - QueryPhase.executeInternal(context); + final TestTotalHitCountCollectorManager manager = TestTotalHitCountCollectorManager.create(sort); + context.queryCollectorManagers().put(TotalHitCountCollector.class, manager); + QueryPhase.executeInternal(context.withCleanQueryResult()); assertNull(context.queryResult().terminatedEarly()); assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); assertThat(context.queryResult().topDocs().topDocs.scoreDocs[0], instanceOf(FieldDoc.class)); assertThat(fieldDoc.fields[0], anyOf(equalTo(1), equalTo(2))); - assertThat(totalHitCountCollector.getTotalHits(), equalTo(numDocs)); - context.queryCollectors().clear(); + assertThat(manager.getTotalHits(), equalTo(numDocs)); + context.queryCollectorManagers().clear(); } { context.setSearcher(newEarlyTerminationContextSearcher(reader, 1)); context.trackTotalHitsUpTo(SearchContext.TRACK_TOTAL_HITS_DISABLED); - QueryPhase.executeInternal(context); + QueryPhase.executeInternal(context.withCleanQueryResult()); assertNull(context.queryResult().terminatedEarly()); assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); assertThat(context.queryResult().topDocs().topDocs.scoreDocs[0], instanceOf(FieldDoc.class)); assertThat(fieldDoc.fields[0], anyOf(equalTo(1), equalTo(2))); - QueryPhase.executeInternal(context); + QueryPhase.executeInternal(context.withCleanQueryResult()); assertNull(context.queryResult().terminatedEarly()); assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); assertThat(context.queryResult().topDocs().topDocs.scoreDocs[0], instanceOf(FieldDoc.class)); @@ -564,7 +568,7 @@ public void testIndexSortScrollOptimization() throws Exception { final Sort indexSort = new Sort(new SortField("rank", SortField.Type.INT), new SortField("tiebreaker", SortField.Type.INT)); IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(indexSort); RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); - final int numDocs = scaledRandomIntBetween(100, 200); + final int numDocs = scaledRandomIntBetween(600, 900); for (int i = 0; i < numDocs; ++i) { Document doc = new Document(); doc.add(new NumericDocValuesField("rank", random().nextInt())); @@ -592,7 +596,7 @@ public void testIndexSortScrollOptimization() throws Exception { context.setSize(10); context.sort(searchSortAndFormat); - QueryPhase.executeInternal(context); + QueryPhase.executeInternal(context.withCleanQueryResult()); assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); assertNull(context.queryResult().terminatedEarly()); assertThat(context.terminateAfter(), equalTo(0)); @@ -601,7 +605,7 @@ public void testIndexSortScrollOptimization() throws Exception { FieldDoc lastDoc = (FieldDoc) context.queryResult().topDocs().topDocs.scoreDocs[sizeMinus1]; context.setSearcher(newEarlyTerminationContextSearcher(reader, 10)); - QueryPhase.executeInternal(context); + QueryPhase.executeInternal(context.withCleanQueryResult()); assertNull(context.queryResult().terminatedEarly()); assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); assertThat(context.terminateAfter(), equalTo(0)); @@ -630,7 +634,8 @@ public void testDisableTopScoreCollection() throws Exception { IndexWriterConfig iwc = newIndexWriterConfig(new StandardAnalyzer()); RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); Document doc = new Document(); - for (int i = 0; i < 10; i++) { + final int numDocs = 2 * scaledRandomIntBetween(50, 450); + for (int i = 0; i < numDocs; i++) { doc.clear(); if (i % 2 == 0) { doc.add(new TextField("title", "foo bar", Store.NO)); @@ -653,16 +658,16 @@ public void testDisableTopScoreCollection() throws Exception { context.trackTotalHitsUpTo(3); TopDocsCollectorContext topDocsContext = TopDocsCollectorContext.createTopDocsCollectorContext(context, false); assertEquals(topDocsContext.create(null).scoreMode(), org.apache.lucene.search.ScoreMode.COMPLETE); - QueryPhase.executeInternal(context); - assertEquals(5, context.queryResult().topDocs().topDocs.totalHits.value); + QueryPhase.executeInternal(context.withCleanQueryResult()); + assertEquals(numDocs / 2, context.queryResult().topDocs().topDocs.totalHits.value); assertEquals(context.queryResult().topDocs().topDocs.totalHits.relation, TotalHits.Relation.EQUAL_TO); assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(3)); context.sort(new SortAndFormats(new Sort(new SortField("other", SortField.Type.INT)), new DocValueFormat[] { DocValueFormat.RAW })); topDocsContext = TopDocsCollectorContext.createTopDocsCollectorContext(context, false); assertEquals(topDocsContext.create(null).scoreMode(), org.apache.lucene.search.ScoreMode.TOP_DOCS); - QueryPhase.executeInternal(context); - assertEquals(5, context.queryResult().topDocs().topDocs.totalHits.value); + QueryPhase.executeInternal(context.withCleanQueryResult()); + assertEquals(numDocs / 2, context.queryResult().topDocs().topDocs.totalHits.value); assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(3)); assertEquals(context.queryResult().topDocs().topDocs.totalHits.relation, TotalHits.Relation.GREATER_THAN_OR_EQUAL_TO); @@ -724,7 +729,7 @@ public void testEnhanceSortOnNumeric() throws Exception { searchContext.parsedQuery(query); searchContext.setTask(task); searchContext.setSize(10); - QueryPhase.executeInternal(searchContext); + QueryPhase.executeInternal(searchContext.withCleanQueryResult()); assertSortResults(searchContext.queryResult().topDocs().topDocs, (long) numDocs, false); } @@ -736,7 +741,7 @@ public void testEnhanceSortOnNumeric() throws Exception { searchContext.parsedQuery(query); searchContext.setTask(task); searchContext.setSize(10); - QueryPhase.executeInternal(searchContext); + QueryPhase.executeInternal(searchContext.withCleanQueryResult()); assertSortResults(searchContext.queryResult().topDocs().topDocs, (long) numDocs, true); } @@ -748,7 +753,7 @@ public void testEnhanceSortOnNumeric() throws Exception { searchContext.parsedQuery(query); searchContext.setTask(task); searchContext.setSize(10); - QueryPhase.executeInternal(searchContext); + QueryPhase.executeInternal(searchContext.withCleanQueryResult()); assertSortResults(searchContext.queryResult().topDocs().topDocs, (long) numDocs, false); } @@ -773,7 +778,7 @@ public void testEnhanceSortOnNumeric() throws Exception { searchContext.setTask(task); searchContext.from(5); searchContext.setSize(0); - QueryPhase.executeInternal(searchContext); + QueryPhase.executeInternal(searchContext.withCleanQueryResult()); assertSortResults(searchContext.queryResult().topDocs().topDocs, (long) numDocs, false); } @@ -800,11 +805,15 @@ public void testEnhanceSortOnNumeric() throws Exception { searchContext.parsedQuery(query); searchContext.setTask(task); searchContext.setSize(10); - QueryPhase.executeInternal(searchContext); + QueryPhase.executeInternal(searchContext.withCleanQueryResult()); final TopDocs topDocs = searchContext.queryResult().topDocs().topDocs; long topValue = (long) ((FieldDoc) topDocs.scoreDocs[0]).fields[0]; assertThat(topValue, greaterThan(afterValue)); assertSortResults(topDocs, (long) numDocs, false); + + final TotalHits totalHits = topDocs.totalHits; + assertEquals(TotalHits.Relation.EQUAL_TO, totalHits.relation); + assertEquals(numDocs, totalHits.value); } reader.close(); @@ -916,13 +925,133 @@ public void testMinScore() throws Exception { context.setSize(1); context.trackTotalHitsUpTo(5); - QueryPhase.executeInternal(context); + QueryPhase.executeInternal(context.withCleanQueryResult()); assertEquals(10, context.queryResult().topDocs().topDocs.totalHits.value); reader.close(); dir.close(); } + public void testMaxScore() throws Exception { + Directory dir = newDirectory(); + final Sort sort = new Sort(new SortField("filter", SortField.Type.STRING)); + IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(sort); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + + final int numDocs = scaledRandomIntBetween(600, 900); + for (int i = 0; i < numDocs; i++) { + Document doc = new Document(); + doc.add(new StringField("foo", "bar", Store.NO)); + doc.add(new StringField("filter", "f1" + ((i > 0) ? " " + Integer.toString(i) : ""), Store.NO)); + doc.add(new SortedDocValuesField("filter", newBytesRef("f1" + ((i > 0) ? " " + Integer.toString(i) : "")))); + w.addDocument(doc); + } + w.close(); + + IndexReader reader = DirectoryReader.open(dir); + TestSearchContext context = new TestSearchContext(null, indexShard, newContextSearcher(reader)); + context.trackScores(true); + context.parsedQuery( + new ParsedQuery( + new BooleanQuery.Builder().add(new TermQuery(new Term("foo", "bar")), Occur.MUST) + .add(new TermQuery(new Term("filter", "f1")), Occur.SHOULD) + .build() + ) + ); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + context.setSize(1); + context.trackTotalHitsUpTo(5); + + QueryPhase.executeInternal(context.withCleanQueryResult()); + assertFalse(Float.isNaN(context.queryResult().getMaxScore())); + assertEquals(1, context.queryResult().topDocs().topDocs.scoreDocs.length); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, greaterThanOrEqualTo(6L)); + + context.sort(new SortAndFormats(sort, new DocValueFormat[] { DocValueFormat.RAW })); + QueryPhase.executeInternal(context.withCleanQueryResult()); + assertFalse(Float.isNaN(context.queryResult().getMaxScore())); + assertEquals(1, context.queryResult().topDocs().topDocs.scoreDocs.length); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, greaterThanOrEqualTo(6L)); + + context.trackScores(false); + QueryPhase.executeInternal(context.withCleanQueryResult()); + assertTrue(Float.isNaN(context.queryResult().getMaxScore())); + assertEquals(1, context.queryResult().topDocs().topDocs.scoreDocs.length); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, greaterThanOrEqualTo(6L)); + + reader.close(); + dir.close(); + } + + public void testCollapseQuerySearchResults() throws Exception { + Directory dir = newDirectory(); + final Sort sort = new Sort(new SortField("user", SortField.Type.INT)); + IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(sort); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + + // Always end up with uneven buckets so collapsing is predictable + final int numDocs = 2 * scaledRandomIntBetween(600, 900) - 1; + for (int i = 0; i < numDocs; i++) { + Document doc = new Document(); + doc.add(new StringField("foo", "bar", Store.NO)); + doc.add(new NumericDocValuesField("user", i & 1)); + w.addDocument(doc); + } + w.close(); + + IndexReader reader = DirectoryReader.open(dir); + QueryShardContext queryShardContext = mock(QueryShardContext.class); + when(queryShardContext.fieldMapper("user")).thenReturn( + new NumberFieldType("user", NumberType.INTEGER, true, false, true, false, null, Collections.emptyMap()) + ); + + TestSearchContext context = new TestSearchContext(queryShardContext, indexShard, newContextSearcher(reader)); + context.collapse(new CollapseBuilder("user").build(context.getQueryShardContext())); + context.trackScores(true); + context.parsedQuery(new ParsedQuery(new TermQuery(new Term("foo", "bar")))); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + context.setSize(2); + context.trackTotalHitsUpTo(5); + + QueryPhase.executeInternal(context.withCleanQueryResult()); + assertFalse(Float.isNaN(context.queryResult().getMaxScore())); + assertEquals(2, context.queryResult().topDocs().topDocs.scoreDocs.length); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); + assertThat(context.queryResult().topDocs().topDocs, instanceOf(CollapseTopFieldDocs.class)); + + CollapseTopFieldDocs topDocs = (CollapseTopFieldDocs) context.queryResult().topDocs().topDocs; + assertThat(topDocs.collapseValues.length, equalTo(2)); + assertThat(topDocs.collapseValues[0], equalTo(0L)); // user == 0 + assertThat(topDocs.collapseValues[1], equalTo(1L)); // user == 1 + + context.sort(new SortAndFormats(sort, new DocValueFormat[] { DocValueFormat.RAW })); + QueryPhase.executeInternal(context.withCleanQueryResult()); + assertFalse(Float.isNaN(context.queryResult().getMaxScore())); + assertEquals(2, context.queryResult().topDocs().topDocs.scoreDocs.length); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); + assertThat(context.queryResult().topDocs().topDocs, instanceOf(CollapseTopFieldDocs.class)); + + topDocs = (CollapseTopFieldDocs) context.queryResult().topDocs().topDocs; + assertThat(topDocs.collapseValues.length, equalTo(2)); + assertThat(topDocs.collapseValues[0], equalTo(0L)); // user == 0 + assertThat(topDocs.collapseValues[1], equalTo(1L)); // user == 1 + + context.trackScores(false); + QueryPhase.executeInternal(context.withCleanQueryResult()); + assertTrue(Float.isNaN(context.queryResult().getMaxScore())); + assertEquals(2, context.queryResult().topDocs().topDocs.scoreDocs.length); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); + assertThat(context.queryResult().topDocs().topDocs, instanceOf(CollapseTopFieldDocs.class)); + + topDocs = (CollapseTopFieldDocs) context.queryResult().topDocs().topDocs; + assertThat(topDocs.collapseValues.length, equalTo(2)); + assertThat(topDocs.collapseValues[0], equalTo(0L)); // user == 0 + assertThat(topDocs.collapseValues[1], equalTo(1L)); // user == 1 + + reader.close(); + dir.close(); + } + public void testCancellationDuringPreprocess() throws IOException { try (Directory dir = newDirectory(); RandomIndexWriter w = new RandomIndexWriter(random(), dir, newIndexWriterConfig())) { @@ -982,7 +1111,8 @@ private static ContextIndexSearcher newContextSearcher(IndexReader reader) throw IndexSearcher.getDefaultSimilarity(), IndexSearcher.getDefaultQueryCache(), IndexSearcher.getDefaultQueryCachingPolicy(), - true + true, + null ); } @@ -992,7 +1122,8 @@ private static ContextIndexSearcher newEarlyTerminationContextSearcher(IndexRead IndexSearcher.getDefaultSimilarity(), IndexSearcher.getDefaultQueryCache(), IndexSearcher.getDefaultQueryCachingPolicy(), - true + true, + null ) { @Override @@ -1003,6 +1134,32 @@ public void search(List leaves, Weight weight, Collector coll }; } + private static class TestTotalHitCountCollectorManager extends TotalHitCountCollectorManager { + private final TotalHitCountCollector collector; + + static TestTotalHitCountCollectorManager create() { + return create(null); + } + + static TestTotalHitCountCollectorManager create(final Sort sort) { + return new TestTotalHitCountCollectorManager(new TotalHitCountCollector(), sort); + } + + private TestTotalHitCountCollectorManager(final TotalHitCountCollector collector, final Sort sort) { + super(sort); + this.collector = collector; + } + + @Override + public TotalHitCountCollector newCollector() throws IOException { + return collector; + } + + public int getTotalHits() { + return collector.getTotalHits(); + } + } + private static class AssertingEarlyTerminationFilterCollector extends FilterCollector { private final int size; diff --git a/server/src/test/java/org/opensearch/search/query/QueryProfilePhaseTests.java b/server/src/test/java/org/opensearch/search/query/QueryProfilePhaseTests.java new file mode 100644 index 0000000000000..dfa41edb5cff2 --- /dev/null +++ b/server/src/test/java/org/opensearch/search/query/QueryProfilePhaseTests.java @@ -0,0 +1,1158 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.search.query; + +import org.apache.lucene.analysis.standard.StandardAnalyzer; +import org.apache.lucene.document.Document; +import org.apache.lucene.document.Field.Store; +import org.apache.lucene.document.NumericDocValuesField; +import org.apache.lucene.document.SortedDocValuesField; +import org.apache.lucene.document.StringField; +import org.apache.lucene.document.TextField; +import org.apache.lucene.index.DirectoryReader; +import org.apache.lucene.index.IndexReader; +import org.apache.lucene.index.IndexWriterConfig; +import org.apache.lucene.index.LeafReaderContext; +import org.apache.lucene.index.Term; +import org.apache.lucene.queries.spans.SpanNearQuery; +import org.apache.lucene.queries.spans.SpanTermQuery; +import org.apache.lucene.search.BooleanClause.Occur; +import org.apache.lucene.search.grouping.CollapseTopFieldDocs; +import org.apache.lucene.search.BooleanQuery; +import org.apache.lucene.search.Collector; +import org.apache.lucene.search.FieldComparator; +import org.apache.lucene.search.FieldDoc; +import org.apache.lucene.search.FilterCollector; +import org.apache.lucene.search.FilterLeafCollector; +import org.apache.lucene.search.IndexSearcher; +import org.apache.lucene.search.LeafCollector; +import org.apache.lucene.search.MatchAllDocsQuery; +import org.apache.lucene.search.MatchNoDocsQuery; +import org.apache.lucene.search.Query; +import org.apache.lucene.search.Sort; +import org.apache.lucene.search.SortField; +import org.apache.lucene.search.TermQuery; +import org.apache.lucene.search.TotalHits; +import org.apache.lucene.search.Weight; +import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.opensearch.action.search.SearchShardTask; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.xcontent.ToXContent; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.json.JsonXContent; +import org.opensearch.index.mapper.NumberFieldMapper.NumberFieldType; +import org.opensearch.index.mapper.NumberFieldMapper.NumberType; +import org.opensearch.index.query.ParsedQuery; +import org.opensearch.index.query.QueryShardContext; +import org.opensearch.index.shard.IndexShard; +import org.opensearch.index.shard.IndexShardTestCase; +import org.opensearch.lucene.queries.MinDocQuery; +import org.opensearch.search.DocValueFormat; +import org.opensearch.search.collapse.CollapseBuilder; +import org.opensearch.search.internal.ContextIndexSearcher; +import org.opensearch.search.internal.ScrollContext; +import org.opensearch.search.internal.SearchContext; +import org.opensearch.search.profile.ProfileResult; +import org.opensearch.search.profile.ProfileShardResult; +import org.opensearch.search.profile.SearchProfileShardResults; +import org.opensearch.search.profile.query.CollectorResult; +import org.opensearch.search.profile.query.QueryProfileShardResult; +import org.opensearch.search.sort.SortAndFormats; +import org.opensearch.test.TestSearchContext; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.function.Consumer; + +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.CoreMatchers.nullValue; +import static org.hamcrest.Matchers.anyOf; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.empty; +import static org.hamcrest.Matchers.greaterThan; +import static org.hamcrest.Matchers.greaterThanOrEqualTo; +import static org.hamcrest.Matchers.instanceOf; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; +import static org.hamcrest.Matchers.hasSize; + +public class QueryProfilePhaseTests extends IndexShardTestCase { + + private IndexShard indexShard; + + @Override + public Settings threadPoolSettings() { + return Settings.builder().put(super.threadPoolSettings()).put("thread_pool.search.min_queue_size", 10).build(); + } + + @Override + public void setUp() throws Exception { + super.setUp(); + indexShard = newShard(true); + } + + @Override + public void tearDown() throws Exception { + super.tearDown(); + closeShards(indexShard); + } + + public void testPostFilterDisablesCountOptimization() throws Exception { + Directory dir = newDirectory(); + final Sort sort = new Sort(new SortField("rank", SortField.Type.INT)); + IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(sort); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + Document doc = new Document(); + w.addDocument(doc); + w.close(); + + IndexReader reader = DirectoryReader.open(dir); + + TestSearchContext context = new TestSearchContext(null, indexShard, newEarlyTerminationContextSearcher(reader, 0)); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + context.parsedQuery(new ParsedQuery(new MatchAllDocsQuery())); + + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers()); + assertEquals(1, context.queryResult().topDocs().topDocs.totalHits.value); + assertProfileData(context, "MatchAllDocsQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_count")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), empty()); + }); + + context.setSearcher(newContextSearcher(reader)); + context.parsedPostFilter(new ParsedQuery(new MatchNoDocsQuery())); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers()); + assertEquals(0, context.queryResult().topDocs().topDocs.totalHits.value); + assertProfileData(context, collector -> { + assertThat(collector.getReason(), equalTo("search_post_filter")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), hasSize(1)); + assertThat(collector.getProfiledChildren().get(0).getReason(), equalTo("search_count")); + assertThat(collector.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + }, (query) -> { + assertThat(query.getQueryName(), equalTo("MatchNoDocsQuery")); + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, (query) -> { + assertThat(query.getQueryName(), equalTo("MatchAllDocsQuery")); + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }); + + reader.close(); + dir.close(); + } + + public void testTerminateAfterWithFilter() throws Exception { + Directory dir = newDirectory(); + final Sort sort = new Sort(new SortField("rank", SortField.Type.INT)); + IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(sort); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + Document doc = new Document(); + for (int i = 0; i < 10; i++) { + doc.add(new StringField("foo", Integer.toString(i), Store.NO)); + } + w.addDocument(doc); + w.close(); + + IndexReader reader = DirectoryReader.open(dir); + + TestSearchContext context = new TestSearchContext(null, indexShard, newContextSearcher(reader)); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + + context.parsedQuery(new ParsedQuery(new MatchAllDocsQuery())); + context.terminateAfter(1); + context.setSize(10); + for (int i = 0; i < 10; i++) { + context.parsedPostFilter(new ParsedQuery(new TermQuery(new Term("foo", Integer.toString(i))))); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers()); + assertEquals(1, context.queryResult().topDocs().topDocs.totalHits.value); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); + assertProfileData(context, collector -> { + assertThat(collector.getReason(), equalTo("search_post_filter")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), hasSize(1)); + assertThat(collector.getProfiledChildren().get(0).getReason(), equalTo("search_terminate_after_count")); + assertThat(collector.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren().get(0).getProfiledChildren(), hasSize(1)); + assertThat(collector.getProfiledChildren().get(0).getProfiledChildren().get(0).getReason(), equalTo("search_top_hits")); + assertThat(collector.getProfiledChildren().get(0).getProfiledChildren().get(0).getTime(), greaterThan(0L)); + }, (query) -> { + assertThat(query.getQueryName(), equalTo("TermQuery")); + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, (query) -> { + assertThat(query.getQueryName(), equalTo("MatchAllDocsQuery")); + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(1L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }); + } + reader.close(); + dir.close(); + } + + public void testMinScoreDisablesCountOptimization() throws Exception { + Directory dir = newDirectory(); + final Sort sort = new Sort(new SortField("rank", SortField.Type.INT)); + IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(sort); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + Document doc = new Document(); + w.addDocument(doc); + w.close(); + + IndexReader reader = DirectoryReader.open(dir); + TestSearchContext context = new TestSearchContext(null, indexShard, newEarlyTerminationContextSearcher(reader, 0)); + context.parsedQuery(new ParsedQuery(new MatchAllDocsQuery())); + context.setSize(0); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers()); + assertEquals(1, context.queryResult().topDocs().topDocs.totalHits.value); + assertProfileData(context, "MatchAllDocsQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_count")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), empty()); + }); + + context.minimumScore(100); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers()); + assertEquals(0, context.queryResult().topDocs().topDocs.totalHits.value); + assertEquals(TotalHits.Relation.EQUAL_TO, context.queryResult().topDocs().topDocs.totalHits.relation); + assertProfileData(context, "MatchAllDocsQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), greaterThanOrEqualTo(100L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(1L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_min_score")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), hasSize(1)); + assertThat(collector.getProfiledChildren().get(0).getReason(), equalTo("search_count")); + assertThat(collector.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + }); + + reader.close(); + dir.close(); + } + + public void testInOrderScrollOptimization() throws Exception { + Directory dir = newDirectory(); + final Sort sort = new Sort(new SortField("rank", SortField.Type.INT)); + IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(sort); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + final int numDocs = scaledRandomIntBetween(600, 900); + for (int i = 0; i < numDocs; ++i) { + w.addDocument(new Document()); + } + w.close(); + IndexReader reader = DirectoryReader.open(dir); + ScrollContext scrollContext = new ScrollContext(); + TestSearchContext context = new TestSearchContext(null, indexShard, newContextSearcher(reader), scrollContext); + context.parsedQuery(new ParsedQuery(new MatchAllDocsQuery())); + scrollContext.lastEmittedDoc = null; + scrollContext.maxScore = Float.NaN; + scrollContext.totalHits = null; + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + int size = randomIntBetween(2, 5); + context.setSize(size); + + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); + assertNull(context.queryResult().terminatedEarly()); + assertThat(context.terminateAfter(), equalTo(0)); + assertThat(context.queryResult().getTotalHits().value, equalTo((long) numDocs)); + assertProfileData(context, "MatchAllDocsQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_top_hits")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), empty()); + }); + + context.setSearcher(newEarlyTerminationContextSearcher(reader, size)); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); + assertThat(context.terminateAfter(), equalTo(size)); + assertThat(context.queryResult().getTotalHits().value, equalTo((long) numDocs)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs[0].doc, greaterThanOrEqualTo(size)); + assertProfileData(context, "ConstantScoreQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_terminate_after_count")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), hasSize(1)); + assertThat(collector.getProfiledChildren().get(0).getReason(), equalTo("search_top_hits")); + assertThat(collector.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + }); + + reader.close(); + dir.close(); + } + + public void testTerminateAfterEarlyTermination() throws Exception { + Directory dir = newDirectory(); + IndexWriterConfig iwc = newIndexWriterConfig(); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + final int numDocs = scaledRandomIntBetween(600, 900); + for (int i = 0; i < numDocs; ++i) { + Document doc = new Document(); + if (randomBoolean()) { + doc.add(new StringField("foo", "bar", Store.NO)); + } + if (randomBoolean()) { + doc.add(new StringField("foo", "baz", Store.NO)); + } + doc.add(new NumericDocValuesField("rank", numDocs - i)); + w.addDocument(doc); + } + w.close(); + final IndexReader reader = DirectoryReader.open(dir); + TestSearchContext context = new TestSearchContext(null, indexShard, newContextSearcher(reader)); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + context.parsedQuery(new ParsedQuery(new MatchAllDocsQuery())); + + context.terminateAfter(1); + { + context.setSize(1); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers()); + assertTrue(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(1L)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); + assertProfileData(context, "MatchAllDocsQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_terminate_after_count")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), hasSize(1)); + assertThat(collector.getProfiledChildren().get(0).getReason(), equalTo("search_top_hits")); + assertThat(collector.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + }); + + context.setSize(0); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers()); + assertTrue(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(1L)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(0)); + assertProfileData(context, "MatchAllDocsQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_terminate_after_count")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), hasSize(1)); + assertThat(collector.getProfiledChildren().get(0).getReason(), equalTo("search_count")); + assertThat(collector.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + }); + } + + { + context.setSize(1); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers()); + assertTrue(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(1L)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); + assertProfileData(context, "MatchAllDocsQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_terminate_after_count")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), hasSize(1)); + assertThat(collector.getProfiledChildren().get(0).getReason(), equalTo("search_top_hits")); + assertThat(collector.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + }); + } + { + context.setSize(1); + BooleanQuery bq = new BooleanQuery.Builder().add(new TermQuery(new Term("foo", "bar")), Occur.SHOULD) + .add(new TermQuery(new Term("foo", "baz")), Occur.SHOULD) + .build(); + context.parsedQuery(new ParsedQuery(bq)); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers()); + assertTrue(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(1L)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); + assertProfileData(context, "BooleanQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + + assertThat(query.getProfiledChildren(), hasSize(2)); + assertThat(query.getProfiledChildren().get(0).getQueryName(), equalTo("TermQuery")); + assertThat(query.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + + assertThat(query.getProfiledChildren().get(1).getQueryName(), equalTo("TermQuery")); + assertThat(query.getProfiledChildren().get(1).getTime(), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_terminate_after_count")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), hasSize(1)); + assertThat(collector.getProfiledChildren().get(0).getReason(), equalTo("search_top_hits")); + assertThat(collector.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + }); + context.setSize(0); + context.parsedQuery(new ParsedQuery(bq)); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers()); + assertTrue(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(1L)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(0)); + + assertProfileData(context, "BooleanQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + + assertThat(query.getProfiledChildren(), hasSize(2)); + assertThat(query.getProfiledChildren().get(0).getQueryName(), equalTo("TermQuery")); + assertThat(query.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("score_count"), equalTo(0L)); + + assertThat(query.getProfiledChildren().get(1).getQueryName(), equalTo("TermQuery")); + assertThat(query.getProfiledChildren().get(1).getTime(), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("score_count"), equalTo(0L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_terminate_after_count")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), hasSize(1)); + assertThat(collector.getProfiledChildren().get(0).getReason(), equalTo("search_count")); + assertThat(collector.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + }); + } + + context.terminateAfter(7); + context.setSize(10); + for (int trackTotalHits : new int[] { -1, 3, 75, 100 }) { + context.trackTotalHitsUpTo(trackTotalHits); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers()); + assertTrue(context.queryResult().terminatedEarly()); + if (trackTotalHits == -1) { + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(0L)); + } else { + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(7L)); + } + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(7)); + assertProfileData(context, "BooleanQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), greaterThanOrEqualTo(7L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + + assertThat(query.getProfiledChildren(), hasSize(2)); + assertThat(query.getProfiledChildren().get(0).getQueryName(), equalTo("TermQuery")); + assertThat(query.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("score_count"), greaterThan(0L)); + + assertThat(query.getProfiledChildren().get(1).getQueryName(), equalTo("TermQuery")); + assertThat(query.getProfiledChildren().get(1).getTime(), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("score_count"), greaterThan(0L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_terminate_after_count")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), hasSize(1)); + assertThat(collector.getProfiledChildren().get(0).getReason(), equalTo("search_top_hits")); + assertThat(collector.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + }); + } + + reader.close(); + dir.close(); + } + + public void testIndexSortingEarlyTermination() throws Exception { + Directory dir = newDirectory(); + final Sort sort = new Sort(new SortField("rank", SortField.Type.INT)); + IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(sort); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + final int numDocs = scaledRandomIntBetween(600, 900); + for (int i = 0; i < numDocs; ++i) { + Document doc = new Document(); + if (randomBoolean()) { + doc.add(new StringField("foo", "bar", Store.NO)); + } + if (randomBoolean()) { + doc.add(new StringField("foo", "baz", Store.NO)); + } + doc.add(new NumericDocValuesField("rank", numDocs - i)); + w.addDocument(doc); + } + w.close(); + + final IndexReader reader = DirectoryReader.open(dir); + TestSearchContext context = new TestSearchContext(null, indexShard, newContextSearcher(reader)); + context.parsedQuery(new ParsedQuery(new MatchAllDocsQuery())); + context.setSize(1); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + context.sort(new SortAndFormats(sort, new DocValueFormat[] { DocValueFormat.RAW })); + + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs[0], instanceOf(FieldDoc.class)); + FieldDoc fieldDoc = (FieldDoc) context.queryResult().topDocs().topDocs.scoreDocs[0]; + assertThat(fieldDoc.fields[0], equalTo(1)); + assertProfileData(context, "MatchAllDocsQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_top_hits")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), empty()); + }); + + { + context.parsedPostFilter(new ParsedQuery(new MinDocQuery(1))); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers()); + assertNull(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo(numDocs - 1L)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs[0], instanceOf(FieldDoc.class)); + assertThat(fieldDoc.fields[0], anyOf(equalTo(1), equalTo(2))); + assertProfileData(context, collector -> { + assertThat(collector.getReason(), equalTo("search_post_filter")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), hasSize(1)); + assertThat(collector.getProfiledChildren().get(0).getReason(), equalTo("search_top_hits")); + assertThat(collector.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + }, (query) -> { + assertThat(query.getQueryName(), equalTo("MinDocQuery")); + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, (query) -> { + assertThat(query.getQueryName(), equalTo("MatchAllDocsQuery")); + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }); + context.parsedPostFilter(null); + } + + { + context.setSearcher(newEarlyTerminationContextSearcher(reader, 1)); + context.trackTotalHitsUpTo(SearchContext.TRACK_TOTAL_HITS_DISABLED); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers()); + assertNull(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs[0], instanceOf(FieldDoc.class)); + assertThat(fieldDoc.fields[0], anyOf(equalTo(1), equalTo(2))); + assertProfileData(context, "MatchAllDocsQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_top_hits")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), empty()); + }); + + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers()); + assertNull(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(1)); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs[0], instanceOf(FieldDoc.class)); + assertThat(fieldDoc.fields[0], anyOf(equalTo(1), equalTo(2))); + assertProfileData(context, "MatchAllDocsQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_top_hits")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), empty()); + }); + } + + reader.close(); + dir.close(); + } + + public void testIndexSortScrollOptimization() throws Exception { + Directory dir = newDirectory(); + final Sort indexSort = new Sort(new SortField("rank", SortField.Type.INT), new SortField("tiebreaker", SortField.Type.INT)); + IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(indexSort); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + final int numDocs = scaledRandomIntBetween(600, 900); + for (int i = 0; i < numDocs; ++i) { + Document doc = new Document(); + doc.add(new NumericDocValuesField("rank", random().nextInt())); + doc.add(new NumericDocValuesField("tiebreaker", i)); + w.addDocument(doc); + } + if (randomBoolean()) { + w.forceMerge(randomIntBetween(1, 10)); + } + w.close(); + + final IndexReader reader = DirectoryReader.open(dir); + List searchSortAndFormats = new ArrayList<>(); + searchSortAndFormats.add(new SortAndFormats(indexSort, new DocValueFormat[] { DocValueFormat.RAW, DocValueFormat.RAW })); + // search sort is a prefix of the index sort + searchSortAndFormats.add(new SortAndFormats(new Sort(indexSort.getSort()[0]), new DocValueFormat[] { DocValueFormat.RAW })); + for (SortAndFormats searchSortAndFormat : searchSortAndFormats) { + ScrollContext scrollContext = new ScrollContext(); + TestSearchContext context = new TestSearchContext(null, indexShard, newContextSearcher(reader), scrollContext); + context.parsedQuery(new ParsedQuery(new MatchAllDocsQuery())); + scrollContext.lastEmittedDoc = null; + scrollContext.maxScore = Float.NaN; + scrollContext.totalHits = null; + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + context.setSize(10); + context.sort(searchSortAndFormat); + + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); + assertNull(context.queryResult().terminatedEarly()); + assertThat(context.terminateAfter(), equalTo(0)); + assertThat(context.queryResult().getTotalHits().value, equalTo((long) numDocs)); + assertProfileData(context, "MatchAllDocsQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_top_hits")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), empty()); + }); + + int sizeMinus1 = context.queryResult().topDocs().topDocs.scoreDocs.length - 1; + FieldDoc lastDoc = (FieldDoc) context.queryResult().topDocs().topDocs.scoreDocs[sizeMinus1]; + + context.setSearcher(newEarlyTerminationContextSearcher(reader, 10)); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers()); + assertNull(context.queryResult().terminatedEarly()); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); + assertThat(context.terminateAfter(), equalTo(0)); + assertThat(context.queryResult().getTotalHits().value, equalTo((long) numDocs)); + assertProfileData(context, "ConstantScoreQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + + assertThat(query.getProfiledChildren(), hasSize(1)); + assertThat(query.getProfiledChildren().get(0).getQueryName(), equalTo("SearchAfterSortedDocQuery")); + assertThat(query.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_top_hits")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), empty()); + }); + FieldDoc firstDoc = (FieldDoc) context.queryResult().topDocs().topDocs.scoreDocs[0]; + for (int i = 0; i < searchSortAndFormat.sort.getSort().length; i++) { + @SuppressWarnings("unchecked") + FieldComparator comparator = (FieldComparator) searchSortAndFormat.sort.getSort()[i].getComparator( + i, + false + ); + int cmp = comparator.compareValues(firstDoc.fields[i], lastDoc.fields[i]); + if (cmp == 0) { + continue; + } + assertThat(cmp, equalTo(1)); + break; + } + } + reader.close(); + dir.close(); + } + + public void testDisableTopScoreCollection() throws Exception { + Directory dir = newDirectory(); + IndexWriterConfig iwc = newIndexWriterConfig(new StandardAnalyzer()); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + Document doc = new Document(); + final int numDocs = 2 * scaledRandomIntBetween(50, 450); + for (int i = 0; i < numDocs; i++) { + doc.clear(); + if (i % 2 == 0) { + doc.add(new TextField("title", "foo bar", Store.NO)); + } else { + doc.add(new TextField("title", "foo", Store.NO)); + } + w.addDocument(doc); + } + w.close(); + + IndexReader reader = DirectoryReader.open(dir); + TestSearchContext context = new TestSearchContext(null, indexShard, newContextSearcher(reader)); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + Query q = new SpanNearQuery.Builder("title", true).addClause(new SpanTermQuery(new Term("title", "foo"))) + .addClause(new SpanTermQuery(new Term("title", "bar"))) + .build(); + + context.parsedQuery(new ParsedQuery(q)); + context.setSize(3); + context.trackTotalHitsUpTo(3); + TopDocsCollectorContext topDocsContext = TopDocsCollectorContext.createTopDocsCollectorContext(context, false); + assertEquals(topDocsContext.create(null).scoreMode(), org.apache.lucene.search.ScoreMode.COMPLETE); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers()); + assertEquals(numDocs / 2, context.queryResult().topDocs().topDocs.totalHits.value); + assertEquals(context.queryResult().topDocs().topDocs.totalHits.relation, TotalHits.Relation.EQUAL_TO); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(3)); + assertProfileData(context, "SpanNearQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_top_hits")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), empty()); + }); + + context.sort(new SortAndFormats(new Sort(new SortField("other", SortField.Type.INT)), new DocValueFormat[] { DocValueFormat.RAW })); + topDocsContext = TopDocsCollectorContext.createTopDocsCollectorContext(context, false); + assertEquals(topDocsContext.create(null).scoreMode(), org.apache.lucene.search.ScoreMode.TOP_DOCS); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers()); + assertEquals(numDocs / 2, context.queryResult().topDocs().topDocs.totalHits.value); + assertThat(context.queryResult().topDocs().topDocs.scoreDocs.length, equalTo(3)); + assertEquals(context.queryResult().topDocs().topDocs.totalHits.relation, TotalHits.Relation.GREATER_THAN_OR_EQUAL_TO); + assertProfileData(context, "SpanNearQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(0L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_top_hits")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), empty()); + }); + + reader.close(); + dir.close(); + } + + public void testMinScore() throws Exception { + Directory dir = newDirectory(); + IndexWriterConfig iwc = newIndexWriterConfig(); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + for (int i = 0; i < 10; i++) { + Document doc = new Document(); + doc.add(new StringField("foo", "bar", Store.NO)); + doc.add(new StringField("filter", "f1", Store.NO)); + w.addDocument(doc); + } + w.close(); + + IndexReader reader = DirectoryReader.open(dir); + TestSearchContext context = new TestSearchContext(null, indexShard, newContextSearcher(reader)); + context.parsedQuery( + new ParsedQuery( + new BooleanQuery.Builder().add(new TermQuery(new Term("foo", "bar")), Occur.MUST) + .add(new TermQuery(new Term("filter", "f1")), Occur.SHOULD) + .build() + ) + ); + context.minimumScore(0.01f); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + context.setSize(1); + context.trackTotalHitsUpTo(5); + + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers()); + assertEquals(10, context.queryResult().topDocs().topDocs.totalHits.value); + assertProfileData(context, "BooleanQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), equalTo(10L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + + assertThat(query.getProfiledChildren(), hasSize(2)); + assertThat(query.getProfiledChildren().get(0).getQueryName(), equalTo("TermQuery")); + assertThat(query.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + + assertThat(query.getProfiledChildren().get(1).getQueryName(), equalTo("TermQuery")); + assertThat(query.getProfiledChildren().get(1).getTime(), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_min_score")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), hasSize(1)); + assertThat(collector.getProfiledChildren().get(0).getReason(), equalTo("search_top_hits")); + assertThat(collector.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + }); + + reader.close(); + dir.close(); + } + + public void testMaxScore() throws Exception { + Directory dir = newDirectory(); + final Sort sort = new Sort(new SortField("filter", SortField.Type.STRING)); + IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(sort); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + + final int numDocs = scaledRandomIntBetween(600, 900); + for (int i = 0; i < numDocs; i++) { + Document doc = new Document(); + doc.add(new StringField("foo", "bar", Store.NO)); + doc.add(new StringField("filter", "f1" + ((i > 0) ? " " + Integer.toString(i) : ""), Store.NO)); + doc.add(new SortedDocValuesField("filter", newBytesRef("f1" + ((i > 0) ? " " + Integer.toString(i) : "")))); + w.addDocument(doc); + } + w.close(); + + IndexReader reader = DirectoryReader.open(dir); + TestSearchContext context = new TestSearchContext(null, indexShard, newContextSearcher(reader)); + context.trackScores(true); + context.parsedQuery( + new ParsedQuery( + new BooleanQuery.Builder().add(new TermQuery(new Term("foo", "bar")), Occur.MUST) + .add(new TermQuery(new Term("filter", "f1")), Occur.SHOULD) + .build() + ) + ); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + context.setSize(1); + context.trackTotalHitsUpTo(5); + + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers()); + assertFalse(Float.isNaN(context.queryResult().getMaxScore())); + assertEquals(1, context.queryResult().topDocs().topDocs.scoreDocs.length); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, greaterThanOrEqualTo(6L)); + assertProfileData(context, "BooleanQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), greaterThanOrEqualTo(6L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + + assertThat(query.getProfiledChildren(), hasSize(2)); + assertThat(query.getProfiledChildren().get(0).getQueryName(), equalTo("TermQuery")); + assertThat(query.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + + assertThat(query.getProfiledChildren().get(1).getQueryName(), equalTo("TermQuery")); + assertThat(query.getProfiledChildren().get(1).getTime(), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_top_hits")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), empty()); + }); + + context.sort(new SortAndFormats(sort, new DocValueFormat[] { DocValueFormat.RAW })); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers()); + assertFalse(Float.isNaN(context.queryResult().getMaxScore())); + assertEquals(1, context.queryResult().topDocs().topDocs.scoreDocs.length); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, greaterThanOrEqualTo(6L)); + assertProfileData(context, "BooleanQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), greaterThanOrEqualTo(6L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + + assertThat(query.getProfiledChildren(), hasSize(2)); + assertThat(query.getProfiledChildren().get(0).getQueryName(), equalTo("TermQuery")); + assertThat(query.getProfiledChildren().get(0).getTime(), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(0).getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + + assertThat(query.getProfiledChildren().get(1).getQueryName(), equalTo("TermQuery")); + assertThat(query.getProfiledChildren().get(1).getTime(), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getProfiledChildren().get(1).getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_top_hits")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), empty()); + }); + + reader.close(); + dir.close(); + } + + public void testCollapseQuerySearchResults() throws Exception { + Directory dir = newDirectory(); + final Sort sort = new Sort(new SortField("user", SortField.Type.INT)); + IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(sort); + RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc); + + // Always end up with uneven buckets so collapsing is predictable + final int numDocs = 2 * scaledRandomIntBetween(600, 900) - 1; + for (int i = 0; i < numDocs; i++) { + Document doc = new Document(); + doc.add(new StringField("foo", "bar", Store.NO)); + doc.add(new NumericDocValuesField("user", i & 1)); + w.addDocument(doc); + } + w.close(); + + IndexReader reader = DirectoryReader.open(dir); + QueryShardContext queryShardContext = mock(QueryShardContext.class); + when(queryShardContext.fieldMapper("user")).thenReturn( + new NumberFieldType("user", NumberType.INTEGER, true, false, true, false, null, Collections.emptyMap()) + ); + + TestSearchContext context = new TestSearchContext(queryShardContext, indexShard, newContextSearcher(reader)); + context.collapse(new CollapseBuilder("user").build(context.getQueryShardContext())); + context.trackScores(true); + context.parsedQuery(new ParsedQuery(new TermQuery(new Term("foo", "bar")))); + context.setTask(new SearchShardTask(123L, "", "", "", null, Collections.emptyMap())); + context.setSize(2); + context.trackTotalHitsUpTo(5); + + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers()); + assertFalse(Float.isNaN(context.queryResult().getMaxScore())); + assertEquals(2, context.queryResult().topDocs().topDocs.scoreDocs.length); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); + assertThat(context.queryResult().topDocs().topDocs, instanceOf(CollapseTopFieldDocs.class)); + + assertProfileData(context, "TermQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), greaterThanOrEqualTo(6L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + assertThat(query.getProfiledChildren(), empty()); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_top_hits")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), empty()); + }); + + context.sort(new SortAndFormats(sort, new DocValueFormat[] { DocValueFormat.RAW })); + QueryPhase.executeInternal(context.withCleanQueryResult().withProfilers()); + assertFalse(Float.isNaN(context.queryResult().getMaxScore())); + assertEquals(2, context.queryResult().topDocs().topDocs.scoreDocs.length); + assertThat(context.queryResult().topDocs().topDocs.totalHits.value, equalTo((long) numDocs)); + assertThat(context.queryResult().topDocs().topDocs, instanceOf(CollapseTopFieldDocs.class)); + + assertProfileData(context, "TermQuery", query -> { + assertThat(query.getTimeBreakdown().keySet(), not(empty())); + assertThat(query.getTimeBreakdown().get("score"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("score_count"), greaterThanOrEqualTo(6L)); + assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L)); + assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L)); + assertThat(query.getProfiledChildren(), empty()); + }, collector -> { + assertThat(collector.getReason(), equalTo("search_top_hits")); + assertThat(collector.getTime(), greaterThan(0L)); + assertThat(collector.getProfiledChildren(), empty()); + }); + + reader.close(); + dir.close(); + } + + private void assertProfileData(SearchContext context, String type, Consumer query, Consumer collector) + throws IOException { + assertProfileData(context, collector, (profileResult) -> { + assertThat(profileResult.getQueryName(), equalTo(type)); + assertThat(profileResult.getTime(), greaterThan(0L)); + query.accept(profileResult); + }); + } + + private void assertProfileData(SearchContext context, Consumer collector, Consumer query1) + throws IOException { + assertProfileData(context, Arrays.asList(query1), collector, false); + } + + private void assertProfileData( + SearchContext context, + Consumer collector, + Consumer query1, + Consumer query2 + ) throws IOException { + assertProfileData(context, Arrays.asList(query1, query2), collector, false); + } + + private final void assertProfileData( + SearchContext context, + List> queries, + Consumer collector, + boolean debug + ) throws IOException { + assertThat(context.getProfilers(), not(nullValue())); + + final ProfileShardResult result = SearchProfileShardResults.buildShardResults(context.getProfilers(), null); + if (debug) { + final SearchProfileShardResults results = new SearchProfileShardResults( + Collections.singletonMap(indexShard.shardId().toString(), result) + ); + + try (final XContentBuilder builder = JsonXContent.contentBuilder().prettyPrint()) { + builder.startObject(); + results.toXContent(builder, ToXContent.EMPTY_PARAMS); + builder.endObject(); + builder.flush(); + + final OutputStream out = builder.getOutputStream(); + assertThat(out, instanceOf(ByteArrayOutputStream.class)); + + logger.info(new String(((ByteArrayOutputStream) out).toByteArray(), StandardCharsets.UTF_8)); + } + } + + assertThat(result.getQueryProfileResults(), hasSize(1)); + + final QueryProfileShardResult queryProfileShardResult = result.getQueryProfileResults().get(0); + assertThat(queryProfileShardResult.getQueryResults(), hasSize(queries.size())); + + for (int i = 0; i < queries.size(); ++i) { + queries.get(i).accept(queryProfileShardResult.getQueryResults().get(i)); + } + + collector.accept(queryProfileShardResult.getCollectorResult()); + } + + private static ContextIndexSearcher newContextSearcher(IndexReader reader) throws IOException { + return new ContextIndexSearcher( + reader, + IndexSearcher.getDefaultSimilarity(), + IndexSearcher.getDefaultQueryCache(), + IndexSearcher.getDefaultQueryCachingPolicy(), + true, + null + ); + } + + private static ContextIndexSearcher newEarlyTerminationContextSearcher(IndexReader reader, int size) throws IOException { + return new ContextIndexSearcher( + reader, + IndexSearcher.getDefaultSimilarity(), + IndexSearcher.getDefaultQueryCache(), + IndexSearcher.getDefaultQueryCachingPolicy(), + true, + null + ) { + + @Override + public void search(List leaves, Weight weight, Collector collector) throws IOException { + final Collector in = new AssertingEarlyTerminationFilterCollector(collector, size); + super.search(leaves, weight, in); + } + }; + } + + private static class AssertingEarlyTerminationFilterCollector extends FilterCollector { + private final int size; + + AssertingEarlyTerminationFilterCollector(Collector in, int size) { + super(in); + this.size = size; + } + + @Override + public LeafCollector getLeafCollector(LeafReaderContext context) throws IOException { + final LeafCollector in = super.getLeafCollector(context); + return new FilterLeafCollector(in) { + int collected; + + @Override + public void collect(int doc) throws IOException { + assert collected <= size : "should not collect more than " + size + " doc per segment, got " + collected; + ++collected; + super.collect(doc); + } + }; + } + } +} diff --git a/test/framework/src/main/java/org/opensearch/search/aggregations/AggregatorTestCase.java b/test/framework/src/main/java/org/opensearch/search/aggregations/AggregatorTestCase.java index 38a0253305833..832328cb0242f 100644 --- a/test/framework/src/main/java/org/opensearch/search/aggregations/AggregatorTestCase.java +++ b/test/framework/src/main/java/org/opensearch/search/aggregations/AggregatorTestCase.java @@ -334,7 +334,8 @@ public boolean shouldCache(Query query) { indexSearcher.getSimilarity(), queryCache, queryCachingPolicy, - false + false, + null ); SearchContext searchContext = mock(SearchContext.class); diff --git a/test/framework/src/main/java/org/opensearch/test/TestSearchContext.java b/test/framework/src/main/java/org/opensearch/test/TestSearchContext.java index 0e91332892a55..0b2235a0afedd 100644 --- a/test/framework/src/main/java/org/opensearch/test/TestSearchContext.java +++ b/test/framework/src/main/java/org/opensearch/test/TestSearchContext.java @@ -32,6 +32,7 @@ package org.opensearch.test; import org.apache.lucene.search.Collector; +import org.apache.lucene.search.CollectorManager; import org.apache.lucene.search.FieldDoc; import org.apache.lucene.search.Query; import org.opensearch.action.OriginalIndices; @@ -70,6 +71,7 @@ import org.opensearch.search.internal.ShardSearchRequest; import org.opensearch.search.profile.Profilers; import org.opensearch.search.query.QuerySearchResult; +import org.opensearch.search.query.ReduceableSearchResult; import org.opensearch.search.rescore.RescoreContext; import org.opensearch.search.sort.SortAndFormats; import org.opensearch.search.suggest.SuggestionSearchContext; @@ -90,7 +92,7 @@ public class TestSearchContext extends SearchContext { final BigArrays bigArrays; final IndexService indexService; final BitsetFilterCache fixedBitSetFilterCache; - final Map, Collector> queryCollectors = new HashMap<>(); + final Map, CollectorManager> queryCollectorManagers = new HashMap<>(); final IndexShard indexShard; final QuerySearchResult queryResult = new QuerySearchResult(); final QueryShardContext queryShardContext; @@ -110,7 +112,9 @@ public class TestSearchContext extends SearchContext { private SearchContextAggregations aggregations; private ScrollContext scrollContext; private FieldDoc searchAfter; - private final long originNanoTime = System.nanoTime(); + private Profilers profilers; + private CollapseContext collapse; + private final Map searchExtBuilders = new HashMap<>(); public TestSearchContext(BigArrays bigArrays, IndexService indexService) { @@ -405,12 +409,13 @@ public FieldDoc searchAfter() { @Override public SearchContext collapse(CollapseContext collapse) { - return null; + this.collapse = collapse; + return this; } @Override public CollapseContext collapse() { - return null; + return collapse; } @Override @@ -596,12 +601,12 @@ public long getRelativeTimeInMillis() { @Override public Profilers getProfilers() { - return null; // no profiling + return profilers; } @Override - public Map, Collector> queryCollectors() { - return queryCollectors; + public Map, CollectorManager> queryCollectorManagers() { + return queryCollectorManagers; } @Override @@ -633,4 +638,21 @@ public void addRescore(RescoreContext rescore) { public ReaderContext readerContext() { throw new UnsupportedOperationException(); } + + /** + * Clean the query results by consuming all of it + */ + public TestSearchContext withCleanQueryResult() { + queryResult.consumeAll(); + profilers = null; + return this; + } + + /** + * Add profilers to the query + */ + public TestSearchContext withProfilers() { + this.profilers = new Profilers(searcher); + return this; + } } From d4b67dcbad6da1bc9bfeecf206265a5756c8bc05 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Fri, 25 Mar 2022 10:11:17 -0500 Subject: [PATCH 007/514] Replaced "master" terminology in Log message (#2575) (#2593) Changed the log message to cluster-manager from master Signed-off-by: Owais Kazi (cherry picked from commit cc0e66b1dcc2cfe17b76bcea1168ebb996fbb090) --- .../rest/discovery/Zen2RestApiIT.java | 2 +- .../UnsafeBootstrapAndDetachCommandIT.java | 20 +++--- .../DedicatedClusterSnapshotRestoreIT.java | 20 +++--- .../AddVotingConfigExclusionsRequest.java | 10 +-- .../cluster/InternalClusterInfoService.java | 10 +-- .../coordination/ClusterBootstrapService.java | 4 +- .../ClusterFormationFailureHelper.java | 14 ++-- .../cluster/coordination/Coordinator.java | 22 ++++--- .../coordination/DetachClusterCommand.java | 4 +- .../cluster/coordination/JoinHelper.java | 2 +- .../cluster/coordination/Reconfigurator.java | 4 +- .../UnsafeBootstrapMasterCommand.java | 10 +-- .../cluster/node/DiscoveryNodeRole.java | 2 +- .../cluster/node/DiscoveryNodes.java | 4 +- .../HandshakingTransportAddressConnector.java | 7 +- .../org/opensearch/discovery/PeerFinder.java | 6 +- .../opensearch/env/NodeRepurposeCommand.java | 10 +-- .../opensearch/gateway/GatewayMetaState.java | 6 +- .../IncrementalClusterStateWriter.java | 3 +- .../gateway/PersistedClusterStateService.java | 2 +- .../PersistentTasksClusterService.java | 2 +- .../repositories/blobstore/package-info.java | 2 +- ...AddVotingConfigExclusionsRequestTests.java | 2 +- ...tAddVotingConfigExclusionsActionTests.java | 4 +- .../ClusterBootstrapServiceTests.java | 2 +- .../ClusterFormationFailureHelperTests.java | 64 +++++++++---------- .../coordination/CoordinatorTests.java | 8 ++- .../discovery/AbstractDisruptionTestCase.java | 2 +- .../AbstractCoordinatorTestCase.java | 2 +- .../opensearch/test/InternalTestCluster.java | 7 +- 30 files changed, 135 insertions(+), 122 deletions(-) diff --git a/modules/transport-netty4/src/internalClusterTest/java/org/opensearch/rest/discovery/Zen2RestApiIT.java b/modules/transport-netty4/src/internalClusterTest/java/org/opensearch/rest/discovery/Zen2RestApiIT.java index 198cc11d824e7..f7899d91e0cb9 100644 --- a/modules/transport-netty4/src/internalClusterTest/java/org/opensearch/rest/discovery/Zen2RestApiIT.java +++ b/modules/transport-netty4/src/internalClusterTest/java/org/opensearch/rest/discovery/Zen2RestApiIT.java @@ -176,7 +176,7 @@ public void testFailsOnUnknownNode() throws Exception { assertThat(e.getResponse().getStatusLine().getStatusCode(), is(400)); assertThat( e.getMessage(), - Matchers.containsString("add voting config exclusions request for [invalid] matched no master-eligible nodes") + Matchers.containsString("add voting config exclusions request for [invalid] matched no cluster-manager-eligible nodes") ); } } diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/UnsafeBootstrapAndDetachCommandIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/UnsafeBootstrapAndDetachCommandIT.java index 1447379b93ec8..292469c6e7b79 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/UnsafeBootstrapAndDetachCommandIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/UnsafeBootstrapAndDetachCommandIT.java @@ -287,7 +287,7 @@ public void test3MasterNodes2Failed() throws Exception { internalCluster().setBootstrapMasterNodeIndex(2); List masterNodes = new ArrayList<>(); - logger.info("--> start 1st master-eligible node"); + logger.info("--> start 1st cluster-manager-eligible node"); masterNodes.add( internalCluster().startMasterOnlyNode( Settings.builder().put(DiscoverySettings.INITIAL_STATE_TIMEOUT_SETTING.getKey(), "0s").build() @@ -299,7 +299,7 @@ public void test3MasterNodes2Failed() throws Exception { Settings.builder().put(DiscoverySettings.INITIAL_STATE_TIMEOUT_SETTING.getKey(), "0s").build() ); // node ordinal 1 - logger.info("--> start 2nd and 3rd master-eligible nodes and bootstrap"); + logger.info("--> start 2nd and 3rd cluster-manager-eligible nodes and bootstrap"); masterNodes.addAll(internalCluster().startMasterOnlyNodes(2)); // node ordinals 2 and 3 logger.info("--> wait for all nodes to join the cluster"); @@ -335,19 +335,19 @@ public void test3MasterNodes2Failed() throws Exception { assertTrue(state.blocks().hasGlobalBlockWithId(NoMasterBlockService.NO_MASTER_BLOCK_ID)); }); - logger.info("--> try to unsafely bootstrap 1st master-eligible node, while node lock is held"); + logger.info("--> try to unsafely bootstrap 1st cluster-manager-eligible node, while node lock is held"); Environment environmentMaster1 = TestEnvironment.newEnvironment( Settings.builder().put(internalCluster().getDefaultSettings()).put(master1DataPathSettings).build() ); expectThrows(() -> unsafeBootstrap(environmentMaster1), UnsafeBootstrapMasterCommand.FAILED_TO_OBTAIN_NODE_LOCK_MSG); - logger.info("--> stop 1st master-eligible node and data-only node"); + logger.info("--> stop 1st cluster-manager-eligible node and data-only node"); NodeEnvironment nodeEnvironment = internalCluster().getMasterNodeInstance(NodeEnvironment.class); internalCluster().stopRandomNode(InternalTestCluster.nameFilter(masterNodes.get(0))); assertBusy(() -> internalCluster().getInstance(GatewayMetaState.class, dataNode).allPendingAsyncStatesWritten()); internalCluster().stopRandomDataNode(); - logger.info("--> unsafely-bootstrap 1st master-eligible node"); + logger.info("--> unsafely-bootstrap 1st cluster-manager-eligible node"); MockTerminal terminal = unsafeBootstrap(environmentMaster1, false, true); Metadata metadata = OpenSearchNodeCommand.createPersistedClusterStateService(Settings.EMPTY, nodeEnvironment.nodeDataPaths()) .loadBestOnDiskState().metadata; @@ -363,7 +363,7 @@ public void test3MasterNodes2Failed() throws Exception { ) ); - logger.info("--> start 1st master-eligible node"); + logger.info("--> start 1st cluster-manager-eligible node"); String masterNode2 = internalCluster().startMasterOnlyNode(master1DataPathSettings); logger.info("--> detach-cluster on data-only node"); @@ -399,7 +399,7 @@ public void test3MasterNodes2Failed() throws Exception { IndexMetadata indexMetadata = clusterService().state().metadata().index("test"); assertThat(indexMetadata.getSettings().get(IndexMetadata.SETTING_HISTORY_UUID), notNullValue()); - logger.info("--> detach-cluster on 2nd and 3rd master-eligible nodes"); + logger.info("--> detach-cluster on 2nd and 3rd cluster-manager-eligible nodes"); Environment environmentMaster2 = TestEnvironment.newEnvironment( Settings.builder().put(internalCluster().getDefaultSettings()).put(master2DataPathSettings).build() ); @@ -409,7 +409,7 @@ public void test3MasterNodes2Failed() throws Exception { ); detachCluster(environmentMaster3, false); - logger.info("--> start 2nd and 3rd master-eligible nodes and ensure 4 nodes stable cluster"); + logger.info("--> start 2nd and 3rd cluster-manager-eligible nodes and ensure 4 nodes stable cluster"); bootstrappedNodes.add(internalCluster().startMasterOnlyNode(master2DataPathSettings)); bootstrappedNodes.add(internalCluster().startMasterOnlyNode(master3DataPathSettings)); ensureStableCluster(4); @@ -422,7 +422,7 @@ public void testAllMasterEligibleNodesFailedDanglingIndexImport() throws Excepti Settings settings = Settings.builder().put(AUTO_IMPORT_DANGLING_INDICES_SETTING.getKey(), true).build(); - logger.info("--> start mixed data and master-eligible node and bootstrap cluster"); + logger.info("--> start mixed data and cluster-manager-eligible node and bootstrap cluster"); String masterNode = internalCluster().startNode(settings); // node ordinal 0 logger.info("--> start data-only node and ensure 2 nodes stable cluster"); @@ -457,7 +457,7 @@ public void testAllMasterEligibleNodesFailedDanglingIndexImport() throws Excepti ); detachCluster(environment, false); - logger.info("--> stop master-eligible node, clear its data and start it again - new cluster should form"); + logger.info("--> stop cluster-manager-eligible node, clear its data and start it again - new cluster should form"); internalCluster().restartNode(masterNode, new InternalTestCluster.RestartCallback() { @Override public boolean clearData(String nodeName) { diff --git a/server/src/internalClusterTest/java/org/opensearch/snapshots/DedicatedClusterSnapshotRestoreIT.java b/server/src/internalClusterTest/java/org/opensearch/snapshots/DedicatedClusterSnapshotRestoreIT.java index 47d57e1260b5f..0c392dbe8bbe6 100644 --- a/server/src/internalClusterTest/java/org/opensearch/snapshots/DedicatedClusterSnapshotRestoreIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/snapshots/DedicatedClusterSnapshotRestoreIT.java @@ -482,8 +482,8 @@ public void testSnapshotWithStuckNode() throws Exception { try { assertAcked(deleteSnapshotResponseFuture.actionGet()); } catch (SnapshotMissingException ex) { - // When master node is closed during this test, it sometime manages to delete the snapshot files before - // completely stopping. In this case the retried delete snapshot operation on the new master can fail + // When cluster-manager node is closed during this test, it sometime manages to delete the snapshot files before + // completely stopping. In this case the retried delete snapshot operation on the new cluster-manager can fail // with SnapshotMissingException } @@ -759,7 +759,7 @@ public void testRegistrationFailure() { logger.info("--> start first node"); internalCluster().startNode(); logger.info("--> start second node"); - // Make sure the first node is elected as master + // Make sure the first node is elected as cluster-manager internalCluster().startNode(nonMasterNode()); // Register mock repositories for (int i = 0; i < 5; i++) { @@ -836,7 +836,7 @@ public void sendResponse(RestResponse response) { } public void testMasterShutdownDuringSnapshot() throws Exception { - logger.info("--> starting two master nodes and two data nodes"); + logger.info("--> starting two cluster-manager nodes and two data nodes"); internalCluster().startMasterOnlyNodes(2); internalCluster().startDataOnlyNodes(2); @@ -859,7 +859,7 @@ public void testMasterShutdownDuringSnapshot() throws Exception { .setIndices("test-idx") .get(); - logger.info("--> stopping master node"); + logger.info("--> stopping cluster-manager node"); internalCluster().stopCurrentMasterNode(); logger.info("--> wait until the snapshot is done"); @@ -874,7 +874,7 @@ public void testMasterShutdownDuringSnapshot() throws Exception { } public void testMasterAndDataShutdownDuringSnapshot() throws Exception { - logger.info("--> starting three master nodes and two data nodes"); + logger.info("--> starting three cluster-manager nodes and two data nodes"); internalCluster().startMasterOnlyNodes(3); internalCluster().startDataOnlyNodes(2); @@ -902,7 +902,7 @@ public void testMasterAndDataShutdownDuringSnapshot() throws Exception { logger.info("--> stopping data node {}", dataNode); stopNode(dataNode); - logger.info("--> stopping master node {} ", masterNode); + logger.info("--> stopping cluster-manager node {} ", masterNode); internalCluster().stopCurrentMasterNode(); logger.info("--> wait until the snapshot is done"); @@ -925,7 +925,7 @@ public void testMasterAndDataShutdownDuringSnapshot() throws Exception { * the cluster. */ public void testRestoreShrinkIndex() throws Exception { - logger.info("--> starting a master node and a data node"); + logger.info("--> starting a cluster-manager node and a data node"); internalCluster().startMasterOnlyNode(); internalCluster().startDataOnlyNode(); @@ -1144,7 +1144,7 @@ public void testDeduplicateIndexMetadata() throws Exception { } public void testDataNodeRestartWithBusyMasterDuringSnapshot() throws Exception { - logger.info("--> starting a master node and two data nodes"); + logger.info("--> starting a cluster-manager node and two data nodes"); internalCluster().startMasterOnlyNode(); internalCluster().startDataOnlyNodes(2); final Path repoPath = randomRepoPath(); @@ -1200,7 +1200,7 @@ public void testDataNodeRestartWithBusyMasterDuringSnapshot() throws Exception { } public void testDataNodeRestartAfterShardSnapshotFailure() throws Exception { - logger.info("--> starting a master node and two data nodes"); + logger.info("--> starting a cluster-manager node and two data nodes"); internalCluster().startMasterOnlyNode(); final List dataNodes = internalCluster().startDataOnlyNodes(2); final Path repoPath = randomRepoPath(); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/configuration/AddVotingConfigExclusionsRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/configuration/AddVotingConfigExclusionsRequest.java index 99291742145f0..e0e5bf622b99e 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/configuration/AddVotingConfigExclusionsRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/configuration/AddVotingConfigExclusionsRequest.java @@ -54,7 +54,7 @@ import java.util.stream.StreamSupport; /** - * A request to add voting config exclusions for certain master-eligible nodes, and wait for these nodes to be removed from the voting + * A request to add voting config exclusions for certain cluster-manager-eligible nodes, and wait for these nodes to be removed from the voting * configuration. */ public class AddVotingConfigExclusionsRequest extends MasterNodeRequest { @@ -66,7 +66,7 @@ public class AddVotingConfigExclusionsRequest extends MasterNodeRequest resolveVotingConfigExclusions(ClusterState currentSta if (newVotingConfigExclusions.isEmpty()) { throw new IllegalArgumentException( - "add voting config exclusions request for " + Arrays.asList(nodeDescriptions) + " matched no master-eligible nodes" + "add voting config exclusions request for " + + Arrays.asList(nodeDescriptions) + + " matched no cluster-manager-eligible nodes" ); } } else if (nodeIds.length >= 1) { diff --git a/server/src/main/java/org/opensearch/cluster/InternalClusterInfoService.java b/server/src/main/java/org/opensearch/cluster/InternalClusterInfoService.java index 05d91fdfd9ebb..5b1c026e5259b 100644 --- a/server/src/main/java/org/opensearch/cluster/InternalClusterInfoService.java +++ b/server/src/main/java/org/opensearch/cluster/InternalClusterInfoService.java @@ -77,7 +77,7 @@ * InternalClusterInfoService provides the ClusterInfoService interface, * routinely updated on a timer. The timer can be dynamically changed by * setting the cluster.info.update.interval setting (defaulting - * to 30 seconds). The InternalClusterInfoService only runs on the master node. + * to 30 seconds). The InternalClusterInfoService only runs on the cluster-manager node. * Listens for changes in the number of data nodes and immediately submits a * ClusterInfoUpdateJob if a node has been added. * @@ -109,7 +109,7 @@ public class InternalClusterInfoService implements ClusterInfoService, ClusterSt private volatile ImmutableOpenMap leastAvailableSpaceUsages; private volatile ImmutableOpenMap mostAvailableSpaceUsages; private volatile IndicesStatsSummary indicesStatsSummary; - // null if this node is not currently the master + // null if this node is not currently the cluster-manager private final AtomicReference refreshAndRescheduleRunnable = new AtomicReference<>(); private volatile boolean enabled; private volatile TimeValue fetchTimeout; @@ -150,8 +150,8 @@ void setUpdateFrequency(TimeValue updateFrequency) { @Override public void clusterChanged(ClusterChangedEvent event) { if (event.localNodeMaster() && refreshAndRescheduleRunnable.get() == null) { - logger.trace("elected as master, scheduling cluster info update tasks"); - executeRefresh(event.state(), "became master"); + logger.trace("elected as cluster-manager, scheduling cluster info update tasks"); + executeRefresh(event.state(), "became cluster-manager"); final RefreshAndRescheduleRunnable newRunnable = new RefreshAndRescheduleRunnable(); refreshAndRescheduleRunnable.set(newRunnable); @@ -535,7 +535,7 @@ protected void doRun() { if (this == refreshAndRescheduleRunnable.get()) { super.doRun(); } else { - logger.trace("master changed, scheduled refresh job is stale"); + logger.trace("cluster-manager changed, scheduled refresh job is stale"); } } diff --git a/server/src/main/java/org/opensearch/cluster/coordination/ClusterBootstrapService.java b/server/src/main/java/org/opensearch/cluster/coordination/ClusterBootstrapService.java index ce34a21e4adb6..8df561149eb3d 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/ClusterBootstrapService.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/ClusterBootstrapService.java @@ -135,7 +135,7 @@ public ClusterBootstrapService( + DiscoveryModule.DISCOVERY_TYPE_SETTING.getKey() + "] set to [" + DiscoveryModule.SINGLE_NODE_DISCOVERY_TYPE - + "] must be master-eligible" + + "] must be cluster-manager-eligible" ); } bootstrapRequirements = Collections.singleton(Node.NODE_NAME_SETTING.get(settings)); @@ -219,7 +219,7 @@ void scheduleUnconfiguredBootstrap() { logger.info( "no discovery configuration found, will perform best-effort cluster bootstrapping after [{}] " - + "unless existing master is discovered", + + "unless existing cluster-manager is discovered", unconfiguredBootstrapTimeout ); diff --git a/server/src/main/java/org/opensearch/cluster/coordination/ClusterFormationFailureHelper.java b/server/src/main/java/org/opensearch/cluster/coordination/ClusterFormationFailureHelper.java index c36a2983a011a..0f419aa7a0937 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/ClusterFormationFailureHelper.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/ClusterFormationFailureHelper.java @@ -192,7 +192,7 @@ String getDescription() { ); if (clusterState.nodes().getLocalNode().isMasterNode() == false) { - return String.format(Locale.ROOT, "master not discovered yet: %s", discoveryStateIgnoringQuorum); + return String.format(Locale.ROOT, "cluster-manager not discovered yet: %s", discoveryStateIgnoringQuorum); } if (clusterState.getLastAcceptedConfiguration().isEmpty()) { @@ -203,14 +203,14 @@ String getDescription() { } else { bootstrappingDescription = String.format( Locale.ROOT, - "this node must discover master-eligible nodes %s to bootstrap a cluster", + "this node must discover cluster-manager-eligible nodes %s to bootstrap a cluster", INITIAL_CLUSTER_MANAGER_NODES_SETTING.get(settings) ); } return String.format( Locale.ROOT, - "master not discovered yet, this node has not previously joined a bootstrapped cluster, and %s: %s", + "cluster-manager not discovered yet, this node has not previously joined a bootstrapped cluster, and %s: %s", bootstrappingDescription, discoveryStateIgnoringQuorum ); @@ -221,7 +221,7 @@ String getDescription() { if (clusterState.getLastCommittedConfiguration().equals(VotingConfiguration.MUST_JOIN_ELECTED_MASTER)) { return String.format( Locale.ROOT, - "master not discovered yet and this node was detached from its previous cluster, have discovered %s; %s", + "cluster-manager not discovered yet and this node was detached from its previous cluster, have discovered %s; %s", foundPeers, discoveryWillContinueDescription ); @@ -250,7 +250,7 @@ String getDescription() { return String.format( Locale.ROOT, - "master not discovered or elected yet, an election requires %s, have discovered %s which %s; %s", + "cluster-manager not discovered or elected yet, an election requires %s, have discovered %s which %s; %s", quorumDescription, foundPeers, isQuorumOrNot, @@ -269,8 +269,8 @@ private String describeQuorum(VotingConfiguration votingConfiguration) { if (nodeIds.size() == 1) { if (nodeIds.contains(GatewayMetaState.STALE_STATE_CONFIG_NODE_ID)) { - return "one or more nodes that have already participated as master-eligible nodes in the cluster but this node was " - + "not master-eligible the last time it joined the cluster"; + return "one or more nodes that have already participated as cluster-manager-eligible nodes in the cluster but this node was " + + "not cluster-manager-eligible the last time it joined the cluster"; } else { return "a node with id " + realNodeIds; } diff --git a/server/src/main/java/org/opensearch/cluster/coordination/Coordinator.java b/server/src/main/java/org/opensearch/cluster/coordination/Coordinator.java index 557f11f75d969..89e5b9b4cfbcc 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/Coordinator.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/Coordinator.java @@ -510,7 +510,7 @@ private void startElection() { private void abdicateTo(DiscoveryNode newMaster) { assert Thread.holdsLock(mutex); assert mode == Mode.LEADER : "expected to be leader on abdication but was " + mode; - assert newMaster.isMasterNode() : "should only abdicate to master-eligible node but was " + newMaster; + assert newMaster.isMasterNode() : "should only abdicate to cluster-manager-eligible node but was " + newMaster; final StartJoinRequest startJoinRequest = new StartJoinRequest(newMaster, Math.max(getCurrentTerm(), maxTermSeen) + 1); logger.info("abdicating to {} with term {}", newMaster, startJoinRequest.getTerm()); getLastAcceptedState().nodes().mastersFirstStream().forEach(node -> { @@ -563,7 +563,7 @@ private Join joinLeaderInTerm(StartJoinRequest startJoinRequest) { private void handleJoinRequest(JoinRequest joinRequest, JoinHelper.JoinCallback joinCallback) { assert Thread.holdsLock(mutex) == false; - assert getLocalNode().isMasterNode() : getLocalNode() + " received a join but is not master-eligible"; + assert getLocalNode().isMasterNode() : getLocalNode() + " received a join but is not cluster-manager-eligible"; logger.trace("handleJoinRequest: as {}, handling {}", mode, joinRequest); if (singleNodeDiscovery && joinRequest.getSourceNode().equals(getLocalNode()) == false) { @@ -683,7 +683,7 @@ void becomeCandidate(String method) { void becomeLeader(String method) { assert Thread.holdsLock(mutex) : "Coordinator mutex not held"; assert mode == Mode.CANDIDATE : "expected candidate but was " + mode; - assert getLocalNode().isMasterNode() : getLocalNode() + " became a leader but is not master-eligible"; + assert getLocalNode().isMasterNode() : getLocalNode() + " became a leader but is not cluster-manager-eligible"; logger.debug( "{}: coordinator becoming LEADER in term {} (was {}, lastKnownLeader was [{}])", @@ -709,7 +709,7 @@ void becomeLeader(String method) { void becomeFollower(String method, DiscoveryNode leaderNode) { assert Thread.holdsLock(mutex) : "Coordinator mutex not held"; - assert leaderNode.isMasterNode() : leaderNode + " became a leader but is not master-eligible"; + assert leaderNode.isMasterNode() : leaderNode + " became a leader but is not cluster-manager-eligible"; assert mode != Mode.LEADER : "do not switch to follower from leader (should be candidate first)"; if (mode == Mode.FOLLOWER && Optional.of(leaderNode).equals(lastKnownLeader)) { @@ -751,11 +751,11 @@ void becomeFollower(String method, DiscoveryNode leaderNode) { } private void cleanMasterService() { - masterService.submitStateUpdateTask("clean-up after stepping down as master", new LocalClusterUpdateTask() { + masterService.submitStateUpdateTask("clean-up after stepping down as cluster-manager", new LocalClusterUpdateTask() { @Override public void onFailure(String source, Exception e) { // ignore - logger.trace("failed to clean-up after stepping down as master", e); + logger.trace("failed to clean-up after stepping down as cluster-manager", e); } @Override @@ -987,9 +987,9 @@ public boolean setInitialConfiguration(final VotingConfiguration votingConfigura } if (getLocalNode().isMasterNode() == false) { - logger.debug("skip setting initial configuration as local node is not a master-eligible node"); + logger.debug("skip setting initial configuration as local node is not a cluster-manager-eligible node"); throw new CoordinationStateRejectedException( - "this node is not master-eligible, but cluster bootstrapping can only happen on a master-eligible node" + "this node is not cluster-manager-eligible, but cluster bootstrapping can only happen on a cluster-manager-eligible node" ); } @@ -1046,8 +1046,10 @@ ClusterState improveConfiguration(ClusterState clusterState) { // exclude any nodes whose ID is in the voting config exclusions list ... final Stream excludedNodeIds = clusterState.getVotingConfigExclusions().stream().map(VotingConfigExclusion::getNodeId); - // ... and also automatically exclude the node IDs of master-ineligible nodes that were previously master-eligible and are still in - // the voting config. We could exclude all the master-ineligible nodes here, but there could be quite a few of them and that makes + // ... and also automatically exclude the node IDs of cluster-manager-ineligible nodes that were previously cluster-manager-eligible + // and are still in + // the voting config. We could exclude all the cluster-manager-ineligible nodes here, but there could be quite a few of them and + // that makes // the logging much harder to follow. final Stream masterIneligibleNodeIdsInVotingConfig = StreamSupport.stream(clusterState.nodes().spliterator(), false) .filter( diff --git a/server/src/main/java/org/opensearch/cluster/coordination/DetachClusterCommand.java b/server/src/main/java/org/opensearch/cluster/coordination/DetachClusterCommand.java index 49d88fd33c724..efa5a5ee600ab 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/DetachClusterCommand.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/DetachClusterCommand.java @@ -47,9 +47,9 @@ public class DetachClusterCommand extends OpenSearchNodeCommand { static final String CONFIRMATION_MSG = DELIMITER + "\n" + "You should only run this tool if you have permanently lost all of the\n" - + "master-eligible nodes in this cluster and you cannot restore the cluster\n" + + "cluster-manager-eligible nodes in this cluster and you cannot restore the cluster\n" + "from a snapshot, or you have already unsafely bootstrapped a new cluster\n" - + "by running `opensearch-node unsafe-bootstrap` on a master-eligible\n" + + "by running `opensearch-node unsafe-bootstrap` on a cluster-manager-eligible\n" + "node that belonged to the same cluster as this node. This tool can cause\n" + "arbitrary data loss and its use should be your last resort.\n" + "\n" diff --git a/server/src/main/java/org/opensearch/cluster/coordination/JoinHelper.java b/server/src/main/java/org/opensearch/cluster/coordination/JoinHelper.java index 6d2fb99e04f86..5975e5b64214f 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/JoinHelper.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/JoinHelper.java @@ -489,7 +489,7 @@ public void close(Mode newMode) { pendingAsTasks.put(task, new JoinTaskListener(task, value)); }); - final String stateUpdateSource = "elected-as-master ([" + pendingAsTasks.size() + "] nodes joined)"; + final String stateUpdateSource = "elected-as-cluster-manager ([" + pendingAsTasks.size() + "] nodes joined)"; pendingAsTasks.put(JoinTaskExecutor.newBecomeMasterTask(), (source, e) -> {}); pendingAsTasks.put(JoinTaskExecutor.newFinishElectionTask(), (source, e) -> {}); diff --git a/server/src/main/java/org/opensearch/cluster/coordination/Reconfigurator.java b/server/src/main/java/org/opensearch/cluster/coordination/Reconfigurator.java index 26f289f5547d6..b38b0cf0f4693 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/Reconfigurator.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/Reconfigurator.java @@ -57,14 +57,14 @@ public class Reconfigurator { * the best resilience it makes automatic adjustments to the voting configuration as master nodes join or leave the cluster. Adjustments * that fix or increase the size of the voting configuration are always a good idea, but the wisdom of reducing the voting configuration * size is less clear. For instance, automatically reducing the voting configuration down to a single node means the cluster requires - * this node to operate, which is not resilient: if it broke we could restore every other master-eligible node in the cluster to health + * this node to operate, which is not resilient: if it broke we could restore every other cluster-manager-eligible node in the cluster to health * and still the cluster would be unavailable. However not reducing the voting configuration size can also hamper resilience: in a * five-node cluster we could lose two nodes and by reducing the voting configuration to the remaining three nodes we could tolerate the * loss of a further node before failing. * * We offer two options: either we auto-shrink the voting configuration as long as it contains more than three nodes, or we don't and we * require the user to control the voting configuration manually using the retirement API. The former, default, option, guarantees that - * as long as there have been at least three master-eligible nodes in the cluster and no more than one of them is currently unavailable, + * as long as there have been at least three cluster-manager-eligible nodes in the cluster and no more than one of them is currently unavailable, * then the cluster will still operate, which is what almost everyone wants. Manual control is for users who want different guarantees. */ public static final Setting CLUSTER_AUTO_SHRINK_VOTING_CONFIGURATION = Setting.boolSetting( diff --git a/server/src/main/java/org/opensearch/cluster/coordination/UnsafeBootstrapMasterCommand.java b/server/src/main/java/org/opensearch/cluster/coordination/UnsafeBootstrapMasterCommand.java index e61b6448f6ac9..c6c7e75497e29 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/UnsafeBootstrapMasterCommand.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/UnsafeBootstrapMasterCommand.java @@ -60,15 +60,15 @@ public class UnsafeBootstrapMasterCommand extends OpenSearchNodeCommand { static final String CONFIRMATION_MSG = DELIMITER + "\n" + "You should only run this tool if you have permanently lost half or more\n" - + "of the master-eligible nodes in this cluster, and you cannot restore the\n" + + "of the cluster-manager-eligible nodes in this cluster, and you cannot restore the\n" + "cluster from a snapshot. This tool can cause arbitrary data loss and its\n" - + "use should be your last resort. If you have multiple surviving master\n" + + "use should be your last resort. If you have multiple surviving cluster-manager\n" + "eligible nodes, you should run this tool on the node with the highest\n" + "cluster state (term, version) pair.\n" + "\n" + "Do you want to proceed?\n"; - static final String NOT_MASTER_NODE_MSG = "unsafe-bootstrap tool can only be run on master eligible node"; + static final String NOT_MASTER_NODE_MSG = "unsafe-bootstrap tool can only be run on cluster-manager eligible node"; static final String EMPTY_LAST_COMMITTED_VOTING_CONFIG_MSG = "last committed voting voting configuration is empty, cluster has never been bootstrapped?"; @@ -81,7 +81,9 @@ public class UnsafeBootstrapMasterCommand extends OpenSearchNodeCommand { private OptionSpec applyClusterReadOnlyBlockOption; UnsafeBootstrapMasterCommand() { - super("Forces the successful election of the current node after the permanent loss of the half or more master-eligible nodes"); + super( + "Forces the successful election of the current node after the permanent loss of the half or more cluster-manager-eligible nodes" + ); applyClusterReadOnlyBlockOption = parser.accepts("apply-cluster-read-only-block", "Optional cluster.blocks.read_only setting") .withOptionalArg() .ofType(Boolean.class); diff --git a/server/src/main/java/org/opensearch/cluster/node/DiscoveryNodeRole.java b/server/src/main/java/org/opensearch/cluster/node/DiscoveryNodeRole.java index cff1a77f4cdb7..83e35c0ee18ab 100644 --- a/server/src/main/java/org/opensearch/cluster/node/DiscoveryNodeRole.java +++ b/server/src/main/java/org/opensearch/cluster/node/DiscoveryNodeRole.java @@ -206,7 +206,7 @@ public Setting legacySetting() { }; /** - * Represents the role for a master-eligible node. + * Represents the role for a cluster-manager-eligible node. * @deprecated As of 2.0, because promoting inclusive language, replaced by {@link #CLUSTER_MANAGER_ROLE} */ @Deprecated diff --git a/server/src/main/java/org/opensearch/cluster/node/DiscoveryNodes.java b/server/src/main/java/org/opensearch/cluster/node/DiscoveryNodes.java index 1097f3bc245ac..8d84869bc8bec 100644 --- a/server/src/main/java/org/opensearch/cluster/node/DiscoveryNodes.java +++ b/server/src/main/java/org/opensearch/cluster/node/DiscoveryNodes.java @@ -574,7 +574,7 @@ public List addedNodes() { public String shortSummary() { final StringBuilder summary = new StringBuilder(); if (masterNodeChanged()) { - summary.append("master node changed {previous ["); + summary.append("cluster-manager node changed {previous ["); if (previousMasterNode() != null) { summary.append(previousMasterNode()); } @@ -799,7 +799,7 @@ public boolean isLocalNodeElectedMaster() { } /** - * Check if the given name of the node role is 'cluster_manger' or 'master'. + * Check if the given name of the node role is 'cluster_manager' or 'master'. * The method is added for {@link #resolveNodes} to keep the code clear, when support the both above roles. * @deprecated As of 2.0, because promoting inclusive language. MASTER_ROLE is deprecated. * @param matchAttrName a given String for a name of the node role. diff --git a/server/src/main/java/org/opensearch/discovery/HandshakingTransportAddressConnector.java b/server/src/main/java/org/opensearch/discovery/HandshakingTransportAddressConnector.java index 906e28cbb6b51..d2e2c5fbea8ac 100644 --- a/server/src/main/java/org/opensearch/discovery/HandshakingTransportAddressConnector.java +++ b/server/src/main/java/org/opensearch/discovery/HandshakingTransportAddressConnector.java @@ -137,7 +137,9 @@ protected void innerOnResponse(DiscoveryNode remoteNode) { if (remoteNode.equals(transportService.getLocalNode())) { listener.onFailure(new ConnectTransportException(remoteNode, "local node found")); } else if (remoteNode.isMasterNode() == false) { - listener.onFailure(new ConnectTransportException(remoteNode, "non-master-eligible node found")); + listener.onFailure( + new ConnectTransportException(remoteNode, "non-cluster-manager-eligible node found") + ); } else { transportService.connectToNode(remoteNode, new ActionListener() { @Override @@ -153,7 +155,8 @@ public void onResponse(Void ignored) { @Override public void onFailure(Exception e) { // we opened a connection and successfully performed a handshake, so we're definitely - // talking to a master-eligible node with a matching cluster name and a good version, + // talking to a cluster-manager-eligible node with a matching cluster name and a good + // version, // but the attempt to open a full connection to its publish address failed; a common // reason is that the remote node is listening on 0.0.0.0 but has made an inappropriate // choice for its publish address. diff --git a/server/src/main/java/org/opensearch/discovery/PeerFinder.java b/server/src/main/java/org/opensearch/discovery/PeerFinder.java index 37f07c5d56a9a..fe669e7b6d073 100644 --- a/server/src/main/java/org/opensearch/discovery/PeerFinder.java +++ b/server/src/main/java/org/opensearch/discovery/PeerFinder.java @@ -225,7 +225,7 @@ public List getLastResolvedAddresses() { public interface TransportAddressConnector { /** - * Identify the node at the given address and, if it is a master node and not the local node then establish a full connection to it. + * Identify the node at the given address and, if it is a cluster-manager node and not the local node then establish a full connection to it. */ void connectToRemoteMasterNode(TransportAddress transportAddress, ActionListener listener); } @@ -275,7 +275,7 @@ private boolean handleWakeUp() { return peersRemoved; } - logger.trace("probing master nodes from cluster state: {}", lastAcceptedNodes); + logger.trace("probing cluster-manager nodes from cluster state: {}", lastAcceptedNodes); for (ObjectCursor discoveryNodeObjectCursor : lastAcceptedNodes.getMasterNodes().values()) { startProbe(discoveryNodeObjectCursor.value.getAddress()); } @@ -381,7 +381,7 @@ void establishConnection() { transportAddressConnector.connectToRemoteMasterNode(transportAddress, new ActionListener() { @Override public void onResponse(DiscoveryNode remoteNode) { - assert remoteNode.isMasterNode() : remoteNode + " is not master-eligible"; + assert remoteNode.isMasterNode() : remoteNode + " is not cluster-manager-eligible"; assert remoteNode.equals(getLocalNode()) == false : remoteNode + " is the local node"; synchronized (mutex) { if (active == false) { diff --git a/server/src/main/java/org/opensearch/env/NodeRepurposeCommand.java b/server/src/main/java/org/opensearch/env/NodeRepurposeCommand.java index d14b7df8b747a..cb431a6a5d0de 100644 --- a/server/src/main/java/org/opensearch/env/NodeRepurposeCommand.java +++ b/server/src/main/java/org/opensearch/env/NodeRepurposeCommand.java @@ -68,7 +68,7 @@ public class NodeRepurposeCommand extends OpenSearchNodeCommand { static final String NO_SHARD_DATA_TO_CLEAN_UP_FOUND = "No shard data to clean-up found"; public NodeRepurposeCommand() { - super("Repurpose this node to another master/data role, cleaning up any excess persisted data"); + super("Repurpose this node to another cluster-manager/data role, cleaning up any excess persisted data"); } void testExecute(Terminal terminal, OptionSet options, Environment env) throws Exception { @@ -129,7 +129,7 @@ private void processNoMasterNoDataNode(Terminal terminal, Path[] dataPaths, Envi terminal.println(noMasterMessage(indexUUIDs.size(), shardDataPaths.size(), indexMetadataPaths.size())); outputHowToSeeVerboseInformation(terminal); - terminal.println("Node is being re-purposed as no-master and no-data. Clean-up of index data will be performed."); + terminal.println("Node is being re-purposed as no-cluster-manager and no-data. Clean-up of index data will be performed."); confirm(terminal, "Do you want to proceed?"); removePaths(terminal, indexPaths); // clean-up shard dirs @@ -137,7 +137,7 @@ private void processNoMasterNoDataNode(Terminal terminal, Path[] dataPaths, Envi MetadataStateFormat.deleteMetaState(dataPaths); IOUtils.rm(Stream.of(dataPaths).map(path -> path.resolve(INDICES_FOLDER)).toArray(Path[]::new)); - terminal.println("Node successfully repurposed to no-master and no-data."); + terminal.println("Node successfully repurposed to no-cluster-manager and no-data."); } private void processMasterNoDataNode(Terminal terminal, Path[] dataPaths, Environment env) throws IOException { @@ -162,12 +162,12 @@ private void processMasterNoDataNode(Terminal terminal, Path[] dataPaths, Enviro terminal.println(shardMessage(shardDataPaths.size(), indexUUIDs.size())); outputHowToSeeVerboseInformation(terminal); - terminal.println("Node is being re-purposed as master and no-data. Clean-up of shard data will be performed."); + terminal.println("Node is being re-purposed as cluster-manager and no-data. Clean-up of shard data will be performed."); confirm(terminal, "Do you want to proceed?"); removePaths(terminal, shardDataPaths); // clean-up shard dirs - terminal.println("Node successfully repurposed to master and no-data."); + terminal.println("Node successfully repurposed to cluster-manager and no-data."); } private ClusterState loadClusterState(Terminal terminal, Environment env, PersistedClusterStateService psf) throws IOException { diff --git a/server/src/main/java/org/opensearch/gateway/GatewayMetaState.java b/server/src/main/java/org/opensearch/gateway/GatewayMetaState.java index fd978a9c8ed8b..3081c4da8f7a7 100644 --- a/server/src/main/java/org/opensearch/gateway/GatewayMetaState.java +++ b/server/src/main/java/org/opensearch/gateway/GatewayMetaState.java @@ -89,7 +89,7 @@ * * When started, ensures that this version is compatible with the state stored on disk, and performs a state upgrade if necessary. Note that * the state being loaded when constructing the instance of this class is not necessarily the state that will be used as {@link - * ClusterState#metadata()} because it might be stale or incomplete. Master-eligible nodes must perform an election to find a complete and + * ClusterState#metadata()} because it might be stale or incomplete. Cluster-manager-eligible nodes must perform an election to find a complete and * non-stale state, and master-ineligible nodes receive the real cluster state from the elected master after joining the cluster. */ public class GatewayMetaState implements Closeable { @@ -97,7 +97,7 @@ public class GatewayMetaState implements Closeable { /** * Fake node ID for a voting configuration written by a master-ineligible data node to indicate that its on-disk state is potentially * stale (since it is written asynchronously after application, rather than before acceptance). This node ID means that if the node is - * restarted as a master-eligible node then it does not win any elections until it has received a fresh cluster state. + * restarted as a cluster-manager-eligible node then it does not win any elections until it has received a fresh cluster state. */ public static final String STALE_STATE_CONFIG_NODE_ID = "STALE_STATE_CONFIG"; @@ -310,7 +310,7 @@ public void applyClusterState(ClusterChangedEvent event) { } try { - // Hack: This is to ensure that non-master-eligible Zen2 nodes always store a current term + // Hack: This is to ensure that non-cluster-manager-eligible Zen2 nodes always store a current term // that's higher than the last accepted term. // TODO: can we get rid of this hack? if (event.state().term() > incrementalClusterStateWriter.getPreviousManifest().getCurrentTerm()) { diff --git a/server/src/main/java/org/opensearch/gateway/IncrementalClusterStateWriter.java b/server/src/main/java/org/opensearch/gateway/IncrementalClusterStateWriter.java index 4c1a921e9c4ac..4933b70384960 100644 --- a/server/src/main/java/org/opensearch/gateway/IncrementalClusterStateWriter.java +++ b/server/src/main/java/org/opensearch/gateway/IncrementalClusterStateWriter.java @@ -333,7 +333,8 @@ void writeManifestAndCleanup(String reason, Manifest manifest) throws WriteState } catch (WriteStateException e) { // If the Manifest write results in a dirty WriteStateException it's not safe to roll back, removing the new metadata files, // because if the Manifest was actually written to disk and its deletion fails it will reference these new metadata files. - // On master-eligible nodes a dirty WriteStateException here is fatal to the node since we no longer really have any idea + // On cluster-manager-eligible nodes a dirty WriteStateException here is fatal to the node since we no longer really have + // any idea // what the state on disk is and the only sensible response is to start again from scratch. if (e.isDirty() == false) { rollback(); diff --git a/server/src/main/java/org/opensearch/gateway/PersistedClusterStateService.java b/server/src/main/java/org/opensearch/gateway/PersistedClusterStateService.java index 8ccf6375239a2..4bcd6bb9fc7a5 100644 --- a/server/src/main/java/org/opensearch/gateway/PersistedClusterStateService.java +++ b/server/src/main/java/org/opensearch/gateway/PersistedClusterStateService.java @@ -108,7 +108,7 @@ import java.util.function.Supplier; /** - * Stores cluster metadata in a bare Lucene index (per data path) split across a number of documents. This is used by master-eligible nodes + * Stores cluster metadata in a bare Lucene index (per data path) split across a number of documents. This is used by cluster-manager-eligible nodes * to record the last-accepted cluster state during publication. The metadata is written incrementally where possible, leaving alone any * documents that have not changed. The index has the following fields: * diff --git a/server/src/main/java/org/opensearch/persistent/PersistentTasksClusterService.java b/server/src/main/java/org/opensearch/persistent/PersistentTasksClusterService.java index 00a5f335338c4..eaa623b53ac1c 100644 --- a/server/src/main/java/org/opensearch/persistent/PersistentTasksClusterService.java +++ b/server/src/main/java/org/opensearch/persistent/PersistentTasksClusterService.java @@ -398,7 +398,7 @@ public void clusterStateProcessed(String source, ClusterState oldState, ClusterS /** * Returns true if the cluster state change(s) require to reassign some persistent tasks. It can happen in the following - * situations: a node left or is added, the routing table changed, the master node changed, the metadata changed or the + * situations: a node left or is added, the routing table changed, the cluster-manager node changed, the metadata changed or the * persistent tasks changed. */ boolean shouldReassignPersistentTasks(final ClusterChangedEvent event) { diff --git a/server/src/main/java/org/opensearch/repositories/blobstore/package-info.java b/server/src/main/java/org/opensearch/repositories/blobstore/package-info.java index 92ae4b69c45bc..a960cfe70aee7 100644 --- a/server/src/main/java/org/opensearch/repositories/blobstore/package-info.java +++ b/server/src/main/java/org/opensearch/repositories/blobstore/package-info.java @@ -38,7 +38,7 @@ * any {@code BlobStoreRepository} implementation must provide via its implementation of * {@link org.opensearch.repositories.blobstore.BlobStoreRepository#getBlobContainer()}.

* - *

The blob store is written to and read from by master-eligible nodes and data nodes. All metadata related to a snapshot's + *

The blob store is written to and read from by cluster-manager-eligible nodes and data nodes. All metadata related to a snapshot's * scope and health is written by the master node.

*

The data-nodes on the other hand, write the data for each individual shard but do not write any blobs outside of shard directories for * shards that they hold the primary of. For each shard, the data-node holding the shard's primary writes the actual data in form of diff --git a/server/src/test/java/org/opensearch/action/admin/cluster/configuration/AddVotingConfigExclusionsRequestTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/configuration/AddVotingConfigExclusionsRequestTests.java index 8da65ba13b9cb..a92e4e4a6c536 100644 --- a/server/src/test/java/org/opensearch/action/admin/cluster/configuration/AddVotingConfigExclusionsRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/configuration/AddVotingConfigExclusionsRequestTests.java @@ -163,7 +163,7 @@ public void testResolve() { IllegalArgumentException.class, () -> makeRequestWithNodeDescriptions("not-a-node").resolveVotingConfigExclusions(clusterState) ).getMessage(), - equalTo("add voting config exclusions request for [not-a-node] matched no master-eligible nodes") + equalTo("add voting config exclusions request for [not-a-node] matched no cluster-manager-eligible nodes") ); assertWarnings(AddVotingConfigExclusionsRequest.DEPRECATION_MESSAGE); } diff --git a/server/src/test/java/org/opensearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsActionTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsActionTests.java index a570db040a805..bff0689a153b3 100644 --- a/server/src/test/java/org/opensearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsActionTests.java @@ -344,7 +344,7 @@ public void testReturnsErrorIfNoMatchingNodeDescriptions() throws InterruptedExc assertThat(rootCause, instanceOf(IllegalArgumentException.class)); assertThat( rootCause.getMessage(), - equalTo("add voting config exclusions request for [not-a-node] matched no master-eligible nodes") + equalTo("add voting config exclusions request for [not-a-node] matched no cluster-manager-eligible nodes") ); assertWarnings(AddVotingConfigExclusionsRequest.DEPRECATION_MESSAGE); } @@ -368,7 +368,7 @@ public void testOnlyMatchesMasterEligibleNodes() throws InterruptedException { assertThat(rootCause, instanceOf(IllegalArgumentException.class)); assertThat( rootCause.getMessage(), - equalTo("add voting config exclusions request for [_all, master:false] matched no master-eligible nodes") + equalTo("add voting config exclusions request for [_all, master:false] matched no cluster-manager-eligible nodes") ); assertWarnings(AddVotingConfigExclusionsRequest.DEPRECATION_MESSAGE); } diff --git a/server/src/test/java/org/opensearch/cluster/coordination/ClusterBootstrapServiceTests.java b/server/src/test/java/org/opensearch/cluster/coordination/ClusterBootstrapServiceTests.java index 079b31f31f599..dd55d078fe2c6 100644 --- a/server/src/test/java/org/opensearch/cluster/coordination/ClusterBootstrapServiceTests.java +++ b/server/src/test/java/org/opensearch/cluster/coordination/ClusterBootstrapServiceTests.java @@ -705,7 +705,7 @@ public void testFailBootstrapNonMasterEligibleNodeWithSingleNodeDiscovery() { IllegalArgumentException.class, () -> new ClusterBootstrapService(settings.build(), transportService, () -> emptyList(), () -> false, vc -> fail()) ).getMessage(), - containsString("node with [discovery.type] set to [single-node] must be master-eligible") + containsString("node with [discovery.type] set to [single-node] must be cluster-manager-eligible") ); } } diff --git a/server/src/test/java/org/opensearch/cluster/coordination/ClusterFormationFailureHelperTests.java b/server/src/test/java/org/opensearch/cluster/coordination/ClusterFormationFailureHelperTests.java index 13cdc640008cb..391d7b0e56332 100644 --- a/server/src/test/java/org/opensearch/cluster/coordination/ClusterFormationFailureHelperTests.java +++ b/server/src/test/java/org/opensearch/cluster/coordination/ClusterFormationFailureHelperTests.java @@ -191,7 +191,7 @@ public void testDescriptionOnMasterIneligibleNodes() { new StatusInfo(HEALTHY, "healthy-info") ).getDescription(), is( - "master not discovered yet: have discovered []; discovery will continue using [] from hosts providers " + "cluster-manager not discovered yet: have discovered []; discovery will continue using [] from hosts providers " + "and [] from last-known cluster state; node term 15, last-accepted version 12 in term 4" ) ); @@ -208,7 +208,7 @@ public void testDescriptionOnMasterIneligibleNodes() { new StatusInfo(HEALTHY, "healthy-info") ).getDescription(), is( - "master not discovered yet: have discovered []; discovery will continue using [" + "cluster-manager not discovered yet: have discovered []; discovery will continue using [" + otherAddress + "] from hosts providers and [] from last-known cluster state; node term 16, last-accepted version 12 in term 4" ) @@ -226,7 +226,7 @@ public void testDescriptionOnMasterIneligibleNodes() { new StatusInfo(HEALTHY, "healthy-info") ).getDescription(), is( - "master not discovered yet: have discovered [" + "cluster-manager not discovered yet: have discovered [" + otherNode + "]; discovery will continue using [] from hosts providers " + "and [] from last-known cluster state; node term 17, last-accepted version 12 in term 4" @@ -257,7 +257,7 @@ public void testDescriptionForBWCState() { new StatusInfo(HEALTHY, "healthy-info") ).getDescription(), is( - "master not discovered yet: have discovered []; discovery will continue using [] from hosts providers " + "cluster-manager not discovered yet: have discovered []; discovery will continue using [] from hosts providers " + "and [] from last-known cluster state; node term 15, last-accepted version 42 in term 0" ) ); @@ -328,7 +328,7 @@ public void testDescriptionBeforeBootstrapping() { new StatusInfo(HEALTHY, "healthy-info") ).getDescription(), is( - "master not discovered yet, this node has not previously joined a bootstrapped cluster, and " + "cluster-manager not discovered yet, this node has not previously joined a bootstrapped cluster, and " + "[cluster.initial_cluster_manager_nodes] is empty on this node: have discovered []; " + "discovery will continue using [] from hosts providers and [" + localNode @@ -348,7 +348,7 @@ public void testDescriptionBeforeBootstrapping() { new StatusInfo(HEALTHY, "healthy-info") ).getDescription(), is( - "master not discovered yet, this node has not previously joined a bootstrapped cluster, and " + "cluster-manager not discovered yet, this node has not previously joined a bootstrapped cluster, and " + "[cluster.initial_cluster_manager_nodes] is empty on this node: have discovered []; " + "discovery will continue using [" + otherAddress @@ -370,7 +370,7 @@ public void testDescriptionBeforeBootstrapping() { new StatusInfo(HEALTHY, "healthy-info") ).getDescription(), is( - "master not discovered yet, this node has not previously joined a bootstrapped cluster, and " + "cluster-manager not discovered yet, this node has not previously joined a bootstrapped cluster, and " + "[cluster.initial_cluster_manager_nodes] is empty on this node: have discovered [" + otherNode + "]; " @@ -391,8 +391,8 @@ public void testDescriptionBeforeBootstrapping() { new StatusInfo(HEALTHY, "healthy-info") ).getDescription(), is( - "master not discovered yet, this node has not previously joined a bootstrapped cluster, and " - + "this node must discover master-eligible nodes [other] to bootstrap a cluster: have discovered []; " + "cluster-manager not discovered yet, this node has not previously joined a bootstrapped cluster, and " + + "this node must discover cluster-manager-eligible nodes [other] to bootstrap a cluster: have discovered []; " + "discovery will continue using [] from hosts providers and [" + localNode + "] from last-known cluster state; node term 4, last-accepted version 7 in term 4" @@ -442,7 +442,7 @@ public void testDescriptionAfterDetachCluster() { new StatusInfo(HEALTHY, "healthy-info") ).getDescription(), is( - "master not discovered yet and this node was detached from its previous cluster, " + "cluster-manager not discovered yet and this node was detached from its previous cluster, " + "have discovered []; " + "discovery will continue using [] from hosts providers and [" + localNode @@ -462,7 +462,7 @@ public void testDescriptionAfterDetachCluster() { new StatusInfo(HEALTHY, "healthy-info") ).getDescription(), is( - "master not discovered yet and this node was detached from its previous cluster, " + "cluster-manager not discovered yet and this node was detached from its previous cluster, " + "have discovered []; " + "discovery will continue using [" + otherAddress @@ -484,7 +484,7 @@ public void testDescriptionAfterDetachCluster() { new StatusInfo(HEALTHY, "healthy-info") ).getDescription(), is( - "master not discovered yet and this node was detached from its previous cluster, " + "cluster-manager not discovered yet and this node was detached from its previous cluster, " + "have discovered [" + otherNode + "]; " @@ -506,7 +506,7 @@ public void testDescriptionAfterDetachCluster() { new StatusInfo(HEALTHY, "healthy-info") ).getDescription(), is( - "master not discovered yet and this node was detached from its previous cluster, " + "cluster-manager not discovered yet and this node was detached from its previous cluster, " + "have discovered [" + yetAnotherNode + "]; " @@ -534,7 +534,7 @@ public void testDescriptionAfterBootstrapping() { new StatusInfo(HEALTHY, "healthy-info") ).getDescription(), is( - "master not discovered or elected yet, an election requires a node with id [otherNode], " + "cluster-manager not discovered or elected yet, an election requires a node with id [otherNode], " + "have discovered [] which is not a quorum; " + "discovery will continue using [] from hosts providers and [" + localNode @@ -554,7 +554,7 @@ public void testDescriptionAfterBootstrapping() { new StatusInfo(HEALTHY, "healthy-info") ).getDescription(), is( - "master not discovered or elected yet, an election requires a node with id [otherNode], " + "cluster-manager not discovered or elected yet, an election requires a node with id [otherNode], " + "have discovered [] which is not a quorum; " + "discovery will continue using [" + otherAddress @@ -576,7 +576,7 @@ public void testDescriptionAfterBootstrapping() { new StatusInfo(HEALTHY, "healthy-info") ).getDescription(), is( - "master not discovered or elected yet, an election requires a node with id [otherNode], " + "cluster-manager not discovered or elected yet, an election requires a node with id [otherNode], " + "have discovered [" + otherNode + "] which is a quorum; " @@ -598,7 +598,7 @@ public void testDescriptionAfterBootstrapping() { new StatusInfo(HEALTHY, "healthy-info") ).getDescription(), is( - "master not discovered or elected yet, an election requires a node with id [otherNode], " + "cluster-manager not discovered or elected yet, an election requires a node with id [otherNode], " + "have discovered [" + yetAnotherNode + "] which is not a quorum; " @@ -619,7 +619,7 @@ public void testDescriptionAfterBootstrapping() { new StatusInfo(HEALTHY, "healthy-info") ).getDescription(), is( - "master not discovered or elected yet, an election requires two nodes with ids [n1, n2], " + "cluster-manager not discovered or elected yet, an election requires two nodes with ids [n1, n2], " + "have discovered [] which is not a quorum; " + "discovery will continue using [] from hosts providers and [" + localNode @@ -638,7 +638,7 @@ public void testDescriptionAfterBootstrapping() { new StatusInfo(HEALTHY, "healthy-info") ).getDescription(), is( - "master not discovered or elected yet, an election requires at least 2 nodes with ids from [n1, n2, n3], " + "cluster-manager not discovered or elected yet, an election requires at least 2 nodes with ids from [n1, n2, n3], " + "have discovered [] which is not a quorum; " + "discovery will continue using [] from hosts providers and [" + localNode @@ -657,7 +657,7 @@ public void testDescriptionAfterBootstrapping() { new StatusInfo(HEALTHY, "healthy-info") ).getDescription(), is( - "master not discovered or elected yet, an election requires 2 nodes with ids [n1, n2], " + "cluster-manager not discovered or elected yet, an election requires 2 nodes with ids [n1, n2], " + "have discovered [] which is not a quorum; " + "discovery will continue using [] from hosts providers and [" + localNode @@ -676,7 +676,7 @@ public void testDescriptionAfterBootstrapping() { new StatusInfo(HEALTHY, "healthy-info") ).getDescription(), is( - "master not discovered or elected yet, an election requires at least 3 nodes with ids from [n1, n2, n3, n4], " + "cluster-manager not discovered or elected yet, an election requires at least 3 nodes with ids from [n1, n2, n3, n4], " + "have discovered [] which is not a quorum; " + "discovery will continue using [] from hosts providers and [" + localNode @@ -695,7 +695,7 @@ public void testDescriptionAfterBootstrapping() { new StatusInfo(HEALTHY, "healthy-info") ).getDescription(), is( - "master not discovered or elected yet, an election requires at least 3 nodes with ids from [n1, n2, n3, n4, n5], " + "cluster-manager not discovered or elected yet, an election requires at least 3 nodes with ids from [n1, n2, n3, n4, n5], " + "have discovered [] which is not a quorum; " + "discovery will continue using [] from hosts providers and [" + localNode @@ -714,7 +714,7 @@ public void testDescriptionAfterBootstrapping() { new StatusInfo(HEALTHY, "healthy-info") ).getDescription(), is( - "master not discovered or elected yet, an election requires at least 3 nodes with ids from [n1, n2, n3, n4], " + "cluster-manager not discovered or elected yet, an election requires at least 3 nodes with ids from [n1, n2, n3, n4], " + "have discovered [] which is not a quorum; " + "discovery will continue using [] from hosts providers and [" + localNode @@ -733,7 +733,7 @@ public void testDescriptionAfterBootstrapping() { new StatusInfo(HEALTHY, "healthy-info") ).getDescription(), is( - "master not discovered or elected yet, an election requires 3 nodes with ids [n1, n2, n3], " + "cluster-manager not discovered or elected yet, an election requires 3 nodes with ids [n1, n2, n3], " + "have discovered [] which is not a quorum; " + "discovery will continue using [] from hosts providers and [" + localNode @@ -752,7 +752,7 @@ public void testDescriptionAfterBootstrapping() { new StatusInfo(HEALTHY, "healthy-info") ).getDescription(), is( - "master not discovered or elected yet, an election requires a node with id [n1], " + "cluster-manager not discovered or elected yet, an election requires a node with id [n1], " + "have discovered [] which is not a quorum; " + "discovery will continue using [] from hosts providers and [" + localNode @@ -771,7 +771,7 @@ public void testDescriptionAfterBootstrapping() { new StatusInfo(HEALTHY, "healthy-info") ).getDescription(), is( - "master not discovered or elected yet, an election requires a node with id [n1] and a node with id [n2], " + "cluster-manager not discovered or elected yet, an election requires a node with id [n1] and a node with id [n2], " + "have discovered [] which is not a quorum; " + "discovery will continue using [] from hosts providers and [" + localNode @@ -790,7 +790,7 @@ public void testDescriptionAfterBootstrapping() { new StatusInfo(HEALTHY, "healthy-info") ).getDescription(), is( - "master not discovered or elected yet, an election requires a node with id [n1] and two nodes with ids [n2, n3], " + "cluster-manager not discovered or elected yet, an election requires a node with id [n1] and two nodes with ids [n2, n3], " + "have discovered [] which is not a quorum; " + "discovery will continue using [] from hosts providers and [" + localNode @@ -809,7 +809,7 @@ public void testDescriptionAfterBootstrapping() { new StatusInfo(HEALTHY, "healthy-info") ).getDescription(), is( - "master not discovered or elected yet, an election requires a node with id [n1] and " + "cluster-manager not discovered or elected yet, an election requires a node with id [n1] and " + "at least 2 nodes with ids from [n2, n3, n4], " + "have discovered [] which is not a quorum; " + "discovery will continue using [] from hosts providers and [" @@ -859,7 +859,7 @@ public void testDescriptionAfterBootstrapping() { // nodes from last-known cluster state could be in either order is( oneOf( - "master not discovered or elected yet, an election requires two nodes with ids [n1, n2], " + "cluster-manager not discovered or elected yet, an election requires two nodes with ids [n1, n2], " + "have discovered [] which is not a quorum; " + "discovery will continue using [] from hosts providers and [" + localNode @@ -867,7 +867,7 @@ public void testDescriptionAfterBootstrapping() { + otherMasterNode + "] from last-known cluster state; node term 0, last-accepted version 0 in term 0", - "master not discovered or elected yet, an election requires two nodes with ids [n1, n2], " + "cluster-manager not discovered or elected yet, an election requires two nodes with ids [n1, n2], " + "have discovered [] which is not a quorum; " + "discovery will continue using [] from hosts providers and [" + otherMasterNode @@ -889,8 +889,8 @@ public void testDescriptionAfterBootstrapping() { new StatusInfo(HEALTHY, "healthy-info") ).getDescription(), is( - "master not discovered or elected yet, an election requires one or more nodes that have already participated as " - + "master-eligible nodes in the cluster but this node was not master-eligible the last time it joined the cluster, " + "cluster-manager not discovered or elected yet, an election requires one or more nodes that have already participated as " + + "cluster-manager-eligible nodes in the cluster but this node was not cluster-manager-eligible the last time it joined the cluster, " + "have discovered [] which is not a quorum; " + "discovery will continue using [] from hosts providers and [" + localNode diff --git a/server/src/test/java/org/opensearch/cluster/coordination/CoordinatorTests.java b/server/src/test/java/org/opensearch/cluster/coordination/CoordinatorTests.java index 1cdea588564c4..f43d6ff4e6c02 100644 --- a/server/src/test/java/org/opensearch/cluster/coordination/CoordinatorTests.java +++ b/server/src/test/java/org/opensearch/cluster/coordination/CoordinatorTests.java @@ -109,7 +109,7 @@ public class CoordinatorTests extends AbstractCoordinatorTestCase { /** * This test was added to verify that state recovery is properly reset on a node after it has become master and successfully * recovered a state (see {@link GatewayService}). The situation which triggers this with a decent likelihood is as follows: - * 3 master-eligible nodes (leader, follower1, follower2), the followers are shut down (leader remains), when followers come back + * 3 cluster-manager-eligible nodes (leader, follower1, follower2), the followers are shut down (leader remains), when followers come back * one of them becomes leader and publishes first state (with STATE_NOT_RECOVERED_BLOCK) to old leader, which accepts it. * Old leader is initiating an election at the same time, and wins election. It becomes leader again, but as it previously * successfully completed state recovery, is never reset to a state where state recovery can be retried. @@ -1558,7 +1558,9 @@ public void match(LogEvent event) { final String message = event.getMessage().getFormattedMessage(); assertThat( message, - startsWith("master not discovered or elected yet, an election requires at least 2 nodes with ids from [") + startsWith( + "cluster-manager not discovered or elected yet, an election requires at least 2 nodes with ids from [" + ) ); final List matchingNodes = cluster.clusterNodes.stream() @@ -1729,7 +1731,7 @@ public void testDoesNotPerformElectionWhenRestartingFollower() { if (cluster.clusterNodes.stream().filter(n -> n.getLocalNode().isMasterNode()).count() == 2) { // in the 2-node case, auto-shrinking the voting configuration is required to reduce the voting configuration down to just - // the leader, otherwise restarting the other master-eligible node triggers an election + // the leader, otherwise restarting the other cluster-manager-eligible node triggers an election leader.submitSetAutoShrinkVotingConfiguration(true); cluster.stabilise(2 * DEFAULT_CLUSTER_STATE_UPDATE_DELAY); // 1st delay for the setting update, 2nd for the reconfiguration } diff --git a/server/src/test/java/org/opensearch/discovery/AbstractDisruptionTestCase.java b/server/src/test/java/org/opensearch/discovery/AbstractDisruptionTestCase.java index 5a61300caa89e..e690770b3d0a5 100644 --- a/server/src/test/java/org/opensearch/discovery/AbstractDisruptionTestCase.java +++ b/server/src/test/java/org/opensearch/discovery/AbstractDisruptionTestCase.java @@ -167,7 +167,7 @@ void assertNoMaster(final String node, @Nullable final ClusterBlock expectedBloc assertBusy(() -> { ClusterState state = getNodeClusterState(node); final DiscoveryNodes nodes = state.nodes(); - assertNull("node [" + node + "] still has [" + nodes.getMasterNode() + "] as master", nodes.getMasterNode()); + assertNull("node [" + node + "] still has [" + nodes.getMasterNode() + "] as cluster-manager", nodes.getMasterNode()); if (expectedBlocks != null) { for (ClusterBlockLevel level : expectedBlocks.levels()) { assertTrue( diff --git a/test/framework/src/main/java/org/opensearch/cluster/coordination/AbstractCoordinatorTestCase.java b/test/framework/src/main/java/org/opensearch/cluster/coordination/AbstractCoordinatorTestCase.java index 9841daa5f81b7..6617102c12ffc 100644 --- a/test/framework/src/main/java/org/opensearch/cluster/coordination/AbstractCoordinatorTestCase.java +++ b/test/framework/src/main/java/org/opensearch/cluster/coordination/AbstractCoordinatorTestCase.java @@ -321,7 +321,7 @@ class Cluster implements Releasable { ); logger.info( - "--> creating cluster of {} nodes (master-eligible nodes: {}) with initial configuration {}", + "--> creating cluster of {} nodes (cluster-manager-eligible nodes: {}) with initial configuration {}", initialNodeCount, masterEligibleNodeIds, initialConfiguration diff --git a/test/framework/src/main/java/org/opensearch/test/InternalTestCluster.java b/test/framework/src/main/java/org/opensearch/test/InternalTestCluster.java index 3a28ec2efdd4b..a7c819609c619 100644 --- a/test/framework/src/main/java/org/opensearch/test/InternalTestCluster.java +++ b/test/framework/src/main/java/org/opensearch/test/InternalTestCluster.java @@ -1121,7 +1121,7 @@ private synchronized void reset(boolean wipeData) throws IOException { } assertTrue( - "expected at least one master-eligible node left in " + nodes, + "expected at least one cluster-manager-eligible node left in " + nodes, nodes.isEmpty() || nodes.values().stream().anyMatch(NodeAndClient::isMasterEligible) ); @@ -1848,7 +1848,8 @@ private void restartNode(NodeAndClient nodeAndClient, RestartCallback callback) publishNode(nodeAndClient); if (callback.validateClusterForming() || excludedNodeIds.isEmpty() == false) { - // we have to validate cluster size to ensure that the restarted node has rejoined the cluster if it was master-eligible; + // we have to validate cluster size to ensure that the restarted node has rejoined the cluster if it was + // cluster-manager-eligible; validateClusterFormed(); } } @@ -1999,7 +2000,7 @@ public synchronized Set nodesInclude(String index) { /** * Performs cluster bootstrap when node with index {@link #bootstrapMasterNodeIndex} is started - * with the names of all existing and new master-eligible nodes. + * with the names of all existing and new cluster-manager-eligible nodes. * Indexing starts from 0. * If {@link #bootstrapMasterNodeIndex} is -1 (default), this method does nothing. */ From b573de0ec5bf282df2bef521dd1292e4c1351bfc Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Fri, 25 Mar 2022 18:47:11 -0400 Subject: [PATCH 008/514] Fix build-tools/reaper source/target compatibility to be JDK-11 (#2596) (#2605) Signed-off-by: Andriy Redko (cherry picked from commit d4ce87bddc409beddf81f5ca583ec120c890edda) Co-authored-by: Andriy Redko --- buildSrc/reaper/build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/buildSrc/reaper/build.gradle b/buildSrc/reaper/build.gradle index d5e8d6ebc7099..4ccbec894e30e 100644 --- a/buildSrc/reaper/build.gradle +++ b/buildSrc/reaper/build.gradle @@ -11,6 +11,9 @@ apply plugin: 'java' +targetCompatibility = JavaVersion.VERSION_11 +sourceCompatibility = JavaVersion.VERSION_11 + jar { archiveFileName = "${project.name}.jar" manifest { From 2379ad80f853565762e0ad886cbc3fcfce690649 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 28 Mar 2022 11:29:16 -0500 Subject: [PATCH 009/514] Enable merge on refresh and merge on commit on Opensearch (#2535) (#2600) Enables merge on refresh and merge on commit in OpenSearch by way of two new index options: index.merge_on_flush.max_full_flush_merge_wait_time and index.merge_on_flush.enabled. Default merge_on_flush is disabled and wait time is 10s. Signed-off-by: Andriy Redko (cherry picked from commit 908682d437ec744395030fe8c3f01973f596de20) --- .../common/settings/IndexScopedSettings.java | 2 + .../org/opensearch/index/IndexSettings.java | 50 +++++ .../index/engine/InternalEngine.java | 16 ++ .../index/engine/InternalEngineTests.java | 206 ++++++++++++++++++ 4 files changed, 274 insertions(+) diff --git a/server/src/main/java/org/opensearch/common/settings/IndexScopedSettings.java b/server/src/main/java/org/opensearch/common/settings/IndexScopedSettings.java index 4c7b3fe25296e..528d6cc9f5e23 100644 --- a/server/src/main/java/org/opensearch/common/settings/IndexScopedSettings.java +++ b/server/src/main/java/org/opensearch/common/settings/IndexScopedSettings.java @@ -187,6 +187,8 @@ public final class IndexScopedSettings extends AbstractScopedSettings { IndexSettings.FINAL_PIPELINE, MetadataIndexStateService.VERIFIED_BEFORE_CLOSE_SETTING, ExistingShardsAllocator.EXISTING_SHARDS_ALLOCATOR_SETTING, + IndexSettings.INDEX_MERGE_ON_FLUSH_ENABLED, + IndexSettings.INDEX_MERGE_ON_FLUSH_MAX_FULL_FLUSH_MERGE_WAIT_TIME, // validate that built-in similarities don't get redefined Setting.groupSetting("index.similarity.", (s) -> { diff --git a/server/src/main/java/org/opensearch/index/IndexSettings.java b/server/src/main/java/org/opensearch/index/IndexSettings.java index 45d9a57442049..aa69417af1897 100644 --- a/server/src/main/java/org/opensearch/index/IndexSettings.java +++ b/server/src/main/java/org/opensearch/index/IndexSettings.java @@ -503,6 +503,27 @@ public final class IndexSettings { Setting.Property.IndexScope ); + /** + * Expert: sets the amount of time to wait for merges (during {@link org.apache.lucene.index.IndexWriter#commit} + * or {@link org.apache.lucene.index.IndexWriter#getReader(boolean, boolean)}) returned by MergePolicy.findFullFlushMerges(...). + * If this time is reached, we proceed with the commit based on segments merged up to that point. The merges are not + * aborted, and will still run to completion independent of the commit or getReader call, like natural segment merges. + */ + public static final Setting INDEX_MERGE_ON_FLUSH_MAX_FULL_FLUSH_MERGE_WAIT_TIME = Setting.timeSetting( + "index.merge_on_flush.max_full_flush_merge_wait_time", + new TimeValue(10, TimeUnit.SECONDS), + new TimeValue(0, TimeUnit.MILLISECONDS), + Property.Dynamic, + Property.IndexScope + ); + + public static final Setting INDEX_MERGE_ON_FLUSH_ENABLED = Setting.boolSetting( + "index.merge_on_flush.enabled", + false, + Property.IndexScope, + Property.Dynamic + ); + private final Index index; private final Version version; private final Logger logger; @@ -584,6 +605,15 @@ private void setRetentionLeaseMillis(final TimeValue retentionLease) { */ private volatile int maxRegexLength; + /** + * The max amount of time to wait for merges + */ + private volatile TimeValue maxFullFlushMergeWaitTime; + /** + * Is merge of flush enabled or not + */ + private volatile boolean mergeOnFlushEnabled; + /** * Returns the default search fields for this index. */ @@ -696,6 +726,8 @@ public IndexSettings(final IndexMetadata indexMetadata, final Settings nodeSetti mappingTotalFieldsLimit = scopedSettings.get(INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING); mappingDepthLimit = scopedSettings.get(INDEX_MAPPING_DEPTH_LIMIT_SETTING); mappingFieldNameLengthLimit = scopedSettings.get(INDEX_MAPPING_FIELD_NAME_LENGTH_LIMIT_SETTING); + maxFullFlushMergeWaitTime = scopedSettings.get(INDEX_MERGE_ON_FLUSH_MAX_FULL_FLUSH_MERGE_WAIT_TIME); + mergeOnFlushEnabled = scopedSettings.get(INDEX_MERGE_ON_FLUSH_ENABLED); scopedSettings.addSettingsUpdateConsumer(MergePolicyConfig.INDEX_COMPOUND_FORMAT_SETTING, mergePolicyConfig::setNoCFSRatio); scopedSettings.addSettingsUpdateConsumer( @@ -765,6 +797,8 @@ public IndexSettings(final IndexMetadata indexMetadata, final Settings nodeSetti scopedSettings.addSettingsUpdateConsumer(INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING, this::setMappingTotalFieldsLimit); scopedSettings.addSettingsUpdateConsumer(INDEX_MAPPING_DEPTH_LIMIT_SETTING, this::setMappingDepthLimit); scopedSettings.addSettingsUpdateConsumer(INDEX_MAPPING_FIELD_NAME_LENGTH_LIMIT_SETTING, this::setMappingFieldNameLengthLimit); + scopedSettings.addSettingsUpdateConsumer(INDEX_MERGE_ON_FLUSH_MAX_FULL_FLUSH_MERGE_WAIT_TIME, this::setMaxFullFlushMergeWaitTime); + scopedSettings.addSettingsUpdateConsumer(INDEX_MERGE_ON_FLUSH_ENABLED, this::setMergeOnFlushEnabled); } private void setSearchIdleAfter(TimeValue searchIdleAfter) { @@ -1328,4 +1362,20 @@ public long getMappingFieldNameLengthLimit() { private void setMappingFieldNameLengthLimit(long value) { this.mappingFieldNameLengthLimit = value; } + + private void setMaxFullFlushMergeWaitTime(TimeValue timeValue) { + this.maxFullFlushMergeWaitTime = timeValue; + } + + private void setMergeOnFlushEnabled(boolean enabled) { + this.mergeOnFlushEnabled = enabled; + } + + public TimeValue getMaxFullFlushMergeWaitTime() { + return this.maxFullFlushMergeWaitTime; + } + + public boolean isMergeOnFlushEnabled() { + return mergeOnFlushEnabled; + } } diff --git a/server/src/main/java/org/opensearch/index/engine/InternalEngine.java b/server/src/main/java/org/opensearch/index/engine/InternalEngine.java index 84090047d68e8..6bef118e0b61f 100644 --- a/server/src/main/java/org/opensearch/index/engine/InternalEngine.java +++ b/server/src/main/java/org/opensearch/index/engine/InternalEngine.java @@ -50,6 +50,7 @@ import org.apache.lucene.index.ShuffleForcedMergePolicy; import org.apache.lucene.index.SoftDeletesRetentionMergePolicy; import org.apache.lucene.index.Term; +import org.apache.lucene.sandbox.index.MergeOnFlushMergePolicy; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.DocIdSetIterator; @@ -2425,6 +2426,21 @@ private IndexWriterConfig getIndexWriterConfig() { // to enable it. mergePolicy = new ShuffleForcedMergePolicy(mergePolicy); } + + if (config().getIndexSettings().isMergeOnFlushEnabled()) { + final long maxFullFlushMergeWaitMillis = config().getIndexSettings().getMaxFullFlushMergeWaitTime().millis(); + if (maxFullFlushMergeWaitMillis > 0) { + iwc.setMaxFullFlushMergeWaitMillis(maxFullFlushMergeWaitMillis); + mergePolicy = new MergeOnFlushMergePolicy(mergePolicy); + } else { + logger.warn( + "The {} is enabled but {} is set to 0, merge on flush will not be activated", + IndexSettings.INDEX_MERGE_ON_FLUSH_ENABLED.getKey(), + IndexSettings.INDEX_MERGE_ON_FLUSH_MAX_FULL_FLUSH_MERGE_WAIT_TIME.getKey() + ); + } + } + iwc.setMergePolicy(new OpenSearchMergePolicy(mergePolicy)); iwc.setSimilarity(engineConfig.getSimilarity()); iwc.setRAMBufferSizeMB(engineConfig.getIndexingBufferSize().getMbFrac()); diff --git a/server/src/test/java/org/opensearch/index/engine/InternalEngineTests.java b/server/src/test/java/org/opensearch/index/engine/InternalEngineTests.java index 361013149578e..c33adf3bcb558 100644 --- a/server/src/test/java/org/opensearch/index/engine/InternalEngineTests.java +++ b/server/src/test/java/org/opensearch/index/engine/InternalEngineTests.java @@ -494,6 +494,212 @@ public void testSegments() throws Exception { } } + public void testMergeSegmentsOnCommitIsDisabled() throws Exception { + final AtomicLong globalCheckpoint = new AtomicLong(SequenceNumbers.NO_OPS_PERFORMED); + + final Settings.Builder settings = Settings.builder() + .put(defaultSettings.getSettings()) + .put(IndexSettings.INDEX_MERGE_ON_FLUSH_MAX_FULL_FLUSH_MERGE_WAIT_TIME.getKey(), TimeValue.timeValueMillis(0)) + .put(IndexSettings.INDEX_MERGE_ON_FLUSH_ENABLED.getKey(), true); + final IndexMetadata indexMetadata = IndexMetadata.builder(defaultSettings.getIndexMetadata()).settings(settings).build(); + final IndexSettings indexSettings = IndexSettingsModule.newIndexSettings(indexMetadata); + + try ( + Store store = createStore(); + InternalEngine engine = createEngine( + config(indexSettings, store, createTempDir(), NoMergePolicy.INSTANCE, null, null, globalCheckpoint::get) + ) + ) { + assertThat(engine.segments(false), empty()); + int numDocsFirstSegment = randomIntBetween(5, 50); + Set liveDocsFirstSegment = new HashSet<>(); + for (int i = 0; i < numDocsFirstSegment; i++) { + String id = Integer.toString(i); + ParsedDocument doc = testParsedDocument(id, null, testDocument(), B_1, null); + engine.index(indexForDoc(doc)); + liveDocsFirstSegment.add(id); + } + engine.refresh("test"); + List segments = engine.segments(randomBoolean()); + assertThat(segments, hasSize(1)); + assertThat(segments.get(0).getNumDocs(), equalTo(liveDocsFirstSegment.size())); + assertThat(segments.get(0).getDeletedDocs(), equalTo(0)); + assertFalse(segments.get(0).committed); + int deletes = 0; + int updates = 0; + int appends = 0; + int iterations = scaledRandomIntBetween(1, 50); + for (int i = 0; i < iterations && liveDocsFirstSegment.isEmpty() == false; i++) { + String idToUpdate = randomFrom(liveDocsFirstSegment); + liveDocsFirstSegment.remove(idToUpdate); + ParsedDocument doc = testParsedDocument(idToUpdate, null, testDocument(), B_1, null); + if (randomBoolean()) { + engine.delete(new Engine.Delete(doc.id(), newUid(doc), primaryTerm.get())); + deletes++; + } else { + engine.index(indexForDoc(doc)); + updates++; + } + if (randomBoolean()) { + engine.index(indexForDoc(testParsedDocument(UUIDs.randomBase64UUID(), null, testDocument(), B_1, null))); + appends++; + } + } + + boolean committed = randomBoolean(); + if (committed) { + engine.flush(); + } + + engine.refresh("test"); + segments = engine.segments(randomBoolean()); + + assertThat(segments, hasSize(2)); + assertThat(segments, hasSize(2)); + assertThat(segments.get(0).getNumDocs(), equalTo(liveDocsFirstSegment.size())); + assertThat(segments.get(0).getDeletedDocs(), equalTo(updates + deletes)); + assertThat(segments.get(0).committed, equalTo(committed)); + + assertThat(segments.get(1).getNumDocs(), equalTo(updates + appends)); + assertThat(segments.get(1).getDeletedDocs(), equalTo(deletes)); // delete tombstones + assertThat(segments.get(1).committed, equalTo(committed)); + } + } + + public void testMergeSegmentsOnCommit() throws Exception { + final AtomicLong globalCheckpoint = new AtomicLong(SequenceNumbers.NO_OPS_PERFORMED); + + final Settings.Builder settings = Settings.builder() + .put(defaultSettings.getSettings()) + .put(IndexSettings.INDEX_MERGE_ON_FLUSH_MAX_FULL_FLUSH_MERGE_WAIT_TIME.getKey(), TimeValue.timeValueMillis(5000)) + .put(IndexSettings.INDEX_MERGE_ON_FLUSH_ENABLED.getKey(), true); + final IndexMetadata indexMetadata = IndexMetadata.builder(defaultSettings.getIndexMetadata()).settings(settings).build(); + final IndexSettings indexSettings = IndexSettingsModule.newIndexSettings(indexMetadata); + + try ( + Store store = createStore(); + InternalEngine engine = createEngine( + config(indexSettings, store, createTempDir(), NoMergePolicy.INSTANCE, null, null, globalCheckpoint::get) + ) + ) { + assertThat(engine.segments(false), empty()); + int numDocsFirstSegment = randomIntBetween(5, 50); + Set liveDocsFirstSegment = new HashSet<>(); + for (int i = 0; i < numDocsFirstSegment; i++) { + String id = Integer.toString(i); + ParsedDocument doc = testParsedDocument(id, null, testDocument(), B_1, null); + engine.index(indexForDoc(doc)); + liveDocsFirstSegment.add(id); + } + engine.refresh("test"); + List segments = engine.segments(randomBoolean()); + assertThat(segments, hasSize(1)); + assertThat(segments.get(0).getNumDocs(), equalTo(liveDocsFirstSegment.size())); + assertThat(segments.get(0).getDeletedDocs(), equalTo(0)); + assertFalse(segments.get(0).committed); + int deletes = 0; + int updates = 0; + int appends = 0; + int iterations = scaledRandomIntBetween(1, 50); + for (int i = 0; i < iterations && liveDocsFirstSegment.isEmpty() == false; i++) { + String idToUpdate = randomFrom(liveDocsFirstSegment); + liveDocsFirstSegment.remove(idToUpdate); + ParsedDocument doc = testParsedDocument(idToUpdate, null, testDocument(), B_1, null); + if (randomBoolean()) { + engine.delete(new Engine.Delete(doc.id(), newUid(doc), primaryTerm.get())); + deletes++; + } else { + engine.index(indexForDoc(doc)); + updates++; + } + if (randomBoolean()) { + engine.index(indexForDoc(testParsedDocument(UUIDs.randomBase64UUID(), null, testDocument(), B_1, null))); + appends++; + } + } + + boolean committed = randomBoolean(); + if (committed) { + engine.flush(); + } + + engine.refresh("test"); + segments = engine.segments(randomBoolean()); + + // All segments have to be merged into one + assertThat(segments, hasSize(1)); + assertThat(segments.get(0).getNumDocs(), equalTo(numDocsFirstSegment + appends - deletes)); + assertThat(segments.get(0).getDeletedDocs(), equalTo(0)); + assertThat(segments.get(0).committed, equalTo(committed)); + } + } + + // this test writes documents to the engine while concurrently flushing/commit + public void testConcurrentMergeSegmentsOnCommit() throws Exception { + final AtomicLong globalCheckpoint = new AtomicLong(SequenceNumbers.NO_OPS_PERFORMED); + + final Settings.Builder settings = Settings.builder() + .put(defaultSettings.getSettings()) + .put(IndexSettings.INDEX_MERGE_ON_FLUSH_MAX_FULL_FLUSH_MERGE_WAIT_TIME.getKey(), TimeValue.timeValueMillis(5000)) + .put(IndexSettings.INDEX_MERGE_ON_FLUSH_ENABLED.getKey(), true); + final IndexMetadata indexMetadata = IndexMetadata.builder(defaultSettings.getIndexMetadata()).settings(settings).build(); + final IndexSettings indexSettings = IndexSettingsModule.newIndexSettings(indexMetadata); + + try ( + Store store = createStore(); + InternalEngine engine = createEngine( + config(indexSettings, store, createTempDir(), NoMergePolicy.INSTANCE, null, null, globalCheckpoint::get) + ) + ) { + final int numIndexingThreads = scaledRandomIntBetween(3, 8); + final int numDocsPerThread = randomIntBetween(500, 1000); + final CyclicBarrier barrier = new CyclicBarrier(numIndexingThreads + 1); + final List indexingThreads = new ArrayList<>(); + final CountDownLatch doneLatch = new CountDownLatch(numIndexingThreads); + // create N indexing threads to index documents simultaneously + for (int threadNum = 0; threadNum < numIndexingThreads; threadNum++) { + final int threadIdx = threadNum; + Thread indexingThread = new Thread(() -> { + try { + barrier.await(); // wait for all threads to start at the same time + // index random number of docs + for (int i = 0; i < numDocsPerThread; i++) { + final String id = "thread" + threadIdx + "#" + i; + ParsedDocument doc = testParsedDocument(id, null, testDocument(), B_1, null); + engine.index(indexForDoc(doc)); + } + } catch (Exception e) { + throw new RuntimeException(e); + } finally { + doneLatch.countDown(); + } + + }); + indexingThreads.add(indexingThread); + } + + // start the indexing threads + for (Thread thread : indexingThreads) { + thread.start(); + } + barrier.await(); // wait for indexing threads to all be ready to start + assertThat(doneLatch.await(10, TimeUnit.SECONDS), is(true)); + + boolean committed = randomBoolean(); + if (committed) { + engine.flush(); + } + + engine.refresh("test"); + List segments = engine.segments(randomBoolean()); + + // All segments have to be merged into one + assertThat(segments, hasSize(1)); + assertThat(segments.get(0).getNumDocs(), equalTo(numIndexingThreads * numDocsPerThread)); + assertThat(segments.get(0).committed, equalTo(committed)); + } + } + public void testCommitStats() throws IOException { final AtomicLong maxSeqNo = new AtomicLong(SequenceNumbers.NO_OPS_PERFORMED); final AtomicLong localCheckpoint = new AtomicLong(SequenceNumbers.NO_OPS_PERFORMED); From cadcfafd33238c693f39b8e0d099530ac70ba8e7 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 28 Mar 2022 12:39:10 -0500 Subject: [PATCH 010/514] Removing SLM check in tests for OpenSearch versions (#2604) (#2621) Signed-off-by: Vacha Shah (cherry picked from commit 5dd75bb0aa4cb64c46e99812b5fd9422588067e6) Co-authored-by: Vacha Shah --- .../java/org/opensearch/test/rest/OpenSearchRestTestCase.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/framework/src/main/java/org/opensearch/test/rest/OpenSearchRestTestCase.java b/test/framework/src/main/java/org/opensearch/test/rest/OpenSearchRestTestCase.java index 27369e79e5dee..9624a9d3d0554 100644 --- a/test/framework/src/main/java/org/opensearch/test/rest/OpenSearchRestTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/rest/OpenSearchRestTestCase.java @@ -531,7 +531,8 @@ protected boolean waitForAllSnapshotsWiped() { private void wipeCluster() throws Exception { // Clean up SLM policies before trying to wipe snapshots so that no new ones get started by SLM after wiping - if (nodeVersions.first().onOrAfter(LegacyESVersion.V_7_4_0)) { // SLM was introduced in version 7.4 + if (nodeVersions.first().onOrAfter(LegacyESVersion.V_7_4_0) && nodeVersions.first().before(Version.V_1_0_0)) { // SLM was introduced + // in version 7.4 if (preserveSLMPoliciesUponCompletion() == false) { // Clean up SLM policies before trying to wipe snapshots so that no new ones get started by SLM after wiping deleteAllSLMPolicies(); From 4b0801f22176112ce7af5478a79fd72949bfd4af Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 06:55:37 -0700 Subject: [PATCH 011/514] Bump forbiddenapis in /buildSrc/src/testKit/thirdPartyAudit (#2611) (#2634) Bumps [forbiddenapis](https://github.com/policeman-tools/forbidden-apis) from 3.2 to 3.3. - [Release notes](https://github.com/policeman-tools/forbidden-apis/releases) - [Commits](https://github.com/policeman-tools/forbidden-apis/compare/3.2...3.3) --- updated-dependencies: - dependency-name: de.thetaphi:forbiddenapis dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> (cherry picked from commit 8f4aec109de82340290d35863217d0ddcd49f383) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- buildSrc/src/testKit/thirdPartyAudit/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/testKit/thirdPartyAudit/build.gradle b/buildSrc/src/testKit/thirdPartyAudit/build.gradle index 41e699db94dcf..2c86d28cf0206 100644 --- a/buildSrc/src/testKit/thirdPartyAudit/build.gradle +++ b/buildSrc/src/testKit/thirdPartyAudit/build.gradle @@ -40,7 +40,7 @@ repositories { } dependencies { - forbiddenApisCliJar 'de.thetaphi:forbiddenapis:3.2' + forbiddenApisCliJar 'de.thetaphi:forbiddenapis:3.3' jdkJarHell 'org.opensearch:opensearch-core:current' compileOnly "org.${project.properties.compileOnlyGroup}:${project.properties.compileOnlyVersion}" implementation "org.${project.properties.compileGroup}:${project.properties.compileVersion}" From f38ef6123f8ca0bc1c2754fba04a4ca020d5613a Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 07:00:53 -0700 Subject: [PATCH 012/514] Bump htrace-core4 from 4.1.0-incubating to 4.2.0-incubating in /plugins/repository-hdfs (#2618) (#2630) * Bump htrace-core4 in /plugins/repository-hdfs Bumps htrace-core4 from 4.1.0-incubating to 4.2.0-incubating. --- updated-dependencies: - dependency-name: org.apache.htrace:htrace-core4 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Updating SHAs Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] (cherry picked from commit 2425f64baab25fe593937f4b78a2964c1797e90a) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- plugins/repository-hdfs/build.gradle | 2 +- .../licenses/htrace-core4-4.1.0-incubating.jar.sha1 | 1 - .../licenses/htrace-core4-4.2.0-incubating.jar.sha1 | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 plugins/repository-hdfs/licenses/htrace-core4-4.1.0-incubating.jar.sha1 create mode 100644 plugins/repository-hdfs/licenses/htrace-core4-4.2.0-incubating.jar.sha1 diff --git a/plugins/repository-hdfs/build.gradle b/plugins/repository-hdfs/build.gradle index dc1f55b686044..19f58bf48366d 100644 --- a/plugins/repository-hdfs/build.gradle +++ b/plugins/repository-hdfs/build.gradle @@ -61,7 +61,7 @@ dependencies { api "org.apache.hadoop:hadoop-client-api:${versions.hadoop3}" runtimeOnly "org.apache.hadoop:hadoop-client-runtime:${versions.hadoop3}" api "org.apache.hadoop:hadoop-hdfs:${versions.hadoop3}" - api 'org.apache.htrace:htrace-core4:4.1.0-incubating' + api 'org.apache.htrace:htrace-core4:4.2.0-incubating' api "org.apache.logging.log4j:log4j-core:${versions.log4j}" api 'org.apache.avro:avro:1.10.2' api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}" diff --git a/plugins/repository-hdfs/licenses/htrace-core4-4.1.0-incubating.jar.sha1 b/plugins/repository-hdfs/licenses/htrace-core4-4.1.0-incubating.jar.sha1 deleted file mode 100644 index 806c624c02cf0..0000000000000 --- a/plugins/repository-hdfs/licenses/htrace-core4-4.1.0-incubating.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -12b3e2adda95e8c41d9d45d33db075137871d2e2 \ No newline at end of file diff --git a/plugins/repository-hdfs/licenses/htrace-core4-4.2.0-incubating.jar.sha1 b/plugins/repository-hdfs/licenses/htrace-core4-4.2.0-incubating.jar.sha1 new file mode 100644 index 0000000000000..e2eafb09dba00 --- /dev/null +++ b/plugins/repository-hdfs/licenses/htrace-core4-4.2.0-incubating.jar.sha1 @@ -0,0 +1 @@ +94b3f1966922bc45d0f8a86a2aa867a4b0df288b \ No newline at end of file From 7d8f9acb7c3263638d7e132ab6fdd2d5434a64d3 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 10:55:07 -0700 Subject: [PATCH 013/514] Add mapping method back referenced in other repos (#2636) (#2648) Signed-off-by: Suraj Singh Signed-off-by: Nicholas Walter Knize (cherry picked from commit bcaa06bc0ffe8d350e80b0da53af5bf2ba9f99d0) Co-authored-by: Suraj Singh <79435743+dreamer-89@users.noreply.github.com> --- .../admin/indices/create/CreateIndexRequest.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexRequest.java index 7f1f516d13a04..26ff4f1da3ba4 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexRequest.java @@ -245,14 +245,22 @@ public CreateIndexRequest mapping(String mapping) { return this; } + /** + * Adds mapping that will be added when the index gets created. + * + * @param source The mapping source + * @param xContentType The content type of the source + */ + public CreateIndexRequest mapping(String source, XContentType xContentType) { + return mapping(new BytesArray(source), xContentType); + } + /** * Adds mapping that will be added when the index gets created. * * @param source The mapping source * @param xContentType the content type of the mapping source - * @deprecated types are being removed */ - @Deprecated private CreateIndexRequest mapping(BytesReference source, XContentType xContentType) { Objects.requireNonNull(xContentType); Map mappingAsMap = XContentHelper.convertToMap(source, false, xContentType).v2(); From 8865e753bae9ab53558385582c3461f74b496d62 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 30 Mar 2022 08:24:51 -0400 Subject: [PATCH 014/514] Update Gradle to 7.4.1 (#2078) (#2645) * Update Gradle to 7.4.1 Signed-off-by: Andriy Redko * Address code review comments, added @PathSensitive(PathSensitivity.RELATIVE) where applicable Signed-off-by: Andriy Redko (cherry picked from commit 223efe68e61aa791b97273d717379d164bd2d00c) Co-authored-by: Andriy Redko --- buildSrc/build.gradle | 2 +- .../precommit/LicenseHeadersTask.groovy | 5 +++++ .../gradle/precommit/FilePermissionsTask.java | 5 +++++ .../precommit/ForbiddenPatternsTask.java | 5 +++++ .../gradle/precommit/LoggerUsageTask.java | 2 ++ .../gradle/precommit/ThirdPartyAuditTask.java | 2 ++ .../gradle/test/rest/CopyRestApiTask.java | 5 +++++ .../gradle/test/rest/CopyRestTestsTask.java | 5 +++++ .../src/main/resources/minimumGradleVersion | 2 +- gradle/missing-javadoc.gradle | 4 ++++ gradle/wrapper/gradle-wrapper.jar | Bin 59536 -> 59821 bytes gradle/wrapper/gradle-wrapper.properties | 4 ++-- 12 files changed, 37 insertions(+), 4 deletions(-) diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index f940eec593306..3c3b227312dbf 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -112,7 +112,7 @@ dependencies { api 'commons-io:commons-io:2.7' api "net.java.dev.jna:jna:5.10.0" api 'gradle.plugin.com.github.johnrengelman:shadow:7.1.2' - api 'de.thetaphi:forbiddenapis:3.2' + api 'de.thetaphi:forbiddenapis:3.3' api 'com.avast.gradle:gradle-docker-compose-plugin:0.14.12' api 'org.apache.maven:maven-model:3.6.2' api 'com.networknt:json-schema-validator:1.0.67' diff --git a/buildSrc/src/main/groovy/org/opensearch/gradle/precommit/LicenseHeadersTask.groovy b/buildSrc/src/main/groovy/org/opensearch/gradle/precommit/LicenseHeadersTask.groovy index b330934ed2d26..b8d0ed2b9c43c 100644 --- a/buildSrc/src/main/groovy/org/opensearch/gradle/precommit/LicenseHeadersTask.groovy +++ b/buildSrc/src/main/groovy/org/opensearch/gradle/precommit/LicenseHeadersTask.groovy @@ -35,7 +35,10 @@ import org.opensearch.gradle.AntTask import org.gradle.api.file.FileCollection import org.gradle.api.tasks.Input import org.gradle.api.tasks.InputFiles +import org.gradle.api.tasks.IgnoreEmptyDirectories; import org.gradle.api.tasks.OutputFile +import org.gradle.api.tasks.PathSensitive +import org.gradle.api.tasks.PathSensitivity import org.gradle.api.tasks.SkipWhenEmpty import java.nio.file.Files @@ -78,6 +81,8 @@ class LicenseHeadersTask extends AntTask { */ @InputFiles @SkipWhenEmpty + @IgnoreEmptyDirectories + @PathSensitive(PathSensitivity.RELATIVE) List getJavaFiles() { return project.sourceSets.collect({it.allJava}) } diff --git a/buildSrc/src/main/java/org/opensearch/gradle/precommit/FilePermissionsTask.java b/buildSrc/src/main/java/org/opensearch/gradle/precommit/FilePermissionsTask.java index 9ffd472151b4b..d525a4a1e2c69 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/precommit/FilePermissionsTask.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/precommit/FilePermissionsTask.java @@ -46,8 +46,11 @@ import org.gradle.api.GradleException; import org.gradle.api.file.FileCollection; import org.gradle.api.file.FileTree; +import org.gradle.api.tasks.IgnoreEmptyDirectories; import org.gradle.api.tasks.InputFiles; import org.gradle.api.tasks.OutputFile; +import org.gradle.api.tasks.PathSensitive; +import org.gradle.api.tasks.PathSensitivity; import org.gradle.api.tasks.SkipWhenEmpty; import org.gradle.api.tasks.StopExecutionException; import org.gradle.api.tasks.TaskAction; @@ -92,6 +95,8 @@ private static boolean isExecutableFile(File file) { */ @InputFiles @SkipWhenEmpty + @IgnoreEmptyDirectories + @PathSensitive(PathSensitivity.RELATIVE) public FileCollection getFiles() { return GradleUtils.getJavaSourceSets(getProject()) .stream() diff --git a/buildSrc/src/main/java/org/opensearch/gradle/precommit/ForbiddenPatternsTask.java b/buildSrc/src/main/java/org/opensearch/gradle/precommit/ForbiddenPatternsTask.java index f57c190496452..754743b9b784c 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/precommit/ForbiddenPatternsTask.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/precommit/ForbiddenPatternsTask.java @@ -37,9 +37,12 @@ import org.gradle.api.file.FileCollection; import org.gradle.api.file.FileTree; import org.gradle.api.plugins.JavaPluginConvention; +import org.gradle.api.tasks.IgnoreEmptyDirectories; import org.gradle.api.tasks.Input; import org.gradle.api.tasks.InputFiles; import org.gradle.api.tasks.OutputFile; +import org.gradle.api.tasks.PathSensitive; +import org.gradle.api.tasks.PathSensitivity; import org.gradle.api.tasks.SkipWhenEmpty; import org.gradle.api.tasks.TaskAction; import org.gradle.api.tasks.util.PatternFilterable; @@ -100,6 +103,8 @@ public ForbiddenPatternsTask() { @InputFiles @SkipWhenEmpty + @IgnoreEmptyDirectories + @PathSensitive(PathSensitivity.RELATIVE) public FileCollection getFiles() { return getProject().getConvention() .getPlugin(JavaPluginConvention.class) diff --git a/buildSrc/src/main/java/org/opensearch/gradle/precommit/LoggerUsageTask.java b/buildSrc/src/main/java/org/opensearch/gradle/precommit/LoggerUsageTask.java index 1fd092b7f268f..ff9f6619d64e6 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/precommit/LoggerUsageTask.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/precommit/LoggerUsageTask.java @@ -37,6 +37,7 @@ import org.gradle.api.plugins.JavaPluginConvention; import org.gradle.api.tasks.CacheableTask; import org.gradle.api.tasks.Classpath; +import org.gradle.api.tasks.IgnoreEmptyDirectories; import org.gradle.api.tasks.InputFiles; import org.gradle.api.tasks.PathSensitive; import org.gradle.api.tasks.PathSensitivity; @@ -79,6 +80,7 @@ public void setClasspath(FileCollection classpath) { @InputFiles @PathSensitive(PathSensitivity.RELATIVE) @SkipWhenEmpty + @IgnoreEmptyDirectories public FileCollection getClassDirectories() { return getProject().getConvention() .getPlugin(JavaPluginConvention.class) diff --git a/buildSrc/src/main/java/org/opensearch/gradle/precommit/ThirdPartyAuditTask.java b/buildSrc/src/main/java/org/opensearch/gradle/precommit/ThirdPartyAuditTask.java index ee68d2740e279..097710b3f1a6e 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/precommit/ThirdPartyAuditTask.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/precommit/ThirdPartyAuditTask.java @@ -47,6 +47,7 @@ import org.gradle.api.tasks.CacheableTask; import org.gradle.api.tasks.Classpath; import org.gradle.api.tasks.CompileClasspath; +import org.gradle.api.tasks.IgnoreEmptyDirectories; import org.gradle.api.tasks.Input; import org.gradle.api.tasks.InputFile; import org.gradle.api.tasks.InputFiles; @@ -195,6 +196,7 @@ public Set getMissingClassExcludes() { @Classpath @SkipWhenEmpty + @IgnoreEmptyDirectories public Set getJarsToScan() { // These are SelfResolvingDependency, and some of them backed by file collections, like the Gradle API files, // or dependencies added as `files(...)`, we can't be sure if those are third party or not. diff --git a/buildSrc/src/main/java/org/opensearch/gradle/test/rest/CopyRestApiTask.java b/buildSrc/src/main/java/org/opensearch/gradle/test/rest/CopyRestApiTask.java index 399cd39d236d7..1468c4cb1b537 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/test/rest/CopyRestApiTask.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/test/rest/CopyRestApiTask.java @@ -43,9 +43,12 @@ import org.gradle.api.file.FileTree; import org.gradle.api.plugins.JavaPluginConvention; import org.gradle.api.provider.ListProperty; +import org.gradle.api.tasks.IgnoreEmptyDirectories; import org.gradle.api.tasks.Input; import org.gradle.api.tasks.InputFiles; import org.gradle.api.tasks.OutputDirectory; +import org.gradle.api.tasks.PathSensitive; +import org.gradle.api.tasks.PathSensitivity; import org.gradle.api.tasks.SkipWhenEmpty; import org.gradle.api.tasks.SourceSet; import org.gradle.api.tasks.TaskAction; @@ -112,8 +115,10 @@ public boolean isSkipHasRestTestCheck() { return skipHasRestTestCheck; } + @IgnoreEmptyDirectories @SkipWhenEmpty @InputFiles + @PathSensitive(PathSensitivity.RELATIVE) public FileTree getInputDir() { FileTree coreFileTree = null; boolean projectHasYamlRestTests = skipHasRestTestCheck || projectHasYamlRestTests(); diff --git a/buildSrc/src/main/java/org/opensearch/gradle/test/rest/CopyRestTestsTask.java b/buildSrc/src/main/java/org/opensearch/gradle/test/rest/CopyRestTestsTask.java index 56ce449f4cf6f..dd94d040cb9d8 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/test/rest/CopyRestTestsTask.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/test/rest/CopyRestTestsTask.java @@ -43,9 +43,12 @@ import org.gradle.api.file.FileTree; import org.gradle.api.plugins.JavaPluginConvention; import org.gradle.api.provider.ListProperty; +import org.gradle.api.tasks.IgnoreEmptyDirectories; import org.gradle.api.tasks.Input; import org.gradle.api.tasks.InputFiles; import org.gradle.api.tasks.OutputDirectory; +import org.gradle.api.tasks.PathSensitive; +import org.gradle.api.tasks.PathSensitivity; import org.gradle.api.tasks.SkipWhenEmpty; import org.gradle.api.tasks.SourceSet; import org.gradle.api.tasks.TaskAction; @@ -104,8 +107,10 @@ String getSourceSetName() { return sourceSetName; } + @IgnoreEmptyDirectories @SkipWhenEmpty @InputFiles + @PathSensitive(PathSensitivity.RELATIVE) public FileTree getInputDir() { FileTree coreFileTree = null; if (includeCore.get().isEmpty() == false) { diff --git a/buildSrc/src/main/resources/minimumGradleVersion b/buildSrc/src/main/resources/minimumGradleVersion index ba92e72f5775b..6b0e58e78f5ee 100644 --- a/buildSrc/src/main/resources/minimumGradleVersion +++ b/buildSrc/src/main/resources/minimumGradleVersion @@ -1 +1 @@ -6.6.1 \ No newline at end of file +7.4.1 \ No newline at end of file diff --git a/gradle/missing-javadoc.gradle b/gradle/missing-javadoc.gradle index df47a3796c825..05531487f35f3 100644 --- a/gradle/missing-javadoc.gradle +++ b/gradle/missing-javadoc.gradle @@ -7,6 +7,8 @@ */ import javax.annotation.Nullable +import org.gradle.api.tasks.PathSensitive; +import org.gradle.api.tasks.PathSensitivity; import org.gradle.internal.jvm.Jvm /** @@ -178,6 +180,8 @@ configure([ class MissingJavadocTask extends DefaultTask { @InputFiles @SkipWhenEmpty + @IgnoreEmptyDirectories + @PathSensitive(PathSensitivity.RELATIVE) SourceDirectorySet srcDirSet; @OutputDirectory diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7454180f2ae8848c63b8b4dea2cb829da983f2fa..41d9927a4d4fb3f96a785543079b8df6723c946b 100644 GIT binary patch delta 8958 zcmY+KWl$VIlZIh&f(Hri?gR<$?iyT!TL`X;1^2~W7YVSq1qtqM!JWlDxLm%}UESUM zndj}Uny%^UnjhVhFb!8V3s(a#fIy>`VW15{5nuy;_V&a5O#0S&!a4dSkUMz_VHu3S zGA@p9Q$T|Sj}tYGWdjH;Mpp8m&yu&YURcrt{K;R|kM~(*{v%QwrBJIUF+K1kX5ZmF zty3i{d`y0;DgE+de>vN@yYqFPe1Ud{!&G*Q?iUc^V=|H%4~2|N zW+DM)W!`b&V2mQ0Y4u_)uB=P@-2`v|Wm{>CxER1P^ z>c}ZPZ)xxdOCDu59{X^~2id7+6l6x)U}C4Em?H~F`uOxS1?}xMxTV|5@}PlN%Cg$( zwY6c}r60=z5ZA1L zTMe;84rLtYvcm?M(H~ZqU;6F7Evo{P7!LGcdwO|qf1w+)MsnvK5^c@Uzj<{ zUoej1>95tuSvDJ|5K6k%&UF*uE6kBn47QJw^yE&#G;u^Z9oYWrK(+oL97hBsUMc_^ z;-lmxebwlB`Er_kXp2$`&o+rPJAN<`WX3ws2K{q@qUp}XTfV{t%KrsZ5vM!Q#4{V& zq>iO$MCiLq#%wXj%`W$_%FRg_WR*quv65TdHhdpV&jlq<=K^K`&!Kl5mA6p4n~p3u zWE{20^hYpn1M}}VmSHBXl1*-)2MP=0_k)EPr#>EoZukiXFDz?Di1I>2@Z^P$pvaF+ zN+qUy63jek2m59;YG)`r^F3-O)0RDIXPhf)XOOdkmu`3SMMSW(g+`Ajt{=h1dt~ks ztrhhP|L4G%5x79N#kwAHh5N){@{fzE7n&%dnisCm65Za<8r_hKvfx4Bg*`%-*-Mvn zFvn~)VP@}1sAyD+B{{8l{EjD10Av&Mz9^Xff*t`lU=q=S#(|>ls520;n3<}X#pyh& z*{CJf7$*&~!9jMnw_D~ikUKJ2+UnXmN6qak{xx%W;BKuXt7@ky!LPI1qk?gDwG@@o zkY+BkIie>{{q==5)kXw(*t#I?__Kwi>`=+s?Gq6X+vtSsaAO&Tf+Bl$vKnzc&%BHM z=loWOQq~n}>l=EL(5&6((ESsQC3^@4jlO5Od{qN#sWV)vqXw}aA>*uvwZopNN(|-T zRTF%5Y_k1R$;(d-)n;hWex{;7b6KgdAVE@&0pd(*qDzBO#YZV%kh%pYt1`hnQ(Fa& zYiDrOTDqk5M7hzp9kI2h!PxNnuJ&xl*zF8sx6!67bA49R1bmUF5bpK&&{eI0U~cH}PM z3aW1$lRb|ItkG5~_eBNu$|I|vYIdAA9a!pVq<+UTx*M}fG`23zxXp&E=FfnY- zEzKj;Cu_s4v>leO7M2-mE(UzKHL4c$c`3dS*19OpLV^4NI*hWWnJQ9lvzP4c;c?do zqrcsKT*i~eIHl0D3r4N{)+RsB6XhrC^;sp2cf_Eq#6*CV;t8v=V!ISe>>9kPgh}NI z=1UZutslxcT$Ad;_P^;Oouoa(cs!Ctpvi>%aQ+Zp=1d|h{W9Wmf7JWxa(~<#tSZ?C%wu4_5F!fc!<@PIBeJ)Nr^$bB6!_Gic_7}c3J{QI~Gg5g5jTp9}V6KYgrgaX>pJt}7$!wOht&KO|+z{Iw@YL|@~D zMww}+lG}rm2^peNx>58ME||ZQxFQeVSX8iogHLq_vXb`>RnoEKaTWBF-$JD#Q4BMv zt2(2Qb*x-?ur1Y(NsW8AdtX0#rDB?O(Vs4_xA(u-o!-tBG03OI!pQD+2UytbL5>lG z*(F)KacHqMa4?dxa(Vcrw>IIAeB$3cx#;;5r2X;HE8|}eYdAgCw#tpXNy7C3w1q`9 zGxZ6;@1G%8shz9e+!K2MO*{_RjO}Jo6eL3{TSZ>nY7)Qs`Dhi5><@oh0r)gT7H-?3 zLDsd^@m%JvrS8sta5`QiZNs^*GT}Hiy^zjK2^Ni%`Z|ma)D2 zuyumbvw$M8$haCTI~6M%d4+P)uX%u{Sfg4Al+F7c6;O-*)DKI7E8izSOKB#FcV{M+ zEvY0FBkq!$J0EW$Cxl}3{JwV^ki-T?q6C30Y5e&p@8Rd?$ST-Ghn*-`tB{k54W<>F z5I)TFpUC!E9298=sk>m#FI4sUDy_!8?51FqqW!9LN1(zuDnB3$!pEUjL>N>RNgAG~-9Xm|1lqHseW(%v&6K(DZ3Pano(1-Qe?3%J&>0`~w^Q-p&@ zg@HjvhJk?*hpF7$9P|gkzz`zBz_5Z!C4_-%fCcAgiSilzFQef!@amHDrW!YZS@?7C zs2Y9~>yqO+rkih?kXztzvnB^6W=f52*iyuZPv$c42$WK7>PHb z6%MYIr5D32KPdwL1hJf{_#jn?`k(taW?mwmZVvrr=y~fNcV$`}v(8};o9AjOJumS4 z`889O91^pkF+|@$d9wVoZ3;^j;^sUs&Ubo_qD&MTL%O z&*SE0ujG~zm;?x)8TLC&ft))nyI zcg44@*Q{cYT+qGrA=In_X{NNCD+B0w#;@g)jvBU;_8od6U>;7HIo@F*=g8CQUo(u^ z3r4FJ7#<@)MXO&5+DgKE&^>^`r!loe7CWE*1k0*0wLFzSOV8jvlX~WOQ?$1v zk$Or}!;ix0g78^6W;+<=J>z@CBs!<<)HvF(Ls-&`matpesJ5kkjC)6nGB@b{ii6-Uoho$BT%iJgugTOeZ$5Xo4D7Pd< zC*LJh5V@2#5%aBZCgzlQi3@<_!VfiL07ywc)ZbwKPfcR|ElQoS(8x|a7#IR}7#Io= zwg4$8S{egr-NffD)Fg&X9bJSoM25pF&%hf>(T&9bI}=#dPQyNYz;ZZ7EZ=u1n701SWKkZ9n(-qU ztN`sdWL1uxQ1mKS@x11;O|@^AD9!NeoPx}?EKIr!2>1Qq4gjfGU)tr6?Z5l7JAS3j zZeq{vG{rb%DFE4%$szK}d2UzB{4>L?Tv+NAlE*&Nq6g+XauaSI+N2Y8PJLw+aNg1p zbxr|hI8wcMP&&+(Cu|%+Jq|r>+BHk@{AvfBXKiVldN)@}TBS0LdIpnANCVE26WL-} zV}HJ^?m&$Rkq;Zf*i-hoasnpJVyTH__dbGWrB_R55d*>pTyl6(?$EO@>RCmTX1Hzr zT2)rOng?D4FfZ_C49hjMV*UonG2DlG$^+k=Y%|?Dqae4}JOU=8=fgY4Uh!pa9eEqf zFX&WLPu!jArN*^(>|H>dj~g`ONZhaaD%h_HHrHkk%d~TR_RrX{&eM#P@3x=S^%_6h zh=A)A{id16$zEFq@-D7La;kTuE!oopx^9{uA3y<}9 z^bQ@U<&pJV6kq7LRF47&!UAvgkBx=)KS_X!NY28^gQr27P=gKh0+E>$aCx&^vj2uc}ycsfSEP zedhTgUwPx%?;+dESs!g1z}5q9EC+fol}tAH9#fhZQ?q1GjyIaR@}lGCSpM-014T~l zEwriqt~ftwz=@2tn$xP&-rJt?nn5sy8sJ5Roy;pavj@O+tm}d_qmAlvhG(&k>(arz z;e|SiTr+0<&6(-An0*4{7akwUk~Yf4M!!YKj^swp9WOa%al`%R>V7mi z+5+UodFAaPdi4(8_FO&O!Ymb#@yxkuVMrog(7gkj$G@FLA#ENMxG)4f<}S%Fn?Up$+C%{02AgMKa^ z4SFGWp6U>{Q6VRJV}yjxXT*e`1XaX}(dW1F&RNhpTzvCtzuu;LMhMfJ2LBEy?{^GHG!OF!! zDvs64TG)?MX&9NCE#H3(M0K>O>`ca0WT2YR>PTe&tn?~0FV!MRtdb@v?MAUG&Ef7v zW%7>H(;Mm)RJkt18GXv!&np z?RUxOrCfs;m{fBz5MVlq59idhov21di5>WXWD-594L-X5;|@kyWi@N+(jLuh=o+5l zGGTi~)nflP_G}Yg5Pi%pl88U4+^*ihDoMP&zA*^xJE_X*Ah!jODrijCqQ^{=&hD7& z^)qv3;cu?olaT3pc{)Kcy9jA2E8I)#Kn8qO>70SQ5P8YSCN=_+_&)qg)OYBg|-k^d3*@jRAeB?;yd-O1A0wJ z?K*RDm|wE<(PBz~+C%2CTtzCTUohxP2*1kE8Of~{KRAvMrO_}NN&@P7SUO{;zx0iK z@or9R8ydYOFZf(cHASCAatL%;62IL27~SmASr(7F&NMr+#gNw@z1VM z_ALFwo3)SoANEwRerBdRV`>y`t72#aF2ConmWQp(Xy|msN9$yxhZ1jAQ67lq{vbC5 zujj|MlGo`6Bfn0TfKgi(k=gq0`K~W+X(@GzYlPI4g0M;owH3yG14rhK>lG8lS{`!K z+Nc@glT-DGz?Ym?v#Hq|_mEdPAlHH5jZuh*6glq!+>Lk$S%ED2@+ea6CE@&1-9a?s znglt|fmIK}fg<9@XgHe4*q!aO<-;Xj$T?IzB-{&2`#eA6rdtCi80mpP&vw(Uytxu$#YzNI_cB>LS zmim>ys;ir;*Dzbr22ZDxO2s;671&J0U<9(n1yj)J zHFNz=ufPcQVEG+ePjB<5C;=H0{>Mi*xD>hQq8`Vi7TjJ$V04$`h3EZGL|}a07oQdR z?{cR(z+d>arn^AUug&voOzzi$ZqaS)blz-z3zr;10x;oP2)|Cyb^WtN2*wNn`YX!Y z+$Pji<7|!XyMCEw4so}xXLU)p)BA~2fl>y2Tt}o9*BPm?AXA8UE8a;>rOgyCwZBFa zyl42y`bc3}+hiZL_|L_LY29vVerM+BVE@YxK>TGm@dHi@Uw*7AIq?QA9?THL603J% zIBJ4y3n8OFzsOI;NH%DZ!MDwMl<#$)d9eVVeqVl(5ZX$PPbt*p_(_9VSXhaUPa9Qu z7)q4vqYKX7ieVSjOmVEbLj4VYtnDpe*0Y&+>0dS^bJ<8s*eHq3tjRAw^+Mu4W^-E= z4;&namG4G;3pVDyPkUw#0kWEO1;HI6M51(1<0|*pa(I!sj}F^)avrE`ShVMKBz}nE zzKgOPMSEp6M>hJzyTHHcjV%W*;Tdb}1xJjCP#=iQuBk_Eho6yCRVp&e!}4IBJ&?ksVc&u#g3+G$oNlJ?mWfADjeBS-Ph3`DKk-~Z70XugH8sq2eba@4 zIC1H_J$`9b$K`J)sGX3d!&>OmC@@rx1TL~NinQOYy72Q_+^&Mg>Ku(fTgaXdr$p_V z#gav1o{k~c>#)u3r@~6v^o)Lf=C{rAlL@!s457pq)pO;Cojx7U{urO4cvXP|E>+dV zmr2?!-5)tk-&*ap^D^2x7NG6nOop2zNFQ9v8-EZ{WCz-h36C)<^|f{V#R_WE^@(T0+d-at5hXX{U?zak*ac-XnyINo+yBD~~3O1I=a z99|CI>502&s-Qi5bv>^2#cQ%ut<4d7KgQ^kE|=%6#VlGiY8$rdJUH{sra;P~cyb_i zeX(kS%w0C?mjhJl9TZp8RS;N~y3(EXEz13oPhOSE4WaTljGkVXWd~|#)vsG6_76I)Kb z8ro?;{j^lxNsaxE-cfP;g(e;mhh3)&ba}li?woV2#7ByioiD>s%L_D;?#;C#z;a(N z-_WY<=SH42m9bFQ>Nb z@4K$@4l8pD7AKxCR>t0%`Qoy9=hA?<<^Vcj8;-E+oBe3ReW1`el8np8E$k{LgFQ}2 z2t8a`wOXFdJ9!5$&mEfD1CnJ)TB+RJih88-Zos9@HZ# zL#{qfbF0ARTXkR@G{lwlOH~nnL)1jcyu!qv2`57S&%oKz0}r{~l9U_UHaJ5!8#nrs z?2FrL`mxnzu&{bweD&62)ilz*?pYIvt`T!XFVVA78})p1YEy7 z8fK#s?b~Yo$n7&_a?EBdXH-_W)Z44?!;DFx6pZ?~RArtBI*Qm4~6nX6Z_T*i$bQPE;Qz?DAPstpGSqr-AJ zo%m9cA`oDDm?&dTaoh_>@F>a?!y4qt_;NGN9Z<%SS;fX-cSu|>+Pba22`CRb#|HZa z;{)yHE>M-pc1C0mrnT~80!u&dvVTYFV8xTQ#g;6{c<9d!FDqU%TK5T6h*w*p980D~ zUyCb`y3{-?(mJFP)0*-Nt;mI$-gc4VQumh|rs&j_^R{sgTPF`1Xja2YWstsKFuQ(d zmZMxV$p$|qQUXchu&8%J(9|)B?`~rIx&)LqDS>ob5%gTeTP#Sbny#y*rnJ&?(l=!( zoV~}LJ1DPLnF8oyM(2ScrQ0{Q4m4-BWnS4wilgCW-~~;}pw=&<+HggRD_3c@3RQIr z9+-%!%}u_{`YS=&>h%kPO3ce}>y!d-zqiniNR-b5r97u;+K6HA2tS>Z#cV{+eFI`* zd8RMGAUtX1KWfPV;q<-5JAykS+2sY$2~UX+4461a(%{P#{rwFPu0xpIuYlbgD{C7C z=U{FUarVTYX6ZUq3wE@G^QT4H2Re;n$Fz9cJ>hABl)9T8pozqbA1)H-%1=WKm^QMu zjnUZ&Pu>q+X&6Co*y#@pxc-4waKMInEPGmE_>3@Ym3S*dedSradmc5mlJn`i0vMW6 zhBnGQD^Z;&S0lnS0curqDO@({J7kTtRE+Ra?nl^HP9<)W&C>~`!258f$XDbyQOQXG zP8hhySnarOpgu8xv8@WlXnm(Uk~)_3$Sg0vTbU3 z{W!5B(L3{Yy3K5PN<@jEarAtja`}@KYva&zFRF*s+_%jIXh$T(S=an8?=Ry3H*NRqWgsM`&!#|@kf1>=4q%bFw7^Rhz!z5I zyI^zU8_R1WN9`88Z=n>pIZQ`Ixr~_9G%Q}@A7rd#*%y7G zXl^Id=^ZL?Rx}}gWXCqzj9C6;x(~mAH|$JteXa1MH<6UQig@!Hf~t}B%tP0I|H&;y zO6N0}svOa1a^PyP9N5?4W6VF%=Bj{qHUgc8@siw4bafT=UPFSoQqKgyUX>sXTBZ=x zOh^Ad!{kOM9v{%5y}`-8u*T&C7Vq6mD%GR}UeU(*epO&qgC-CkD;%=l)ZuinSzHM` z{@`j&_vC6dDe{Yb9k@1zeV_K6!l(@=6ucoI=R^cH=6{i71%4W3$J-?<8Qn#$-DMtA z6Qqi)t?4ifrt%3jSA#6ji#{f(($KBL-iQh-xrC||3U3lq`9>r)>X%oLvtimuHW-)} zy}>9~|M>w4eES`g7;iBM%Se5-OP%1U6gNWp3AZqT8C6OlFFfQ$|7LL;tBV)(qlp4K zruar^K8FnJN3@_}B;G`a~H`t|3+6d>q3#`ctTkE-D^1#d9NalQ04lH*qUW2!V zhk7#z8OwHhSl8w14;KctfO8ubZJ4$dEdpXE78wABz=n5*=q9ex3S}`e7x~~V-jmHOhtX2*n+pBslo3uosdE7xABK=V#-t{1Hd~?i z{i~%Bw6NYF+F$aK$M`r#xe=NxhA5=p%i7!$);sd>Q}#`G?Q~fygrMXmZw?0#5#17W}6Tj+&kFexG{!mYl5FoA99}3G9l;3lVQ^ z48^~gsVppE*x91WheqI(A%F0Z#$#1UJP1R12Mj9r)y(A?a+iquX+d8WD4WAQJ_!oq z9rTISr7bPd(GTP57xm$}C}&kjMivi;zi^Y9g3&X0A;ovdJ?{%_wHgt%%9P&N4H z^XzV(uNA4 zAP`hgP6BEN5`YXh|DF~6Pud?~gWfhUKoPX4>z|}0aocC&K+AoV%|SX*N!wGq3|y< zg4lP(04XIPmt6}$N!dTk+pZv>u;MTB{L4hp9uXk7>aS!6jqM2lVr%{)H3$O127TSZ z0x9hi0k-P?nWFdQ0K`pykqUIT&jD~B0tHP{ffS(}fZ(aW$oBWTSfHO!A^><6vA?qar%tzN-5NQO zL&|F{nGiQyzNJ+bM$Y`n=Lx^3wTG^o2bGB@cwr1eb+6c-1tN=U+Db;bc~eJ!hwM{SbI=#g?$!PjDB+) zPgU_2EIxocr*EOJG52-~!gml&|D|C2OQ3Y(zAhL}iae4-Ut0F*!z!VEdfw8#`LAi# zhJ_EM*~;S|FMV6y%-SduHjPOI3cFM(GpH|HES<}*=vqY+64%dJYc|k?n6Br7)D#~# zEqO(xepfaf2F{>{E2`xb=AO%A<7RtUq6kU_Iu0m?@0K(+<}u3gVw5fy=Y4CC*{IE3 zLP3YBJ7x+U(os5=&NT%gKi23bbaZ`@;%ln)wp4GpDUT$J8NtFDHJzIe_-t}{!HAsh zJ4<^WovY};)9IKAskSebdQiXv$y5}THuJZ}ouoElIZRui=6lrupV|_Jz=9^&;@HwL;J#@23k?A;k`0Bgf;ioO>W`IQ+4? z7A)eKoY4%+g%=w;=Vm8}H>@U*=*AWNtPqgWRqib#5RTGA@Q=43FrQn3J`GkTUV5yp0U`EOTqjfp+-9;0F8!dMEwwcK%(6`8sDD^aR04 zd6O5vh|Xk?&3dy4f|1QK&Ulf{h6Iq;d-&*ti#Ck>wZFG;GHwc?b;X~eBITx49>2d8 z4HcK&1&DvEGT6kXdzAm4oO8%c}8OBt~8H956_;YP-ss*uMf==a+%w~F>Qkm7r)IAuxuoX}h92$gHqbFUun#8m zWHdy`Zrm#=Pa98x8cO0vd@Tgkr*lm0{dky+Gocr0P8y%HGEI#c3qLqIRc`Oq_C%*; zG+QTr(#Q|yHKv6R@!DmLlwJQ3FAB)Yor-I4zyDyqM4yp5n2TrQH>gRt*Zw0+WI-Sj`EgmYHh=t9! zF6lz^xpqGGpo6!5`sc0a^FVhy_Uxq|@~(1@IIzV)nTpY9sY`CV!?8e&bB8=M&sYEb z2i}fvKdhp9Hs68Y-!QJ<=wE(iQ5+49tqt;Rh|jhYrI5VW-mIz|UY{h8E=rC5sh#DU z?wGgk-Tn!I?+Zer7pHlF_Z^!Kd1qkS3&lv#%s6-<5Y%jQL${cge5=G5Ab?D&|9$Y~ zf%rJC2+=2vg;y0-SJb3<@3%}BO$T$C66q$L_H33a`VUbgW~N(4B=v5(<=My|#|J7q z*Ox4wL4kbJd_~EjLTABSu4U7Jk#`y(6O*U6(k6XxM}CtGZB(H@3~kh*zaGRXM}Iwp zQ%xFk2>@wiZrVCV_G4G~v;NebCQ%T7{SDyPpSv&dT@Cn)Mx@IK*IdNrj{*4pkV4wv z)y0J538h>cpB7iPSzA~x24T`{dzNkpvGIqvt1Dvdq@o-`B=$hkczX8$yFMhsWNK-X zxr$kR$tMD0@W)Vxe1^t9qVmsg&K^F@u84)(n2dttIEAZFN6VD$&tskpG%SI7whGL3 z)DeRiwe&?8m7U{G`oW8!SCi*dM>oYL%UKQnKxV_0RXAEBQg1kStExGEUVwLJ0orGGwb7uv+kPDl7_E2*iD|J*=8A@;XCvwq0aw5oJYN*Yh&o=l} z2z8YKb-fIAH5spql4eXqp*)o2*b>#1@DSt?zZi{GPj0gH&Nm+EI<3^z0w%YTEV4xw zI6$+=Faa|Y4o5i0zm5lOg|&tmnJ806DBovU@Ll6XsA;NRrTK~t*AAJIAS=v-UZ%Pr z$oddI@NRir&erzCwq|)ciJemr-E061j{0Vc@Ys7K(mW|JYj*$+i1Q8XlIK8T?TYS(AXu$`2U zQ@fHxc=AVHl_}cRZQ)w0anMEoqRKKIvS^`<-aMf*FM`NsG&Uowneo+Ji$7DUDYc7*Hjg;-&aHM%3 zXO6cz$$G};Uqh+iY7Wpme>PHG4cu(q;xyskNLs$^uRRMfEg?8Cj~aE-ajM%CXkx0F z>C?g3tIA#9sBQOpe`J+04{q7^TqhFk^F1jFtk4JDRO*`d-fx`GYHb=&(JiaM1b?Y^ zO3Kj3sj76ieol|N$;>j@t#tKj=@*gP+mv}KwlTcPYgR$+)2(gk)2JNE=jSauPq!$< z<|?Sb%W)wS)b>b6i{8!x!^!xIdU3{CJFVnTcw0j{M%DUCF=_>eYYEUWnA-|B(+KYL z_W_`JI&&u^@t0})@DH^1LDuT0s3dMpCHIbYBgOT4Zh_4yHbSqRbtIKndeT4Q*Jg91 z@>rO!^t-G~*AIW;FQ$3J=b;oGg8?CTa~qNCb>&cgp@e;?0AqA&paz~(%PYO+QBo4( zp?}ZdSMWx0iJm7HVNk9A#^9Osa#GPJ!_pYEW}($8>&2}fbr@&ygZ?${A7_9?X$(&5 z#~-hxdPQwCNEpf=^+WH-3`2LxrrBMTa}~qJC9S;VzhG!On^JLyW6WkF{8aAE$sM+( zxr8xLW(KIjI`Rm(24r3OJBk<3GF=G!uSP0-G&AY32mLm8q=#Xom&Pqv=1C{d3>1^ zAjsmV@XZ%BKq^eUfBpa8KvO8ob|F3hAjJv*yo2Bhl0)KUus{qA9m8jf)KnOGGTa6~4>3@J_VzkL|vYPl*uL+Ot*Q7W!f5rJw5+AsjP_IfL+-S*2p| zB7!FhjvkUTxQkGWGSg{X;h~dK>gAJivW?88Nu!3o>ySDaABn$rAYt086#27fbjPQS zhq>55ASvm*60qRdVOY9=bU^+{Pi#!OaZwENN;zy5?EztOHK-Q5;rCuiFl}BSc1YaQ zC-S{=KsGDz@Ji9O5W;XxE0xI|@3o6(2~i4b8Ii9VT;^G$*dRw(V?=br)D&q^XkeBX z+gl~+R@rVD-Hwv@7RHV?Bip5KMI)aV^&snt?H<$Nt=OPx#VxF&BGi?2A2+lNOYywNUGMeGL;|(=UjGDtLG0sN&LpGx;|U;xa13s z;W_|SPk^G}!M9_^pO zA3bt3-tca%^42sHeDtfcC0S3w3H1ny!Bxpa=*k?XRPpx9Bb-gx1J9Yvx)4J(8cG+q z(iCPZ9dsf3#QVyZgD_MW#G#qgV)olu$59&3(PzQfw@%4uZ~<5J=ABvdY43(Qnp{;G zHg3>@T#>DbTuhFl3)fb3TFqdh)V2aq7!;&JOHseTWukvA7}(iGUq;v-{2J0iHSNHq z;+)h!p6Ok^+Sp8-jgL($n6Qu47xyE`cFO5SdZR6;R!FET`tm#0D37z339Suxjpv+s z*=%2-N$N?X&0?x_uut3erF@aBGj;9$k9?3FlbDO{RQa1_qtxrh4!4#fjp4x~akvdTp@ zos?^Q&XE;3N93s4rHQGPrV7+au1$$aB6$hLy*Yz_kN$~dweb9PcB!eYVQTGjFuJP> zZCEwBtb>TIgIO^qAzq@Bv-qud_ZD-2W<_at&ml-gv`tPt$@DF5`HlA zM>DmmMkpv&Zm-8)Y#0bLQf4MpD4_-7M8eu6rh(tL8dq8onHs#R9J~dGd2IaXXMC~h z91pKhnQa%Fsn29nAA1;x(%oC zhca~qQDJaMf?wFrl-Pj;e$bZMYmMF!Y3Lv&Sb?Sjn#!NVx&NDyc^$b4uYyo2OmERa zRz;yDGd@JTykzFLe|Wk-y7#3x`6$wt$zR8r48mdUvfbeL+4D|Z``~7$PrE@qc7rZe zVsIoIbCwzjLZ@_M1*bD{HaYn();Z1-q*-I{tEnTZ(}Zmk&%MXSNBX>o| z-u*RNkAyKC-Srp7c-=@5f)xMWg>o2WWl}j6j9=8+D8;T z>0*0q#;qw8%U8i;6s0fu#I*%(g*@@a2Er@@nyI}{=@W{Z-;`=wN4N~>6Xrh&z#g}l zN1g5}0-#(nHUTv_rl2{yUZ;h#t&Fd?tY!7L%ClY)>uH-Ny2ET$lW$S)IQiN79H)D^ zb&0AXYkupy0~w8)*>Sj_p9}4L?lGTq%VG|2p`nWGhnM^!g|j-|O{%9Q%swOq63|*W zw$(N_laI}`ilB+o!a-wl?er~;;3+)$_akSQ!8YO_&-e*SI7n^(QQ;X0ZE`{4f!gAl z5$d+9CKVNonM!NO_frREICIAxOv)wm>}-k?iRisM`R7;=lyo|E_YR~FpS&PS`Lg0f zl-ON<0S%Uix8J%#yZdkCz4YNhcec<|7*P(JsM#>-L>+tYg_71q9~70FAc^6KW5jql zw!crdgVLH1G_eET=|SEc977;)ezVC|{PJZfra|}@rD;0s&@61mTEBJtILllg{%{vN zfhb&lq0yChaLhnJ-Qb62MB7`>M;|_ceHKZAeeh@#8tbrK!ArP6oXIhMK;dhEJTY`@ z0Tq>MIe0`7tGv)N*F0IGYSJv0vN?Az8g+4K9S!pW2~9F4W(_U_T=jCZrzuZ3*|__T zONp_UWmyePv8C~rckc?Xji;Z5OEqg zC*Um)i;Wh4TEwqReQdVVbUKT^2>Tpi6z_^-uF*adUFug4i@JhzpWT^Sk&E>CyP2?H zWf6x}ehuTs6wvzCnTU&gYzT029Nz19(In1WC z`(1IGmi!O%2AR|BjQa4Q0~u)kM%}?xQyjWuQ16^Gp++;`vr7!k--UZWM*~7Zl|ceO@I3`OpaRhD;YoCuo5IC0uHx>9 z478hu@H|e0Zlo)Zj@01#;8BDs@991xe~^9uG2}UXLM(m7fa}AMwX*tjioBeV&Q8Gx zSq$6wZFkRBK`cMI>R(@W@+lo2t)L+4q-negWRLWZBz*|%=W4v62JrmzNuOtA*x)QE z5L%=OH#@KMdB%Jp^r?0tE}5-*6oP`-lO7Sf)0)n*e<{HA=&qhLR)oD8-+V}Z4=md) z+k9lKf64DB2hAT)UaCP~di?-V3~JBH7itYyk~L6hrnxM%?RKntqd`=!b|e7eFnAcu z3*V;g{xr7TSTm$}DY%~SMpl>m{Sj!We+WfxSEor?YeiAxYUy25pn(?T()E>ByP^c@ zipwvWrhIK((R((VU+;@LmOnDu)ZXB3YArzzin!Z^0;PyJWnlfflo|q8(QY;o1*5CO z##hnkO{uynTMdk`~DOC#1 zdiYxQoy}=@7(ke#A8$YZZVtk4wo$8x28&I;cY3Ro-|kW=*yiiHgCLZeAr)UtVx>Tu z|LvL0hq|1-jC0I4x#>&QZCfrVB=zT!nR|~Uz`9%~2 znl{uZ{VEszW`Fad^q_HB!K9*|U-stK%?~;g?&&+12A}Rq$z($Bzuk^2X(Y=hF?-dQ ztc3DsQKI;qhWIV`99Q#R3xnU0AvY!i*BECj-z9l74|%O=V@nlv|qqC^r^-~C?E zGW%c|uYgnfJ(gjsTm_cIqcv*mYM{+i+&@F@+69ZQOK&u#v4oxUSQJ=tvqQ3W=*m;| z>SkBi8LYb-qRY7Sthh*0%3XAC%$z1rhOJzuX=PkTOa=DlocZUpE#KxVNH5)_4n=T( zGi3YrH7e~sPNYVBd~Grcq#CF~rN{p9Zza-Ntnwfma@TB)=3g36*0lSZg#ixEjFe%+ zX=&LDZ5zqculZ`=RYc^ln(~;nN|Qh6gN=!6f9-N2h+3NWbIxYud&;4SX*tWf5slk4 z{q@@l71UAZgj~*6edXb57fBUxvAS7s(RI=X868JM0+^DCn2yC>;v%S;qPOjB>YVsz(Zx9a>>BK&M zIQK>7_n)4ud0X5YM}^i*keH{ehLsiy9@NvOpsFeQjdI6anLGvVbBw_*fU1TzdVS$i z*4j7z!I5RF#rSz|8ibi$;qE{4`aqWYik7QB5U&F5C*;TO_x+gtzPGpzNt!7~nsBT7)Ckc(K~%uv&{{6A`mmBJVAk-{s~52Vu|HbCH7_W1~ZCX^RflOakGg=jo2Z z<*s;5-J+2@^LRDZ-7EV&Pq+FTErw@pfFqvx^i%E7Fx#^n(E`m2(c>K-O5`M`Yek9el zzTGs5qD6*G;y#~xu3>qWuO?-amKYtvRA}I9z#UspEeM;wOERYeot_n_EUMJf$4_u?E!6X~?q)tPoZb^_;8Y_Ox2h1m<+Le-fsRd|T8db<8#$bqez zua^Z|>h%zdnuU^ww$#-dZ9NTM`FN+!IlLkz*FqWb!x^Z|C{KyGjZ+>G;;7Mb@LY|H zc+Gp`L((Dw7pnDlHNm&;SfHedhx*kad$I^uGz{`0BYelq0yEUHpNKSkvj$|dpvY3{7*YGyhXA^LP0&wOw9oNoC=QoVx1<2Dne8qqZL zm>nFh5DX(-RnQwvHCZQwn^#Z=E!SPVlaRJ78Bo@}!!9dRt^qZy?-*`Pt4WSmgucJv zV1yFkcjlEM^uz-;b#Q7ZCP@Lk)m}uPX={R4B=56k7WNh11BN~0T*vr@!!ow^B0hOR zQ)4)&(e%>bNNL%bm<&8H{*l_L7s0$2GUgX2Vd;=4d9Dm2v3TaL+;L>{K7h7 zV#k?xDPm(NDE31$ z<}|X)pEY6myjK+^gaIMk&Yj2~F0rSKemNqlsVm4c|N7mp_C*L01s;GNx#D-*&gk!qQr}^?_r@q!8fuXw!)fA7xkd} zb>vHvdx~H$5qqAWrow7}+8zBM65-JOt5z za=T6f7MK`XJuQog8kIEboPdhcaVJeHy)5z7EBLK5NRr()E|#K0L0N^JD@pUA^Czb` zbUZ_558y+vqAGeyHCbrvOvLD67Ph}06959VzQ_|>RrXQAqE+AQ(-AaKdxoWaF8hdt z{O3W@b^*o#-f1VuU>YMV03ELF7zkCN4Q&b#prz%3Nne0lSbRo@@ z^ihv%oIl~Qyl6Q;a#$*jOC%x0_;eis*)J7=f@Ct*)xF5 zo}u~@-I}2|$b%5L7>@+Z?4o+1r&v6ceIy+vroK&jCQ<4q&45HP2wCol4hVm3pZtjf zHz1D7oyaSKJ~T{Gx}7ONLA)D5k(%%`WswrDyzX*rn}i}}TB4^y#@mAwPzoC)`?rYv zHgx|trUN#mu*VzUV~8TnJM2Qh*ZM5B{x&y>5An`(M7=Z*Q>TdiH@j*2=moNuOtvpz z+G`@~-`%~+AgPKgke@XiRPgndh@bp*-HRsh;HTtz@-y_uhb%7ylVOTqG0#u?Vn5c5 zEp*XRo|8hcgG^$#{$O9CJ&NE;TrfRpSnLmes&MO{m=N%zc`}gb!eQ7odl$oy1%PI} z#AIxx%oRVy&{O~9xnK4$EY>(eQj}!HKIV$Fz*H=-=Kn)N0D6u`(;iO|VraI4fu_W` z;b5{7;Lyx4za}DU#+U7}=H0dAS#YJJ&g2!P@Htu-AL&w=-)*%P9h2{wR|@?Ff9~)b z^+e_3Hetq7W%ls{!?<6&Y$Z;NNB41pvrv)|MET6AZXFXJeFqbFW5@i5WGzl?bP+~? z*&_puH;wKv2)9T_d+P`bLvJFqX#j&xa*-;0nGBbQf0DC>o~=J_Wmtf*2SZQr?{i~X z9-IbRH8{iy?<0v9Ir1?$66+igy|yDQ5J~A9sFX@Pe<*kCY8+MwH?I z`P}zfQ6l^AO8ehZ=l^ZR;R%uu4;BK*=?W9t|0{+-at(MQZ(CtG=EJFNaFMlKCMXu30(gJUqj5+ z`GM|!keqcj;FKTa_qq;{*dHRXAq157hlB@kL#8%yAm2AgfU|*rDKX@FLlp=HL8ddv zAWLCHe@DcDeB2}fl7#=0+#<05c3=VqM*O3bkr@9X4nO|)q0hU;Gye{L8ZN*NH8Id@mP-u;Fmb8YuorjLrW&ndip8CN%_qp982r w1WEnz9^$&s1hkp_3#lPJQ~!HI7WYYjA7>z!`?f%npAh2%rB@vD|Lau$2O)#1n*aa+ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index daf75f8e132cb..30b8947900f87 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -11,7 +11,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionSha256Sum=c9490e938b221daf0094982288e4038deed954a3f12fb54cbf270ddf4e37d879 +distributionSha256Sum=a9a7b7baba105f6557c9dcf9c3c6e8f7e57e6b49889c5f1d133f015d0727e4be From e705e728345bddcd65e78587acac134547d25d63 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 30 Mar 2022 10:32:26 -0500 Subject: [PATCH 015/514] Gradle check retry (#2638) (#2662) Add retry plugin support for Test implementations Signed-off-by: Kunal Kotwani (cherry picked from commit 65cc56e754e4a854963663ead5d06ea6e975d1eb) --- build.gradle | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index be5766f327e0d..bfa435cb4812c 100644 --- a/build.gradle +++ b/build.gradle @@ -49,6 +49,7 @@ plugins { id 'opensearch.docker-support' id 'opensearch.global-build-info' id "com.diffplug.spotless" version "6.3.0" apply false + id "org.gradle.test-retry" version "1.3.1" apply false } apply from: 'gradle/build-complete.gradle' @@ -232,7 +233,7 @@ allprojects { tasks.withType(JavaCompile).configureEach { JavaCompile compile -> // See please https://bugs.openjdk.java.net/browse/JDK-8209058 if (BuildParams.runtimeJavaVersion > JavaVersion.VERSION_11) { - compile.options.compilerArgs << '-Werror' + compile.options.compilerArgs << '-Werror' } compile.options.compilerArgs << '-Xlint:auxiliaryclass' compile.options.compilerArgs << '-Xlint:cast' @@ -386,6 +387,18 @@ gradle.projectsEvaluated { } } +// test retry configuration +subprojects { + apply plugin: "org.gradle.test-retry" + tasks.withType(Test).configureEach { + retry { + failOnPassedAfterRetry = false + maxRetries = 3 + maxFailures = 10 + } + } +} + // eclipse configuration allprojects { apply plugin: 'eclipse' @@ -445,9 +458,9 @@ allprojects { tasks.named('eclipse') { dependsOn 'cleanEclipse', 'copyEclipseSettings' } afterEvaluate { - tasks.findByName("eclipseJdt")?.configure { - dependsOn 'copyEclipseSettings' - } + tasks.findByName("eclipseJdt")?.configure { + dependsOn 'copyEclipseSettings' + } } } From 18c14e21fbd6be74cdbe5d5f5508032ed93b61cc Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 30 Mar 2022 13:54:36 -0400 Subject: [PATCH 016/514] Added jenkinsfile to run gradle check in OpenSearch (#2166) (#2628) * Added jenkinsfile for gradle check Signed-off-by: Owais Kazi * Added jenkinsfile to run gradle check Signed-off-by: Owais Kazi * PR comment Signed-off-by: Owais Kazi (cherry picked from commit f1d35d028ffc807303c75ba677f4c2cff9835041) Co-authored-by: Owais Kazi --- jenkins/jenkinsfile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 jenkins/jenkinsfile diff --git a/jenkins/jenkinsfile b/jenkins/jenkinsfile new file mode 100644 index 0000000000000..113cb27c4a610 --- /dev/null +++ b/jenkins/jenkinsfile @@ -0,0 +1,32 @@ +pipeline { + agent { + docker { + label 'AL2-X64' + /* See + https://github.com/opensearch-project/opensearch-build/blob/main/docker/ci/dockerfiles/build.ubuntu18.opensearch.x64.dockerfile + for docker image + */ + image 'opensearchstaging/ci-runner:ci-runner-ubuntu1804-build-v1' + alwaysPull true + } + } + + environment { + JAVA11_HOME="/opt/java/openjdk-11" + JAVA14_HOME="/opt/java/openjdk-14" + JAVA17_HOME="/opt/java/openjdk-17" + JAVA8_HOME="/opt/java/openjdk-8" + JAVA_HOME="/opt/java/openjdk-14" + } + + stages { + stage('gradle-check') { + steps { + script { + sh 'echo gradle check' + sh './gradlew check --no-daemon --no-scan' + } + } + } + } +} From 8c336f21bc1fb2be2b60a5d23dc279211ce8538b Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 30 Mar 2022 15:15:07 -0400 Subject: [PATCH 017/514] Bump jboss-annotations-api_1.2_spec in /qa/wildfly (#2615) (#2666) Bumps [jboss-annotations-api_1.2_spec](https://github.com/jboss/jboss-annotations-api_spec) from 1.0.0.Final to 1.0.2.Final. - [Release notes](https://github.com/jboss/jboss-annotations-api_spec/releases) - [Commits](https://github.com/jboss/jboss-annotations-api_spec/compare/jboss-annotations-api_1.1_spec-1.0.0.Final...jboss-annotations-api_1.2_spec-1.0.2.Final) --- updated-dependencies: - dependency-name: org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> (cherry picked from commit b5b0cd1b3aaf2b20dc3f357cae10600c04f8d4bf) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- qa/wildfly/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa/wildfly/build.gradle b/qa/wildfly/build.gradle index 7cb08a9de6f08..1a7f899c7c960 100644 --- a/qa/wildfly/build.gradle +++ b/qa/wildfly/build.gradle @@ -40,7 +40,7 @@ testFixtures.useFixture() dependencies { providedCompile 'javax.enterprise:cdi-api:1.2' - providedCompile 'org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec:1.0.0.Final' + providedCompile 'org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec:1.0.2.Final' providedCompile 'org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_2.0_spec:1.0.0.Final' api('org.jboss.resteasy:resteasy-jackson2-provider:3.0.19.Final') { exclude module: 'jackson-annotations' From c58d17d7c5efcdff4eca77f2b38200a937c0df1f Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 30 Mar 2022 15:15:45 -0400 Subject: [PATCH 018/514] Changed JAVA_HOME to jdk-17 (#2656) (#2669) Signed-off-by: Owais Kazi (cherry picked from commit 8ea246e70ee53b0bbd668435e63b7c8061576bce) Co-authored-by: Owais Kazi --- jenkins/jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jenkins/jenkinsfile b/jenkins/jenkinsfile index 113cb27c4a610..96973fceea765 100644 --- a/jenkins/jenkinsfile +++ b/jenkins/jenkinsfile @@ -3,7 +3,7 @@ pipeline { docker { label 'AL2-X64' /* See - https://github.com/opensearch-project/opensearch-build/blob/main/docker/ci/dockerfiles/build.ubuntu18.opensearch.x64.dockerfile + https://hub.docker.com/layers/ci-runner/opensearchstaging/ci-runner/ci-runner-ubuntu1804-build-v1/images/sha256-2c7bb2780bc08cd4e7e3c382ac53db414754dabd52f9b70e1c7e344dfb9a0e5e?context=explore for docker image */ image 'opensearchstaging/ci-runner:ci-runner-ubuntu1804-build-v1' @@ -16,7 +16,7 @@ pipeline { JAVA14_HOME="/opt/java/openjdk-14" JAVA17_HOME="/opt/java/openjdk-17" JAVA8_HOME="/opt/java/openjdk-8" - JAVA_HOME="/opt/java/openjdk-14" + JAVA_HOME="/opt/java/openjdk-17" } stages { From 6b9d4bf31974acd3ed89bd5ad2183d8df8d8f28b Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 30 Mar 2022 16:26:14 -0400 Subject: [PATCH 019/514] Bump google-oauth-client from 1.31.0 to 1.33.1 in /plugins/repository-gcs (#2616) (#2626) * Bump google-oauth-client in /plugins/repository-gcs Bumps [google-oauth-client](https://github.com/googleapis/google-oauth-java-client) from 1.31.0 to 1.33.1. - [Release notes](https://github.com/googleapis/google-oauth-java-client/releases) - [Changelog](https://github.com/googleapis/google-oauth-java-client/blob/main/CHANGELOG.md) - [Commits](https://github.com/googleapis/google-oauth-java-client/compare/v1.31.0...v1.33.1) --- updated-dependencies: - dependency-name: com.google.oauth-client:google-oauth-client dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Updating SHAs Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] (cherry picked from commit 0216ab24356a2bd6f01b1debd6327942b35575ad) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- plugins/repository-gcs/build.gradle | 2 +- .../repository-gcs/licenses/google-oauth-client-1.31.0.jar.sha1 | 1 - .../repository-gcs/licenses/google-oauth-client-1.33.1.jar.sha1 | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 plugins/repository-gcs/licenses/google-oauth-client-1.31.0.jar.sha1 create mode 100644 plugins/repository-gcs/licenses/google-oauth-client-1.33.1.jar.sha1 diff --git a/plugins/repository-gcs/build.gradle b/plugins/repository-gcs/build.gradle index e1ecf3c65a0f9..2cfbd76394bcb 100644 --- a/plugins/repository-gcs/build.gradle +++ b/plugins/repository-gcs/build.gradle @@ -69,7 +69,7 @@ dependencies { api 'com.google.cloud:google-cloud-core-http:1.93.3' api 'com.google.auth:google-auth-library-credentials:0.20.0' api 'com.google.auth:google-auth-library-oauth2-http:0.20.0' - api 'com.google.oauth-client:google-oauth-client:1.31.0' + api 'com.google.oauth-client:google-oauth-client:1.33.1' api 'com.google.api-client:google-api-client:1.30.10' api 'com.google.http-client:google-http-client-appengine:1.35.0' api 'com.google.http-client:google-http-client-jackson2:1.35.0' diff --git a/plugins/repository-gcs/licenses/google-oauth-client-1.31.0.jar.sha1 b/plugins/repository-gcs/licenses/google-oauth-client-1.31.0.jar.sha1 deleted file mode 100644 index 942dbb5d167a4..0000000000000 --- a/plugins/repository-gcs/licenses/google-oauth-client-1.31.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -bf1cfbbaa2497d0a841ea0363df4a61170d5823b \ No newline at end of file diff --git a/plugins/repository-gcs/licenses/google-oauth-client-1.33.1.jar.sha1 b/plugins/repository-gcs/licenses/google-oauth-client-1.33.1.jar.sha1 new file mode 100644 index 0000000000000..3897a85310ec6 --- /dev/null +++ b/plugins/repository-gcs/licenses/google-oauth-client-1.33.1.jar.sha1 @@ -0,0 +1 @@ +0a431f1a677c5f89507591ab47a7ccdb0b18b6f7 \ No newline at end of file From 396f758bc8a3e7da30a774eb3a018490b557a5a3 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 30 Mar 2022 16:26:57 -0400 Subject: [PATCH 020/514] Bump jettison from 1.1 to 1.4.1 in /plugins/discovery-azure-classic (#2614) (#2624) * Bump jettison from 1.1 to 1.4.1 in /plugins/discovery-azure-classic Bumps [jettison](https://github.com/jettison-json/jettison) from 1.1 to 1.4.1. - [Release notes](https://github.com/jettison-json/jettison/releases) - [Commits](https://github.com/jettison-json/jettison/compare/jettison-1.1...jettison-1.4.1) --- updated-dependencies: - dependency-name: org.codehaus.jettison:jettison dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Updating SHAs Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] (cherry picked from commit e44706e500b375396bb9e8450909d0a052ff6589) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- plugins/discovery-azure-classic/build.gradle | 2 +- plugins/discovery-azure-classic/licenses/jettison-1.1.jar.sha1 | 1 - .../discovery-azure-classic/licenses/jettison-1.4.1.jar.sha1 | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 plugins/discovery-azure-classic/licenses/jettison-1.1.jar.sha1 create mode 100644 plugins/discovery-azure-classic/licenses/jettison-1.4.1.jar.sha1 diff --git a/plugins/discovery-azure-classic/build.gradle b/plugins/discovery-azure-classic/build.gradle index 28cbc647ac31a..575b8858b16ba 100644 --- a/plugins/discovery-azure-classic/build.gradle +++ b/plugins/discovery-azure-classic/build.gradle @@ -59,7 +59,7 @@ dependencies { api "com.sun.jersey:jersey-client:${versions.jersey}" api "com.sun.jersey:jersey-core:${versions.jersey}" api "com.sun.jersey:jersey-json:${versions.jersey}" - api 'org.codehaus.jettison:jettison:1.1' + api 'org.codehaus.jettison:jettison:1.4.1' api 'com.sun.xml.bind:jaxb-impl:2.2.3-1' // HACK: javax.xml.bind was removed from default modules in java 9, so we pull the api in here, diff --git a/plugins/discovery-azure-classic/licenses/jettison-1.1.jar.sha1 b/plugins/discovery-azure-classic/licenses/jettison-1.1.jar.sha1 deleted file mode 100644 index 53133f3b018e6..0000000000000 --- a/plugins/discovery-azure-classic/licenses/jettison-1.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -1a01a2a1218fcf9faa2cc2a6ced025bdea687262 diff --git a/plugins/discovery-azure-classic/licenses/jettison-1.4.1.jar.sha1 b/plugins/discovery-azure-classic/licenses/jettison-1.4.1.jar.sha1 new file mode 100644 index 0000000000000..815d87d917f2e --- /dev/null +++ b/plugins/discovery-azure-classic/licenses/jettison-1.4.1.jar.sha1 @@ -0,0 +1 @@ +8d16bbcbac93446942c9e5da04530159afbe3e65 \ No newline at end of file From c9ed2822504b177337ca3ef321ff5264431c8fd6 Mon Sep 17 00:00:00 2001 From: Suraj Singh Date: Thu, 31 Mar 2022 13:44:10 -0700 Subject: [PATCH 021/514] Backport/backport 2679 to 2.x (#2685) * Add 1.3.2 to main causing gradle check failures (#2679) Signed-off-by: Suraj Singh (cherry picked from commit e051a426d2d0b7e986bd81feb82ec7cb1baf674f) * Add 1.3.2 to main causing gradle check failures (#2679) Signed-off-by: Suraj Singh (cherry picked from commit e051a426d2d0b7e986bd81feb82ec7cb1baf674f) * Remove 1.4.0 bwc version Signed-off-by: Suraj Singh --- .ci/bwcVersions | 1 + server/src/main/java/org/opensearch/Version.java | 1 + 2 files changed, 2 insertions(+) diff --git a/.ci/bwcVersions b/.ci/bwcVersions index 081fe1e794169..7b317d170d54c 100644 --- a/.ci/bwcVersions +++ b/.ci/bwcVersions @@ -38,4 +38,5 @@ BWC_VERSION: - "1.2.5" - "1.3.0" - "1.3.1" + - "1.3.2" - "2.0.0" diff --git a/server/src/main/java/org/opensearch/Version.java b/server/src/main/java/org/opensearch/Version.java index c6c2f0806afb6..cd0bf7b8d8174 100644 --- a/server/src/main/java/org/opensearch/Version.java +++ b/server/src/main/java/org/opensearch/Version.java @@ -80,6 +80,7 @@ public class Version implements Comparable, ToXContentFragment { public static final Version V_1_2_5 = new Version(1020599, org.apache.lucene.util.Version.LUCENE_8_10_1); public static final Version V_1_3_0 = new Version(1030099, org.apache.lucene.util.Version.LUCENE_8_10_1); public static final Version V_1_3_1 = new Version(1030199, org.apache.lucene.util.Version.LUCENE_8_10_1); + public static final Version V_1_3_2 = new Version(1030299, org.apache.lucene.util.Version.LUCENE_8_10_1); public static final Version V_2_0_0 = new Version(2000099, org.apache.lucene.util.Version.LUCENE_9_1_0); public static final Version V_2_1_0 = new Version(2010099, org.apache.lucene.util.Version.LUCENE_9_1_0); public static final Version CURRENT = V_2_1_0; From 757ef87c64dfd91c0c67966d52761de8c44f812c Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 31 Mar 2022 18:35:41 -0400 Subject: [PATCH 022/514] Update to Gradle 7.4.2 (#2688) (#2692) Signed-off-by: Andriy Redko (cherry picked from commit ff7805e6cadcd6879abb9f273763c9825aa058ac) Co-authored-by: Andriy Redko --- gradle/wrapper/gradle-wrapper.jar | Bin 59821 -> 59536 bytes gradle/wrapper/gradle-wrapper.properties | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 41d9927a4d4fb3f96a785543079b8df6723c946b..7454180f2ae8848c63b8b4dea2cb829da983f2fa 100644 GIT binary patch delta 8722 zcmY*;Wn2_c*XJ;R(j_4+E#1=H-QC^YIm8gsFf@+D&?(ZAlF}t5odeR+{krb6yU*TF z|2X&D{M`@d*32TNOe20l5=0ho#^2I~pbD~q^aFzN{Rm#3zYeiL5N6aRiR|+XoxRvM znZSLLlAJDh@2J2?#n2A?qar%tzN-5NQO zL&|F{nGiQyzNJ+bM$Y`n=Lx^3wTG^o2bGB@cwr1eb+6c-1tN=U+Db;bc~eJ!hwM{SbI=#g?$!PjDB+) zPgU_2EIxocr*EOJG52-~!gml&|D|C2OQ3Y(zAhL}iae4-Ut0F*!z!VEdfw8#`LAi# zhJ_EM*~;S|FMV6y%-SduHjPOI3cFM(GpH|HES<}*=vqY+64%dJYc|k?n6Br7)D#~# zEqO(xepfaf2F{>{E2`xb=AO%A<7RtUq6kU_Iu0m?@0K(+<}u3gVw5fy=Y4CC*{IE3 zLP3YBJ7x+U(os5=&NT%gKi23bbaZ`@;%ln)wp4GpDUT$J8NtFDHJzIe_-t}{!HAsh zJ4<^WovY};)9IKAskSebdQiXv$y5}THuJZ}ouoElIZRui=6lrupV|_Jz=9^&;@HwL;J#@23k?A;k`0Bgf;ioO>W`IQ+4? z7A)eKoY4%+g%=w;=Vm8}H>@U*=*AWNtPqgWRqib#5RTGA@Q=43FrQn3J`GkTUV5yp0U`EOTqjfp+-9;0F8!dMEwwcK%(6`8sDD^aR04 zd6O5vh|Xk?&3dy4f|1QK&Ulf{h6Iq;d-&*ti#Ck>wZFG;GHwc?b;X~eBITx49>2d8 z4HcK&1&DvEGT6kXdzAm4oO8%c}8OBt~8H956_;YP-ss*uMf==a+%w~F>Qkm7r)IAuxuoX}h92$gHqbFUun#8m zWHdy`Zrm#=Pa98x8cO0vd@Tgkr*lm0{dky+Gocr0P8y%HGEI#c3qLqIRc`Oq_C%*; zG+QTr(#Q|yHKv6R@!DmLlwJQ3FAB)Yor-I4zyDyqM4yp5n2TrQH>gRt*Zw0+WI-Sj`EgmYHh=t9! zF6lz^xpqGGpo6!5`sc0a^FVhy_Uxq|@~(1@IIzV)nTpY9sY`CV!?8e&bB8=M&sYEb z2i}fvKdhp9Hs68Y-!QJ<=wE(iQ5+49tqt;Rh|jhYrI5VW-mIz|UY{h8E=rC5sh#DU z?wGgk-Tn!I?+Zer7pHlF_Z^!Kd1qkS3&lv#%s6-<5Y%jQL${cge5=G5Ab?D&|9$Y~ zf%rJC2+=2vg;y0-SJb3<@3%}BO$T$C66q$L_H33a`VUbgW~N(4B=v5(<=My|#|J7q z*Ox4wL4kbJd_~EjLTABSu4U7Jk#`y(6O*U6(k6XxM}CtGZB(H@3~kh*zaGRXM}Iwp zQ%xFk2>@wiZrVCV_G4G~v;NebCQ%T7{SDyPpSv&dT@Cn)Mx@IK*IdNrj{*4pkV4wv z)y0J538h>cpB7iPSzA~x24T`{dzNkpvGIqvt1Dvdq@o-`B=$hkczX8$yFMhsWNK-X zxr$kR$tMD0@W)Vxe1^t9qVmsg&K^F@u84)(n2dttIEAZFN6VD$&tskpG%SI7whGL3 z)DeRiwe&?8m7U{G`oW8!SCi*dM>oYL%UKQnKxV_0RXAEBQg1kStExGEUVwLJ0orGGwb7uv+kPDl7_E2*iD|J*=8A@;XCvwq0aw5oJYN*Yh&o=l} z2z8YKb-fIAH5spql4eXqp*)o2*b>#1@DSt?zZi{GPj0gH&Nm+EI<3^z0w%YTEV4xw zI6$+=Faa|Y4o5i0zm5lOg|&tmnJ806DBovU@Ll6XsA;NRrTK~t*AAJIAS=v-UZ%Pr z$oddI@NRir&erzCwq|)ciJemr-E061j{0Vc@Ys7K(mW|JYj*$+i1Q8XlIK8T?TYS(AXu$`2U zQ@fHxc=AVHl_}cRZQ)w0anMEoqRKKIvS^`<-aMf*FM`NsG&Uowneo+Ji$7DUDYc7*Hjg;-&aHM%3 zXO6cz$$G};Uqh+iY7Wpme>PHG4cu(q;xyskNLs$^uRRMfEg?8Cj~aE-ajM%CXkx0F z>C?g3tIA#9sBQOpe`J+04{q7^TqhFk^F1jFtk4JDRO*`d-fx`GYHb=&(JiaM1b?Y^ zO3Kj3sj76ieol|N$;>j@t#tKj=@*gP+mv}KwlTcPYgR$+)2(gk)2JNE=jSauPq!$< z<|?Sb%W)wS)b>b6i{8!x!^!xIdU3{CJFVnTcw0j{M%DUCF=_>eYYEUWnA-|B(+KYL z_W_`JI&&u^@t0})@DH^1LDuT0s3dMpCHIbYBgOT4Zh_4yHbSqRbtIKndeT4Q*Jg91 z@>rO!^t-G~*AIW;FQ$3J=b;oGg8?CTa~qNCb>&cgp@e;?0AqA&paz~(%PYO+QBo4( zp?}ZdSMWx0iJm7HVNk9A#^9Osa#GPJ!_pYEW}($8>&2}fbr@&ygZ?${A7_9?X$(&5 z#~-hxdPQwCNEpf=^+WH-3`2LxrrBMTa}~qJC9S;VzhG!On^JLyW6WkF{8aAE$sM+( zxr8xLW(KIjI`Rm(24r3OJBk<3GF=G!uSP0-G&AY32mLm8q=#Xom&Pqv=1C{d3>1^ zAjsmV@XZ%BKq^eUfBpa8KvO8ob|F3hAjJv*yo2Bhl0)KUus{qA9m8jf)KnOGGTa6~4>3@J_VzkL|vYPl*uL+Ot*Q7W!f5rJw5+AsjP_IfL+-S*2p| zB7!FhjvkUTxQkGWGSg{X;h~dK>gAJivW?88Nu!3o>ySDaABn$rAYt086#27fbjPQS zhq>55ASvm*60qRdVOY9=bU^+{Pi#!OaZwENN;zy5?EztOHK-Q5;rCuiFl}BSc1YaQ zC-S{=KsGDz@Ji9O5W;XxE0xI|@3o6(2~i4b8Ii9VT;^G$*dRw(V?=br)D&q^XkeBX z+gl~+R@rVD-Hwv@7RHV?Bip5KMI)aV^&snt?H<$Nt=OPx#VxF&BGi?2A2+lNOYywNUGMeGL;|(=UjGDtLG0sN&LpGx;|U;xa13s z;W_|SPk^G}!M9_^pO zA3bt3-tca%^42sHeDtfcC0S3w3H1ny!Bxpa=*k?XRPpx9Bb-gx1J9Yvx)4J(8cG+q z(iCPZ9dsf3#QVyZgD_MW#G#qgV)olu$59&3(PzQfw@%4uZ~<5J=ABvdY43(Qnp{;G zHg3>@T#>DbTuhFl3)fb3TFqdh)V2aq7!;&JOHseTWukvA7}(iGUq;v-{2J0iHSNHq z;+)h!p6Ok^+Sp8-jgL($n6Qu47xyE`cFO5SdZR6;R!FET`tm#0D37z339Suxjpv+s z*=%2-N$N?X&0?x_uut3erF@aBGj;9$k9?3FlbDO{RQa1_qtxrh4!4#fjp4x~akvdTp@ zos?^Q&XE;3N93s4rHQGPrV7+au1$$aB6$hLy*Yz_kN$~dweb9PcB!eYVQTGjFuJP> zZCEwBtb>TIgIO^qAzq@Bv-qud_ZD-2W<_at&ml-gv`tPt$@DF5`HlA zM>DmmMkpv&Zm-8)Y#0bLQf4MpD4_-7M8eu6rh(tL8dq8onHs#R9J~dGd2IaXXMC~h z91pKhnQa%Fsn29nAA1;x(%oC zhca~qQDJaMf?wFrl-Pj;e$bZMYmMF!Y3Lv&Sb?Sjn#!NVx&NDyc^$b4uYyo2OmERa zRz;yDGd@JTykzFLe|Wk-y7#3x`6$wt$zR8r48mdUvfbeL+4D|Z``~7$PrE@qc7rZe zVsIoIbCwzjLZ@_M1*bD{HaYn();Z1-q*-I{tEnTZ(}Zmk&%MXSNBX>o| z-u*RNkAyKC-Srp7c-=@5f)xMWg>o2WWl}j6j9=8+D8;T z>0*0q#;qw8%U8i;6s0fu#I*%(g*@@a2Er@@nyI}{=@W{Z-;`=wN4N~>6Xrh&z#g}l zN1g5}0-#(nHUTv_rl2{yUZ;h#t&Fd?tY!7L%ClY)>uH-Ny2ET$lW$S)IQiN79H)D^ zb&0AXYkupy0~w8)*>Sj_p9}4L?lGTq%VG|2p`nWGhnM^!g|j-|O{%9Q%swOq63|*W zw$(N_laI}`ilB+o!a-wl?er~;;3+)$_akSQ!8YO_&-e*SI7n^(QQ;X0ZE`{4f!gAl z5$d+9CKVNonM!NO_frREICIAxOv)wm>}-k?iRisM`R7;=lyo|E_YR~FpS&PS`Lg0f zl-ON<0S%Uix8J%#yZdkCz4YNhcec<|7*P(JsM#>-L>+tYg_71q9~70FAc^6KW5jql zw!crdgVLH1G_eET=|SEc977;)ezVC|{PJZfra|}@rD;0s&@61mTEBJtILllg{%{vN zfhb&lq0yChaLhnJ-Qb62MB7`>M;|_ceHKZAeeh@#8tbrK!ArP6oXIhMK;dhEJTY`@ z0Tq>MIe0`7tGv)N*F0IGYSJv0vN?Az8g+4K9S!pW2~9F4W(_U_T=jCZrzuZ3*|__T zONp_UWmyePv8C~rckc?Xji;Z5OEqg zC*Um)i;Wh4TEwqReQdVVbUKT^2>Tpi6z_^-uF*adUFug4i@JhzpWT^Sk&E>CyP2?H zWf6x}ehuTs6wvzCnTU&gYzT029Nz19(In1WC z`(1IGmi!O%2AR|BjQa4Q0~u)kM%}?xQyjWuQ16^Gp++;`vr7!k--UZWM*~7Zl|ceO@I3`OpaRhD;YoCuo5IC0uHx>9 z478hu@H|e0Zlo)Zj@01#;8BDs@991xe~^9uG2}UXLM(m7fa}AMwX*tjioBeV&Q8Gx zSq$6wZFkRBK`cMI>R(@W@+lo2t)L+4q-negWRLWZBz*|%=W4v62JrmzNuOtA*x)QE z5L%=OH#@KMdB%Jp^r?0tE}5-*6oP`-lO7Sf)0)n*e<{HA=&qhLR)oD8-+V}Z4=md) z+k9lKf64DB2hAT)UaCP~di?-V3~JBH7itYyk~L6hrnxM%?RKntqd`=!b|e7eFnAcu z3*V;g{xr7TSTm$}DY%~SMpl>m{Sj!We+WfxSEor?YeiAxYUy25pn(?T()E>ByP^c@ zipwvWrhIK((R((VU+;@LmOnDu)ZXB3YArzzin!Z^0;PyJWnlfflo|q8(QY;o1*5CO z##hnkO{uynTMdk`~DOC#1 zdiYxQoy}=@7(ke#A8$YZZVtk4wo$8x28&I;cY3Ro-|kW=*yiiHgCLZeAr)UtVx>Tu z|LvL0hq|1-jC0I4x#>&QZCfrVB=zT!nR|~Uz`9%~2 znl{uZ{VEszW`Fad^q_HB!K9*|U-stK%?~;g?&&+12A}Rq$z($Bzuk^2X(Y=hF?-dQ ztc3DsQKI;qhWIV`99Q#R3xnU0AvY!i*BECj-z9l74|%O=V@nlv|qqC^r^-~C?E zGW%c|uYgnfJ(gjsTm_cIqcv*mYM{+i+&@F@+69ZQOK&u#v4oxUSQJ=tvqQ3W=*m;| z>SkBi8LYb-qRY7Sthh*0%3XAC%$z1rhOJzuX=PkTOa=DlocZUpE#KxVNH5)_4n=T( zGi3YrH7e~sPNYVBd~Grcq#CF~rN{p9Zza-Ntnwfma@TB)=3g36*0lSZg#ixEjFe%+ zX=&LDZ5zqculZ`=RYc^ln(~;nN|Qh6gN=!6f9-N2h+3NWbIxYud&;4SX*tWf5slk4 z{q@@l71UAZgj~*6edXb57fBUxvAS7s(RI=X868JM0+^DCn2yC>;v%S;qPOjB>YVsz(Zx9a>>BK&M zIQK>7_n)4ud0X5YM}^i*keH{ehLsiy9@NvOpsFeQjdI6anLGvVbBw_*fU1TzdVS$i z*4j7z!I5RF#rSz|8ibi$;qE{4`aqWYik7QB5U&F5C*;TO_x+gtzPGpzNt!7~nsBT7)Ckc(K~%uv&{{6A`mmBJVAk-{s~52Vu|HbCH7_W1~ZCX^RflOakGg=jo2Z z<*s;5-J+2@^LRDZ-7EV&Pq+FTErw@pfFqvx^i%E7Fx#^n(E`m2(c>K-O5`M`Yek9el zzTGs5qD6*G;y#~xu3>qWuO?-amKYtvRA}I9z#UspEeM;wOERYeot_n_EUMJf$4_u?E!6X~?q)tPoZb^_;8Y_Ox2h1m<+Le-fsRd|T8db<8#$bqez zua^Z|>h%zdnuU^ww$#-dZ9NTM`FN+!IlLkz*FqWb!x^Z|C{KyGjZ+>G;;7Mb@LY|H zc+Gp`L((Dw7pnDlHNm&;SfHedhx*kad$I^uGz{`0BYelq0yEUHpNKSkvj$|dpvY3{7*YGyhXA^LP0&wOw9oNoC=QoVx1<2Dne8qqZL zm>nFh5DX(-RnQwvHCZQwn^#Z=E!SPVlaRJ78Bo@}!!9dRt^qZy?-*`Pt4WSmgucJv zV1yFkcjlEM^uz-;b#Q7ZCP@Lk)m}uPX={R4B=56k7WNh11BN~0T*vr@!!ow^B0hOR zQ)4)&(e%>bNNL%bm<&8H{*l_L7s0$2GUgX2Vd;=4d9Dm2v3TaL+;L>{K7h7 zV#k?xDPm(NDE31$ z<}|X)pEY6myjK+^gaIMk&Yj2~F0rSKemNqlsVm4c|N7mp_C*L01s;GNx#D-*&gk!qQr}^?_r@q!8fuXw!)fA7xkd} zb>vHvdx~H$5qqAWrow7}+8zBM65-JOt5z za=T6f7MK`XJuQog8kIEboPdhcaVJeHy)5z7EBLK5NRr()E|#K0L0N^JD@pUA^Czb` zbUZ_558y+vqAGeyHCbrvOvLD67Ph}06959VzQ_|>RrXQAqE+AQ(-AaKdxoWaF8hdt z{O3W@b^*o#-f1VuU>YMV03ELF7zkCN4Q&b#prz%3Nne0lSbRo@@ z^ihv%oIl~Qyl6Q;a#$*jOC%x0_;eis*)J7=f@Ct*)xF5 zo}u~@-I}2|$b%5L7>@+Z?4o+1r&v6ceIy+vroK&jCQ<4q&45HP2wCol4hVm3pZtjf zHz1D7oyaSKJ~T{Gx}7ONLA)D5k(%%`WswrDyzX*rn}i}}TB4^y#@mAwPzoC)`?rYv zHgx|trUN#mu*VzUV~8TnJM2Qh*ZM5B{x&y>5An`(M7=Z*Q>TdiH@j*2=moNuOtvpz z+G`@~-`%~+AgPKgke@XiRPgndh@bp*-HRsh;HTtz@-y_uhb%7ylVOTqG0#u?Vn5c5 zEp*XRo|8hcgG^$#{$O9CJ&NE;TrfRpSnLmes&MO{m=N%zc`}gb!eQ7odl$oy1%PI} z#AIxx%oRVy&{O~9xnK4$EY>(eQj}!HKIV$Fz*H=-=Kn)N0D6u`(;iO|VraI4fu_W` z;b5{7;Lyx4za}DU#+U7}=H0dAS#YJJ&g2!P@Htu-AL&w=-)*%P9h2{wR|@?Ff9~)b z^+e_3Hetq7W%ls{!?<6&Y$Z;NNB41pvrv)|MET6AZXFXJeFqbFW5@i5WGzl?bP+~? z*&_puH;wKv2)9T_d+P`bLvJFqX#j&xa*-;0nGBbQf0DC>o~=J_Wmtf*2SZQr?{i~X z9-IbRH8{iy?<0v9Ir1?$66+igy|yDQ5J~A9sFX@Pe<*kCY8+MwH?I z`P}zfQ6l^AO8ehZ=l^ZR;R%uu4;BK*=?W9t|0{+-at(MQZ(CtG=EJFNaFMlKCMXu30(gJUqj5+ z`GM|!keqcj;FKTa_qq;{*dHRXAq157hlB@kL#8%yAm2AgfU|*rDKX@FLlp=HL8ddv zAWLCHe@DcDeB2}fl7#=0+#<05c3=VqM*O3bkr@9X4nO|)q0hU;Gye{L8ZN*NH8Id@mP-u;Fmb8YuorjLrW&ndip8CN%_qp982r w1WEnz9^$&s1hkp_3#lPJQ~!HI7WYYjA7>z!`?f%npAh2%rB@vD|Lau$2O)#1n*aa+ delta 8958 zcmY+KWl$VIlZIh&f(Hri?gR<$?iyT!TL`X;1^2~W7YVSq1qtqM!JWlDxLm%}UESUM zndj}Uny%^UnjhVhFb!8V3s(a#fIy>`VW15{5nuy;_V&a5O#0S&!a4dSkUMz_VHu3S zGA@p9Q$T|Sj}tYGWdjH;Mpp8m&yu&YURcrt{K;R|kM~(*{v%QwrBJIUF+K1kX5ZmF zty3i{d`y0;DgE+de>vN@yYqFPe1Ud{!&G*Q?iUc^V=|H%4~2|N zW+DM)W!`b&V2mQ0Y4u_)uB=P@-2`v|Wm{>CxER1P^ z>c}ZPZ)xxdOCDu59{X^~2id7+6l6x)U}C4Em?H~F`uOxS1?}xMxTV|5@}PlN%Cg$( zwY6c}r60=z5ZA1L zTMe;84rLtYvcm?M(H~ZqU;6F7Evo{P7!LGcdwO|qf1w+)MsnvK5^c@Uzj<{ zUoej1>95tuSvDJ|5K6k%&UF*uE6kBn47QJw^yE&#G;u^Z9oYWrK(+oL97hBsUMc_^ z;-lmxebwlB`Er_kXp2$`&o+rPJAN<`WX3ws2K{q@qUp}XTfV{t%KrsZ5vM!Q#4{V& zq>iO$MCiLq#%wXj%`W$_%FRg_WR*quv65TdHhdpV&jlq<=K^K`&!Kl5mA6p4n~p3u zWE{20^hYpn1M}}VmSHBXl1*-)2MP=0_k)EPr#>EoZukiXFDz?Di1I>2@Z^P$pvaF+ zN+qUy63jek2m59;YG)`r^F3-O)0RDIXPhf)XOOdkmu`3SMMSW(g+`Ajt{=h1dt~ks ztrhhP|L4G%5x79N#kwAHh5N){@{fzE7n&%dnisCm65Za<8r_hKvfx4Bg*`%-*-Mvn zFvn~)VP@}1sAyD+B{{8l{EjD10Av&Mz9^Xff*t`lU=q=S#(|>ls520;n3<}X#pyh& z*{CJf7$*&~!9jMnw_D~ikUKJ2+UnXmN6qak{xx%W;BKuXt7@ky!LPI1qk?gDwG@@o zkY+BkIie>{{q==5)kXw(*t#I?__Kwi>`=+s?Gq6X+vtSsaAO&Tf+Bl$vKnzc&%BHM z=loWOQq~n}>l=EL(5&6((ESsQC3^@4jlO5Od{qN#sWV)vqXw}aA>*uvwZopNN(|-T zRTF%5Y_k1R$;(d-)n;hWex{;7b6KgdAVE@&0pd(*qDzBO#YZV%kh%pYt1`hnQ(Fa& zYiDrOTDqk5M7hzp9kI2h!PxNnuJ&xl*zF8sx6!67bA49R1bmUF5bpK&&{eI0U~cH}PM z3aW1$lRb|ItkG5~_eBNu$|I|vYIdAA9a!pVq<+UTx*M}fG`23zxXp&E=FfnY- zEzKj;Cu_s4v>leO7M2-mE(UzKHL4c$c`3dS*19OpLV^4NI*hWWnJQ9lvzP4c;c?do zqrcsKT*i~eIHl0D3r4N{)+RsB6XhrC^;sp2cf_Eq#6*CV;t8v=V!ISe>>9kPgh}NI z=1UZutslxcT$Ad;_P^;Oouoa(cs!Ctpvi>%aQ+Zp=1d|h{W9Wmf7JWxa(~<#tSZ?C%wu4_5F!fc!<@PIBeJ)Nr^$bB6!_Gic_7}c3J{QI~Gg5g5jTp9}V6KYgrgaX>pJt}7$!wOht&KO|+z{Iw@YL|@~D zMww}+lG}rm2^peNx>58ME||ZQxFQeVSX8iogHLq_vXb`>RnoEKaTWBF-$JD#Q4BMv zt2(2Qb*x-?ur1Y(NsW8AdtX0#rDB?O(Vs4_xA(u-o!-tBG03OI!pQD+2UytbL5>lG z*(F)KacHqMa4?dxa(Vcrw>IIAeB$3cx#;;5r2X;HE8|}eYdAgCw#tpXNy7C3w1q`9 zGxZ6;@1G%8shz9e+!K2MO*{_RjO}Jo6eL3{TSZ>nY7)Qs`Dhi5><@oh0r)gT7H-?3 zLDsd^@m%JvrS8sta5`QiZNs^*GT}Hiy^zjK2^Ni%`Z|ma)D2 zuyumbvw$M8$haCTI~6M%d4+P)uX%u{Sfg4Al+F7c6;O-*)DKI7E8izSOKB#FcV{M+ zEvY0FBkq!$J0EW$Cxl}3{JwV^ki-T?q6C30Y5e&p@8Rd?$ST-Ghn*-`tB{k54W<>F z5I)TFpUC!E9298=sk>m#FI4sUDy_!8?51FqqW!9LN1(zuDnB3$!pEUjL>N>RNgAG~-9Xm|1lqHseW(%v&6K(DZ3Pano(1-Qe?3%J&>0`~w^Q-p&@ zg@HjvhJk?*hpF7$9P|gkzz`zBz_5Z!C4_-%fCcAgiSilzFQef!@amHDrW!YZS@?7C zs2Y9~>yqO+rkih?kXztzvnB^6W=f52*iyuZPv$c42$WK7>PHb z6%MYIr5D32KPdwL1hJf{_#jn?`k(taW?mwmZVvrr=y~fNcV$`}v(8};o9AjOJumS4 z`889O91^pkF+|@$d9wVoZ3;^j;^sUs&Ubo_qD&MTL%O z&*SE0ujG~zm;?x)8TLC&ft))nyI zcg44@*Q{cYT+qGrA=In_X{NNCD+B0w#;@g)jvBU;_8od6U>;7HIo@F*=g8CQUo(u^ z3r4FJ7#<@)MXO&5+DgKE&^>^`r!loe7CWE*1k0*0wLFzSOV8jvlX~WOQ?$1v zk$Or}!;ix0g78^6W;+<=J>z@CBs!<<)HvF(Ls-&`matpesJ5kkjC)6nGB@b{ii6-Uoho$BT%iJgugTOeZ$5Xo4D7Pd< zC*LJh5V@2#5%aBZCgzlQi3@<_!VfiL07ywc)ZbwKPfcR|ElQoS(8x|a7#IR}7#Io= zwg4$8S{egr-NffD)Fg&X9bJSoM25pF&%hf>(T&9bI}=#dPQyNYz;ZZ7EZ=u1n701SWKkZ9n(-qU ztN`sdWL1uxQ1mKS@x11;O|@^AD9!NeoPx}?EKIr!2>1Qq4gjfGU)tr6?Z5l7JAS3j zZeq{vG{rb%DFE4%$szK}d2UzB{4>L?Tv+NAlE*&Nq6g+XauaSI+N2Y8PJLw+aNg1p zbxr|hI8wcMP&&+(Cu|%+Jq|r>+BHk@{AvfBXKiVldN)@}TBS0LdIpnANCVE26WL-} zV}HJ^?m&$Rkq;Zf*i-hoasnpJVyTH__dbGWrB_R55d*>pTyl6(?$EO@>RCmTX1Hzr zT2)rOng?D4FfZ_C49hjMV*UonG2DlG$^+k=Y%|?Dqae4}JOU=8=fgY4Uh!pa9eEqf zFX&WLPu!jArN*^(>|H>dj~g`ONZhaaD%h_HHrHkk%d~TR_RrX{&eM#P@3x=S^%_6h zh=A)A{id16$zEFq@-D7La;kTuE!oopx^9{uA3y<}9 z^bQ@U<&pJV6kq7LRF47&!UAvgkBx=)KS_X!NY28^gQr27P=gKh0+E>$aCx&^vj2uc}ycsfSEP zedhTgUwPx%?;+dESs!g1z}5q9EC+fol}tAH9#fhZQ?q1GjyIaR@}lGCSpM-014T~l zEwriqt~ftwz=@2tn$xP&-rJt?nn5sy8sJ5Roy;pavj@O+tm}d_qmAlvhG(&k>(arz z;e|SiTr+0<&6(-An0*4{7akwUk~Yf4M!!YKj^swp9WOa%al`%R>V7mi z+5+UodFAaPdi4(8_FO&O!Ymb#@yxkuVMrog(7gkj$G@FLA#ENMxG)4f<}S%Fn?Up$+C%{02AgMKa^ z4SFGWp6U>{Q6VRJV}yjxXT*e`1XaX}(dW1F&RNhpTzvCtzuu;LMhMfJ2LBEy?{^GHG!OF!! zDvs64TG)?MX&9NCE#H3(M0K>O>`ca0WT2YR>PTe&tn?~0FV!MRtdb@v?MAUG&Ef7v zW%7>H(;Mm)RJkt18GXv!&np z?RUxOrCfs;m{fBz5MVlq59idhov21di5>WXWD-594L-X5;|@kyWi@N+(jLuh=o+5l zGGTi~)nflP_G}Yg5Pi%pl88U4+^*ihDoMP&zA*^xJE_X*Ah!jODrijCqQ^{=&hD7& z^)qv3;cu?olaT3pc{)Kcy9jA2E8I)#Kn8qO>70SQ5P8YSCN=_+_&)qg)OYBg|-k^d3*@jRAeB?;yd-O1A0wJ z?K*RDm|wE<(PBz~+C%2CTtzCTUohxP2*1kE8Of~{KRAvMrO_}NN&@P7SUO{;zx0iK z@or9R8ydYOFZf(cHASCAatL%;62IL27~SmASr(7F&NMr+#gNw@z1VM z_ALFwo3)SoANEwRerBdRV`>y`t72#aF2ConmWQp(Xy|msN9$yxhZ1jAQ67lq{vbC5 zujj|MlGo`6Bfn0TfKgi(k=gq0`K~W+X(@GzYlPI4g0M;owH3yG14rhK>lG8lS{`!K z+Nc@glT-DGz?Ym?v#Hq|_mEdPAlHH5jZuh*6glq!+>Lk$S%ED2@+ea6CE@&1-9a?s znglt|fmIK}fg<9@XgHe4*q!aO<-;Xj$T?IzB-{&2`#eA6rdtCi80mpP&vw(Uytxu$#YzNI_cB>LS zmim>ys;ir;*Dzbr22ZDxO2s;671&J0U<9(n1yj)J zHFNz=ufPcQVEG+ePjB<5C;=H0{>Mi*xD>hQq8`Vi7TjJ$V04$`h3EZGL|}a07oQdR z?{cR(z+d>arn^AUug&voOzzi$ZqaS)blz-z3zr;10x;oP2)|Cyb^WtN2*wNn`YX!Y z+$Pji<7|!XyMCEw4so}xXLU)p)BA~2fl>y2Tt}o9*BPm?AXA8UE8a;>rOgyCwZBFa zyl42y`bc3}+hiZL_|L_LY29vVerM+BVE@YxK>TGm@dHi@Uw*7AIq?QA9?THL603J% zIBJ4y3n8OFzsOI;NH%DZ!MDwMl<#$)d9eVVeqVl(5ZX$PPbt*p_(_9VSXhaUPa9Qu z7)q4vqYKX7ieVSjOmVEbLj4VYtnDpe*0Y&+>0dS^bJ<8s*eHq3tjRAw^+Mu4W^-E= z4;&namG4G;3pVDyPkUw#0kWEO1;HI6M51(1<0|*pa(I!sj}F^)avrE`ShVMKBz}nE zzKgOPMSEp6M>hJzyTHHcjV%W*;Tdb}1xJjCP#=iQuBk_Eho6yCRVp&e!}4IBJ&?ksVc&u#g3+G$oNlJ?mWfADjeBS-Ph3`DKk-~Z70XugH8sq2eba@4 zIC1H_J$`9b$K`J)sGX3d!&>OmC@@rx1TL~NinQOYy72Q_+^&Mg>Ku(fTgaXdr$p_V z#gav1o{k~c>#)u3r@~6v^o)Lf=C{rAlL@!s457pq)pO;Cojx7U{urO4cvXP|E>+dV zmr2?!-5)tk-&*ap^D^2x7NG6nOop2zNFQ9v8-EZ{WCz-h36C)<^|f{V#R_WE^@(T0+d-at5hXX{U?zak*ac-XnyINo+yBD~~3O1I=a z99|CI>502&s-Qi5bv>^2#cQ%ut<4d7KgQ^kE|=%6#VlGiY8$rdJUH{sra;P~cyb_i zeX(kS%w0C?mjhJl9TZp8RS;N~y3(EXEz13oPhOSE4WaTljGkVXWd~|#)vsG6_76I)Kb z8ro?;{j^lxNsaxE-cfP;g(e;mhh3)&ba}li?woV2#7ByioiD>s%L_D;?#;C#z;a(N z-_WY<=SH42m9bFQ>Nb z@4K$@4l8pD7AKxCR>t0%`Qoy9=hA?<<^Vcj8;-E+oBe3ReW1`el8np8E$k{LgFQ}2 z2t8a`wOXFdJ9!5$&mEfD1CnJ)TB+RJih88-Zos9@HZ# zL#{qfbF0ARTXkR@G{lwlOH~nnL)1jcyu!qv2`57S&%oKz0}r{~l9U_UHaJ5!8#nrs z?2FrL`mxnzu&{bweD&62)ilz*?pYIvt`T!XFVVA78})p1YEy7 z8fK#s?b~Yo$n7&_a?EBdXH-_W)Z44?!;DFx6pZ?~RArtBI*Qm4~6nX6Z_T*i$bQPE;Qz?DAPstpGSqr-AJ zo%m9cA`oDDm?&dTaoh_>@F>a?!y4qt_;NGN9Z<%SS;fX-cSu|>+Pba22`CRb#|HZa z;{)yHE>M-pc1C0mrnT~80!u&dvVTYFV8xTQ#g;6{c<9d!FDqU%TK5T6h*w*p980D~ zUyCb`y3{-?(mJFP)0*-Nt;mI$-gc4VQumh|rs&j_^R{sgTPF`1Xja2YWstsKFuQ(d zmZMxV$p$|qQUXchu&8%J(9|)B?`~rIx&)LqDS>ob5%gTeTP#Sbny#y*rnJ&?(l=!( zoV~}LJ1DPLnF8oyM(2ScrQ0{Q4m4-BWnS4wilgCW-~~;}pw=&<+HggRD_3c@3RQIr z9+-%!%}u_{`YS=&>h%kPO3ce}>y!d-zqiniNR-b5r97u;+K6HA2tS>Z#cV{+eFI`* zd8RMGAUtX1KWfPV;q<-5JAykS+2sY$2~UX+4461a(%{P#{rwFPu0xpIuYlbgD{C7C z=U{FUarVTYX6ZUq3wE@G^QT4H2Re;n$Fz9cJ>hABl)9T8pozqbA1)H-%1=WKm^QMu zjnUZ&Pu>q+X&6Co*y#@pxc-4waKMInEPGmE_>3@Ym3S*dedSradmc5mlJn`i0vMW6 zhBnGQD^Z;&S0lnS0curqDO@({J7kTtRE+Ra?nl^HP9<)W&C>~`!258f$XDbyQOQXG zP8hhySnarOpgu8xv8@WlXnm(Uk~)_3$Sg0vTbU3 z{W!5B(L3{Yy3K5PN<@jEarAtja`}@KYva&zFRF*s+_%jIXh$T(S=an8?=Ry3H*NRqWgsM`&!#|@kf1>=4q%bFw7^Rhz!z5I zyI^zU8_R1WN9`88Z=n>pIZQ`Ixr~_9G%Q}@A7rd#*%y7G zXl^Id=^ZL?Rx}}gWXCqzj9C6;x(~mAH|$JteXa1MH<6UQig@!Hf~t}B%tP0I|H&;y zO6N0}svOa1a^PyP9N5?4W6VF%=Bj{qHUgc8@siw4bafT=UPFSoQqKgyUX>sXTBZ=x zOh^Ad!{kOM9v{%5y}`-8u*T&C7Vq6mD%GR}UeU(*epO&qgC-CkD;%=l)ZuinSzHM` z{@`j&_vC6dDe{Yb9k@1zeV_K6!l(@=6ucoI=R^cH=6{i71%4W3$J-?<8Qn#$-DMtA z6Qqi)t?4ifrt%3jSA#6ji#{f(($KBL-iQh-xrC||3U3lq`9>r)>X%oLvtimuHW-)} zy}>9~|M>w4eES`g7;iBM%Se5-OP%1U6gNWp3AZqT8C6OlFFfQ$|7LL;tBV)(qlp4K zruar^K8FnJN3@_}B;G`a~H`t|3+6d>q3#`ctTkE-D^1#d9NalQ04lH*qUW2!V zhk7#z8OwHhSl8w14;KctfO8ubZJ4$dEdpXE78wABz=n5*=q9ex3S}`e7x~~V-jmHOhtX2*n+pBslo3uosdE7xABK=V#-t{1Hd~?i z{i~%Bw6NYF+F$aK$M`r#xe=NxhA5=p%i7!$);sd>Q}#`G?Q~fygrMXmZw?0#5#17W}6Tj+&kFexG{!mYl5FoA99}3G9l;3lVQ^ z48^~gsVppE*x91WheqI(A%F0Z#$#1UJP1R12Mj9r)y(A?a+iquX+d8WD4WAQJ_!oq z9rTISr7bPd(GTP57xm$}C}&kjMivi;zi^Y9g3&X0A;ovdJ?{%_wHgt%%9P&N4H z^XzV(uNA4 zAP`hgP6BEN5`YXh|DF~6Pud?~gWfhUKoPX4>z|}0aocC&K+AoV%|SX*N!wGq3|y< zg4lP(04XIPmt6}$N!dTk+pZv>u;MTB{L4hp9uXk7>aS!6jqM2lVr%{)H3$O127TSZ z0x9hi0k-P?nWFdQ0K`pykqUIT&jD~B0tHP{ffS(}fZ(aW$oBWTSfHO!A^><6v Date: Fri, 1 Apr 2022 16:37:43 -0400 Subject: [PATCH 023/514] [CVE-2020-36518] Update jackson-databind to 2.13.2.2 (#2704) Signed-off-by: Andriy Redko --- buildSrc/build.gradle | 2 +- buildSrc/version.properties | 1 + distribution/tools/upgrade-cli/build.gradle | 2 +- .../upgrade-cli/licenses/jackson-databind-2.13.2.2.jar.sha1 | 1 + .../tools/upgrade-cli/licenses/jackson-databind-2.13.2.jar.sha1 | 1 - libs/dissect/build.gradle | 2 +- modules/ingest-geoip/build.gradle | 2 +- .../ingest-geoip/licenses/jackson-databind-2.13.2.2.jar.sha1 | 1 + modules/ingest-geoip/licenses/jackson-databind-2.13.2.jar.sha1 | 1 - plugins/discovery-ec2/build.gradle | 2 +- .../discovery-ec2/licenses/jackson-databind-2.13.2.2.jar.sha1 | 1 + plugins/discovery-ec2/licenses/jackson-databind-2.13.2.jar.sha1 | 1 - plugins/repository-azure/build.gradle | 2 +- .../licenses/jackson-databind-2.13.2.2.jar.sha1 | 1 + .../repository-azure/licenses/jackson-databind-2.13.2.jar.sha1 | 1 - plugins/repository-hdfs/build.gradle | 2 +- .../repository-hdfs/licenses/jackson-databind-2.13.2.2.jar.sha1 | 1 + .../repository-hdfs/licenses/jackson-databind-2.13.2.jar.sha1 | 1 - plugins/repository-s3/build.gradle | 2 +- .../repository-s3/licenses/jackson-databind-2.13.2.2.jar.sha1 | 1 + plugins/repository-s3/licenses/jackson-databind-2.13.2.jar.sha1 | 1 - qa/os/build.gradle | 2 +- qa/wildfly/build.gradle | 2 +- test/fixtures/hdfs-fixture/build.gradle | 2 +- 24 files changed, 18 insertions(+), 17 deletions(-) create mode 100644 distribution/tools/upgrade-cli/licenses/jackson-databind-2.13.2.2.jar.sha1 delete mode 100644 distribution/tools/upgrade-cli/licenses/jackson-databind-2.13.2.jar.sha1 create mode 100644 modules/ingest-geoip/licenses/jackson-databind-2.13.2.2.jar.sha1 delete mode 100644 modules/ingest-geoip/licenses/jackson-databind-2.13.2.jar.sha1 create mode 100644 plugins/discovery-ec2/licenses/jackson-databind-2.13.2.2.jar.sha1 delete mode 100644 plugins/discovery-ec2/licenses/jackson-databind-2.13.2.jar.sha1 create mode 100644 plugins/repository-azure/licenses/jackson-databind-2.13.2.2.jar.sha1 delete mode 100644 plugins/repository-azure/licenses/jackson-databind-2.13.2.jar.sha1 create mode 100644 plugins/repository-hdfs/licenses/jackson-databind-2.13.2.2.jar.sha1 delete mode 100644 plugins/repository-hdfs/licenses/jackson-databind-2.13.2.jar.sha1 create mode 100644 plugins/repository-s3/licenses/jackson-databind-2.13.2.2.jar.sha1 delete mode 100644 plugins/repository-s3/licenses/jackson-databind-2.13.2.jar.sha1 diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 3c3b227312dbf..17b16fd3eeadf 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -116,7 +116,7 @@ dependencies { api 'com.avast.gradle:gradle-docker-compose-plugin:0.14.12' api 'org.apache.maven:maven-model:3.6.2' api 'com.networknt:json-schema-validator:1.0.67' - api "com.fasterxml.jackson.core:jackson-databind:${props.getProperty('jackson')}" + api "com.fasterxml.jackson.core:jackson-databind:${props.getProperty('jackson_databind')}" testFixturesApi "junit:junit:${props.getProperty('junit')}" testFixturesApi "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${props.getProperty('randomizedrunner')}" diff --git a/buildSrc/version.properties b/buildSrc/version.properties index 2c064b11a2739..4c09afd961c20 100644 --- a/buildSrc/version.properties +++ b/buildSrc/version.properties @@ -10,6 +10,7 @@ bundled_jdk = 17.0.2+8 spatial4j = 0.7 jts = 1.15.0 jackson = 2.13.2 +jackson_databind = 2.13.2.2 snakeyaml = 1.26 icu4j = 70.1 supercsv = 2.4.0 diff --git a/distribution/tools/upgrade-cli/build.gradle b/distribution/tools/upgrade-cli/build.gradle index 0e1996f3d68fa..d29c808562168 100644 --- a/distribution/tools/upgrade-cli/build.gradle +++ b/distribution/tools/upgrade-cli/build.gradle @@ -15,7 +15,7 @@ dependencies { compileOnly project(":server") compileOnly project(":libs:opensearch-cli") implementation "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" - implementation "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}" + implementation "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}" implementation "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}" testImplementation project(":test:framework") testImplementation 'com.google.jimfs:jimfs:1.2' diff --git a/distribution/tools/upgrade-cli/licenses/jackson-databind-2.13.2.2.jar.sha1 b/distribution/tools/upgrade-cli/licenses/jackson-databind-2.13.2.2.jar.sha1 new file mode 100644 index 0000000000000..9d9266300feef --- /dev/null +++ b/distribution/tools/upgrade-cli/licenses/jackson-databind-2.13.2.2.jar.sha1 @@ -0,0 +1 @@ +ffeb635597d093509f33e1e94274d14be610f933 \ No newline at end of file diff --git a/distribution/tools/upgrade-cli/licenses/jackson-databind-2.13.2.jar.sha1 b/distribution/tools/upgrade-cli/licenses/jackson-databind-2.13.2.jar.sha1 deleted file mode 100644 index 5d356f3fd045f..0000000000000 --- a/distribution/tools/upgrade-cli/licenses/jackson-databind-2.13.2.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -926e48c451166a291f1ce6c6276d9abbefa7c00f \ No newline at end of file diff --git a/libs/dissect/build.gradle b/libs/dissect/build.gradle index 0f0b8407e7e6b..47f7970ea5ac0 100644 --- a/libs/dissect/build.gradle +++ b/libs/dissect/build.gradle @@ -34,7 +34,7 @@ dependencies { } testImplementation "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" testImplementation "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}" - testImplementation "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}" + testImplementation "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}" } tasks.named('forbiddenApisMain').configure { diff --git a/modules/ingest-geoip/build.gradle b/modules/ingest-geoip/build.gradle index f78dc49e9fb8a..b1d5afbe68a17 100644 --- a/modules/ingest-geoip/build.gradle +++ b/modules/ingest-geoip/build.gradle @@ -42,7 +42,7 @@ dependencies { api('com.maxmind.geoip2:geoip2:2.16.1') // geoip2 dependencies: api("com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}") - api("com.fasterxml.jackson.core:jackson-databind:${versions.jackson}") + api("com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}") api('com.maxmind.db:maxmind-db:2.0.0') testImplementation 'org.elasticsearch:geolite2-databases:20191119' diff --git a/modules/ingest-geoip/licenses/jackson-databind-2.13.2.2.jar.sha1 b/modules/ingest-geoip/licenses/jackson-databind-2.13.2.2.jar.sha1 new file mode 100644 index 0000000000000..9d9266300feef --- /dev/null +++ b/modules/ingest-geoip/licenses/jackson-databind-2.13.2.2.jar.sha1 @@ -0,0 +1 @@ +ffeb635597d093509f33e1e94274d14be610f933 \ No newline at end of file diff --git a/modules/ingest-geoip/licenses/jackson-databind-2.13.2.jar.sha1 b/modules/ingest-geoip/licenses/jackson-databind-2.13.2.jar.sha1 deleted file mode 100644 index 5d356f3fd045f..0000000000000 --- a/modules/ingest-geoip/licenses/jackson-databind-2.13.2.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -926e48c451166a291f1ce6c6276d9abbefa7c00f \ No newline at end of file diff --git a/plugins/discovery-ec2/build.gradle b/plugins/discovery-ec2/build.gradle index 7998e0861c7b1..0e096958538a4 100644 --- a/plugins/discovery-ec2/build.gradle +++ b/plugins/discovery-ec2/build.gradle @@ -50,7 +50,7 @@ dependencies { api "commons-logging:commons-logging:${versions.commonslogging}" api "org.apache.logging.log4j:log4j-1.2-api:${versions.log4j}" api "commons-codec:commons-codec:${versions.commonscodec}" - api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}" + api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}" api "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}" } diff --git a/plugins/discovery-ec2/licenses/jackson-databind-2.13.2.2.jar.sha1 b/plugins/discovery-ec2/licenses/jackson-databind-2.13.2.2.jar.sha1 new file mode 100644 index 0000000000000..9d9266300feef --- /dev/null +++ b/plugins/discovery-ec2/licenses/jackson-databind-2.13.2.2.jar.sha1 @@ -0,0 +1 @@ +ffeb635597d093509f33e1e94274d14be610f933 \ No newline at end of file diff --git a/plugins/discovery-ec2/licenses/jackson-databind-2.13.2.jar.sha1 b/plugins/discovery-ec2/licenses/jackson-databind-2.13.2.jar.sha1 deleted file mode 100644 index 5d356f3fd045f..0000000000000 --- a/plugins/discovery-ec2/licenses/jackson-databind-2.13.2.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -926e48c451166a291f1ce6c6276d9abbefa7c00f \ No newline at end of file diff --git a/plugins/repository-azure/build.gradle b/plugins/repository-azure/build.gradle index 60fb99f459454..a491e766eb7c7 100644 --- a/plugins/repository-azure/build.gradle +++ b/plugins/repository-azure/build.gradle @@ -62,7 +62,7 @@ dependencies { api 'io.projectreactor.netty:reactor-netty-http:1.0.16' api "org.slf4j:slf4j-api:${versions.slf4j}" api "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}" - api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}" + api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}" api "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${versions.jackson}" api "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${versions.jackson}" api "com.fasterxml.jackson.module:jackson-module-jaxb-annotations:${versions.jackson}" diff --git a/plugins/repository-azure/licenses/jackson-databind-2.13.2.2.jar.sha1 b/plugins/repository-azure/licenses/jackson-databind-2.13.2.2.jar.sha1 new file mode 100644 index 0000000000000..9d9266300feef --- /dev/null +++ b/plugins/repository-azure/licenses/jackson-databind-2.13.2.2.jar.sha1 @@ -0,0 +1 @@ +ffeb635597d093509f33e1e94274d14be610f933 \ No newline at end of file diff --git a/plugins/repository-azure/licenses/jackson-databind-2.13.2.jar.sha1 b/plugins/repository-azure/licenses/jackson-databind-2.13.2.jar.sha1 deleted file mode 100644 index 5d356f3fd045f..0000000000000 --- a/plugins/repository-azure/licenses/jackson-databind-2.13.2.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -926e48c451166a291f1ce6c6276d9abbefa7c00f \ No newline at end of file diff --git a/plugins/repository-hdfs/build.gradle b/plugins/repository-hdfs/build.gradle index 19f58bf48366d..d17a4060b9ab6 100644 --- a/plugins/repository-hdfs/build.gradle +++ b/plugins/repository-hdfs/build.gradle @@ -64,7 +64,7 @@ dependencies { api 'org.apache.htrace:htrace-core4:4.2.0-incubating' api "org.apache.logging.log4j:log4j-core:${versions.log4j}" api 'org.apache.avro:avro:1.10.2' - api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}" + api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}" api 'com.google.code.gson:gson:2.9.0' runtimeOnly 'com.google.guava:guava:30.1.1-jre' api 'com.google.protobuf:protobuf-java:3.19.3' diff --git a/plugins/repository-hdfs/licenses/jackson-databind-2.13.2.2.jar.sha1 b/plugins/repository-hdfs/licenses/jackson-databind-2.13.2.2.jar.sha1 new file mode 100644 index 0000000000000..9d9266300feef --- /dev/null +++ b/plugins/repository-hdfs/licenses/jackson-databind-2.13.2.2.jar.sha1 @@ -0,0 +1 @@ +ffeb635597d093509f33e1e94274d14be610f933 \ No newline at end of file diff --git a/plugins/repository-hdfs/licenses/jackson-databind-2.13.2.jar.sha1 b/plugins/repository-hdfs/licenses/jackson-databind-2.13.2.jar.sha1 deleted file mode 100644 index 5d356f3fd045f..0000000000000 --- a/plugins/repository-hdfs/licenses/jackson-databind-2.13.2.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -926e48c451166a291f1ce6c6276d9abbefa7c00f \ No newline at end of file diff --git a/plugins/repository-s3/build.gradle b/plugins/repository-s3/build.gradle index c5939958c816a..072683e3bd5e5 100644 --- a/plugins/repository-s3/build.gradle +++ b/plugins/repository-s3/build.gradle @@ -58,7 +58,7 @@ dependencies { api "org.apache.logging.log4j:log4j-1.2-api:${versions.log4j}" api "commons-codec:commons-codec:${versions.commonscodec}" api "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" - api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}" + api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}" api "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}" api "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:${versions.jackson}" api "joda-time:joda-time:${versions.joda}" diff --git a/plugins/repository-s3/licenses/jackson-databind-2.13.2.2.jar.sha1 b/plugins/repository-s3/licenses/jackson-databind-2.13.2.2.jar.sha1 new file mode 100644 index 0000000000000..9d9266300feef --- /dev/null +++ b/plugins/repository-s3/licenses/jackson-databind-2.13.2.2.jar.sha1 @@ -0,0 +1 @@ +ffeb635597d093509f33e1e94274d14be610f933 \ No newline at end of file diff --git a/plugins/repository-s3/licenses/jackson-databind-2.13.2.jar.sha1 b/plugins/repository-s3/licenses/jackson-databind-2.13.2.jar.sha1 deleted file mode 100644 index 5d356f3fd045f..0000000000000 --- a/plugins/repository-s3/licenses/jackson-databind-2.13.2.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -926e48c451166a291f1ce6c6276d9abbefa7c00f \ No newline at end of file diff --git a/qa/os/build.gradle b/qa/os/build.gradle index 038e3d16745c3..92c5e4f154ad8 100644 --- a/qa/os/build.gradle +++ b/qa/os/build.gradle @@ -50,7 +50,7 @@ dependencies { testImplementation "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}" testImplementation "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" - testImplementation "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}" + testImplementation "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}" } tasks.named('forbiddenApisTest').configure { diff --git a/qa/wildfly/build.gradle b/qa/wildfly/build.gradle index 1a7f899c7c960..0e1c566bd2b52 100644 --- a/qa/wildfly/build.gradle +++ b/qa/wildfly/build.gradle @@ -50,7 +50,7 @@ dependencies { } api "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}" api "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" - api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}" + api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}" api "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:${versions.jackson}" api "com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:${versions.jackson}" api "com.fasterxml.jackson.module:jackson-module-jaxb-annotations:${versions.jackson}" diff --git a/test/fixtures/hdfs-fixture/build.gradle b/test/fixtures/hdfs-fixture/build.gradle index d1040acd03aa7..c56cc6d196b63 100644 --- a/test/fixtures/hdfs-fixture/build.gradle +++ b/test/fixtures/hdfs-fixture/build.gradle @@ -41,6 +41,6 @@ dependencies { api 'com.google.code.gson:gson:2.9.0' api "org.bouncycastle:bcpkix-jdk15on:${versions.bouncycastle}" api "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:${versions.jackson}" - api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}" + api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}" api 'net.minidev:json-smart:2.4.8' } From aa8fbae6c916e39de3e6dd42c948ed9fdaf5c6b7 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Fri, 1 Apr 2022 15:15:50 -0700 Subject: [PATCH 024/514] Add Shadow jar publication to lang-painless module. (#2681) (#2713) * Add Shadow jar publication to lang-painless module. This change creates a shadow jar for asm dependencies so that they do not conflict with direct asm dependencies from log4j AL2 patch. Signed-off-by: Marc Handalian * Remove security.manager systemProperty that is not required. Signed-off-by: Marc Handalian * Add explicit task dependency for publishing to maven local required by gradle. Signed-off-by: Marc Handalian * Move asm dependencies back to api scope. Signed-off-by: Marc Handalian (cherry picked from commit d7d41085f81a5e7eab6e31849f8bfc2b5cfc61d3) Co-authored-by: Marc Handalian --- modules/lang-painless/build.gradle | 30 ++++++++++++++++++- .../licenses/asm-analysis-7.2.jar.sha1 | 1 - .../licenses/asm-analysis-9.2.jar.sha1 | 1 + 3 files changed, 30 insertions(+), 2 deletions(-) delete mode 100644 modules/lang-painless/licenses/asm-analysis-7.2.jar.sha1 create mode 100644 modules/lang-painless/licenses/asm-analysis-9.2.jar.sha1 diff --git a/modules/lang-painless/build.gradle b/modules/lang-painless/build.gradle index 7f37b5e76d904..0dd032f8647f7 100644 --- a/modules/lang-painless/build.gradle +++ b/modules/lang-painless/build.gradle @@ -29,8 +29,11 @@ */ import org.opensearch.gradle.testclusters.DefaultTestClustersTask; +import com.github.jengelman.gradle.plugins.shadow.ShadowBasePlugin + apply plugin: 'opensearch.validate-rest-spec' apply plugin: 'opensearch.yaml-rest-test' +apply plugin: 'com.github.johnrengelman.shadow' opensearchplugin { description 'An easy, safe and fast scripting language for OpenSearch' @@ -49,11 +52,36 @@ dependencies { api 'org.ow2.asm:asm-util:9.2' api 'org.ow2.asm:asm-tree:7.2' api 'org.ow2.asm:asm-commons:9.2' - api 'org.ow2.asm:asm-analysis:7.2' + api 'org.ow2.asm:asm-analysis:9.2' api 'org.ow2.asm:asm:9.2' api project('spi') } +test { + doFirst { + test.classpath -= project.files(project.tasks.named('shadowJar')) + test.classpath -= project.configurations.getByName(ShadowBasePlugin.CONFIGURATION_NAME) + test.classpath += project.extensions.getByType(SourceSetContainer).getByName(SourceSet.MAIN_SOURCE_SET_NAME).runtimeClasspath + } +} + +shadowJar { + classifier = null + relocate 'org.objectweb', 'org.opensearch.repackage.org.objectweb' + dependencies { + include(dependency('org.ow2.asm:asm:9.2')) + include(dependency('org.ow2.asm:asm-util:9.2')) + include(dependency('org.ow2.asm:asm-tree:9.2')) + include(dependency('org.ow2.asm:asm-commons:9.2')) + include(dependency('org.ow2.asm:asm-analysis:9.2')) + } +} + +tasks.validateNebulaPom.dependsOn tasks.generatePomFileForShadowPublication +tasks.validateShadowPom.dependsOn tasks.generatePomFileForNebulaPublication +tasks.publishNebulaPublicationToMavenLocal.dependsOn tasks.generatePomFileForShadowPublication +tasks.publishShadowPublicationToMavenLocal.dependsOn tasks.generatePomFileForNebulaPublication + tasks.named("dependencyLicenses").configure { mapping from: /asm-.*/, to: 'asm' } diff --git a/modules/lang-painless/licenses/asm-analysis-7.2.jar.sha1 b/modules/lang-painless/licenses/asm-analysis-7.2.jar.sha1 deleted file mode 100644 index 849b5e0bfa671..0000000000000 --- a/modules/lang-painless/licenses/asm-analysis-7.2.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -b6e6abe057f23630113f4167c34bda7086691258 \ No newline at end of file diff --git a/modules/lang-painless/licenses/asm-analysis-9.2.jar.sha1 b/modules/lang-painless/licenses/asm-analysis-9.2.jar.sha1 new file mode 100644 index 0000000000000..b93483a24da5d --- /dev/null +++ b/modules/lang-painless/licenses/asm-analysis-9.2.jar.sha1 @@ -0,0 +1 @@ +7487dd756daf96cab9986e44b9d7bcb796a61c10 \ No newline at end of file From dcfa3fbe19e0a40592a04492b1d267a73f8634f7 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Fri, 1 Apr 2022 16:07:05 -0700 Subject: [PATCH 025/514] Centralize codes related to 'master_timeout' deprecation for eaiser removal - in CAT Nodes API (#2670) (#2695) The request parameter `master_timeout` for CAT Nodes API is deprecated and alternative parameter `cluster_manager_timeout` is added in commit https://github.com/opensearch-project/OpenSearch/commit/a87c9d4455f042cf14e684c7f4dce1904dd0dbe5 / PR https://github.com/opensearch-project/OpenSearch/pull/2435. This PR refactors a previous code commit, and it's suggested by https://github.com/opensearch-project/OpenSearch/pull/2658#discussion_r838671097. Change: This PR put the temporary code related to the 'master_timeout' deprecation in centralized places, so that it will be easier to remove when removing the deprecated parameter `master_timeout` in the future. - Move the method `parseDeprecatedMasterTimeoutParameter()` into abstract base class `BaseRestHandler`, so that every REST API handler can call it. - Put the unit tests related to the 'master_timeout' deprecation in one class. Another notable change: Prohibit using two paramters `master_timeout` and `cluster_manager_timeout` together. Reason: There are other 60 REST APIs have got request parameter `master_timeout`, and the parameter pending to be deprecated. (See issue #2511 for the full list). - Adding new codes (creating deprecation warning, validating the parameter value and unit tests) in every class for the 60 APIs will cause large duplication. - Removing the duplicate deprecated codes in the future is also a trouble. Signed-off-by: Tianli Feng --- .../org/opensearch/rest/BaseRestHandler.java | 31 +++++ .../java/org/opensearch/rest/RestRequest.java | 27 ----- .../rest/action/cat/RestNodesAction.java | 20 +--- .../RenamedTimeoutRequestParameterTests.java | 113 ++++++++++++++++++ .../org/opensearch/rest/RestRequestTests.java | 37 ------ .../rest/action/cat/RestNodesActionTests.java | 18 --- 6 files changed, 145 insertions(+), 101 deletions(-) create mode 100644 server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java diff --git a/server/src/main/java/org/opensearch/rest/BaseRestHandler.java b/server/src/main/java/org/opensearch/rest/BaseRestHandler.java index 4ee209111bdcb..e0a62581447ac 100644 --- a/server/src/main/java/org/opensearch/rest/BaseRestHandler.java +++ b/server/src/main/java/org/opensearch/rest/BaseRestHandler.java @@ -36,9 +36,12 @@ import org.apache.logging.log4j.Logger; import org.apache.lucene.search.spell.LevenshteinDistance; import org.apache.lucene.util.CollectionUtil; +import org.opensearch.OpenSearchParseException; +import org.opensearch.action.support.master.MasterNodeRequest; import org.opensearch.client.node.NodeClient; import org.opensearch.common.CheckedConsumer; import org.opensearch.common.collect.Tuple; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.settings.Setting; import org.opensearch.common.settings.Setting.Property; import org.opensearch.plugins.ActionPlugin; @@ -200,6 +203,34 @@ protected Set responseParams() { return Collections.emptySet(); } + /** + * Parse the deprecated request parameter 'master_timeout', and add deprecated log if the parameter is used. + * It also validates whether the two parameters 'master_timeout' and 'cluster_manager_timeout' are not assigned together. + * The method is temporarily added in 2.0 duing applying inclusive language. Remove the method along with MASTER_ROLE. + * @param mnr the action request + * @param request the REST request to handle + * @param logger the logger that logs deprecation notices + * @param logMsgKeyPrefix the key prefix of a deprecation message to avoid duplicate messages. + */ + public static void parseDeprecatedMasterTimeoutParameter( + MasterNodeRequest mnr, + RestRequest request, + DeprecationLogger logger, + String logMsgKeyPrefix + ) { + final String MASTER_TIMEOUT_DEPRECATED_MESSAGE = + "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version."; + final String DUPLICATE_PARAMETER_ERROR_MESSAGE = + "Please only use one of the request parameters [master_timeout, cluster_manager_timeout]."; + if (request.hasParam("master_timeout")) { + logger.deprecate(logMsgKeyPrefix + "_master_timeout_parameter", MASTER_TIMEOUT_DEPRECATED_MESSAGE); + if (request.hasParam("cluster_manager_timeout")) { + throw new OpenSearchParseException(DUPLICATE_PARAMETER_ERROR_MESSAGE); + } + mnr.masterNodeTimeout(request.paramAsTime("master_timeout", mnr.masterNodeTimeout())); + } + } + public static class Wrapper extends BaseRestHandler { protected final BaseRestHandler delegate; diff --git a/server/src/main/java/org/opensearch/rest/RestRequest.java b/server/src/main/java/org/opensearch/rest/RestRequest.java index e04d8faa8af39..7d11da7e122cd 100644 --- a/server/src/main/java/org/opensearch/rest/RestRequest.java +++ b/server/src/main/java/org/opensearch/rest/RestRequest.java @@ -54,7 +54,6 @@ import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -579,32 +578,6 @@ public static XContentType parseContentType(List header) { throw new IllegalArgumentException("empty Content-Type header"); } - /** - * The method is only used to validate whether the values of the 2 request parameters "master_timeout" and "cluster_manager_timeout" is the same value or not. - * If the 2 values are not the same, throw an {@link OpenSearchParseException}. - * @param keys Names of the request parameters. - * @deprecated The method will be removed along with the request parameter "master_timeout". - */ - @Deprecated - public void validateParamValuesAreEqual(String... keys) { - // Track the last seen value and ensure that every subsequent value matches it. - // The value to be tracked is the non-empty values of the parameters with the key. - String lastSeenValue = null; - for (String key : keys) { - String value = param(key); - if (!Strings.isNullOrEmpty(value)) { - if (lastSeenValue == null || value.equals(lastSeenValue)) { - lastSeenValue = value; - } else { - throw new OpenSearchParseException( - "The values of the request parameters: {} are required to be equal, otherwise please only assign value to one of the request parameters.", - Arrays.toString(keys) - ); - } - } - } - } - public static class ContentTypeHeaderException extends RuntimeException { ContentTypeHeaderException(final IllegalArgumentException cause) { diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestNodesAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestNodesAction.java index abc4b48b01cff..3052a9736f9a3 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestNodesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestNodesAction.java @@ -86,8 +86,6 @@ public class RestNodesAction extends AbstractCatAction { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestNodesAction.class); static final String LOCAL_DEPRECATED_MESSAGE = "Deprecated parameter [local] used. This parameter does not cause this API to act " + "locally, and should not be used. It will be unsupported in version 8.0."; - static final String MASTER_TIMEOUT_DEPRECATED_MESSAGE = - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version."; @Override public List routes() { @@ -113,7 +111,7 @@ public RestChannelConsumer doCatRequest(final RestRequest request, final NodeCli } clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); clusterStateRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", clusterStateRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request); + parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request, deprecationLogger, getName()); final boolean fullId = request.paramAsBoolean("full_id", false); return channel -> client.admin().cluster().state(clusterStateRequest, new RestActionListener(channel) { @Override @@ -529,20 +527,4 @@ Table buildTable( private short calculatePercentage(long used, long max) { return max <= 0 ? 0 : (short) ((100d * used) / max); } - - /** - * Parse the deprecated request parameter 'master_timeout', and add deprecated log if the parameter is used. - * It also validates whether the value of 'master_timeout' is the same with 'cluster_manager_timeout'. - * Remove the method along with MASTER_ROLE. - * @deprecated As of 2.0, because promoting inclusive language. - */ - @Deprecated - private void parseDeprecatedMasterTimeoutParameter(ClusterStateRequest clusterStateRequest, RestRequest request) { - final String deprecatedTimeoutParam = "master_timeout"; - if (request.hasParam(deprecatedTimeoutParam)) { - deprecationLogger.deprecate("cat_nodes_master_timeout_parameter", MASTER_TIMEOUT_DEPRECATED_MESSAGE); - request.validateParamValuesAreEqual(deprecatedTimeoutParam, "cluster_manager_timeout"); - clusterStateRequest.masterNodeTimeout(request.paramAsTime(deprecatedTimeoutParam, clusterStateRequest.masterNodeTimeout())); - } - } } diff --git a/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java b/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java new file mode 100644 index 0000000000000..b96edad72350f --- /dev/null +++ b/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java @@ -0,0 +1,113 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.action; + +import org.junit.After; +import org.opensearch.OpenSearchParseException; +import org.opensearch.action.support.master.MasterNodeRequest; +import org.opensearch.client.node.NodeClient; +import org.opensearch.common.logging.DeprecationLogger; +import org.opensearch.common.settings.Settings; +import org.opensearch.rest.BaseRestHandler; +import org.opensearch.rest.action.cat.RestNodesAction; +import org.opensearch.test.OpenSearchTestCase; +import org.opensearch.test.rest.FakeRestRequest; +import org.opensearch.threadpool.TestThreadPool; + +import static org.hamcrest.Matchers.containsString; + +/** + * As of 2.0, the request parameter 'master_timeout' in all applicable REST APIs is deprecated, + * and alternative parameter 'cluster_manager_timeout' is added. + * The tests are used to validate the behavior about the renamed request parameter. + * Remove the test after removing MASTER_ROLE and 'master_timeout'. + */ +public class RenamedTimeoutRequestParameterTests extends OpenSearchTestCase { + private final TestThreadPool threadPool = new TestThreadPool(RenamedTimeoutRequestParameterTests.class.getName()); + private final NodeClient client = new NodeClient(Settings.EMPTY, threadPool); + private final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RenamedTimeoutRequestParameterTests.class); + + private static final String DUPLICATE_PARAMETER_ERROR_MESSAGE = + "Please only use one of the request parameters [master_timeout, cluster_manager_timeout]."; + private static final String MASTER_TIMEOUT_DEPRECATED_MESSAGE = + "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version."; + + @After + public void terminateThreadPool() { + terminate(threadPool); + } + + public void testNoWarningsForNewParam() { + BaseRestHandler.parseDeprecatedMasterTimeoutParameter( + getMasterNodeRequest(), + getRestRequestWithNewParam(), + deprecationLogger, + "test" + ); + } + + public void testDeprecationWarningForOldParam() { + BaseRestHandler.parseDeprecatedMasterTimeoutParameter( + getMasterNodeRequest(), + getRestRequestWithDeprecatedParam(), + deprecationLogger, + "test" + ); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testBothParamsNotValid() { + Exception e = assertThrows( + OpenSearchParseException.class, + () -> BaseRestHandler.parseDeprecatedMasterTimeoutParameter( + getMasterNodeRequest(), + getRestRequestWithBothParams(), + deprecationLogger, + "test" + ) + ); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testCatAllocation() { + RestNodesAction action = new RestNodesAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.doCatRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + private MasterNodeRequest getMasterNodeRequest() { + return new MasterNodeRequest() { + @Override + public ActionRequestValidationException validate() { + return null; + } + }; + } + + private FakeRestRequest getRestRequestWithBothParams() { + FakeRestRequest request = new FakeRestRequest(); + request.params().put("cluster_manager_timeout", "1h"); + request.params().put("master_timeout", "3s"); + return request; + } + + private FakeRestRequest getRestRequestWithDeprecatedParam() { + FakeRestRequest request = new FakeRestRequest(); + request.params().put("master_timeout", "3s"); + return request; + } + + private FakeRestRequest getRestRequestWithNewParam() { + FakeRestRequest request = new FakeRestRequest(); + request.params().put("cluster_manager_timeout", "2m"); + return request; + } +} diff --git a/server/src/test/java/org/opensearch/rest/RestRequestTests.java b/server/src/test/java/org/opensearch/rest/RestRequestTests.java index d5a915b42cf87..7abc53e4ca610 100644 --- a/server/src/test/java/org/opensearch/rest/RestRequestTests.java +++ b/server/src/test/java/org/opensearch/rest/RestRequestTests.java @@ -34,7 +34,6 @@ import org.opensearch.OpenSearchParseException; import org.opensearch.common.CheckedConsumer; -import org.opensearch.common.Strings; import org.opensearch.common.bytes.BytesArray; import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.collect.MapBuilder; @@ -51,13 +50,11 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; -import java.util.Locale; import java.util.Map; import java.util.concurrent.atomic.AtomicReference; import static java.util.Collections.emptyMap; import static java.util.Collections.singletonMap; -import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.mockito.Mockito.mock; @@ -283,40 +280,6 @@ public void testRequiredContent() { assertEquals("unknown content type", e.getMessage()); } - /* - * The test is added in 2.0 when the request parameter "cluster_manager_timeout" is introduced. - * Remove the test along with the removal of the non-inclusive terminology "master_timeout". - */ - public void testValidateParamValuesAreEqualWhenTheyAreEqual() { - FakeRestRequest request = new FakeRestRequest(); - String valueForKey1 = randomFrom("value1", "", null); - String valueForKey2 = "value1"; - request.params().put("key1", valueForKey1); - request.params().put("key2", valueForKey2); - request.validateParamValuesAreEqual("key1", "key2"); - assertTrue( - String.format( - Locale.ROOT, - "The 2 values should be equal, or having 1 null/empty value. Value of key1: %s. Value of key2: %s", - valueForKey1, - valueForKey2 - ), - Strings.isNullOrEmpty(valueForKey1) || valueForKey1.equals(valueForKey2) - ); - } - - /* - * The test is added in 2.0 when the request parameter "cluster_manager_timeout" is introduced. - * Remove the test along with the removal of the non-inclusive terminology "master_timeout". - */ - public void testValidateParamValuesAreEqualWhenTheyAreNotEqual() { - FakeRestRequest request = new FakeRestRequest(); - request.params().put("key1", "value1"); - request.params().put("key2", "value2"); - Exception e = assertThrows(OpenSearchParseException.class, () -> request.validateParamValuesAreEqual("key1", "key2")); - assertThat(e.getMessage(), containsString("The values of the request parameters: [key1, key2] are required to be equal")); - } - private static RestRequest contentRestRequest(String content, Map params) { Map> headers = new HashMap<>(); headers.put("Content-Type", Collections.singletonList("application/json")); diff --git a/server/src/test/java/org/opensearch/rest/action/cat/RestNodesActionTests.java b/server/src/test/java/org/opensearch/rest/action/cat/RestNodesActionTests.java index 9293d40605f42..593ad2907797e 100644 --- a/server/src/test/java/org/opensearch/rest/action/cat/RestNodesActionTests.java +++ b/server/src/test/java/org/opensearch/rest/action/cat/RestNodesActionTests.java @@ -32,7 +32,6 @@ package org.opensearch.rest.action.cat; -import org.opensearch.OpenSearchParseException; import org.opensearch.Version; import org.opensearch.action.admin.cluster.node.info.NodesInfoResponse; import org.opensearch.action.admin.cluster.node.stats.NodesStatsResponse; @@ -52,7 +51,6 @@ import static java.util.Collections.emptyMap; import static java.util.Collections.emptySet; -import static org.hamcrest.CoreMatchers.containsString; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -91,20 +89,4 @@ public void testCatNodesWithLocalDeprecationWarning() { terminate(threadPool); } - - /** - * Validate both cluster_manager_timeout and its predecessor can be parsed correctly. - * Remove the test along with MASTER_ROLE. It's added in version 2.0.0. - */ - public void testCatNodesWithClusterManagerTimeout() { - TestThreadPool threadPool = new TestThreadPool(RestNodesActionTests.class.getName()); - NodeClient client = new NodeClient(Settings.EMPTY, threadPool); - FakeRestRequest request = new FakeRestRequest(); - request.params().put("cluster_manager_timeout", randomFrom("1h", "2m")); - request.params().put("master_timeout", "3s"); - Exception e = assertThrows(OpenSearchParseException.class, () -> action.doCatRequest(request, client)); - assertThat(e.getMessage(), containsString("[master_timeout, cluster_manager_timeout] are required to be equal")); - assertWarnings(RestNodesAction.MASTER_TIMEOUT_DEPRECATED_MESSAGE); - terminate(threadPool); - } } From 4e9be6ad072df56ed1c7ec253a23f45d36a164af Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 4 Apr 2022 10:24:16 -0500 Subject: [PATCH 026/514] [Backport 2.x] Add request parameter 'cluster_manager_timeout' as the alternative for 'master_timeout', and deprecate 'master_timeout' - in CAT APIs (#2716) Apply the change of CAT Nodes API in PR #2435 to other applicable CAT APIs. - Deprecate the request parameter `master_timeout` that used in many CAT APIs. - Add alternative new request parameter `cluster_manager_timeout`. - Add unit tests. Signed-off-by: Tianli Feng (cherry picked from commit 78465b4a08d51b8016ebfa757ca24e97606bdc84) --- .../rest-api-spec/api/cat.allocation.json | 10 +- .../api/cat.cluster_manager.json | 10 +- .../rest-api-spec/api/cat.indices.json | 10 +- .../rest-api-spec/api/cat.nodeattrs.json | 10 +- .../rest-api-spec/api/cat.pending_tasks.json | 10 +- .../rest-api-spec/api/cat.plugins.json | 10 +- .../rest-api-spec/api/cat.repositories.json | 10 +- .../rest-api-spec/api/cat.segments.json | 12 ++ .../rest-api-spec/api/cat.shards.json | 10 +- .../rest-api-spec/api/cat.snapshots.json | 10 +- .../rest-api-spec/api/cat.templates.json | 10 +- .../rest-api-spec/api/cat.thread_pool.json | 10 +- .../rest/action/cat/RestAllocationAction.java | 6 +- .../rest/action/cat/RestIndicesAction.java | 126 +++++++++++------- .../rest/action/cat/RestMasterAction.java | 6 +- .../rest/action/cat/RestNodeAttrsAction.java | 6 +- .../cat/RestPendingClusterTasksAction.java | 8 +- .../rest/action/cat/RestPluginsAction.java | 6 +- .../action/cat/RestRepositoriesAction.java | 10 +- .../rest/action/cat/RestSegmentsAction.java | 8 +- .../rest/action/cat/RestShardsAction.java | 6 +- .../rest/action/cat/RestSnapshotAction.java | 8 +- .../rest/action/cat/RestTemplatesAction.java | 8 +- .../rest/action/cat/RestThreadPoolAction.java | 6 +- .../RenamedTimeoutRequestParameterTests.java | 96 +++++++++++++ 25 files changed, 346 insertions(+), 76 deletions(-) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.allocation.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.allocation.json index 7b3dc70b03c38..717c1c49808f6 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.allocation.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.allocation.json @@ -55,7 +55,15 @@ }, "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "h":{ "type":"list", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.cluster_manager.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.cluster_manager.json index c1084825546bf..cd96038ad0693 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.cluster_manager.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.cluster_manager.json @@ -36,7 +36,15 @@ }, "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "h":{ "type":"list", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.indices.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.indices.json index a92189134f88f..2491ab309531d 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.indices.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.indices.json @@ -55,7 +55,15 @@ }, "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "h":{ "type":"list", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.nodeattrs.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.nodeattrs.json index e688e23cab089..c8afa4cb17039 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.nodeattrs.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.nodeattrs.json @@ -26,7 +26,15 @@ }, "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "h":{ "type":"list", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.pending_tasks.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.pending_tasks.json index 36fa33be495cd..9c0edf8c53d90 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.pending_tasks.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.pending_tasks.json @@ -26,7 +26,15 @@ }, "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "h":{ "type":"list", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.plugins.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.plugins.json index d5346c6d9e7b4..0b5b39b01ee58 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.plugins.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.plugins.json @@ -26,7 +26,15 @@ }, "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "h":{ "type":"list", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.repositories.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.repositories.json index 84d9965907ff3..58960709a99bb 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.repositories.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.repositories.json @@ -27,7 +27,15 @@ }, "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "h":{ "type":"list", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.segments.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.segments.json index 472ef7fd22eee..5107353c7b14f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.segments.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.segments.json @@ -49,6 +49,18 @@ "pb" ] }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" + }, "h":{ "type":"list", "description":"Comma-separated list of column names to display" diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.shards.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.shards.json index a13c0f6bf6d4a..fab381a098e3f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.shards.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.shards.json @@ -55,7 +55,15 @@ }, "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "h":{ "type":"list", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.snapshots.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.snapshots.json index 757c2cfbe7dc6..1320207abfe75 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.snapshots.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.snapshots.json @@ -39,7 +39,15 @@ }, "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "h":{ "type":"list", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.templates.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.templates.json index 53fc872b5dae2..d45593b7bb2c8 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.templates.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.templates.json @@ -38,7 +38,15 @@ }, "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "h":{ "type":"list", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.thread_pool.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.thread_pool.json index 710c297dbbe75..1165703490d1a 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.thread_pool.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.thread_pool.json @@ -54,7 +54,15 @@ }, "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "h":{ "type":"list", diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestAllocationAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestAllocationAction.java index a74d64d1530c5..eb03b9e25a294 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestAllocationAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestAllocationAction.java @@ -44,6 +44,7 @@ import org.opensearch.cluster.routing.ShardRouting; import org.opensearch.common.Strings; import org.opensearch.common.Table; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.unit.ByteSizeValue; import org.opensearch.rest.RestRequest; import org.opensearch.rest.RestResponse; @@ -58,6 +59,8 @@ public class RestAllocationAction extends AbstractCatAction { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestAllocationAction.class); + @Override public List routes() { return unmodifiableList(asList(new Route(GET, "/_cat/allocation"), new Route(GET, "/_cat/allocation/{nodes}"))); @@ -79,7 +82,8 @@ public RestChannelConsumer doCatRequest(final RestRequest request, final NodeCli final ClusterStateRequest clusterStateRequest = new ClusterStateRequest(); clusterStateRequest.clear().routingTable(true); clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); - clusterStateRequest.masterNodeTimeout(request.paramAsTime("master_timeout", clusterStateRequest.masterNodeTimeout())); + clusterStateRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", clusterStateRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request, deprecationLogger, getName()); return channel -> client.admin().cluster().state(clusterStateRequest, new RestActionListener(channel) { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestIndicesAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestIndicesAction.java index 2c0eef6a8fdb8..a26b57aab0636 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestIndicesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestIndicesAction.java @@ -32,6 +32,7 @@ package org.opensearch.rest.action.cat; +import org.opensearch.OpenSearchParseException; import org.opensearch.action.ActionListener; import org.opensearch.action.ActionResponse; import org.opensearch.action.admin.cluster.health.ClusterHealthRequest; @@ -52,6 +53,7 @@ import org.opensearch.cluster.metadata.IndexMetadata; import org.opensearch.common.Strings; import org.opensearch.common.Table; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.settings.Settings; import org.opensearch.common.time.DateFormatter; import org.opensearch.common.unit.TimeValue; @@ -82,6 +84,11 @@ public class RestIndicesAction extends AbstractCatAction { private static final DateFormatter STRICT_DATE_TIME_FORMATTER = DateFormatter.forPattern("strict_date_time"); + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestIndicesAction.class); + private static final String MASTER_TIMEOUT_DEPRECATED_MESSAGE = + "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version."; + private static final String DUPLICATE_PARAMETER_ERROR_MESSAGE = + "Please only use one of the request parameters [master_timeout, cluster_manager_timeout]."; @Override public List routes() { @@ -109,7 +116,16 @@ public RestChannelConsumer doCatRequest(final RestRequest request, final NodeCli final String[] indices = Strings.splitStringByCommaToArray(request.param("index")); final IndicesOptions indicesOptions = IndicesOptions.fromRequest(request, IndicesOptions.strictExpand()); final boolean local = request.paramAsBoolean("local", false); - final TimeValue masterNodeTimeout = request.paramAsTime("master_timeout", DEFAULT_MASTER_NODE_TIMEOUT); + TimeValue clusterManagerTimeout = request.paramAsTime("cluster_manager_timeout", DEFAULT_MASTER_NODE_TIMEOUT); + // Remove the if condition and statements inside after removing MASTER_ROLE. + if (request.hasParam("master_timeout")) { + deprecationLogger.deprecate("cat_indices_master_timeout_parameter", MASTER_TIMEOUT_DEPRECATED_MESSAGE); + if (request.hasParam("cluster_manager_timeout")) { + throw new OpenSearchParseException(DUPLICATE_PARAMETER_ERROR_MESSAGE); + } + clusterManagerTimeout = request.paramAsTime("master_timeout", DEFAULT_MASTER_NODE_TIMEOUT); + } + final TimeValue clusterManagerNodeTimeout = clusterManagerTimeout; final boolean includeUnloadedSegments = request.paramAsBoolean("include_unloaded_segments", false); return channel -> { @@ -120,56 +136,66 @@ public RestResponse buildResponse(final Table table) throws Exception { } }); - sendGetSettingsRequest(indices, indicesOptions, local, masterNodeTimeout, client, new ActionListener() { - @Override - public void onResponse(final GetSettingsResponse getSettingsResponse) { - final GroupedActionListener groupedListener = createGroupedListener(request, 4, listener); - groupedListener.onResponse(getSettingsResponse); - - // The list of indices that will be returned is determined by the indices returned from the Get Settings call. - // All the other requests just provide additional detail, and wildcards may be resolved differently depending on the - // type of request in the presence of security plugins (looking at you, ClusterHealthRequest), so - // force the IndicesOptions for all the sub-requests to be as inclusive as possible. - final IndicesOptions subRequestIndicesOptions = IndicesOptions.lenientExpandHidden(); - - // Indices that were successfully resolved during the get settings request might be deleted when the subsequent cluster - // state, cluster health and indices stats requests execute. We have to distinguish two cases: - // 1) the deleted index was explicitly passed as parameter to the /_cat/indices request. In this case we want the - // subsequent requests to fail. - // 2) the deleted index was resolved as part of a wildcard or _all. In this case, we want the subsequent requests not to - // fail on the deleted index (as we want to ignore wildcards that cannot be resolved). - // This behavior can be ensured by letting the cluster state, cluster health and indices stats requests re-resolve the - // index names with the same indices options that we used for the initial cluster state request (strictExpand). - sendIndicesStatsRequest( - indices, - subRequestIndicesOptions, - includeUnloadedSegments, - client, - ActionListener.wrap(groupedListener::onResponse, groupedListener::onFailure) - ); - sendClusterStateRequest( - indices, - subRequestIndicesOptions, - local, - masterNodeTimeout, - client, - ActionListener.wrap(groupedListener::onResponse, groupedListener::onFailure) - ); - sendClusterHealthRequest( - indices, - subRequestIndicesOptions, - local, - masterNodeTimeout, - client, - ActionListener.wrap(groupedListener::onResponse, groupedListener::onFailure) - ); - } - - @Override - public void onFailure(final Exception e) { - listener.onFailure(e); + sendGetSettingsRequest( + indices, + indicesOptions, + local, + clusterManagerNodeTimeout, + client, + new ActionListener() { + @Override + public void onResponse(final GetSettingsResponse getSettingsResponse) { + final GroupedActionListener groupedListener = createGroupedListener(request, 4, listener); + groupedListener.onResponse(getSettingsResponse); + + // The list of indices that will be returned is determined by the indices returned from the Get Settings call. + // All the other requests just provide additional detail, and wildcards may be resolved differently depending on the + // type of request in the presence of security plugins (looking at you, ClusterHealthRequest), so + // force the IndicesOptions for all the sub-requests to be as inclusive as possible. + final IndicesOptions subRequestIndicesOptions = IndicesOptions.lenientExpandHidden(); + + // Indices that were successfully resolved during the get settings request might be deleted when the subsequent + // cluster + // state, cluster health and indices stats requests execute. We have to distinguish two cases: + // 1) the deleted index was explicitly passed as parameter to the /_cat/indices request. In this case we want the + // subsequent requests to fail. + // 2) the deleted index was resolved as part of a wildcard or _all. In this case, we want the subsequent requests + // not to + // fail on the deleted index (as we want to ignore wildcards that cannot be resolved). + // This behavior can be ensured by letting the cluster state, cluster health and indices stats requests re-resolve + // the + // index names with the same indices options that we used for the initial cluster state request (strictExpand). + sendIndicesStatsRequest( + indices, + subRequestIndicesOptions, + includeUnloadedSegments, + client, + ActionListener.wrap(groupedListener::onResponse, groupedListener::onFailure) + ); + sendClusterStateRequest( + indices, + subRequestIndicesOptions, + local, + clusterManagerNodeTimeout, + client, + ActionListener.wrap(groupedListener::onResponse, groupedListener::onFailure) + ); + sendClusterHealthRequest( + indices, + subRequestIndicesOptions, + local, + clusterManagerNodeTimeout, + client, + ActionListener.wrap(groupedListener::onResponse, groupedListener::onFailure) + ); + } + + @Override + public void onFailure(final Exception e) { + listener.onFailure(e); + } } - }); + ); }; } diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java index 1219b419122c6..4bcb16c741ecf 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java @@ -38,6 +38,7 @@ import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.cluster.node.DiscoveryNodes; import org.opensearch.common.Table; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.RestRequest; import org.opensearch.rest.RestResponse; import org.opensearch.rest.action.RestResponseListener; @@ -49,6 +50,8 @@ public class RestMasterAction extends AbstractCatAction { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestMasterAction.class); + @Override public List replacedRoutes() { // The deprecated path will be removed in a future major version. @@ -70,7 +73,8 @@ public RestChannelConsumer doCatRequest(final RestRequest request, final NodeCli final ClusterStateRequest clusterStateRequest = new ClusterStateRequest(); clusterStateRequest.clear().nodes(true); clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); - clusterStateRequest.masterNodeTimeout(request.paramAsTime("master_timeout", clusterStateRequest.masterNodeTimeout())); + clusterStateRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", clusterStateRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request, deprecationLogger, getName()); return channel -> client.admin().cluster().state(clusterStateRequest, new RestResponseListener(channel) { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestNodeAttrsAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestNodeAttrsAction.java index d6fc27a2713db..6ea36267d39ed 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestNodeAttrsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestNodeAttrsAction.java @@ -42,6 +42,7 @@ import org.opensearch.cluster.node.DiscoveryNodes; import org.opensearch.common.Strings; import org.opensearch.common.Table; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.monitor.process.ProcessInfo; import org.opensearch.rest.RestRequest; import org.opensearch.rest.RestResponse; @@ -56,6 +57,8 @@ public class RestNodeAttrsAction extends AbstractCatAction { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestNodeAttrsAction.class); + @Override public List routes() { return singletonList(new Route(GET, "/_cat/nodeattrs")); @@ -76,7 +79,8 @@ public RestChannelConsumer doCatRequest(final RestRequest request, final NodeCli final ClusterStateRequest clusterStateRequest = new ClusterStateRequest(); clusterStateRequest.clear().nodes(true); clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); - clusterStateRequest.masterNodeTimeout(request.paramAsTime("master_timeout", clusterStateRequest.masterNodeTimeout())); + clusterStateRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", clusterStateRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request, deprecationLogger, getName()); return channel -> client.admin().cluster().state(clusterStateRequest, new RestActionListener(channel) { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestPendingClusterTasksAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestPendingClusterTasksAction.java index dbc1b21fcf0ab..7e261510ee742 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestPendingClusterTasksAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestPendingClusterTasksAction.java @@ -37,6 +37,7 @@ import org.opensearch.client.node.NodeClient; import org.opensearch.cluster.service.PendingClusterTask; import org.opensearch.common.Table; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.RestRequest; import org.opensearch.rest.RestResponse; import org.opensearch.rest.action.RestResponseListener; @@ -48,6 +49,8 @@ public class RestPendingClusterTasksAction extends AbstractCatAction { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestPendingClusterTasksAction.class); + @Override public List routes() { return singletonList(new Route(GET, "/_cat/pending_tasks")); @@ -66,7 +69,10 @@ protected void documentation(StringBuilder sb) { @Override public RestChannelConsumer doCatRequest(final RestRequest request, final NodeClient client) { PendingClusterTasksRequest pendingClusterTasksRequest = new PendingClusterTasksRequest(); - pendingClusterTasksRequest.masterNodeTimeout(request.paramAsTime("master_timeout", pendingClusterTasksRequest.masterNodeTimeout())); + pendingClusterTasksRequest.masterNodeTimeout( + request.paramAsTime("cluster_manager_timeout", pendingClusterTasksRequest.masterNodeTimeout()) + ); + parseDeprecatedMasterTimeoutParameter(pendingClusterTasksRequest, request, deprecationLogger, getName()); pendingClusterTasksRequest.local(request.paramAsBoolean("local", pendingClusterTasksRequest.local())); return channel -> client.admin() .cluster() diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestPluginsAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestPluginsAction.java index 79cac0f906c74..8975c8ab4b3de 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestPluginsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestPluginsAction.java @@ -42,6 +42,7 @@ import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.cluster.node.DiscoveryNodes; import org.opensearch.common.Table; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.plugins.PluginInfo; import org.opensearch.rest.RestRequest; import org.opensearch.rest.RestResponse; @@ -55,6 +56,8 @@ public class RestPluginsAction extends AbstractCatAction { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestPluginsAction.class); + @Override public List routes() { return singletonList(new Route(GET, "/_cat/plugins")); @@ -75,7 +78,8 @@ public RestChannelConsumer doCatRequest(final RestRequest request, final NodeCli final ClusterStateRequest clusterStateRequest = new ClusterStateRequest(); clusterStateRequest.clear().nodes(true); clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); - clusterStateRequest.masterNodeTimeout(request.paramAsTime("master_timeout", clusterStateRequest.masterNodeTimeout())); + clusterStateRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", clusterStateRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request, deprecationLogger, getName()); return channel -> client.admin().cluster().state(clusterStateRequest, new RestActionListener(channel) { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestRepositoriesAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestRepositoriesAction.java index fec3996506fca..76c71bee791ef 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestRepositoriesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestRepositoriesAction.java @@ -37,6 +37,7 @@ import org.opensearch.client.node.NodeClient; import org.opensearch.cluster.metadata.RepositoryMetadata; import org.opensearch.common.Table; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.RestRequest; import org.opensearch.rest.RestResponse; import org.opensearch.rest.action.RestResponseListener; @@ -51,16 +52,21 @@ */ public class RestRepositoriesAction extends AbstractCatAction { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestRepositoriesAction.class); + @Override public List routes() { return singletonList(new Route(GET, "/_cat/repositories")); } @Override - protected RestChannelConsumer doCatRequest(RestRequest request, NodeClient client) { + public RestChannelConsumer doCatRequest(RestRequest request, NodeClient client) { GetRepositoriesRequest getRepositoriesRequest = new GetRepositoriesRequest(); getRepositoriesRequest.local(request.paramAsBoolean("local", getRepositoriesRequest.local())); - getRepositoriesRequest.masterNodeTimeout(request.paramAsTime("master_timeout", getRepositoriesRequest.masterNodeTimeout())); + getRepositoriesRequest.masterNodeTimeout( + request.paramAsTime("cluster_manager_timeout", getRepositoriesRequest.masterNodeTimeout()) + ); + parseDeprecatedMasterTimeoutParameter(getRepositoriesRequest, request, deprecationLogger, getName()); return channel -> client.admin() .cluster() diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestSegmentsAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestSegmentsAction.java index 8d9d1937bdf56..3a31fdab125b1 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestSegmentsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestSegmentsAction.java @@ -43,6 +43,7 @@ import org.opensearch.cluster.node.DiscoveryNodes; import org.opensearch.common.Strings; import org.opensearch.common.Table; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.index.engine.Segment; import org.opensearch.rest.RestRequest; import org.opensearch.rest.RestResponse; @@ -58,6 +59,8 @@ public class RestSegmentsAction extends AbstractCatAction { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestSegmentsAction.class); + @Override public List routes() { return unmodifiableList(asList(new Route(GET, "/_cat/segments"), new Route(GET, "/_cat/segments/{index}"))); @@ -74,12 +77,13 @@ public boolean allowSystemIndexAccessByDefault() { } @Override - protected RestChannelConsumer doCatRequest(final RestRequest request, final NodeClient client) { + public RestChannelConsumer doCatRequest(final RestRequest request, final NodeClient client) { final String[] indices = Strings.splitStringByCommaToArray(request.param("index")); final ClusterStateRequest clusterStateRequest = new ClusterStateRequest(); clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); - clusterStateRequest.masterNodeTimeout(request.paramAsTime("master_timeout", clusterStateRequest.masterNodeTimeout())); + clusterStateRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", clusterStateRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request, deprecationLogger, getName()); clusterStateRequest.clear().nodes(true).routingTable(true).indices(indices); return channel -> client.admin().cluster().state(clusterStateRequest, new RestActionListener(channel) { diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestShardsAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestShardsAction.java index f9aa1a5554e9e..32e2ca8481f83 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestShardsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestShardsAction.java @@ -43,6 +43,7 @@ import org.opensearch.cluster.routing.UnassignedInfo; import org.opensearch.common.Strings; import org.opensearch.common.Table; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.unit.TimeValue; import org.opensearch.index.cache.query.QueryCacheStats; import org.opensearch.index.engine.CommitStats; @@ -75,6 +76,8 @@ public class RestShardsAction extends AbstractCatAction { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestShardsAction.class); + @Override public List routes() { return unmodifiableList(asList(new Route(GET, "/_cat/shards"), new Route(GET, "/_cat/shards/{index}"))); @@ -101,7 +104,8 @@ public RestChannelConsumer doCatRequest(final RestRequest request, final NodeCli final String[] indices = Strings.splitStringByCommaToArray(request.param("index")); final ClusterStateRequest clusterStateRequest = new ClusterStateRequest(); clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); - clusterStateRequest.masterNodeTimeout(request.paramAsTime("master_timeout", clusterStateRequest.masterNodeTimeout())); + clusterStateRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", clusterStateRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request, deprecationLogger, getName()); clusterStateRequest.clear().nodes(true).routingTable(true).indices(indices); return channel -> client.admin().cluster().state(clusterStateRequest, new RestActionListener(channel) { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestSnapshotAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestSnapshotAction.java index 55e20bc59aeac..5adb9228d9869 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestSnapshotAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestSnapshotAction.java @@ -36,6 +36,7 @@ import org.opensearch.action.admin.cluster.snapshots.get.GetSnapshotsResponse; import org.opensearch.client.node.NodeClient; import org.opensearch.common.Table; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.time.DateFormatter; import org.opensearch.common.unit.TimeValue; import org.opensearch.rest.RestRequest; @@ -58,6 +59,8 @@ */ public class RestSnapshotAction extends AbstractCatAction { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestSnapshotAction.class); + @Override public List routes() { return unmodifiableList(asList(new Route(GET, "/_cat/snapshots"), new Route(GET, "/_cat/snapshots/{repository}"))); @@ -69,13 +72,14 @@ public String getName() { } @Override - protected RestChannelConsumer doCatRequest(final RestRequest request, NodeClient client) { + public RestChannelConsumer doCatRequest(final RestRequest request, NodeClient client) { GetSnapshotsRequest getSnapshotsRequest = new GetSnapshotsRequest().repository(request.param("repository")) .snapshots(new String[] { GetSnapshotsRequest.ALL_SNAPSHOTS }); getSnapshotsRequest.ignoreUnavailable(request.paramAsBoolean("ignore_unavailable", getSnapshotsRequest.ignoreUnavailable())); - getSnapshotsRequest.masterNodeTimeout(request.paramAsTime("master_timeout", getSnapshotsRequest.masterNodeTimeout())); + getSnapshotsRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", getSnapshotsRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(getSnapshotsRequest, request, deprecationLogger, getName()); return channel -> client.admin() .cluster() diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestTemplatesAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestTemplatesAction.java index fcead3a34e8a9..bedc57453cb9b 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestTemplatesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestTemplatesAction.java @@ -40,6 +40,7 @@ import org.opensearch.cluster.metadata.ComposableIndexTemplate; import org.opensearch.cluster.metadata.Metadata; import org.opensearch.common.Table; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.regex.Regex; import org.opensearch.rest.RestRequest; import org.opensearch.rest.RestResponse; @@ -54,6 +55,8 @@ public class RestTemplatesAction extends AbstractCatAction { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestTemplatesAction.class); + @Override public List routes() { return unmodifiableList(asList(new Route(GET, "/_cat/templates"), new Route(GET, "/_cat/templates/{name}"))); @@ -70,12 +73,13 @@ protected void documentation(StringBuilder sb) { } @Override - protected RestChannelConsumer doCatRequest(final RestRequest request, NodeClient client) { + public RestChannelConsumer doCatRequest(final RestRequest request, NodeClient client) { final String matchPattern = request.hasParam("name") ? request.param("name") : null; final ClusterStateRequest clusterStateRequest = new ClusterStateRequest(); clusterStateRequest.clear().metadata(true); clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); - clusterStateRequest.masterNodeTimeout(request.paramAsTime("master_timeout", clusterStateRequest.masterNodeTimeout())); + clusterStateRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", clusterStateRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request, deprecationLogger, getName()); return channel -> client.admin().cluster().state(clusterStateRequest, new RestResponseListener(channel) { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestThreadPoolAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestThreadPoolAction.java index 1198fe0bdcba3..2f43a3a66d01b 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestThreadPoolAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestThreadPoolAction.java @@ -44,6 +44,7 @@ import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.cluster.node.DiscoveryNodes; import org.opensearch.common.Table; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.regex.Regex; import org.opensearch.monitor.process.ProcessInfo; import org.opensearch.rest.RestRequest; @@ -68,6 +69,8 @@ public class RestThreadPoolAction extends AbstractCatAction { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestThreadPoolAction.class); + @Override public List routes() { return unmodifiableList(asList(new Route(GET, "/_cat/thread_pool"), new Route(GET, "/_cat/thread_pool/{thread_pool_patterns}"))); @@ -89,7 +92,8 @@ public RestChannelConsumer doCatRequest(final RestRequest request, final NodeCli final ClusterStateRequest clusterStateRequest = new ClusterStateRequest(); clusterStateRequest.clear().nodes(true); clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); - clusterStateRequest.masterNodeTimeout(request.paramAsTime("master_timeout", clusterStateRequest.masterNodeTimeout())); + clusterStateRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", clusterStateRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request, deprecationLogger, getName()); return channel -> client.admin().cluster().state(clusterStateRequest, new RestActionListener(channel) { @Override diff --git a/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java b/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java index b96edad72350f..f34313f9e9adf 100644 --- a/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java +++ b/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java @@ -15,7 +15,19 @@ import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.settings.Settings; import org.opensearch.rest.BaseRestHandler; +import org.opensearch.rest.action.cat.RestAllocationAction; +import org.opensearch.rest.action.cat.RestRepositoriesAction; +import org.opensearch.rest.action.cat.RestThreadPoolAction; +import org.opensearch.rest.action.cat.RestMasterAction; +import org.opensearch.rest.action.cat.RestShardsAction; +import org.opensearch.rest.action.cat.RestPluginsAction; +import org.opensearch.rest.action.cat.RestNodeAttrsAction; import org.opensearch.rest.action.cat.RestNodesAction; +import org.opensearch.rest.action.cat.RestIndicesAction; +import org.opensearch.rest.action.cat.RestTemplatesAction; +import org.opensearch.rest.action.cat.RestPendingClusterTasksAction; +import org.opensearch.rest.action.cat.RestSegmentsAction; +import org.opensearch.rest.action.cat.RestSnapshotAction; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.rest.FakeRestRequest; import org.opensearch.threadpool.TestThreadPool; @@ -77,12 +89,96 @@ public void testBothParamsNotValid() { } public void testCatAllocation() { + RestAllocationAction action = new RestAllocationAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.doCatRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testCatIndices() { + RestIndicesAction action = new RestIndicesAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.doCatRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testCatClusterManager() { + RestMasterAction action = new RestMasterAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.doCatRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testCatNodeattrs() { + RestNodeAttrsAction action = new RestNodeAttrsAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.doCatRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testCatNodes() { RestNodesAction action = new RestNodesAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.doCatRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } + public void testCatPendingTasks() { + RestPendingClusterTasksAction action = new RestPendingClusterTasksAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.doCatRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testCatPlugins() { + RestPluginsAction action = new RestPluginsAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.doCatRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testCatRepositories() { + RestRepositoriesAction action = new RestRepositoriesAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.doCatRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testCatShards() { + RestShardsAction action = new RestShardsAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.doCatRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testCatSnapshots() { + RestSnapshotAction action = new RestSnapshotAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.doCatRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testCatTemplates() { + RestTemplatesAction action = new RestTemplatesAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.doCatRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testCatThreadPool() { + RestThreadPoolAction action = new RestThreadPoolAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.doCatRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testCatSegments() { + RestSegmentsAction action = new RestSegmentsAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.doCatRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + private MasterNodeRequest getMasterNodeRequest() { return new MasterNodeRequest() { @Override From 2431e2194bec03f0c8a7fa69fe5242b8fade85d0 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 4 Apr 2022 11:17:24 -0500 Subject: [PATCH 027/514] Make Rest-High-Rest-Level tests allow deprecation warning temporarily, during deprecation of request parameter 'master_timeout' (#2702) (#2740) Temporarily build rest client with setStrictDeprecationMode(false) to allow deprecation warning in HLRC tests while master_timeout parameters is being refactored. Signed-off-by: Tianli Feng (cherry picked from commit 6a2a33d1872850b04562164c39621698cb99d7b8) --- .../java/org/opensearch/test/rest/OpenSearchRestTestCase.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/framework/src/main/java/org/opensearch/test/rest/OpenSearchRestTestCase.java b/test/framework/src/main/java/org/opensearch/test/rest/OpenSearchRestTestCase.java index 9624a9d3d0554..f976b3619102a 100644 --- a/test/framework/src/main/java/org/opensearch/test/rest/OpenSearchRestTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/rest/OpenSearchRestTestCase.java @@ -824,7 +824,8 @@ protected String getProtocol() { protected RestClient buildClient(Settings settings, HttpHost[] hosts) throws IOException { RestClientBuilder builder = RestClient.builder(hosts); configureClient(builder, settings); - builder.setStrictDeprecationMode(true); + // TODO: set the method argument to 'true' after PR https://github.com/opensearch-project/OpenSearch/pull/2683 merged. + builder.setStrictDeprecationMode(false); return builder.build(); } From 1884de5a88b2537e586f569d7b8823d0806b7729 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 4 Apr 2022 11:55:21 -0500 Subject: [PATCH 028/514] Optimize Node, remove duplicate Settings (#2703) (#2742) Removes duplicate Settings Signed-off-by: ruanwenjun Signed-off-by: Nicholas Walter knize (cherry picked from commit d848c632603a31631ea0a12382c52cce36adacae) Co-authored-by: Wenjun Ruan --- .../opensearch/index/get/ShardGetService.java | 27 ++++++++----------- .../main/java/org/opensearch/node/Node.java | 6 +---- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/server/src/main/java/org/opensearch/index/get/ShardGetService.java b/server/src/main/java/org/opensearch/index/get/ShardGetService.java index e63d80336bc7a..6aa10bc450b51 100644 --- a/server/src/main/java/org/opensearch/index/get/ShardGetService.java +++ b/server/src/main/java/org/opensearch/index/get/ShardGetService.java @@ -216,25 +216,20 @@ private GetResult innerGet( fetchSourceContext = normalizeFetchSourceContent(fetchSourceContext, gFields); Term uidTerm = new Term(IdFieldMapper.NAME, Uid.encodeId(id)); - Engine.GetResult get = indexShard.get( - new Engine.Get(realtime, true, id, uidTerm).version(version) - .versionType(versionType) - .setIfSeqNo(ifSeqNo) - .setIfPrimaryTerm(ifPrimaryTerm) - ); - if (get.exists() == false) { - get.close(); - } - - if (get == null || get.exists() == false) { - return new GetResult(shardId.getIndexName(), id, UNASSIGNED_SEQ_NO, UNASSIGNED_PRIMARY_TERM, -1, false, null, null, null); - } - try { + try ( + Engine.GetResult get = indexShard.get( + new Engine.Get(realtime, true, id, uidTerm).version(version) + .versionType(versionType) + .setIfSeqNo(ifSeqNo) + .setIfPrimaryTerm(ifPrimaryTerm) + ) + ) { + if (get == null || get.exists() == false) { + return new GetResult(shardId.getIndexName(), id, UNASSIGNED_SEQ_NO, UNASSIGNED_PRIMARY_TERM, -1, false, null, null, null); + } // break between having loaded it from translog (so we only have _source), and having a document to load return innerGetLoadFromStoredFields(id, gFields, fetchSourceContext, get, mapperService); - } finally { - get.close(); } } diff --git a/server/src/main/java/org/opensearch/node/Node.java b/server/src/main/java/org/opensearch/node/Node.java index 6368e097f6a14..73c2f221bc7cc 100644 --- a/server/src/main/java/org/opensearch/node/Node.java +++ b/server/src/main/java/org/opensearch/node/Node.java @@ -348,11 +348,7 @@ protected Node( Settings tmpSettings = Settings.builder() .put(initialEnvironment.settings()) .put(Client.CLIENT_TYPE_SETTING_S.getKey(), CLIENT_TYPE) - .build(); - - // Enabling shard indexing backpressure node-attribute - tmpSettings = Settings.builder() - .put(tmpSettings) + // Enabling shard indexing backpressure node-attribute .put(NODE_ATTRIBUTES.getKey() + SHARD_INDEXING_PRESSURE_ENABLED_ATTRIBUTE_KEY, "true") .build(); From a4785509ea68358ac1dfad3e39efe67726784106 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 4 Apr 2022 10:51:47 -0700 Subject: [PATCH 029/514] [Remove] types from rest-api-spec endpoints (#2689) (#2697) Removes types from rest-api-spec endpoints Signed-off-by: Nicholas Walter Knize (cherry picked from commit 86eb24d27fa016d2a47b026a1270e5abd59ddd11) Co-authored-by: Nick Knize --- .../client/RestHighLevelClientTests.java | 1 - .../resources/rest-api-spec/api/bulk.json | 17 ------ .../resources/rest-api-spec/api/create.json | 26 --------- .../resources/rest-api-spec/api/delete.json | 25 --------- .../rest-api-spec/api/exists_source.json | 25 --------- .../resources/rest-api-spec/api/explain.json | 26 --------- .../api/indices.exists_type.json | 55 ------------------- .../rest-api-spec/api/indices.stats.json | 4 -- .../api/indices.validate_query.json | 22 -------- .../resources/rest-api-spec/api/update.json | 25 --------- 10 files changed, 226 deletions(-) delete mode 100644 rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists_type.json diff --git a/client/rest-high-level/src/test/java/org/opensearch/client/RestHighLevelClientTests.java b/client/rest-high-level/src/test/java/org/opensearch/client/RestHighLevelClientTests.java index 73ce7d1b2b794..7766fa76d5cfe 100644 --- a/client/rest-high-level/src/test/java/org/opensearch/client/RestHighLevelClientTests.java +++ b/client/rest-high-level/src/test/java/org/opensearch/client/RestHighLevelClientTests.java @@ -841,7 +841,6 @@ public void testApiNamingConventions() throws Exception { "create", "get_script_context", "get_script_languages", - "indices.exists_type", "indices.get_upgrade", "indices.put_alias", "render_search_template", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/bulk.json b/rest-api-spec/src/main/resources/rest-api-spec/api/bulk.json index f7c0d69805caf..bb066cd131480 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/bulk.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/bulk.json @@ -26,23 +26,6 @@ "description":"Default index for items which don't provide one" } } - }, - { - "path":"/{index}/{type}/_bulk", - "methods":[ - "POST", - "PUT" - ], - "parts":{ - "index":{ - "type":"string", - "description":"Default index for items which don't provide one" - }, - "type":{ - "type":"string", - "description":"Default document type for items which don't provide one" - } - } } ] }, diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/create.json b/rest-api-spec/src/main/resources/rest-api-spec/api/create.json index 171f3da44d36d..767af84b82258 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/create.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/create.json @@ -23,32 +23,6 @@ "description":"The name of the index" } } - }, - { - "path":"/{index}/{type}/{id}/_create", - "methods":[ - "PUT", - "POST" - ], - "parts":{ - "id":{ - "type":"string", - "description":"Document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - }, - "type":{ - "type":"string", - "description":"The type of the document", - "deprecated":true - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"Specifying types in urls has been deprecated" - } } ] }, diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/delete.json b/rest-api-spec/src/main/resources/rest-api-spec/api/delete.json index 0d82bca9d4173..76dceb455627f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/delete.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/delete.json @@ -22,31 +22,6 @@ "description":"The name of the index" } } - }, - { - "path":"/{index}/{type}/{id}", - "methods":[ - "DELETE" - ], - "parts":{ - "id":{ - "type":"string", - "description":"The document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - }, - "type":{ - "type":"string", - "description":"The type of the document", - "deprecated":true - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"Specifying types in urls has been deprecated" - } } ] }, diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/exists_source.json b/rest-api-spec/src/main/resources/rest-api-spec/api/exists_source.json index 143ee406025ce..bdbf818fb5d81 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/exists_source.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/exists_source.json @@ -22,31 +22,6 @@ "description":"The name of the index" } } - }, - { - "path":"/{index}/{type}/{id}/_source", - "methods":[ - "HEAD" - ], - "parts":{ - "id":{ - "type":"string", - "description":"The document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - }, - "type":{ - "type":"string", - "description":"The type of the document; deprecated and optional starting with 7.0", - "deprecated":true - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"Specifying types in urls has been deprecated" - } } ] }, diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/explain.json b/rest-api-spec/src/main/resources/rest-api-spec/api/explain.json index c7c393a6a1cba..7f630f7666f30 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/explain.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/explain.json @@ -23,32 +23,6 @@ "description":"The name of the index" } } - }, - { - "path":"/{index}/{type}/{id}/_explain", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "id":{ - "type":"string", - "description":"The document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - }, - "type":{ - "type":"string", - "description":"The type of the document", - "deprecated":true - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"Specifying types in urls has been deprecated" - } } ] }, diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists_type.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists_type.json deleted file mode 100644 index c854d0e8fd841..0000000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.exists_type.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "indices.exists_type":{ - "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-types-exists.html", - "description":"Returns information about whether a particular document type exists. (DEPRECATED)" - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/{index}/_mapping/{type}", - "methods":[ - "HEAD" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names; use `_all` to check the types across all indices" - }, - "type":{ - "type":"list", - "description":"A comma-separated list of document types to check" - } - } - } - ] - }, - "params":{ - "ignore_unavailable":{ - "type":"boolean", - "description":"Whether specified concrete indices should be ignored when unavailable (missing or closed)" - }, - "allow_no_indices":{ - "type":"boolean", - "description":"Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)" - }, - "expand_wildcards":{ - "type":"enum", - "options":[ - "open", - "closed", - "hidden", - "none", - "all" - ], - "default":"open", - "description":"Whether to expand wildcard expression to concrete indices that are open, closed or both." - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" - } - } - } -} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.stats.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.stats.json index 0a8960f2f9e89..382bb9efde0ff 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.stats.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.stats.json @@ -118,10 +118,6 @@ ], "default":"indices" }, - "types":{ - "type":"list", - "description":"A comma-separated list of document types for the `indexing` index metric" - }, "include_segment_file_sizes":{ "type":"boolean", "description":"Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.validate_query.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.validate_query.json index 3becec003a9e6..cc0386ee3b972 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.validate_query.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.validate_query.json @@ -26,28 +26,6 @@ "description":"A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices" } } - }, - { - "path":"/{index}/{type}/_validate/query", - "methods":[ - "GET", - "POST" - ], - "parts":{ - "index":{ - "type":"list", - "description":"A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices" - }, - "type":{ - "type":"list", - "description":"A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types", - "deprecated":true - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"Specifying types in urls has been deprecated" - } } ] }, diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/update.json b/rest-api-spec/src/main/resources/rest-api-spec/api/update.json index 81bc101600aeb..c8d1ed435756b 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/update.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/update.json @@ -22,31 +22,6 @@ "description":"The name of the index" } } - }, - { - "path":"/{index}/{type}/{id}/_update", - "methods":[ - "POST" - ], - "parts":{ - "id":{ - "type":"string", - "description":"Document ID" - }, - "index":{ - "type":"string", - "description":"The name of the index" - }, - "type":{ - "type":"string", - "description":"The type of the document", - "deprecated":true - } - }, - "deprecated":{ - "version":"7.0.0", - "description":"Specifying types in urls has been deprecated" - } } ] }, From 2e0835cc3694ac96783584efe660d3f41285e36d Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 4 Apr 2022 11:31:32 -0700 Subject: [PATCH 030/514] Bump asm-tree from 7.2 to 9.2 in /modules/lang-painless (#2617) (#2632) * Bump asm-tree from 7.2 to 9.2 in /modules/lang-painless Bumps asm-tree from 7.2 to 9.2. --- updated-dependencies: - dependency-name: org.ow2.asm:asm-tree dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Updating SHAs Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] (cherry picked from commit 932cab67bda39b1b57a2ff72f191847914f6fe13) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- modules/lang-painless/build.gradle | 2 +- modules/lang-painless/licenses/asm-tree-7.2.jar.sha1 | 1 - modules/lang-painless/licenses/asm-tree-9.2.jar.sha1 | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 modules/lang-painless/licenses/asm-tree-7.2.jar.sha1 create mode 100644 modules/lang-painless/licenses/asm-tree-9.2.jar.sha1 diff --git a/modules/lang-painless/build.gradle b/modules/lang-painless/build.gradle index 0dd032f8647f7..ffbb3e60eb5ab 100644 --- a/modules/lang-painless/build.gradle +++ b/modules/lang-painless/build.gradle @@ -50,7 +50,7 @@ testClusters.all { dependencies { api 'org.antlr:antlr4-runtime:4.9.3' api 'org.ow2.asm:asm-util:9.2' - api 'org.ow2.asm:asm-tree:7.2' + api 'org.ow2.asm:asm-tree:9.2' api 'org.ow2.asm:asm-commons:9.2' api 'org.ow2.asm:asm-analysis:9.2' api 'org.ow2.asm:asm:9.2' diff --git a/modules/lang-painless/licenses/asm-tree-7.2.jar.sha1 b/modules/lang-painless/licenses/asm-tree-7.2.jar.sha1 deleted file mode 100644 index 986a1c55f5e8f..0000000000000 --- a/modules/lang-painless/licenses/asm-tree-7.2.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -3a23cc36edaf8fc5a89cb100182758ccb5991487 \ No newline at end of file diff --git a/modules/lang-painless/licenses/asm-tree-9.2.jar.sha1 b/modules/lang-painless/licenses/asm-tree-9.2.jar.sha1 new file mode 100644 index 0000000000000..7b486521ecef3 --- /dev/null +++ b/modules/lang-painless/licenses/asm-tree-9.2.jar.sha1 @@ -0,0 +1 @@ +d96c99a30f5e1a19b0e609dbb19a44d8518ac01e \ No newline at end of file From 494aa53ff65e5f7259ec00aac027ea2c80a3a3ad Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 4 Apr 2022 12:15:09 -0700 Subject: [PATCH 031/514] Bump proto-google-common-protos from 1.16.0 to 2.8.0 in /plugins/repository-gcs (#2738) (#2743) * Bump proto-google-common-protos in /plugins/repository-gcs Bumps [proto-google-common-protos](https://github.com/googleapis/java-iam) from 1.16.0 to 2.8.0. - [Release notes](https://github.com/googleapis/java-iam/releases) - [Changelog](https://github.com/googleapis/java-iam/blob/main/CHANGELOG.md) - [Commits](https://github.com/googleapis/java-iam/commits) --- updated-dependencies: - dependency-name: com.google.api.grpc:proto-google-common-protos dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Updating SHAs Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] (cherry picked from commit f9ca90eb88ad25edd99b9770659bd66ff56969c9) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- plugins/repository-gcs/build.gradle | 2 +- .../licenses/proto-google-common-protos-1.16.0.jar.sha1 | 1 - .../licenses/proto-google-common-protos-2.8.0.jar.sha1 | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 plugins/repository-gcs/licenses/proto-google-common-protos-1.16.0.jar.sha1 create mode 100644 plugins/repository-gcs/licenses/proto-google-common-protos-2.8.0.jar.sha1 diff --git a/plugins/repository-gcs/build.gradle b/plugins/repository-gcs/build.gradle index 2cfbd76394bcb..6e577d058ff67 100644 --- a/plugins/repository-gcs/build.gradle +++ b/plugins/repository-gcs/build.gradle @@ -64,7 +64,7 @@ dependencies { api 'com.google.protobuf:protobuf-java-util:3.19.3' api 'com.google.protobuf:protobuf-java:3.19.3' api 'com.google.code.gson:gson:2.9.0' - api 'com.google.api.grpc:proto-google-common-protos:1.16.0' + api 'com.google.api.grpc:proto-google-common-protos:2.8.0' api 'com.google.api.grpc:proto-google-iam-v1:0.12.0' api 'com.google.cloud:google-cloud-core-http:1.93.3' api 'com.google.auth:google-auth-library-credentials:0.20.0' diff --git a/plugins/repository-gcs/licenses/proto-google-common-protos-1.16.0.jar.sha1 b/plugins/repository-gcs/licenses/proto-google-common-protos-1.16.0.jar.sha1 deleted file mode 100644 index 7762b7a3ebdc3..0000000000000 --- a/plugins/repository-gcs/licenses/proto-google-common-protos-1.16.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -2c5f022ea3b8e8df6a619c4cd8faf9af86022daa \ No newline at end of file diff --git a/plugins/repository-gcs/licenses/proto-google-common-protos-2.8.0.jar.sha1 b/plugins/repository-gcs/licenses/proto-google-common-protos-2.8.0.jar.sha1 new file mode 100644 index 0000000000000..3f14d9e59c9e9 --- /dev/null +++ b/plugins/repository-gcs/licenses/proto-google-common-protos-2.8.0.jar.sha1 @@ -0,0 +1 @@ +8adcbc3c5c3b1b7af1cf1e8a25af26a516d62a4c \ No newline at end of file From debb45ccc59b6bd99451016fbd2a601301e55672 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 4 Apr 2022 16:41:53 -0500 Subject: [PATCH 032/514] [Version] Don't spoof major for 3.0+ clusters (#2722) (#2750) Changes version comparison logic to only translate major version when comparing with legacy 7x versions. This is needed beginning in 2.0 so that when running 2.0+ versions in bwc mode for 3.0+ upgrades, node versions no longer have to translate major version or spoof to legacy versions. Signed-off-by: Nicholas Walter Knize (cherry picked from commit 2d716ad9e2cd997eaa1ad8273cbf91a0691deb6d) --- .../src/main/java/org/opensearch/Version.java | 42 ++++++++++--------- .../org/opensearch/LegacyESVersionTests.java | 4 +- .../java/org/opensearch/VersionTests.java | 20 +++++++++ 3 files changed, 45 insertions(+), 21 deletions(-) diff --git a/server/src/main/java/org/opensearch/Version.java b/server/src/main/java/org/opensearch/Version.java index cd0bf7b8d8174..abbc37a17d32b 100644 --- a/server/src/main/java/org/opensearch/Version.java +++ b/server/src/main/java/org/opensearch/Version.java @@ -279,11 +279,16 @@ public boolean onOrBefore(Version version) { return version.id >= id; } - // LegacyESVersion major 7 is equivalent to Version major 1 public int compareMajor(Version other) { - int m = major == 1 ? 7 : major == 2 ? 8 : major; - int om = other.major == 1 ? 7 : other.major == 2 ? 8 : other.major; - return Integer.compare(m, om); + // comparing Legacy 7x for bwc + // todo: remove the following when removing legacy support in 3.0.0 + if (major == 7 || other.major == 7 || major == 6 || other.major == 6) { + // opensearch v1.x and v2.x need major translation to compare w/ legacy versions + int m = major == 1 ? 7 : major == 2 ? 8 : major; + int om = other.major == 1 ? 7 : other.major == 2 ? 8 : other.major; + return Integer.compare(m, om); + } + return Integer.compare(major, other.major); } @Override @@ -339,12 +344,9 @@ protected Version computeMinCompatVersion() { } else if (major == 6) { // force the minimum compatibility for version 6 to 5.6 since we don't reference version 5 anymore return LegacyESVersion.fromId(5060099); - } - /* - * TODO - uncomment this logic from OpenSearch version 3 onwards - * - else if (major >= 3) { + } else if (major >= 3 && major < 5) { // all major versions from 3 onwards are compatible with last minor series of the previous major + // todo: remove 5 check when removing LegacyESVersionTests Version bwcVersion = null; for (int i = DeclaredVersionsHolder.DECLARED_VERSIONS.size() - 1; i >= 0; i--) { @@ -358,7 +360,6 @@ else if (major >= 3) { } return bwcVersion == null ? this : bwcVersion; } - */ return Version.min(this, fromId(maskId((int) major * 1000000 + 0 * 10000 + 99))); } @@ -396,6 +397,10 @@ private Version computeMinIndexCompatVersion() { bwcMajor = major - 1; } final int bwcMinor = 0; + if (major == 3) { + return Version.min(this, fromId((bwcMajor * 1000000 + bwcMinor * 10000 + 99) ^ MASK)); + } + // todo remove below when LegacyESVersion is removed in 3.0 return Version.min(this, fromId((bwcMajor * 1000000 + bwcMinor * 10000 + 99))); } @@ -409,16 +414,15 @@ public boolean isCompatible(Version version) { // OpenSearch version 2 is the functional equivalent of predecessor unreleased version "8" // todo refactor this logic after removing deprecated features int a = major; - if (major == 1) { - a = 7; - } else if (major == 2) { - a = 8; - } int b = version.major; - if (version.major == 1) { - b = 7; - } else if (version.major == 2) { - b = 8; + + if (a == 7 || b == 7 || a == 6 || b == 6) { + if (major <= 2) { + a += 6; // for legacy compatibility up to version 2.x (to compare minCompat) + } + if (version.major <= 2) { + b += 6; // for legacy compatibility up to version 2.x (to compare minCompat) + } } assert compatible == false || Math.max(a, b) - Math.min(a, b) <= 1; diff --git a/server/src/test/java/org/opensearch/LegacyESVersionTests.java b/server/src/test/java/org/opensearch/LegacyESVersionTests.java index 8fb3636dd8b2c..d59f5e38a4ed7 100644 --- a/server/src/test/java/org/opensearch/LegacyESVersionTests.java +++ b/server/src/test/java/org/opensearch/LegacyESVersionTests.java @@ -63,8 +63,8 @@ public void testVersionComparison() { // compare opensearch version to LegacyESVersion assertThat(Version.V_1_0_0.compareMajor(LegacyESVersion.V_7_0_0), is(0)); - assertThat(Version.V_1_0_0.compareMajor(LegacyESVersion.fromString("6.3.0")), is(1)); - assertThat(LegacyESVersion.fromString("6.3.0").compareMajor(Version.V_1_0_0), is(-1)); + assertThat(Version.V_2_0_0.compareMajor(LegacyESVersion.fromString("7.3.0")), is(1)); + assertThat(LegacyESVersion.fromString("7.3.0").compareMajor(Version.V_2_0_0), is(-1)); } public void testMin() { diff --git a/server/src/test/java/org/opensearch/VersionTests.java b/server/src/test/java/org/opensearch/VersionTests.java index beff71eceab0d..c2566e83dd9b6 100644 --- a/server/src/test/java/org/opensearch/VersionTests.java +++ b/server/src/test/java/org/opensearch/VersionTests.java @@ -245,6 +245,26 @@ public void testOpenSearchMinIndexCompatVersion() { assertEquals(expected.revision, actual.revision); } + /** test first version of opensearch compatibility that does not support legacy versions */ + public void testOpenSearchPreLegacyRemoval() { + Version opensearchVersion = Version.fromString("3.0.0"); + int opensearchMajor = opensearchVersion.major; + List candidates = VersionUtils.allOpenSearchVersions(); + Version expectedMinIndexCompat = VersionUtils.getFirstVersionOfMajor(candidates, opensearchMajor - 1); + Version actualMinIndexCompat = opensearchVersion.minimumIndexCompatibilityVersion(); + + Version expectedMinCompat = VersionUtils.lastFirstReleasedMinorFromMajor(VersionUtils.allOpenSearchVersions(), opensearchMajor - 1); + Version actualMinCompat = opensearchVersion.minimumCompatibilityVersion(); + // since some legacy versions still support build (alpha, beta, RC) we check major minor revision only + assertEquals(expectedMinIndexCompat.major, actualMinIndexCompat.major); + assertEquals(expectedMinIndexCompat.minor, actualMinIndexCompat.minor); + assertEquals(expectedMinIndexCompat.revision, actualMinIndexCompat.revision); + + assertEquals(expectedMinCompat.major, actualMinCompat.major); + assertEquals(expectedMinCompat.minor, actualMinCompat.minor); + assertEquals(expectedMinCompat.revision, actualMinCompat.revision); + } + public void testToString() { assertEquals("2.0.0-beta1", Version.fromString("2.0.0-beta1").toString()); assertEquals("5.0.0-alpha1", Version.fromId(5000001).toString()); From 25b0a892be36afc72b1b9fa8784debbd278af390 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 4 Apr 2022 23:49:18 -0500 Subject: [PATCH 033/514] [Backport 2.x] Add resource stats to task framework (#2655) Adds resource stats to task framework Signed-off-by: sruti1312 Signed-off-by: Nicholas Walter Knize (cherry picked from commit 8b997c1d84fcc3ee99dec915982bdd642a124ea3) Co-authored-by: Sruti Parthiban Co-authored-by: Nicholas Walter Knize --- .../org/opensearch/client/tasks/TaskInfo.java | 18 +- .../core/tasks/GetTaskResponseTests.java | 18 +- .../tasks/CancelTasksResponseTests.java | 3 +- .../TransportRethrottleActionTests.java | 6 +- .../admin/cluster/node/tasks/TasksIT.java | 3 +- .../rest/action/cat/RestTasksAction.java | 2 + .../org/opensearch/tasks/ResourceStats.java | 28 ++++ .../opensearch/tasks/ResourceStatsType.java | 32 ++++ .../opensearch/tasks/ResourceUsageInfo.java | 108 ++++++++++++ .../opensearch/tasks/ResourceUsageMetric.java | 27 +++ .../main/java/org/opensearch/tasks/Task.java | 155 +++++++++++++++++- .../java/org/opensearch/tasks/TaskInfo.java | 39 ++++- .../opensearch/tasks/TaskResourceStats.java | 106 ++++++++++++ .../opensearch/tasks/TaskResourceUsage.java | 105 ++++++++++++ .../opensearch/tasks/ThreadResourceInfo.java | 54 ++++++ .../admin/cluster/node/tasks/TaskTests.java | 84 +++++++++- .../tasks/CancelTasksResponseTests.java | 2 +- .../tasks/ListTasksResponseTests.java | 18 +- .../org/opensearch/tasks/TaskInfoTests.java | 79 +++++++-- 19 files changed, 844 insertions(+), 43 deletions(-) create mode 100644 server/src/main/java/org/opensearch/tasks/ResourceStats.java create mode 100644 server/src/main/java/org/opensearch/tasks/ResourceStatsType.java create mode 100644 server/src/main/java/org/opensearch/tasks/ResourceUsageInfo.java create mode 100644 server/src/main/java/org/opensearch/tasks/ResourceUsageMetric.java create mode 100644 server/src/main/java/org/opensearch/tasks/TaskResourceStats.java create mode 100644 server/src/main/java/org/opensearch/tasks/TaskResourceUsage.java create mode 100644 server/src/main/java/org/opensearch/tasks/ThreadResourceInfo.java diff --git a/client/rest-high-level/src/main/java/org/opensearch/client/tasks/TaskInfo.java b/client/rest-high-level/src/main/java/org/opensearch/client/tasks/TaskInfo.java index de8374b283ea6..375f004dc3052 100644 --- a/client/rest-high-level/src/main/java/org/opensearch/client/tasks/TaskInfo.java +++ b/client/rest-high-level/src/main/java/org/opensearch/client/tasks/TaskInfo.java @@ -57,6 +57,7 @@ public class TaskInfo { private TaskId parentTaskId; private final Map status = new HashMap<>(); private final Map headers = new HashMap<>(); + private final Map resourceStats = new HashMap<>(); public TaskInfo(TaskId taskId) { this.taskId = taskId; @@ -150,6 +151,14 @@ public Map getStatus() { return status; } + void setResourceStats(Map resourceStats) { + this.resourceStats.putAll(resourceStats); + } + + public Map getResourceStats() { + return resourceStats; + } + private void noOpParse(Object s) {} public static final ObjectParser.NamedObjectParser PARSER; @@ -170,6 +179,7 @@ private void noOpParse(Object s) {} parser.declareBoolean(TaskInfo::setCancelled, new ParseField("cancelled")); parser.declareString(TaskInfo::setParentTaskId, new ParseField("parent_task_id")); parser.declareObject(TaskInfo::setHeaders, (p, c) -> p.mapStrings(), new ParseField("headers")); + parser.declareObject(TaskInfo::setResourceStats, (p, c) -> p.map(), new ParseField("resource_stats")); PARSER = (XContentParser p, Void v, String name) -> parser.parse(p, new TaskInfo(new TaskId(name)), null); } @@ -188,7 +198,8 @@ && isCancelled() == taskInfo.isCancelled() && Objects.equals(getDescription(), taskInfo.getDescription()) && Objects.equals(getParentTaskId(), taskInfo.getParentTaskId()) && Objects.equals(status, taskInfo.status) - && Objects.equals(getHeaders(), taskInfo.getHeaders()); + && Objects.equals(getHeaders(), taskInfo.getHeaders()) + && Objects.equals(getResourceStats(), taskInfo.getResourceStats()); } @Override @@ -204,7 +215,8 @@ public int hashCode() { isCancelled(), getParentTaskId(), status, - getHeaders() + getHeaders(), + getResourceStats() ); } @@ -236,6 +248,8 @@ public String toString() { + status + ", headers=" + headers + + ", resource_stats=" + + resourceStats + '}'; } } diff --git a/client/rest-high-level/src/test/java/org/opensearch/client/core/tasks/GetTaskResponseTests.java b/client/rest-high-level/src/test/java/org/opensearch/client/core/tasks/GetTaskResponseTests.java index 403e295303784..07ee0bedd4777 100644 --- a/client/rest-high-level/src/test/java/org/opensearch/client/core/tasks/GetTaskResponseTests.java +++ b/client/rest-high-level/src/test/java/org/opensearch/client/core/tasks/GetTaskResponseTests.java @@ -38,6 +38,8 @@ import org.opensearch.common.xcontent.ToXContent; import org.opensearch.common.xcontent.XContentBuilder; import org.opensearch.tasks.RawTaskStatus; +import org.opensearch.tasks.TaskResourceStats; +import org.opensearch.tasks.TaskResourceUsage; import org.opensearch.tasks.Task; import org.opensearch.tasks.TaskId; import org.opensearch.tasks.TaskInfo; @@ -45,6 +47,7 @@ import java.io.IOException; import java.util.Collections; +import java.util.HashMap; import java.util.Map; import static org.opensearch.test.AbstractXContentTestCase.xContentTester; @@ -57,7 +60,7 @@ public void testFromXContent() throws IOException { ) .assertEqualsConsumer(this::assertEqualInstances) .assertToXContentEquivalence(true) - .randomFieldsExcludeFilter(field -> field.endsWith("headers") || field.endsWith("status")) + .randomFieldsExcludeFilter(field -> field.endsWith("headers") || field.endsWith("status") || field.contains("resource_stats")) .test(); } @@ -106,7 +109,8 @@ static TaskInfo randomTaskInfo() { cancellable, cancelled, parentTaskId, - headers + headers, + randomResourceStats() ); } @@ -127,4 +131,14 @@ private static RawTaskStatus randomRawTaskStatus() { throw new IllegalStateException(e); } } + + private static TaskResourceStats randomResourceStats() { + return randomBoolean() ? null : new TaskResourceStats(new HashMap() { + { + for (int i = 0; i < randomInt(5); i++) { + put(randomAlphaOfLength(5), new TaskResourceUsage(randomNonNegativeLong(), randomNonNegativeLong())); + } + } + }); + } } diff --git a/client/rest-high-level/src/test/java/org/opensearch/client/tasks/CancelTasksResponseTests.java b/client/rest-high-level/src/test/java/org/opensearch/client/tasks/CancelTasksResponseTests.java index 552a3712eea40..26be36b7162f6 100644 --- a/client/rest-high-level/src/test/java/org/opensearch/client/tasks/CancelTasksResponseTests.java +++ b/client/rest-high-level/src/test/java/org/opensearch/client/tasks/CancelTasksResponseTests.java @@ -96,7 +96,8 @@ protected CancelTasksResponseTests.ByNodeCancelTasksResponse createServerTestIns cancellable, cancelled, new TaskId("node1", randomLong()), - Collections.singletonMap("x-header-of", "some-value") + Collections.singletonMap("x-header-of", "some-value"), + null ) ); } diff --git a/modules/reindex/src/test/java/org/opensearch/index/reindex/TransportRethrottleActionTests.java b/modules/reindex/src/test/java/org/opensearch/index/reindex/TransportRethrottleActionTests.java index a9e1a59b7e443..6456aa0af9aac 100644 --- a/modules/reindex/src/test/java/org/opensearch/index/reindex/TransportRethrottleActionTests.java +++ b/modules/reindex/src/test/java/org/opensearch/index/reindex/TransportRethrottleActionTests.java @@ -131,7 +131,8 @@ public void testRethrottleSuccessfulResponse() { true, false, new TaskId("test", task.getId()), - Collections.emptyMap() + Collections.emptyMap(), + null ) ); sliceStatuses.add(new BulkByScrollTask.StatusOrException(status)); @@ -167,7 +168,8 @@ public void testRethrottleWithSomeSucceeded() { true, false, new TaskId("test", task.getId()), - Collections.emptyMap() + Collections.emptyMap(), + null ) ); sliceStatuses.add(new BulkByScrollTask.StatusOrException(status)); diff --git a/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/node/tasks/TasksIT.java b/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/node/tasks/TasksIT.java index fbac2f7dbff6e..ac0ae44eb732e 100644 --- a/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/node/tasks/TasksIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/node/tasks/TasksIT.java @@ -907,7 +907,8 @@ public void testNodeNotFoundButTaskFound() throws Exception { false, false, TaskId.EMPTY_TASK_ID, - Collections.emptyMap() + Collections.emptyMap(), + null ), new RuntimeException("test") ), diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestTasksAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestTasksAction.java index b87205593ce87..a6624c2f8cfdc 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestTasksAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestTasksAction.java @@ -137,6 +137,7 @@ protected Table getTableWithHeader(final RestRequest request) { // Task detailed info if (detailed) { table.addCell("description", "default:true;alias:desc;desc:task action"); + table.addCell("resource_stats", "default:false;desc:resource consumption info of the task"); } table.endHeaders(); return table; @@ -173,6 +174,7 @@ private void buildRow(Table table, boolean fullId, boolean detailed, DiscoveryNo if (detailed) { table.addCell(taskInfo.getDescription()); + table.addCell(taskInfo.getResourceStats()); } table.endRow(); } diff --git a/server/src/main/java/org/opensearch/tasks/ResourceStats.java b/server/src/main/java/org/opensearch/tasks/ResourceStats.java new file mode 100644 index 0000000000000..aab103ad08dcf --- /dev/null +++ b/server/src/main/java/org/opensearch/tasks/ResourceStats.java @@ -0,0 +1,28 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.tasks; + +/** + * Different resource stats are defined. + */ +public enum ResourceStats { + CPU("cpu_time_in_nanos"), + MEMORY("memory_in_bytes"); + + private final String statsName; + + ResourceStats(String statsName) { + this.statsName = statsName; + } + + @Override + public String toString() { + return statsName; + } +} diff --git a/server/src/main/java/org/opensearch/tasks/ResourceStatsType.java b/server/src/main/java/org/opensearch/tasks/ResourceStatsType.java new file mode 100644 index 0000000000000..c670ac5ba689c --- /dev/null +++ b/server/src/main/java/org/opensearch/tasks/ResourceStatsType.java @@ -0,0 +1,32 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.tasks; + +/** Defines the different types of resource stats. */ +public enum ResourceStatsType { + // resource stats of the worker thread reported directly from runnable. + WORKER_STATS("worker_stats", false); + + private final String statsType; + private final boolean onlyForAnalysis; + + ResourceStatsType(String statsType, boolean onlyForAnalysis) { + this.statsType = statsType; + this.onlyForAnalysis = onlyForAnalysis; + } + + public boolean isOnlyForAnalysis() { + return onlyForAnalysis; + } + + @Override + public String toString() { + return statsType; + } +} diff --git a/server/src/main/java/org/opensearch/tasks/ResourceUsageInfo.java b/server/src/main/java/org/opensearch/tasks/ResourceUsageInfo.java new file mode 100644 index 0000000000000..ae58f712b63c2 --- /dev/null +++ b/server/src/main/java/org/opensearch/tasks/ResourceUsageInfo.java @@ -0,0 +1,108 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.tasks; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.util.Collections; +import java.util.EnumMap; +import java.util.Map; +import java.util.concurrent.atomic.AtomicLong; + +/** + * Thread resource usage information for particular resource stats type. + *

+ * It captures the resource usage information like memory, CPU about a particular execution of thread + * for a specific stats type. + */ +public class ResourceUsageInfo { + private static final Logger logger = LogManager.getLogger(ResourceUsageInfo.class); + private final EnumMap statsInfo = new EnumMap<>(ResourceStats.class); + + public ResourceUsageInfo(ResourceUsageMetric... resourceUsageMetrics) { + for (ResourceUsageMetric resourceUsageMetric : resourceUsageMetrics) { + this.statsInfo.put(resourceUsageMetric.getStats(), new ResourceStatsInfo(resourceUsageMetric.getValue())); + } + } + + public void recordResourceUsageMetrics(ResourceUsageMetric... resourceUsageMetrics) { + for (ResourceUsageMetric resourceUsageMetric : resourceUsageMetrics) { + final ResourceStatsInfo resourceStatsInfo = statsInfo.get(resourceUsageMetric.getStats()); + if (resourceStatsInfo != null) { + updateResourceUsageInfo(resourceStatsInfo, resourceUsageMetric); + } else { + throw new IllegalStateException( + "cannot update [" + + resourceUsageMetric.getStats().toString() + + "] entry as its not present current_stats_info:" + + statsInfo + ); + } + } + } + + private void updateResourceUsageInfo(ResourceStatsInfo resourceStatsInfo, ResourceUsageMetric resourceUsageMetric) { + long currentEndValue; + long newEndValue; + do { + currentEndValue = resourceStatsInfo.endValue.get(); + newEndValue = resourceUsageMetric.getValue(); + if (currentEndValue > newEndValue) { + logger.debug( + "dropping resource usage update as the new value is lower than current value [" + + "resource_stats=[{}], " + + "current_end_value={}, " + + "new_end_value={}]", + resourceUsageMetric.getStats(), + currentEndValue, + newEndValue + ); + return; + } + } while (!resourceStatsInfo.endValue.compareAndSet(currentEndValue, newEndValue)); + logger.debug( + "updated resource usage info [resource_stats=[{}], " + "old_end_value={}, new_end_value={}]", + resourceUsageMetric.getStats(), + currentEndValue, + newEndValue + ); + } + + public Map getStatsInfo() { + return Collections.unmodifiableMap(statsInfo); + } + + @Override + public String toString() { + return statsInfo.toString(); + } + + /** + * Defines resource stats information. + */ + static class ResourceStatsInfo { + private final long startValue; + private final AtomicLong endValue; + + private ResourceStatsInfo(long startValue) { + this.startValue = startValue; + this.endValue = new AtomicLong(startValue); + } + + public long getTotalValue() { + return endValue.get() - startValue; + } + + @Override + public String toString() { + return String.valueOf(getTotalValue()); + } + } +} diff --git a/server/src/main/java/org/opensearch/tasks/ResourceUsageMetric.java b/server/src/main/java/org/opensearch/tasks/ResourceUsageMetric.java new file mode 100644 index 0000000000000..0d13ffe6ec01a --- /dev/null +++ b/server/src/main/java/org/opensearch/tasks/ResourceUsageMetric.java @@ -0,0 +1,27 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.tasks; + +public class ResourceUsageMetric { + private final ResourceStats stats; + private final long value; + + public ResourceUsageMetric(ResourceStats stats, long value) { + this.stats = stats; + this.value = value; + } + + public ResourceStats getStats() { + return stats; + } + + public long getValue() { + return value; + } +} diff --git a/server/src/main/java/org/opensearch/tasks/Task.java b/server/src/main/java/org/opensearch/tasks/Task.java index ad9d5c3f04411..62453d08724ce 100644 --- a/server/src/main/java/org/opensearch/tasks/Task.java +++ b/server/src/main/java/org/opensearch/tasks/Task.java @@ -32,6 +32,8 @@ package org.opensearch.tasks; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.opensearch.action.ActionResponse; import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.common.io.stream.NamedWriteable; @@ -39,18 +41,27 @@ import org.opensearch.common.xcontent.ToXContentObject; import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; /** * Current task information */ public class Task { + private static final Logger logger = LogManager.getLogger(Task.class); + /** * The request header to mark tasks with specific ids */ public static final String X_OPAQUE_ID = "X-Opaque-Id"; + private static final String TOTAL = "total"; + private final long id; private final String type; @@ -63,6 +74,8 @@ public class Task { private final Map headers; + private final Map> resourceStats; + /** * The task's start time as a wall clock time since epoch ({@link System#currentTimeMillis()} style). */ @@ -74,7 +87,7 @@ public class Task { private final long startTimeNanos; public Task(long id, String type, String action, String description, TaskId parentTask, Map headers) { - this(id, type, action, description, parentTask, System.currentTimeMillis(), System.nanoTime(), headers); + this(id, type, action, description, parentTask, System.currentTimeMillis(), System.nanoTime(), headers, new ConcurrentHashMap<>()); } public Task( @@ -85,7 +98,8 @@ public Task( TaskId parentTask, long startTime, long startTimeNanos, - Map headers + Map headers, + ConcurrentHashMap> resourceStats ) { this.id = id; this.type = type; @@ -95,6 +109,7 @@ public Task( this.startTime = startTime; this.startTimeNanos = startTimeNanos; this.headers = headers; + this.resourceStats = resourceStats; } /** @@ -108,19 +123,48 @@ public Task( * generate data? */ public final TaskInfo taskInfo(String localNodeId, boolean detailed) { + return taskInfo(localNodeId, detailed, detailed == false); + } + + /** + * Build a version of the task status you can throw over the wire and back + * with the option to include resource stats or not. + * This method is only used during creating TaskResult to avoid storing resource information into the task index. + * + * @param excludeStats should information exclude resource stats. + * By default, detailed flag is used to control including resource information. + * But inorder to avoid storing resource stats into task index as strict mapping is enforced and breaks when adding this field. + * In the future, task-index-mapping.json can be modified to add resource stats. + */ + private TaskInfo taskInfo(String localNodeId, boolean detailed, boolean excludeStats) { String description = null; Task.Status status = null; + TaskResourceStats resourceStats = null; if (detailed) { description = getDescription(); status = getStatus(); } - return taskInfo(localNodeId, description, status); + if (excludeStats == false) { + resourceStats = new TaskResourceStats(new HashMap<>() { + { + put(TOTAL, getTotalResourceStats()); + } + }); + } + return taskInfo(localNodeId, description, status, resourceStats); } /** - * Build a proper {@link TaskInfo} for this task. + * Build a {@link TaskInfo} for this task without resource stats. */ protected final TaskInfo taskInfo(String localNodeId, String description, Status status) { + return taskInfo(localNodeId, description, status, null); + } + + /** + * Build a proper {@link TaskInfo} for this task. + */ + protected final TaskInfo taskInfo(String localNodeId, String description, Status status, TaskResourceStats resourceStats) { return new TaskInfo( new TaskId(localNodeId, getId()), getType(), @@ -132,7 +176,8 @@ protected final TaskInfo taskInfo(String localNodeId, String description, Status this instanceof CancellableTask, this instanceof CancellableTask && ((CancellableTask) this).isCancelled(), parentTask, - headers + headers, + resourceStats ); } @@ -195,6 +240,102 @@ public Status getStatus() { return null; } + /** + * Returns thread level resource consumption of the task + */ + public Map> getResourceStats() { + return Collections.unmodifiableMap(resourceStats); + } + + /** + * Returns current total resource usage of the task. + * Currently, this method is only called on demand, during get and listing of tasks. + * In the future, these values can be cached as an optimization. + */ + public TaskResourceUsage getTotalResourceStats() { + return new TaskResourceUsage(getTotalResourceUtilization(ResourceStats.CPU), getTotalResourceUtilization(ResourceStats.MEMORY)); + } + + /** + * Returns total resource consumption for a specific task stat. + */ + public long getTotalResourceUtilization(ResourceStats stats) { + long totalResourceConsumption = 0L; + for (List threadResourceInfosList : resourceStats.values()) { + for (ThreadResourceInfo threadResourceInfo : threadResourceInfosList) { + final ResourceUsageInfo.ResourceStatsInfo statsInfo = threadResourceInfo.getResourceUsageInfo().getStatsInfo().get(stats); + if (threadResourceInfo.getStatsType().isOnlyForAnalysis() == false && statsInfo != null) { + totalResourceConsumption += statsInfo.getTotalValue(); + } + } + } + return totalResourceConsumption; + } + + /** + * Adds thread's starting resource consumption information + * @param threadId ID of the thread + * @param statsType stats type + * @param resourceUsageMetrics resource consumption metrics of the thread + * @throws IllegalStateException matching active thread entry was found which is not expected. + */ + public void startThreadResourceTracking(long threadId, ResourceStatsType statsType, ResourceUsageMetric... resourceUsageMetrics) { + final List threadResourceInfoList = resourceStats.computeIfAbsent(threadId, k -> new ArrayList<>()); + // active thread entry should not be present in the list + for (ThreadResourceInfo threadResourceInfo : threadResourceInfoList) { + if (threadResourceInfo.getStatsType() == statsType && threadResourceInfo.isActive()) { + throw new IllegalStateException( + "unexpected active thread resource entry present [" + threadId + "]:[" + threadResourceInfo + "]" + ); + } + } + threadResourceInfoList.add(new ThreadResourceInfo(statsType, resourceUsageMetrics)); + } + + /** + * This method is used to update the resource consumption stats so that the data isn't too stale for long-running task. + * If active thread entry is present in the list, the entry is updated. If one is not found, it throws an exception. + * @param threadId ID of the thread + * @param statsType stats type + * @param resourceUsageMetrics resource consumption metrics of the thread + * @throws IllegalStateException if no matching active thread entry was found. + */ + public void updateThreadResourceStats(long threadId, ResourceStatsType statsType, ResourceUsageMetric... resourceUsageMetrics) { + final List threadResourceInfoList = resourceStats.get(threadId); + if (threadResourceInfoList != null) { + for (ThreadResourceInfo threadResourceInfo : threadResourceInfoList) { + // the active entry present in the list is updated + if (threadResourceInfo.getStatsType() == statsType && threadResourceInfo.isActive()) { + threadResourceInfo.recordResourceUsageMetrics(resourceUsageMetrics); + return; + } + } + } + throw new IllegalStateException("cannot update if active thread resource entry is not present"); + } + + /** + * Record the thread's final resource consumption values. + * If active thread entry is present in the list, the entry is updated. If one is not found, it throws an exception. + * @param threadId ID of the thread + * @param statsType stats type + * @param resourceUsageMetrics resource consumption metrics of the thread + * @throws IllegalStateException if no matching active thread entry was found. + */ + public void stopThreadResourceTracking(long threadId, ResourceStatsType statsType, ResourceUsageMetric... resourceUsageMetrics) { + final List threadResourceInfoList = resourceStats.get(threadId); + if (threadResourceInfoList != null) { + for (ThreadResourceInfo threadResourceInfo : threadResourceInfoList) { + if (threadResourceInfo.getStatsType() == statsType && threadResourceInfo.isActive()) { + threadResourceInfo.setActive(false); + threadResourceInfo.recordResourceUsageMetrics(resourceUsageMetrics); + return; + } + } + } + throw new IllegalStateException("cannot update final values if active thread resource entry is not present"); + } + /** * Report of the internal status of a task. These can vary wildly from task * to task because each task is implemented differently but we should try @@ -217,12 +358,12 @@ public String getHeader(String header) { } public TaskResult result(DiscoveryNode node, Exception error) throws IOException { - return new TaskResult(taskInfo(node.getId(), true), error); + return new TaskResult(taskInfo(node.getId(), true, true), error); } public TaskResult result(DiscoveryNode node, ActionResponse response) throws IOException { if (response instanceof ToXContent) { - return new TaskResult(taskInfo(node.getId(), true), (ToXContent) response); + return new TaskResult(taskInfo(node.getId(), true, true), (ToXContent) response); } else { throw new IllegalStateException("response has to implement ToXContent to be able to store the results"); } diff --git a/server/src/main/java/org/opensearch/tasks/TaskInfo.java b/server/src/main/java/org/opensearch/tasks/TaskInfo.java index cf77eaf540ee6..b6814282b5db4 100644 --- a/server/src/main/java/org/opensearch/tasks/TaskInfo.java +++ b/server/src/main/java/org/opensearch/tasks/TaskInfo.java @@ -86,6 +86,8 @@ public final class TaskInfo implements Writeable, ToXContentFragment { private final Map headers; + private final TaskResourceStats resourceStats; + public TaskInfo( TaskId taskId, String type, @@ -97,7 +99,8 @@ public TaskInfo( boolean cancellable, boolean cancelled, TaskId parentTaskId, - Map headers + Map headers, + TaskResourceStats resourceStats ) { if (cancellable == false && cancelled == true) { throw new IllegalArgumentException("task cannot be cancelled"); @@ -113,11 +116,13 @@ public TaskInfo( this.cancelled = cancelled; this.parentTaskId = parentTaskId; this.headers = headers; + this.resourceStats = resourceStats; } /** * Read from a stream. */ + @SuppressWarnings("unchecked") public TaskInfo(StreamInput in) throws IOException { taskId = TaskId.readFromStream(in); type = in.readString(); @@ -137,6 +142,11 @@ public TaskInfo(StreamInput in) throws IOException { } parentTaskId = TaskId.readFromStream(in); headers = in.readMap(StreamInput::readString, StreamInput::readString); + if (in.getVersion().onOrAfter(Version.V_2_1_0)) { + resourceStats = in.readOptionalWriteable(TaskResourceStats::new); + } else { + resourceStats = null; + } } @Override @@ -154,6 +164,9 @@ public void writeTo(StreamOutput out) throws IOException { } parentTaskId.writeTo(out); out.writeMap(headers, StreamOutput::writeString, StreamOutput::writeString); + if (out.getVersion().onOrAfter(Version.V_2_1_0)) { + out.writeOptionalWriteable(resourceStats); + } } public TaskId getTaskId() { @@ -226,6 +239,13 @@ public Map getHeaders() { return headers; } + /** + * Returns the task resource information + */ + public TaskResourceStats getResourceStats() { + return resourceStats; + } + @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.field("node", taskId.getNodeId()); @@ -253,6 +273,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.field(attribute.getKey(), attribute.getValue()); } builder.endObject(); + if (resourceStats != null) { + builder.startObject("resource_stats"); + resourceStats.toXContent(builder, params); + builder.endObject(); + } return builder; } @@ -278,6 +303,8 @@ public static TaskInfo fromXContent(XContentParser parser) { // This might happen if we are reading an old version of task info headers = Collections.emptyMap(); } + @SuppressWarnings("unchecked") + TaskResourceStats resourceStats = (TaskResourceStats) a[i++]; RawTaskStatus status = statusBytes == null ? null : new RawTaskStatus(statusBytes); TaskId parentTaskId = parentTaskIdString == null ? TaskId.EMPTY_TASK_ID : new TaskId(parentTaskIdString); return new TaskInfo( @@ -291,7 +318,8 @@ public static TaskInfo fromXContent(XContentParser parser) { cancellable, cancelled, parentTaskId, - headers + headers, + resourceStats ); }); static { @@ -309,6 +337,7 @@ public static TaskInfo fromXContent(XContentParser parser) { PARSER.declareBoolean(optionalConstructorArg(), new ParseField("cancelled")); PARSER.declareString(optionalConstructorArg(), new ParseField("parent_task_id")); PARSER.declareObject(optionalConstructorArg(), (p, c) -> p.mapStrings(), new ParseField("headers")); + PARSER.declareObject(optionalConstructorArg(), (p, c) -> TaskResourceStats.fromXContent(p), new ParseField("resource_stats")); } @Override @@ -333,7 +362,8 @@ public boolean equals(Object obj) { && Objects.equals(cancellable, other.cancellable) && Objects.equals(cancelled, other.cancelled) && Objects.equals(status, other.status) - && Objects.equals(headers, other.headers); + && Objects.equals(headers, other.headers) + && Objects.equals(resourceStats, other.resourceStats); } @Override @@ -349,7 +379,8 @@ public int hashCode() { cancellable, cancelled, status, - headers + headers, + resourceStats ); } } diff --git a/server/src/main/java/org/opensearch/tasks/TaskResourceStats.java b/server/src/main/java/org/opensearch/tasks/TaskResourceStats.java new file mode 100644 index 0000000000000..c35e08ebb34ec --- /dev/null +++ b/server/src/main/java/org/opensearch/tasks/TaskResourceStats.java @@ -0,0 +1,106 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.tasks; + +import org.opensearch.common.Strings; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.xcontent.ToXContentFragment; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentParser; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Resource information about a currently running task. + *

+ * Writeable TaskResourceStats objects are used to represent resource + * snapshot information about currently running task. + */ +public class TaskResourceStats implements Writeable, ToXContentFragment { + private final Map resourceUsage; + + public TaskResourceStats(Map resourceUsage) { + this.resourceUsage = Objects.requireNonNull(resourceUsage, "resource usage is required"); + } + + /** + * Read from a stream. + */ + public TaskResourceStats(StreamInput in) throws IOException { + resourceUsage = in.readMap(StreamInput::readString, TaskResourceUsage::readFromStream); + } + + @Override + public void writeTo(StreamOutput out) throws IOException { + out.writeMap(resourceUsage, StreamOutput::writeString, (stream, stats) -> stats.writeTo(stream)); + } + + public Map getResourceUsageInfo() { + return resourceUsage; + } + + @Override + public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { + for (Map.Entry resourceUsageEntry : resourceUsage.entrySet()) { + builder.startObject(resourceUsageEntry.getKey()); + if (resourceUsageEntry.getValue() != null) { + resourceUsageEntry.getValue().toXContent(builder, params); + } + builder.endObject(); + } + return builder; + } + + public static TaskResourceStats fromXContent(XContentParser parser) throws IOException { + XContentParser.Token token = parser.currentToken(); + if (token == null) { + token = parser.nextToken(); + } + if (token == XContentParser.Token.START_OBJECT) { + token = parser.nextToken(); + } + final Map resourceStats = new HashMap<>(); + if (token == XContentParser.Token.FIELD_NAME) { + assert parser.currentToken() == XContentParser.Token.FIELD_NAME : "Expected field name but saw [" + parser.currentToken() + "]"; + do { + // Must point to field name + String fieldName = parser.currentName(); + // And then the value + TaskResourceUsage value = TaskResourceUsage.fromXContent(parser); + resourceStats.put(fieldName, value); + } while (parser.nextToken() == XContentParser.Token.FIELD_NAME); + } + return new TaskResourceStats(resourceStats); + } + + @Override + public String toString() { + return Strings.toString(this, true, true); + } + + // Implements equals and hashcode for testing + @Override + public boolean equals(Object obj) { + if (obj == null || obj.getClass() != TaskResourceStats.class) { + return false; + } + TaskResourceStats other = (TaskResourceStats) obj; + return Objects.equals(resourceUsage, other.resourceUsage); + } + + @Override + public int hashCode() { + return Objects.hash(resourceUsage); + } +} diff --git a/server/src/main/java/org/opensearch/tasks/TaskResourceUsage.java b/server/src/main/java/org/opensearch/tasks/TaskResourceUsage.java new file mode 100644 index 0000000000000..6af3de2b78c06 --- /dev/null +++ b/server/src/main/java/org/opensearch/tasks/TaskResourceUsage.java @@ -0,0 +1,105 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.tasks; + +import org.opensearch.common.ParseField; +import org.opensearch.common.Strings; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.xcontent.ConstructingObjectParser; +import org.opensearch.common.xcontent.ToXContentFragment; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentParser; + +import java.io.IOException; +import java.util.Objects; + +import static org.opensearch.common.xcontent.ConstructingObjectParser.constructorArg; + +/** + * Task resource usage information + *

+ * Writeable TaskResourceUsage objects are used to represent resource usage + * information of running tasks. + */ +public class TaskResourceUsage implements Writeable, ToXContentFragment { + private static final ParseField CPU_TIME_IN_NANOS = new ParseField("cpu_time_in_nanos"); + private static final ParseField MEMORY_IN_BYTES = new ParseField("memory_in_bytes"); + + private final long cpuTimeInNanos; + private final long memoryInBytes; + + public TaskResourceUsage(long cpuTimeInNanos, long memoryInBytes) { + this.cpuTimeInNanos = cpuTimeInNanos; + this.memoryInBytes = memoryInBytes; + } + + /** + * Read from a stream. + */ + public static TaskResourceUsage readFromStream(StreamInput in) throws IOException { + return new TaskResourceUsage(in.readVLong(), in.readVLong()); + } + + @Override + public void writeTo(StreamOutput out) throws IOException { + out.writeVLong(cpuTimeInNanos); + out.writeVLong(memoryInBytes); + } + + public long getCpuTimeInNanos() { + return cpuTimeInNanos; + } + + public long getMemoryInBytes() { + return memoryInBytes; + } + + @Override + public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { + builder.field(CPU_TIME_IN_NANOS.getPreferredName(), cpuTimeInNanos); + builder.field(MEMORY_IN_BYTES.getPreferredName(), memoryInBytes); + return builder; + } + + public static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( + "task_resource_usage", + a -> new TaskResourceUsage((Long) a[0], (Long) a[1]) + ); + + static { + PARSER.declareLong(constructorArg(), CPU_TIME_IN_NANOS); + PARSER.declareLong(constructorArg(), MEMORY_IN_BYTES); + } + + public static TaskResourceUsage fromXContent(XContentParser parser) { + return PARSER.apply(parser, null); + } + + @Override + public String toString() { + return Strings.toString(this, true, true); + } + + // Implements equals and hashcode for testing + @Override + public boolean equals(Object obj) { + if (obj == null || obj.getClass() != TaskResourceUsage.class) { + return false; + } + TaskResourceUsage other = (TaskResourceUsage) obj; + return Objects.equals(cpuTimeInNanos, other.cpuTimeInNanos) && Objects.equals(memoryInBytes, other.memoryInBytes); + } + + @Override + public int hashCode() { + return Objects.hash(cpuTimeInNanos, memoryInBytes); + } +} diff --git a/server/src/main/java/org/opensearch/tasks/ThreadResourceInfo.java b/server/src/main/java/org/opensearch/tasks/ThreadResourceInfo.java new file mode 100644 index 0000000000000..8b45c38c8fb63 --- /dev/null +++ b/server/src/main/java/org/opensearch/tasks/ThreadResourceInfo.java @@ -0,0 +1,54 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.tasks; + +/** + * Resource consumption information about a particular execution of thread. + *

+ * It captures the resource usage information about a particular execution of thread + * for a specific stats type like worker_stats or response_stats etc., + */ +public class ThreadResourceInfo { + private volatile boolean isActive = true; + private final ResourceStatsType statsType; + private final ResourceUsageInfo resourceUsageInfo; + + public ThreadResourceInfo(ResourceStatsType statsType, ResourceUsageMetric... resourceUsageMetrics) { + this.statsType = statsType; + this.resourceUsageInfo = new ResourceUsageInfo(resourceUsageMetrics); + } + + /** + * Updates thread's resource consumption information. + */ + public void recordResourceUsageMetrics(ResourceUsageMetric... resourceUsageMetrics) { + resourceUsageInfo.recordResourceUsageMetrics(resourceUsageMetrics); + } + + public void setActive(boolean isActive) { + this.isActive = isActive; + } + + public boolean isActive() { + return isActive; + } + + public ResourceStatsType getStatsType() { + return statsType; + } + + public ResourceUsageInfo getResourceUsageInfo() { + return resourceUsageInfo; + } + + @Override + public String toString() { + return resourceUsageInfo + ", stats_type=" + statsType + ", is_active=" + isActive; + } +} diff --git a/server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/TaskTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/TaskTests.java index 5f8d5992c9f2f..45db94577f15f 100644 --- a/server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/TaskTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/node/tasks/TaskTests.java @@ -31,16 +31,23 @@ package org.opensearch.action.admin.cluster.node.tasks; +import org.opensearch.action.search.SearchAction; import org.opensearch.common.bytes.BytesArray; import org.opensearch.common.xcontent.XContentHelper; +import org.opensearch.tasks.Task; import org.opensearch.tasks.TaskId; import org.opensearch.tasks.TaskInfo; +import org.opensearch.tasks.ResourceUsageMetric; +import org.opensearch.tasks.ResourceStats; +import org.opensearch.tasks.ResourceStatsType; import org.opensearch.test.OpenSearchTestCase; import java.nio.charset.StandardCharsets; import java.util.Collections; import java.util.Map; +import static org.opensearch.tasks.TaskInfoTests.randomResourceStats; + public class TaskTests extends OpenSearchTestCase { public void testTaskInfoToString() { @@ -61,7 +68,8 @@ public void testTaskInfoToString() { cancellable, cancelled, TaskId.EMPTY_TASK_ID, - Collections.singletonMap("foo", "bar") + Collections.singletonMap("foo", "bar"), + randomResourceStats(randomBoolean()) ); String taskInfoString = taskInfo.toString(); Map map = XContentHelper.convertToMap(new BytesArray(taskInfoString.getBytes(StandardCharsets.UTF_8)), true).v2(); @@ -94,7 +102,8 @@ public void testCancellableOptionWhenCancelledTrue() { cancellable, cancelled, TaskId.EMPTY_TASK_ID, - Collections.singletonMap("foo", "bar") + Collections.singletonMap("foo", "bar"), + randomResourceStats(randomBoolean()) ); String taskInfoString = taskInfo.toString(); Map map = XContentHelper.convertToMap(new BytesArray(taskInfoString.getBytes(StandardCharsets.UTF_8)), true).v2(); @@ -120,7 +129,8 @@ public void testCancellableOptionWhenCancelledFalse() { cancellable, cancelled, TaskId.EMPTY_TASK_ID, - Collections.singletonMap("foo", "bar") + Collections.singletonMap("foo", "bar"), + randomResourceStats(randomBoolean()) ); String taskInfoString = taskInfo.toString(); Map map = XContentHelper.convertToMap(new BytesArray(taskInfoString.getBytes(StandardCharsets.UTF_8)), true).v2(); @@ -148,9 +158,75 @@ public void testNonCancellableOption() { cancellable, cancelled, TaskId.EMPTY_TASK_ID, - Collections.singletonMap("foo", "bar") + Collections.singletonMap("foo", "bar"), + randomResourceStats(randomBoolean()) ) ); assertEquals(e.getMessage(), "task cannot be cancelled"); } + + public void testTaskResourceStats() { + final Task task = new Task( + randomLong(), + "transport", + SearchAction.NAME, + "description", + new TaskId(randomLong() + ":" + randomLong()), + Collections.emptyMap() + ); + + long totalMemory = 0L; + long totalCPU = 0L; + + // reporting resource consumption events and checking total consumption values + for (int i = 0; i < randomInt(10); i++) { + long initial_memory = randomLongBetween(1, 100); + long initial_cpu = randomLongBetween(1, 100); + + ResourceUsageMetric[] initialTaskResourceMetrics = new ResourceUsageMetric[] { + new ResourceUsageMetric(ResourceStats.MEMORY, initial_memory), + new ResourceUsageMetric(ResourceStats.CPU, initial_cpu) }; + task.startThreadResourceTracking(i, ResourceStatsType.WORKER_STATS, initialTaskResourceMetrics); + + long memory = initial_memory + randomLongBetween(1, 10000); + long cpu = initial_cpu + randomLongBetween(1, 10000); + + totalMemory += memory - initial_memory; + totalCPU += cpu - initial_cpu; + + ResourceUsageMetric[] taskResourceMetrics = new ResourceUsageMetric[] { + new ResourceUsageMetric(ResourceStats.MEMORY, memory), + new ResourceUsageMetric(ResourceStats.CPU, cpu) }; + task.updateThreadResourceStats(i, ResourceStatsType.WORKER_STATS, taskResourceMetrics); + task.stopThreadResourceTracking(i, ResourceStatsType.WORKER_STATS); + } + assertEquals(task.getTotalResourceStats().getMemoryInBytes(), totalMemory); + assertEquals(task.getTotalResourceStats().getCpuTimeInNanos(), totalCPU); + + // updating should throw an IllegalStateException when active entry is not present. + try { + task.updateThreadResourceStats(randomInt(), ResourceStatsType.WORKER_STATS); + fail("update should not be successful as active entry is not present!"); + } catch (IllegalStateException e) { + // pass + } + + // re-adding a thread entry that is already present, should throw an exception + int threadId = randomInt(); + task.startThreadResourceTracking(threadId, ResourceStatsType.WORKER_STATS, new ResourceUsageMetric(ResourceStats.MEMORY, 100)); + try { + task.startThreadResourceTracking(threadId, ResourceStatsType.WORKER_STATS); + fail("add/start should not be successful as active entry is already present!"); + } catch (IllegalStateException e) { + // pass + } + + // existing active entry is present only for memory, update cannot be called with cpu values. + try { + task.updateThreadResourceStats(threadId, ResourceStatsType.WORKER_STATS, new ResourceUsageMetric(ResourceStats.CPU, 200)); + fail("update should not be successful as entry for CPU is not present!"); + } catch (IllegalStateException e) { + // pass + } + } } diff --git a/server/src/test/java/org/opensearch/tasks/CancelTasksResponseTests.java b/server/src/test/java/org/opensearch/tasks/CancelTasksResponseTests.java index 64d2979c2c5a0..c0ec4ca3d31fd 100644 --- a/server/src/test/java/org/opensearch/tasks/CancelTasksResponseTests.java +++ b/server/src/test/java/org/opensearch/tasks/CancelTasksResponseTests.java @@ -62,7 +62,7 @@ protected CancelTasksResponse createTestInstance() { private static List randomTasks() { List randomTasks = new ArrayList<>(); for (int i = 0; i < randomInt(10); i++) { - randomTasks.add(TaskInfoTests.randomTaskInfo()); + randomTasks.add(TaskInfoTests.randomTaskInfo(false)); } return randomTasks; } diff --git a/server/src/test/java/org/opensearch/tasks/ListTasksResponseTests.java b/server/src/test/java/org/opensearch/tasks/ListTasksResponseTests.java index 4d5feb46de1d0..0201509d03a2b 100644 --- a/server/src/test/java/org/opensearch/tasks/ListTasksResponseTests.java +++ b/server/src/test/java/org/opensearch/tasks/ListTasksResponseTests.java @@ -45,6 +45,7 @@ import java.net.ConnectException; import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.function.Predicate; import java.util.function.Supplier; @@ -72,7 +73,12 @@ public void testNonEmptyToString() { true, false, new TaskId("node1", 0), - Collections.singletonMap("foo", "bar") + Collections.singletonMap("foo", "bar"), + new TaskResourceStats(new HashMap() { + { + put("dummy-type1", new TaskResourceUsage(100, 100)); + } + }) ); ListTasksResponse tasksResponse = new ListTasksResponse(singletonList(info), emptyList(), emptyList()); assertEquals( @@ -93,6 +99,12 @@ public void testNonEmptyToString() { + " \"parent_task_id\" : \"node1:0\",\n" + " \"headers\" : {\n" + " \"foo\" : \"bar\"\n" + + " },\n" + + " \"resource_stats\" : {\n" + + " \"dummy-type1\" : {\n" + + " \"cpu_time_in_nanos\" : 100,\n" + + " \"memory_in_bytes\" : 100\n" + + " }\n" + " }\n" + " }\n" + " ]\n" @@ -127,8 +139,8 @@ protected boolean supportsUnknownFields() { @Override protected Predicate getRandomFieldsExcludeFilter() { - // status and headers hold arbitrary content, we can't inject random fields in them - return field -> field.endsWith("status") || field.endsWith("headers"); + // status, headers and resource_stats hold arbitrary content, we can't inject random fields in them + return field -> field.endsWith("status") || field.endsWith("headers") || field.contains("resource_stats"); } @Override diff --git a/server/src/test/java/org/opensearch/tasks/TaskInfoTests.java b/server/src/test/java/org/opensearch/tasks/TaskInfoTests.java index 89b690d81a4ea..7c8cb3230659b 100644 --- a/server/src/test/java/org/opensearch/tasks/TaskInfoTests.java +++ b/server/src/test/java/org/opensearch/tasks/TaskInfoTests.java @@ -77,13 +77,13 @@ protected boolean supportsUnknownFields() { @Override protected Predicate getRandomFieldsExcludeFilter() { - // status and headers hold arbitrary content, we can't inject random fields in them - return field -> "status".equals(field) || "headers".equals(field); + // status, headers and resource_stats hold arbitrary content, we can't inject random fields in them + return field -> "status".equals(field) || "headers".equals(field) || field.contains("resource_stats"); } @Override protected TaskInfo mutateInstance(TaskInfo info) { - switch (between(0, 9)) { + switch (between(0, 10)) { case 0: TaskId taskId = new TaskId(info.getTaskId().getNodeId() + randomAlphaOfLength(5), info.getTaskId().getId()); return new TaskInfo( @@ -97,7 +97,8 @@ protected TaskInfo mutateInstance(TaskInfo info) { info.isCancellable(), info.isCancelled(), info.getParentTaskId(), - info.getHeaders() + info.getHeaders(), + info.getResourceStats() ); case 1: return new TaskInfo( @@ -111,7 +112,8 @@ protected TaskInfo mutateInstance(TaskInfo info) { info.isCancellable(), info.isCancelled(), info.getParentTaskId(), - info.getHeaders() + info.getHeaders(), + info.getResourceStats() ); case 2: return new TaskInfo( @@ -125,7 +127,8 @@ protected TaskInfo mutateInstance(TaskInfo info) { info.isCancellable(), info.isCancelled(), info.getParentTaskId(), - info.getHeaders() + info.getHeaders(), + info.getResourceStats() ); case 3: return new TaskInfo( @@ -139,7 +142,8 @@ protected TaskInfo mutateInstance(TaskInfo info) { info.isCancellable(), info.isCancelled(), info.getParentTaskId(), - info.getHeaders() + info.getHeaders(), + info.getResourceStats() ); case 4: Task.Status newStatus = randomValueOtherThan(info.getStatus(), TaskInfoTests::randomRawTaskStatus); @@ -154,7 +158,8 @@ protected TaskInfo mutateInstance(TaskInfo info) { info.isCancellable(), info.isCancelled(), info.getParentTaskId(), - info.getHeaders() + info.getHeaders(), + info.getResourceStats() ); case 5: return new TaskInfo( @@ -168,7 +173,8 @@ protected TaskInfo mutateInstance(TaskInfo info) { info.isCancellable(), info.isCancelled(), info.getParentTaskId(), - info.getHeaders() + info.getHeaders(), + info.getResourceStats() ); case 6: return new TaskInfo( @@ -182,7 +188,8 @@ protected TaskInfo mutateInstance(TaskInfo info) { info.isCancellable(), info.isCancelled(), info.getParentTaskId(), - info.getHeaders() + info.getHeaders(), + info.getResourceStats() ); case 7: return new TaskInfo( @@ -196,7 +203,8 @@ protected TaskInfo mutateInstance(TaskInfo info) { info.isCancellable() == false, false, info.getParentTaskId(), - info.getHeaders() + info.getHeaders(), + info.getResourceStats() ); case 8: TaskId parentId = new TaskId(info.getParentTaskId().getNodeId() + randomAlphaOfLength(5), info.getParentTaskId().getId()); @@ -211,7 +219,8 @@ protected TaskInfo mutateInstance(TaskInfo info) { info.isCancellable(), info.isCancelled(), parentId, - info.getHeaders() + info.getHeaders(), + info.getResourceStats() ); case 9: Map headers = info.getHeaders(); @@ -232,7 +241,30 @@ protected TaskInfo mutateInstance(TaskInfo info) { info.isCancellable(), info.isCancelled(), info.getParentTaskId(), - headers + headers, + info.getResourceStats() + ); + case 10: + Map resourceUsageMap; + if (info.getResourceStats() == null) { + resourceUsageMap = new HashMap<>(1); + } else { + resourceUsageMap = new HashMap<>(info.getResourceStats().getResourceUsageInfo()); + } + resourceUsageMap.put(randomAlphaOfLength(5), new TaskResourceUsage(randomNonNegativeLong(), randomNonNegativeLong())); + return new TaskInfo( + info.getTaskId(), + info.getType(), + info.getAction(), + info.getDescription(), + info.getStatus(), + info.getStartTime(), + info.getRunningTimeNanos(), + info.isCancellable(), + info.isCancelled(), + info.getParentTaskId(), + info.getHeaders(), + new TaskResourceStats(resourceUsageMap) ); default: throw new IllegalStateException(); @@ -240,11 +272,15 @@ protected TaskInfo mutateInstance(TaskInfo info) { } static TaskInfo randomTaskInfo() { + return randomTaskInfo(randomBoolean()); + } + + static TaskInfo randomTaskInfo(boolean detailed) { TaskId taskId = randomTaskId(); String type = randomAlphaOfLength(5); String action = randomAlphaOfLength(5); - Task.Status status = randomBoolean() ? randomRawTaskStatus() : null; - String description = randomBoolean() ? randomAlphaOfLength(5) : null; + Task.Status status = detailed ? randomRawTaskStatus() : null; + String description = detailed ? randomAlphaOfLength(5) : null; long startTime = randomLong(); long runningTimeNanos = randomLong(); boolean cancellable = randomBoolean(); @@ -264,7 +300,8 @@ static TaskInfo randomTaskInfo() { cancellable, cancelled, parentTaskId, - headers + headers, + randomResourceStats(detailed) ); } @@ -285,4 +322,14 @@ private static RawTaskStatus randomRawTaskStatus() { throw new IllegalStateException(e); } } + + public static TaskResourceStats randomResourceStats(boolean detailed) { + return detailed ? new TaskResourceStats(new HashMap() { + { + for (int i = 0; i < randomInt(5); i++) { + put(randomAlphaOfLength(5), new TaskResourceUsage(randomNonNegativeLong(), randomNonNegativeLong())); + } + } + }) : null; + } } From 55726d4eb2145be228f4982eae7e8a308b461b25 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 5 Apr 2022 06:26:57 -0500 Subject: [PATCH 034/514] Update ThirdPartyAuditTask to check for and list pointless exclusions. (#2760) (#2764) This change swaps the order of the task to first check for no pointless exclusions. If not caught first these will be thrown inside of the bogusExcludesCount block that logs a useless error message. Signed-off-by: Marc Handalian (cherry picked from commit 21f9950806e0395e89bcfd70b76def9d4133b937) --- .../org/opensearch/gradle/precommit/ThirdPartyAuditTask.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/java/org/opensearch/gradle/precommit/ThirdPartyAuditTask.java b/buildSrc/src/main/java/org/opensearch/gradle/precommit/ThirdPartyAuditTask.java index 097710b3f1a6e..2a49ae05db1fb 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/precommit/ThirdPartyAuditTask.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/precommit/ThirdPartyAuditTask.java @@ -237,6 +237,7 @@ public void runThirdPartyAudit() throws IOException { Set jdkJarHellClasses = runJdkJarHellCheck(); if (missingClassExcludes != null) { + assertNoPointlessExclusions("are not missing", missingClassExcludes, missingClasses); long bogousExcludesCount = Stream.concat(missingClassExcludes.stream(), violationsExcludes.stream()) .filter(each -> missingClasses.contains(each) == false) .filter(each -> violationsClasses.contains(each) == false) @@ -247,7 +248,6 @@ public void runThirdPartyAudit() throws IOException { "All excluded classes seem to have no issues. " + "This is sometimes an indication that the check silently failed" ); } - assertNoPointlessExclusions("are not missing", missingClassExcludes, missingClasses); missingClasses.removeAll(missingClassExcludes); } assertNoPointlessExclusions("have no violations", violationsExcludes, violationsClasses); From 1834e070d317b73df033d19e098799a420da8e9e Mon Sep 17 00:00:00 2001 From: Tianli Feng Date: Tue, 5 Apr 2022 10:41:02 -0700 Subject: [PATCH 035/514] Add request parameter 'cluster_manager_timeout' and deprecate 'master_timeout' - in Cluster APIs (#2658) (#2754) - Deprecate the request parameter `master_timeout` that used in Cluster APIs which have got the parameter. - Add alternative new request parameter `cluster_manager_timeout`. - Add unit tests. Signed-off-by: Tianli Feng --- .../api/cluster.get_settings.json | 10 ++- .../rest-api-spec/api/cluster.health.json | 10 ++- .../api/cluster.pending_tasks.json | 10 ++- .../api/cluster.put_settings.json | 10 ++- .../rest-api-spec/api/cluster.reroute.json | 10 ++- .../rest-api-spec/api/cluster.state.json | 10 ++- .../cluster/RestClusterGetSettingsAction.java | 6 +- .../cluster/RestClusterHealthAction.java | 6 +- .../cluster/RestClusterRerouteAction.java | 5 +- .../admin/cluster/RestClusterStateAction.java | 5 +- .../RestClusterUpdateSettingsAction.java | 6 +- .../RestPendingClusterTasksAction.java | 8 +- .../RenamedTimeoutRequestParameterTests.java | 85 +++++++++++++++++++ .../reroute/ClusterRerouteRequestTests.java | 2 +- .../cluster/RestClusterHealthActionTests.java | 6 +- 15 files changed, 171 insertions(+), 18 deletions(-) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.get_settings.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.get_settings.json index 6f91fbbedf5de..c60230dbc43b3 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.get_settings.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.get_settings.json @@ -22,7 +22,15 @@ }, "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "timeout":{ "type":"time", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.health.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.health.json index 894b141f2f3b3..b3fc958891dfe 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.health.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.health.json @@ -56,7 +56,15 @@ }, "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "timeout":{ "type":"time", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.pending_tasks.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.pending_tasks.json index d940adf9aef5d..22cfbac7ff447 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.pending_tasks.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.pending_tasks.json @@ -22,7 +22,15 @@ }, "master_timeout":{ "type":"time", - "description":"Specify timeout for connection to master" + "description":"Specify timeout for connection to master", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.put_settings.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.put_settings.json index f6b9a0863380e..1e36acc51544d 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.put_settings.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.put_settings.json @@ -22,7 +22,15 @@ }, "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "timeout":{ "type":"time", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.reroute.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.reroute.json index bcf2704110664..285da40dd0245 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.reroute.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.reroute.json @@ -44,7 +44,15 @@ }, "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "timeout":{ "type":"time", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.state.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.state.json index c17e5b073e361..b43ab901785bd 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.state.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.state.json @@ -71,7 +71,15 @@ }, "master_timeout":{ "type":"time", - "description":"Specify timeout for connection to master" + "description":"Specify timeout for connection to master", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" }, "flat_settings":{ "type":"boolean", diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterGetSettingsAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterGetSettingsAction.java index 003f1bec11d87..1238cd2a818d5 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterGetSettingsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterGetSettingsAction.java @@ -38,6 +38,7 @@ import org.opensearch.client.Requests; import org.opensearch.client.node.NodeClient; import org.opensearch.cluster.ClusterState; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Settings; import org.opensearch.common.settings.SettingsFilter; @@ -59,6 +60,8 @@ public class RestClusterGetSettingsAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestClusterGetSettingsAction.class); + private final Settings settings; private final ClusterSettings clusterSettings; private final SettingsFilter settingsFilter; @@ -84,7 +87,8 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC ClusterStateRequest clusterStateRequest = Requests.clusterStateRequest().routingTable(false).nodes(false); final boolean renderDefaults = request.paramAsBoolean("include_defaults", false); clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); - clusterStateRequest.masterNodeTimeout(request.paramAsTime("master_timeout", clusterStateRequest.masterNodeTimeout())); + clusterStateRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", clusterStateRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request, deprecationLogger, getName()); return channel -> client.admin().cluster().state(clusterStateRequest, new RestBuilderListener(channel) { @Override public RestResponse buildResponse(ClusterStateResponse response, XContentBuilder builder) throws Exception { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterHealthAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterHealthAction.java index 8b782e4399e73..877e387a15ec3 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterHealthAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterHealthAction.java @@ -39,6 +39,7 @@ import org.opensearch.cluster.health.ClusterHealthStatus; import org.opensearch.common.Priority; import org.opensearch.common.Strings; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestStatusToXContentListener; @@ -56,6 +57,8 @@ public class RestClusterHealthAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestClusterHealthAction.class); + @Override public List routes() { return unmodifiableList(asList(new Route(GET, "/_cluster/health"), new Route(GET, "/_cluster/health/{index}"))); @@ -81,7 +84,8 @@ public static ClusterHealthRequest fromRequest(final RestRequest request) { final ClusterHealthRequest clusterHealthRequest = clusterHealthRequest(Strings.splitStringByCommaToArray(request.param("index"))); clusterHealthRequest.indicesOptions(IndicesOptions.fromRequest(request, clusterHealthRequest.indicesOptions())); clusterHealthRequest.local(request.paramAsBoolean("local", clusterHealthRequest.local())); - clusterHealthRequest.masterNodeTimeout(request.paramAsTime("master_timeout", clusterHealthRequest.masterNodeTimeout())); + clusterHealthRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", clusterHealthRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(clusterHealthRequest, request, deprecationLogger, "cluster_health"); clusterHealthRequest.timeout(request.paramAsTime("timeout", clusterHealthRequest.timeout())); String waitForStatus = request.param("wait_for_status"); if (waitForStatus != null) { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterRerouteAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterRerouteAction.java index f519da109ba09..9c0e09b7629e0 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterRerouteAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterRerouteAction.java @@ -80,7 +80,7 @@ public RestClusterRerouteAction(SettingsFilter settingsFilter) { } // TODO: Remove the DeprecationLogger after removing MASTER_ROLE. - // It's used to log deprecation when request parameter 'metric' contains 'master_node'. + // It's used to log deprecation when request parameter 'metric' contains 'master_node', or request parameter 'master_timeout' is used. private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestClusterRerouteAction.class); private static final String DEPRECATED_MESSAGE_MASTER_NODE = "Deprecated value [master_node] used for parameter [metric]. To promote inclusive language, please use [cluster_manager_node] instead. It will be unsupported in a future major version."; @@ -143,7 +143,8 @@ public static ClusterRerouteRequest createRequest(RestRequest request) throws IO clusterRerouteRequest.explain(request.paramAsBoolean("explain", clusterRerouteRequest.explain())); clusterRerouteRequest.timeout(request.paramAsTime("timeout", clusterRerouteRequest.timeout())); clusterRerouteRequest.setRetryFailed(request.paramAsBoolean("retry_failed", clusterRerouteRequest.isRetryFailed())); - clusterRerouteRequest.masterNodeTimeout(request.paramAsTime("master_timeout", clusterRerouteRequest.masterNodeTimeout())); + clusterRerouteRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", clusterRerouteRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(clusterRerouteRequest, request, deprecationLogger, "cluster_reroute"); request.applyContentParser(parser -> PARSER.parse(parser, clusterRerouteRequest, null)); return clusterRerouteRequest; } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterStateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterStateAction.java index 32aa055c18300..7f18a19b5cd54 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterStateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterStateAction.java @@ -73,7 +73,7 @@ public RestClusterStateAction(SettingsFilter settingsFilter) { } // TODO: Remove the DeprecationLogger after removing MASTER_ROLE. - // It's used to log deprecation when request parameter 'metric' contains 'master_node'. + // It's used to log deprecation when request parameter 'metric' contains 'master_node', or request parameter 'master_timeout' is used. private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestClusterStateAction.class); private static final String DEPRECATED_MESSAGE_MASTER_NODE = "Deprecated value [master_node] used for parameter [metric]. To promote inclusive language, please use [cluster_manager_node] instead. It will be unsupported in a future major version."; @@ -104,7 +104,8 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC final ClusterStateRequest clusterStateRequest = Requests.clusterStateRequest(); clusterStateRequest.indicesOptions(IndicesOptions.fromRequest(request, clusterStateRequest.indicesOptions())); clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); - clusterStateRequest.masterNodeTimeout(request.paramAsTime("master_timeout", clusterStateRequest.masterNodeTimeout())); + clusterStateRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", clusterStateRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request, deprecationLogger, getName()); if (request.hasParam("wait_for_metadata_version")) { clusterStateRequest.waitForMetadataVersion(request.paramAsLong("wait_for_metadata_version", 0)); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterUpdateSettingsAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterUpdateSettingsAction.java index bbe1bba70926f..c05cdc752b5f7 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterUpdateSettingsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterUpdateSettingsAction.java @@ -35,6 +35,7 @@ import org.opensearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest; import org.opensearch.client.Requests; import org.opensearch.client.node.NodeClient; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.XContentParser; import org.opensearch.rest.BaseRestHandler; @@ -51,6 +52,8 @@ public class RestClusterUpdateSettingsAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestClusterUpdateSettingsAction.class); + private static final String PERSISTENT = "persistent"; private static final String TRANSIENT = "transient"; @@ -69,8 +72,9 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC final ClusterUpdateSettingsRequest clusterUpdateSettingsRequest = Requests.clusterUpdateSettingsRequest(); clusterUpdateSettingsRequest.timeout(request.paramAsTime("timeout", clusterUpdateSettingsRequest.timeout())); clusterUpdateSettingsRequest.masterNodeTimeout( - request.paramAsTime("master_timeout", clusterUpdateSettingsRequest.masterNodeTimeout()) + request.paramAsTime("cluster_manager_timeout", clusterUpdateSettingsRequest.masterNodeTimeout()) ); + parseDeprecatedMasterTimeoutParameter(clusterUpdateSettingsRequest, request, deprecationLogger, getName()); Map source; try (XContentParser parser = request.contentParser()) { source = parser.map(); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPendingClusterTasksAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPendingClusterTasksAction.java index de80054a9afb2..155adc8cc7e19 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPendingClusterTasksAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPendingClusterTasksAction.java @@ -34,6 +34,7 @@ import org.opensearch.action.admin.cluster.tasks.PendingClusterTasksRequest; import org.opensearch.client.node.NodeClient; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; @@ -46,6 +47,8 @@ public class RestPendingClusterTasksAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestPendingClusterTasksAction.class); + @Override public List routes() { return singletonList(new Route(GET, "/_cluster/pending_tasks")); @@ -59,7 +62,10 @@ public String getName() { @Override public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { PendingClusterTasksRequest pendingClusterTasksRequest = new PendingClusterTasksRequest(); - pendingClusterTasksRequest.masterNodeTimeout(request.paramAsTime("master_timeout", pendingClusterTasksRequest.masterNodeTimeout())); + pendingClusterTasksRequest.masterNodeTimeout( + request.paramAsTime("cluster_manager_timeout", pendingClusterTasksRequest.masterNodeTimeout()) + ); + parseDeprecatedMasterTimeoutParameter(pendingClusterTasksRequest, request, deprecationLogger, getName()); pendingClusterTasksRequest.local(request.paramAsBoolean("local", pendingClusterTasksRequest.local())); return channel -> client.admin().cluster().pendingClusterTasks(pendingClusterTasksRequest, new RestToXContentListener<>(channel)); } diff --git a/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java b/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java index f34313f9e9adf..8bc9afc152382 100644 --- a/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java +++ b/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java @@ -12,9 +12,18 @@ import org.opensearch.OpenSearchParseException; import org.opensearch.action.support.master.MasterNodeRequest; import org.opensearch.client.node.NodeClient; +import org.opensearch.common.bytes.BytesArray; import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.settings.Settings; +import org.opensearch.common.settings.SettingsFilter; +import org.opensearch.common.xcontent.NamedXContentRegistry; +import org.opensearch.common.xcontent.XContentType; import org.opensearch.rest.BaseRestHandler; +import org.opensearch.rest.action.admin.cluster.RestClusterGetSettingsAction; +import org.opensearch.rest.action.admin.cluster.RestClusterHealthAction; +import org.opensearch.rest.action.admin.cluster.RestClusterRerouteAction; +import org.opensearch.rest.action.admin.cluster.RestClusterStateAction; +import org.opensearch.rest.action.admin.cluster.RestClusterUpdateSettingsAction; import org.opensearch.rest.action.cat.RestAllocationAction; import org.opensearch.rest.action.cat.RestRepositoriesAction; import org.opensearch.rest.action.cat.RestThreadPoolAction; @@ -32,6 +41,9 @@ import org.opensearch.test.rest.FakeRestRequest; import org.opensearch.threadpool.TestThreadPool; +import java.io.IOException; +import java.util.Collections; + import static org.hamcrest.Matchers.containsString; /** @@ -179,6 +191,68 @@ public void testCatSegments() { assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } + public void testClusterHealth() { + Exception e = assertThrows( + OpenSearchParseException.class, + () -> RestClusterHealthAction.fromRequest(getRestRequestWithBodyWithBothParams()) + ); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testClusterReroute() throws IOException { + final SettingsFilter filter = new SettingsFilter(Collections.singleton("foo.filtered")); + RestClusterRerouteAction action = new RestClusterRerouteAction(filter); + Exception e = assertThrows( + OpenSearchParseException.class, + () -> action.prepareRequest(getRestRequestWithBodyWithBothParams(), client) + ); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testClusterState() throws IOException { + final SettingsFilter filter = new SettingsFilter(Collections.singleton("foo.filtered")); + RestClusterStateAction action = new RestClusterStateAction(filter); + Exception e = assertThrows( + OpenSearchParseException.class, + () -> action.prepareRequest(getRestRequestWithBodyWithBothParams(), client) + ); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testClusterGetSettings() throws IOException { + final SettingsFilter filter = new SettingsFilter(Collections.singleton("foo.filtered")); + RestClusterGetSettingsAction action = new RestClusterGetSettingsAction(null, null, filter); + Exception e = assertThrows( + OpenSearchParseException.class, + () -> action.prepareRequest(getRestRequestWithBodyWithBothParams(), client) + ); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testClusterUpdateSettings() throws IOException { + RestClusterUpdateSettingsAction action = new RestClusterUpdateSettingsAction(); + Exception e = assertThrows( + OpenSearchParseException.class, + () -> action.prepareRequest(getRestRequestWithBodyWithBothParams(), client) + ); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testClusterPendingTasks() { + RestPendingClusterTasksAction action = new RestPendingClusterTasksAction(); + Exception e = assertThrows( + OpenSearchParseException.class, + () -> action.prepareRequest(getRestRequestWithBodyWithBothParams(), client) + ); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + private MasterNodeRequest getMasterNodeRequest() { return new MasterNodeRequest() { @Override @@ -206,4 +280,15 @@ private FakeRestRequest getRestRequestWithNewParam() { request.params().put("cluster_manager_timeout", "2m"); return request; } + + private FakeRestRequest getRestRequestWithBodyWithBothParams() { + FakeRestRequest request = getFakeRestRequestWithBody(); + request.params().put("cluster_manager_timeout", "2m"); + request.params().put("master_timeout", "3s"); + return request; + } + + private FakeRestRequest getFakeRestRequestWithBody() { + return new FakeRestRequest.Builder(NamedXContentRegistry.EMPTY).withContent(new BytesArray("{}"), XContentType.JSON).build(); + } } diff --git a/server/src/test/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteRequestTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteRequestTests.java index 3b7f2ff7f7ae2..6f62883ff436c 100644 --- a/server/src/test/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteRequestTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteRequestTests.java @@ -232,7 +232,7 @@ private RestRequest toRestRequest(ClusterRerouteRequest original) throws IOExcep params.put("retry_failed", Boolean.toString(original.isRetryFailed())); } if (false == original.masterNodeTimeout().equals(MasterNodeRequest.DEFAULT_MASTER_NODE_TIMEOUT) || randomBoolean()) { - params.put("master_timeout", original.masterNodeTimeout().toString()); + params.put("cluster_manager_timeout", original.masterNodeTimeout().toString()); } if (original.getCommands() != null) { hasBody = true; diff --git a/server/src/test/java/org/opensearch/rest/action/admin/cluster/RestClusterHealthActionTests.java b/server/src/test/java/org/opensearch/rest/action/admin/cluster/RestClusterHealthActionTests.java index 4f065653b44a6..8334a1e88190a 100644 --- a/server/src/test/java/org/opensearch/rest/action/admin/cluster/RestClusterHealthActionTests.java +++ b/server/src/test/java/org/opensearch/rest/action/admin/cluster/RestClusterHealthActionTests.java @@ -52,7 +52,7 @@ public void testFromRequest() { Map params = new HashMap<>(); String index = "index"; boolean local = randomBoolean(); - String masterTimeout = randomTimeValue(); + String clusterManagerTimeout = randomTimeValue(); String timeout = randomTimeValue(); ClusterHealthStatus waitForStatus = randomFrom(ClusterHealthStatus.values()); boolean waitForNoRelocatingShards = randomBoolean(); @@ -63,7 +63,7 @@ public void testFromRequest() { params.put("index", index); params.put("local", String.valueOf(local)); - params.put("master_timeout", masterTimeout); + params.put("cluster_manager_timeout", clusterManagerTimeout); params.put("timeout", timeout); params.put("wait_for_status", waitForStatus.name()); if (waitForNoRelocatingShards || randomBoolean()) { @@ -81,7 +81,7 @@ public void testFromRequest() { assertThat(clusterHealthRequest.indices().length, equalTo(1)); assertThat(clusterHealthRequest.indices()[0], equalTo(index)); assertThat(clusterHealthRequest.local(), equalTo(local)); - assertThat(clusterHealthRequest.masterNodeTimeout(), equalTo(TimeValue.parseTimeValue(masterTimeout, "test"))); + assertThat(clusterHealthRequest.masterNodeTimeout(), equalTo(TimeValue.parseTimeValue(clusterManagerTimeout, "test"))); assertThat(clusterHealthRequest.timeout(), equalTo(TimeValue.parseTimeValue(timeout, "test"))); assertThat(clusterHealthRequest.waitForStatus(), equalTo(waitForStatus)); assertThat(clusterHealthRequest.waitForNoRelocatingShards(), equalTo(waitForNoRelocatingShards)); From e5b669a8230a84226b1c4fcce848a6dbb188cfc9 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 5 Apr 2022 12:03:50 -0700 Subject: [PATCH 036/514] Add request parameter 'cluster_manager_timeout' and deprecate 'master_timeout' - in Index APIs except index template APIs (#2660) (#2770) - Deprecate the request parameter `master_timeout` that used in Index APIs which have got the parameter. (except index template APIs, which is addressed in PR https://github.com/opensearch-project/OpenSearch/pull/2678) - Add alternative new request parameter `cluster_manager_timeout`. - Add unit tests. Signed-off-by: Tianli Feng (cherry picked from commit 7aa496f9dda6ba2c26db19206951a5ccf6387e1b) --- .../http/DanglingIndicesRestIT.java | 4 +- ...angling_indices.delete_dangling_index.json | 14 +- ...angling_indices.import_dangling_index.json | 14 +- .../rest-api-spec/api/indices.add_block.json | 10 +- .../rest-api-spec/api/indices.clone.json | 14 +- .../rest-api-spec/api/indices.close.json | 10 +- .../rest-api-spec/api/indices.create.json | 10 +- .../api/indices.delete_alias.json | 10 +- .../rest-api-spec/api/indices.get.json | 10 +- .../api/indices.get_mapping.json | 10 +- .../api/indices.get_settings.json | 10 +- .../api/indices.get_template.json | 10 +- .../rest-api-spec/api/indices.put_alias.json | 10 +- .../api/indices.put_mapping.json | 10 +- .../api/indices.put_settings.json | 10 +- .../rest-api-spec/api/indices.rollover.json | 10 +- .../rest-api-spec/api/indices.shrink.json | 14 +- .../rest-api-spec/api/indices.split.json | 14 +- .../api/indices.update_aliases.json | 10 +- .../test/indices.clone/10_basic.yml | 6 + .../test/indices.clone/20_source_mapping.yml | 3 + .../test/indices.clone/30_copy_settings.yml | 4 +- .../test/indices.shrink/10_basic.yml | 5 + .../test/indices.shrink/20_source_mapping.yml | 4 +- .../test/indices.shrink/30_copy_settings.yml | 5 + .../test/indices.split/10_basic.yml | 16 ++ .../test/indices.split/20_source_mapping.yml | 5 + .../test/indices.split/30_copy_settings.yml | 6 +- .../RestDeleteDanglingIndexAction.java | 6 +- .../RestImportDanglingIndexAction.java | 6 +- .../indices/RestAddIndexBlockAction.java | 6 +- .../admin/indices/RestCloseIndexAction.java | 6 +- .../admin/indices/RestCreateIndexAction.java | 6 +- .../admin/indices/RestDeleteIndexAction.java | 6 +- .../admin/indices/RestGetIndicesAction.java | 6 +- .../admin/indices/RestGetMappingAction.java | 19 +- .../admin/indices/RestGetSettingsAction.java | 6 +- .../indices/RestIndexDeleteAliasesAction.java | 6 +- .../indices/RestIndexPutAliasAction.java | 6 +- .../indices/RestIndicesAliasesAction.java | 6 +- .../admin/indices/RestOpenIndexAction.java | 6 +- .../admin/indices/RestPutMappingAction.java | 6 +- .../admin/indices/RestResizeHandler.java | 3 +- .../indices/RestRolloverIndexAction.java | 3 +- .../indices/RestUpdateSettingsAction.java | 6 +- .../RenamedTimeoutRequestParameterTests.java | 172 ++++++++++++++++++ 46 files changed, 489 insertions(+), 50 deletions(-) diff --git a/qa/smoke-test-http/src/test/java/org/opensearch/http/DanglingIndicesRestIT.java b/qa/smoke-test-http/src/test/java/org/opensearch/http/DanglingIndicesRestIT.java index d5dcde2492046..3b32ac40917e4 100644 --- a/qa/smoke-test-http/src/test/java/org/opensearch/http/DanglingIndicesRestIT.java +++ b/qa/smoke-test-http/src/test/java/org/opensearch/http/DanglingIndicesRestIT.java @@ -135,7 +135,7 @@ public void testDanglingIndicesCanBeImported() throws Exception { importRequest.addParameter("accept_data_loss", "true"); // Ensure this parameter is accepted importRequest.addParameter("timeout", "20s"); - importRequest.addParameter("master_timeout", "20s"); + importRequest.addParameter("cluster_manager_timeout", "20s"); final Response importResponse = restClient.performRequest(importRequest); assertThat(importResponse.getStatusLine().getStatusCode(), equalTo(ACCEPTED.getStatus())); @@ -171,7 +171,7 @@ public void testDanglingIndicesCanBeDeleted() throws Exception { deleteRequest.addParameter("accept_data_loss", "true"); // Ensure these parameters is accepted deleteRequest.addParameter("timeout", "20s"); - deleteRequest.addParameter("master_timeout", "20s"); + deleteRequest.addParameter("cluster_manager_timeout", "20s"); final Response deleteResponse = restClient.performRequest(deleteRequest); assertThat(deleteResponse.getStatusLine().getStatusCode(), equalTo(ACCEPTED.getStatus())); diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/dangling_indices.delete_dangling_index.json b/rest-api-spec/src/main/resources/rest-api-spec/api/dangling_indices.delete_dangling_index.json index 1e3d74784591b..5d832fc794f4f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/dangling_indices.delete_dangling_index.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/dangling_indices.delete_dangling_index.json @@ -30,9 +30,17 @@ "type": "time", "description": "Explicit operation timeout" }, - "master_timeout": { - "type": "time", - "description": "Specify timeout for connection to master" + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/dangling_indices.import_dangling_index.json b/rest-api-spec/src/main/resources/rest-api-spec/api/dangling_indices.import_dangling_index.json index e9dce01a76727..5b056e1fa145f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/dangling_indices.import_dangling_index.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/dangling_indices.import_dangling_index.json @@ -30,9 +30,17 @@ "type": "time", "description": "Explicit operation timeout" }, - "master_timeout": { - "type": "time", - "description": "Specify timeout for connection to master" + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.add_block.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.add_block.json index 7389fb1322824..af10b9f50091f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.add_block.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.add_block.json @@ -32,7 +32,15 @@ }, "master_timeout":{ "type":"time", - "description":"Specify timeout for connection to master" + "description":"Specify timeout for connection to master", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" }, "ignore_unavailable":{ "type":"boolean", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.clone.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.clone.json index d3a249583bd84..b55d43371005f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.clone.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.clone.json @@ -31,9 +31,17 @@ "type" : "time", "description" : "Explicit operation timeout" }, - "master_timeout": { - "type" : "time", - "description" : "Specify timeout for connection to master" + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" }, "wait_for_active_shards": { "type" : "string", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.close.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.close.json index f26c8e77a06a6..1182b73541f93 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.close.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.close.json @@ -28,7 +28,15 @@ }, "master_timeout":{ "type":"time", - "description":"Specify timeout for connection to master" + "description":"Specify timeout for connection to master", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" }, "ignore_unavailable":{ "type":"boolean", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.create.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.create.json index 922183d628ac6..53ea4cbd80803 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.create.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.create.json @@ -32,7 +32,15 @@ }, "master_timeout":{ "type":"time", - "description":"Specify timeout for connection to master" + "description":"Specify timeout for connection to master", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" } }, "body":{ diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.delete_alias.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.delete_alias.json index 13abf70ca739b..049a397c6b3e2 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.delete_alias.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.delete_alias.json @@ -48,7 +48,15 @@ }, "master_timeout":{ "type":"time", - "description":"Specify timeout for connection to master" + "description":"Specify timeout for connection to master", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get.json index 90a1274ecb059..0a43f6481d86d 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get.json @@ -57,7 +57,15 @@ }, "master_timeout":{ "type":"time", - "description":"Specify timeout for connection to master" + "description":"Specify timeout for connection to master", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_mapping.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_mapping.json index 24fd668069697..321bfaba4f941 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_mapping.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_mapping.json @@ -50,7 +50,15 @@ }, "master_timeout":{ "type":"time", - "description":"Specify timeout for connection to master" + "description":"Specify timeout for connection to master", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" }, "local":{ "type":"boolean", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_settings.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_settings.json index 68e325446d3dc..1bdaea01f87bf 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_settings.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_settings.json @@ -58,7 +58,15 @@ "params":{ "master_timeout":{ "type":"time", - "description":"Specify timeout for connection to master" + "description":"Specify timeout for connection to master", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" }, "ignore_unavailable":{ "type":"boolean", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_template.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_template.json index 337016763ad0a..04d2f846e6ac1 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_template.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_template.json @@ -34,7 +34,15 @@ }, "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "local":{ "type":"boolean", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_alias.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_alias.json index 603f24b665eb7..00767afbaec04 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_alias.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_alias.json @@ -50,7 +50,15 @@ }, "master_timeout":{ "type":"time", - "description":"Specify timeout for connection to master" + "description":"Specify timeout for connection to master", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" } }, "body":{ diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_mapping.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_mapping.json index 451cbccd8d329..c8b63d4e1cee1 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_mapping.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_mapping.json @@ -29,7 +29,15 @@ }, "master_timeout":{ "type":"time", - "description":"Specify timeout for connection to master" + "description":"Specify timeout for connection to master", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" }, "ignore_unavailable":{ "type":"boolean", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_settings.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_settings.json index 66fe23bab8ba2..ca245ec543da3 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_settings.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_settings.json @@ -30,7 +30,15 @@ "params":{ "master_timeout":{ "type":"time", - "description":"Specify timeout for connection to master" + "description":"Specify timeout for connection to master", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" }, "timeout":{ "type":"time", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.rollover.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.rollover.json index fef1f03d1c9a7..303b7c7b03c19 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.rollover.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.rollover.json @@ -48,7 +48,15 @@ }, "master_timeout":{ "type":"time", - "description":"Specify timeout for connection to master" + "description":"Specify timeout for connection to master", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" }, "wait_for_active_shards":{ "type":"string", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.shrink.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.shrink.json index fd6d705d6a5fa..6bb09ee0019e1 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.shrink.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.shrink.json @@ -35,9 +35,17 @@ "type" : "time", "description" : "Explicit operation timeout" }, - "master_timeout": { - "type" : "time", - "description" : "Specify timeout for connection to master" + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" }, "wait_for_active_shards": { "type" : "string", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.split.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.split.json index 02df3cdedf01f..d1b5a28c9ff0f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.split.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.split.json @@ -35,9 +35,17 @@ "type" : "time", "description" : "Explicit operation timeout" }, - "master_timeout": { - "type" : "time", - "description" : "Specify timeout for connection to master" + "master_timeout":{ + "type":"time", + "description":"Specify timeout for connection to master", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" }, "wait_for_active_shards": { "type" : "string", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.update_aliases.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.update_aliases.json index d4a222f2061c8..c31cb8fe59c0f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.update_aliases.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.update_aliases.json @@ -22,7 +22,15 @@ }, "master_timeout":{ "type":"time", - "description":"Specify timeout for connection to master" + "description":"Specify timeout for connection to master", + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" } }, "body":{ diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.clone/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.clone/10_basic.yml index a4d1841ed7108..6488e4960e08f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.clone/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.clone/10_basic.yml @@ -31,6 +31,7 @@ setup: - skip: version: " - 7.3.99" reason: index cloning was added in 7.4.0 + features: allowed_warnings # make it read-only - do: indices.put_settings: @@ -46,6 +47,8 @@ setup: # now we do the actual clone - do: + allowed_warnings: + - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." indices.clone: index: "source" target: "target" @@ -94,9 +97,12 @@ setup: - skip: version: " - 7.3.99" reason: index cloning was added in 7.4.0 + features: allowed_warnings # try to do an illegal clone with illegal number_of_shards - do: catch: /illegal_argument_exception/ + allowed_warnings: + - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." indices.clone: index: "source" target: "target" diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.clone/20_source_mapping.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.clone/20_source_mapping.yml index 625f574fa73de..1a3074d091399 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.clone/20_source_mapping.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.clone/20_source_mapping.yml @@ -3,6 +3,7 @@ - skip: version: " - 7.3.99" reason: index cloning was added in 7.4.0 + features: allowed_warnings # create index - do: indices.create: @@ -50,6 +51,8 @@ # now we do the actual clone - do: + allowed_warnings: + - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." indices.clone: index: "source" target: "target" diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.clone/30_copy_settings.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.clone/30_copy_settings.yml index 503cc15609072..467f5266122eb 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.clone/30_copy_settings.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.clone/30_copy_settings.yml @@ -3,7 +3,7 @@ - skip: version: " - 7.3.99" reason: index cloning was added in 7.4.0 - features: [arbitrary_key] + features: [arbitrary_key, allowed_warnings] - do: nodes.info: @@ -36,6 +36,8 @@ # now we do an actual clone and copy settings - do: + allowed_warnings: + - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." indices.clone: index: "source" target: "copy-settings-target" diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.shrink/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.shrink/10_basic.yml index a5b1cb8607b3a..4db7ca353334f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.shrink/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.shrink/10_basic.yml @@ -7,6 +7,9 @@ # which node is the one with the highest version and that is the only one that can safely # be used to shrink the index. + - skip: + features: allowed_warnings + - do: nodes.info: node_id: data:true @@ -53,6 +56,8 @@ # now we do the actual shrink - do: + allowed_warnings: + - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." indices.shrink: index: "source" target: "target" diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.shrink/20_source_mapping.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.shrink/20_source_mapping.yml index dec0760fc6b19..4ddf122d82691 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.shrink/20_source_mapping.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.shrink/20_source_mapping.yml @@ -3,7 +3,7 @@ - skip: version: " - 6.9.99" reason: expects warnings that pre-7.0.0 will not send - features: [warnings, arbitrary_key] + features: [warnings, arbitrary_key, allowed_warnings] - do: nodes.info: @@ -60,6 +60,8 @@ # now we do the actual shrink - do: + allowed_warnings: + - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." indices.shrink: index: "source" target: "target" diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.shrink/30_copy_settings.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.shrink/30_copy_settings.yml index a744895c4ce38..112303a3a7298 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.shrink/30_copy_settings.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.shrink/30_copy_settings.yml @@ -47,6 +47,7 @@ index.merge.scheduler.max_thread_count: 2 allowed_warnings: - "parameter [copy_settings] is deprecated and will be removed in 8.0.0" + - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." - do: cluster.health: @@ -64,6 +65,8 @@ # now we do a actual shrink and copy settings (by default) - do: + allowed_warnings: + - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." indices.shrink: index: "source" target: "default-copy-settings-target" @@ -91,6 +94,8 @@ # now we do a actual shrink and try to set no copy settings - do: catch: /illegal_argument_exception/ + allowed_warnings: + - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." indices.shrink: index: "source" target: "explicit-no-copy-settings-target" diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.split/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.split/10_basic.yml index 4ae1d0002a237..01781e35b9ae9 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.split/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.split/10_basic.yml @@ -29,6 +29,9 @@ setup: --- "Split index via API": + - skip: + features: allowed_warnings + # make it read-only - do: indices.put_settings: @@ -44,6 +47,8 @@ setup: # now we do the actual split - do: + allowed_warnings: + - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." indices.split: index: "source" target: "target" @@ -90,6 +95,8 @@ setup: --- "Split from 1 to N": + - skip: + features: allowed_warnings - do: indices.create: index: source_one_shard @@ -131,6 +138,8 @@ setup: # now we do the actual split from 1 to 5 - do: + allowed_warnings: + - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." indices.split: index: "source_one_shard" target: "target" @@ -176,9 +185,14 @@ setup: --- "Create illegal split indices": + - skip: + features: allowed_warnings + # try to do an illegal split with number_of_routing_shards set - do: catch: /illegal_argument_exception/ + allowed_warnings: + - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." indices.split: index: "source" target: "target" @@ -193,6 +207,8 @@ setup: # try to do an illegal split with illegal number_of_shards - do: catch: /illegal_state_exception/ + allowed_warnings: + - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." indices.split: index: "source" target: "target" diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.split/20_source_mapping.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.split/20_source_mapping.yml index c86e49aac0561..0baae30238013 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.split/20_source_mapping.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.split/20_source_mapping.yml @@ -1,5 +1,8 @@ --- "Split index ignores target template mapping": + - skip: + features: allowed_warnings + # create index - do: indices.create: @@ -48,6 +51,8 @@ # now we do the actual split - do: + allowed_warnings: + - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." indices.split: index: "source" target: "target" diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.split/30_copy_settings.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.split/30_copy_settings.yml index 0ceacf1f064ca..ace49ff6dd917 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.split/30_copy_settings.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.split/30_copy_settings.yml @@ -49,7 +49,7 @@ index.merge.scheduler.max_thread_count: 2 allowed_warnings: - "parameter [copy_settings] is deprecated and will be removed in 8.0.0" - + - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." - do: cluster.health: @@ -67,6 +67,8 @@ # now we do a actual shrink and copy settings (by default) - do: + allowed_warnings: + - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." indices.split: index: "source" target: "default-copy-settings-target" @@ -94,6 +96,8 @@ - do: catch: /illegal_argument_exception/ + allowed_warnings: + - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." indices.split: index: "source" target: "explicit-no-copy-settings-target" diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/dangling/RestDeleteDanglingIndexAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/dangling/RestDeleteDanglingIndexAction.java index 8024d97743cc8..3e8883058d18e 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/dangling/RestDeleteDanglingIndexAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/dangling/RestDeleteDanglingIndexAction.java @@ -35,6 +35,7 @@ import org.opensearch.action.admin.indices.dangling.delete.DeleteDanglingIndexRequest; import org.opensearch.action.support.master.AcknowledgedResponse; import org.opensearch.client.node.NodeClient; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.RestStatus; @@ -49,6 +50,8 @@ public class RestDeleteDanglingIndexAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestDeleteDanglingIndexAction.class); + @Override public List routes() { return singletonList(new Route(DELETE, "/_dangling/{index_uuid}")); @@ -67,7 +70,8 @@ public RestChannelConsumer prepareRequest(final RestRequest request, NodeClient ); deleteRequest.timeout(request.paramAsTime("timeout", deleteRequest.timeout())); - deleteRequest.masterNodeTimeout(request.paramAsTime("master_timeout", deleteRequest.masterNodeTimeout())); + deleteRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", deleteRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(deleteRequest, request, deprecationLogger, getName()); return channel -> client.admin() .cluster() diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/dangling/RestImportDanglingIndexAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/dangling/RestImportDanglingIndexAction.java index b7ba7361c2980..5a48159bd9651 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/dangling/RestImportDanglingIndexAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/dangling/RestImportDanglingIndexAction.java @@ -42,12 +42,15 @@ import org.opensearch.action.admin.indices.dangling.import_index.ImportDanglingIndexRequest; import org.opensearch.action.support.master.AcknowledgedResponse; import org.opensearch.client.node.NodeClient; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.RestStatus; import org.opensearch.rest.action.RestToXContentListener; public class RestImportDanglingIndexAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestImportDanglingIndexAction.class); + @Override public List routes() { return singletonList(new Route(POST, "/_dangling/{index_uuid}")); @@ -66,7 +69,8 @@ public RestChannelConsumer prepareRequest(final RestRequest request, NodeClient ); importRequest.timeout(request.paramAsTime("timeout", importRequest.timeout())); - importRequest.masterNodeTimeout(request.paramAsTime("master_timeout", importRequest.masterNodeTimeout())); + importRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", importRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(importRequest, request, deprecationLogger, getName()); return channel -> client.admin() .cluster() diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestAddIndexBlockAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestAddIndexBlockAction.java index 89faeb1b7c7d9..6854662e3bb18 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestAddIndexBlockAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestAddIndexBlockAction.java @@ -37,6 +37,7 @@ import org.opensearch.client.node.NodeClient; import org.opensearch.cluster.metadata.IndexMetadata; import org.opensearch.common.Strings; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; @@ -49,6 +50,8 @@ public class RestAddIndexBlockAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestAddIndexBlockAction.class); + @Override public List routes() { return Collections.singletonList(new Route(PUT, "/{index}/_block/{block}")); @@ -65,7 +68,8 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC IndexMetadata.APIBlock.fromName(request.param("block")), Strings.splitStringByCommaToArray(request.param("index")) ); - addIndexBlockRequest.masterNodeTimeout(request.paramAsTime("master_timeout", addIndexBlockRequest.masterNodeTimeout())); + addIndexBlockRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", addIndexBlockRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(addIndexBlockRequest, request, deprecationLogger, getName()); addIndexBlockRequest.timeout(request.paramAsTime("timeout", addIndexBlockRequest.timeout())); addIndexBlockRequest.indicesOptions(IndicesOptions.fromRequest(request, addIndexBlockRequest.indicesOptions())); return channel -> client.admin().indices().addBlock(addIndexBlockRequest, new RestToXContentListener<>(channel)); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestCloseIndexAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestCloseIndexAction.java index 8da0ec3c5a349..168d553112fe1 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestCloseIndexAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestCloseIndexAction.java @@ -37,6 +37,7 @@ import org.opensearch.action.support.IndicesOptions; import org.opensearch.client.node.NodeClient; import org.opensearch.common.Strings; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; @@ -50,6 +51,8 @@ public class RestCloseIndexAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestCloseIndexAction.class); + @Override public List routes() { return unmodifiableList(asList(new Route(POST, "/_close"), new Route(POST, "/{index}/_close"))); @@ -63,7 +66,8 @@ public String getName() { @Override public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { CloseIndexRequest closeIndexRequest = new CloseIndexRequest(Strings.splitStringByCommaToArray(request.param("index"))); - closeIndexRequest.masterNodeTimeout(request.paramAsTime("master_timeout", closeIndexRequest.masterNodeTimeout())); + closeIndexRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", closeIndexRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(closeIndexRequest, request, deprecationLogger, getName()); closeIndexRequest.timeout(request.paramAsTime("timeout", closeIndexRequest.timeout())); closeIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, closeIndexRequest.indicesOptions())); String waitForActiveShards = request.param("wait_for_active_shards"); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestCreateIndexAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestCreateIndexAction.java index 5b628bc094c41..54199b8e68516 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestCreateIndexAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestCreateIndexAction.java @@ -35,6 +35,7 @@ import org.opensearch.action.admin.indices.create.CreateIndexRequest; import org.opensearch.action.support.ActiveShardCount; import org.opensearch.client.node.NodeClient; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.xcontent.LoggingDeprecationHandler; import org.opensearch.common.xcontent.XContentHelper; import org.opensearch.index.mapper.MapperService; @@ -53,6 +54,8 @@ public class RestCreateIndexAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestIndexPutAliasAction.class); + @Override public List routes() { return singletonList(new Route(PUT, "/{index}")); @@ -74,7 +77,8 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC } createIndexRequest.timeout(request.paramAsTime("timeout", createIndexRequest.timeout())); - createIndexRequest.masterNodeTimeout(request.paramAsTime("master_timeout", createIndexRequest.masterNodeTimeout())); + createIndexRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", createIndexRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(createIndexRequest, request, deprecationLogger, getName()); createIndexRequest.waitForActiveShards(ActiveShardCount.parseString(request.param("wait_for_active_shards"))); return channel -> client.admin().indices().create(createIndexRequest, new RestToXContentListener<>(channel)); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteIndexAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteIndexAction.java index e8b5caf8f234a..63fa8a4b29d85 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteIndexAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteIndexAction.java @@ -36,6 +36,7 @@ import org.opensearch.action.support.IndicesOptions; import org.opensearch.client.node.NodeClient; import org.opensearch.common.Strings; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; @@ -49,6 +50,8 @@ public class RestDeleteIndexAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestDeleteIndexAction.class); + @Override public List routes() { return unmodifiableList(asList(new Route(DELETE, "/"), new Route(DELETE, "/{index}"))); @@ -63,7 +66,8 @@ public String getName() { public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { DeleteIndexRequest deleteIndexRequest = new DeleteIndexRequest(Strings.splitStringByCommaToArray(request.param("index"))); deleteIndexRequest.timeout(request.paramAsTime("timeout", deleteIndexRequest.timeout())); - deleteIndexRequest.masterNodeTimeout(request.paramAsTime("master_timeout", deleteIndexRequest.masterNodeTimeout())); + deleteIndexRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", deleteIndexRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(deleteIndexRequest, request, deprecationLogger, getName()); deleteIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, deleteIndexRequest.indicesOptions())); return channel -> client.admin().indices().delete(deleteIndexRequest, new RestToXContentListener<>(channel)); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetIndicesAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetIndicesAction.java index 37c8162c6d31b..c94d691d4e99b 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetIndicesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetIndicesAction.java @@ -36,6 +36,7 @@ import org.opensearch.action.support.IndicesOptions; import org.opensearch.client.node.NodeClient; import org.opensearch.common.Strings; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.settings.Settings; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; @@ -55,6 +56,8 @@ */ public class RestGetIndicesAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestGetIndicesAction.class); + @Override public List routes() { return unmodifiableList(asList(new Route(GET, "/{index}"), new Route(HEAD, "/{index}"))); @@ -72,7 +75,8 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC getIndexRequest.indices(indices); getIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, getIndexRequest.indicesOptions())); getIndexRequest.local(request.paramAsBoolean("local", getIndexRequest.local())); - getIndexRequest.masterNodeTimeout(request.paramAsTime("master_timeout", getIndexRequest.masterNodeTimeout())); + getIndexRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", getIndexRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(getIndexRequest, request, deprecationLogger, getName()); getIndexRequest.humanReadable(request.paramAsBoolean("human", false)); getIndexRequest.includeDefaults(request.paramAsBoolean("include_defaults", false)); return channel -> client.admin().indices().getIndex(getIndexRequest, new RestToXContentListener<>(channel)); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetMappingAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetMappingAction.java index f4f33905408e7..62ea315fd89a0 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetMappingAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetMappingAction.java @@ -32,6 +32,7 @@ package org.opensearch.rest.action.admin.indices; +import org.opensearch.OpenSearchParseException; import org.opensearch.OpenSearchTimeoutException; import org.opensearch.action.ActionRunnable; import org.opensearch.action.admin.indices.mapping.get.GetMappingsRequest; @@ -39,6 +40,7 @@ import org.opensearch.action.support.IndicesOptions; import org.opensearch.client.node.NodeClient; import org.opensearch.common.Strings; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.unit.TimeValue; import org.opensearch.common.xcontent.XContentBuilder; import org.opensearch.rest.BaseRestHandler; @@ -59,6 +61,12 @@ public class RestGetMappingAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestGetMappingAction.class); + private static final String MASTER_TIMEOUT_DEPRECATED_MESSAGE = + "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version."; + private static final String DUPLICATE_PARAMETER_ERROR_MESSAGE = + "Please only use one of the request parameters [master_timeout, cluster_manager_timeout]."; + private final ThreadPool threadPool; public RestGetMappingAction(ThreadPool threadPool) { @@ -89,7 +97,16 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC final GetMappingsRequest getMappingsRequest = new GetMappingsRequest(); getMappingsRequest.indices(indices); getMappingsRequest.indicesOptions(IndicesOptions.fromRequest(request, getMappingsRequest.indicesOptions())); - final TimeValue timeout = request.paramAsTime("master_timeout", getMappingsRequest.masterNodeTimeout()); + TimeValue clusterManagerTimeout = request.paramAsTime("cluster_manager_timeout", getMappingsRequest.masterNodeTimeout()); + // TODO: Remove the if condition and statements inside after removing MASTER_ROLE. + if (request.hasParam("master_timeout")) { + deprecationLogger.deprecate("get_mapping_master_timeout_parameter", MASTER_TIMEOUT_DEPRECATED_MESSAGE); + if (request.hasParam("cluster_manager_timeout")) { + throw new OpenSearchParseException(DUPLICATE_PARAMETER_ERROR_MESSAGE); + } + clusterManagerTimeout = request.paramAsTime("master_timeout", getMappingsRequest.masterNodeTimeout()); + } + final TimeValue timeout = clusterManagerTimeout; getMappingsRequest.masterNodeTimeout(timeout); getMappingsRequest.local(request.paramAsBoolean("local", getMappingsRequest.local())); return channel -> client.admin().indices().getMappings(getMappingsRequest, new RestActionListener(channel) { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetSettingsAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetSettingsAction.java index 589bdfdbe79dd..293078b3568e3 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetSettingsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetSettingsAction.java @@ -36,6 +36,7 @@ import org.opensearch.action.support.IndicesOptions; import org.opensearch.client.node.NodeClient; import org.opensearch.common.Strings; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; @@ -49,6 +50,8 @@ public class RestGetSettingsAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestGetSettingsAction.class); + @Override public List routes() { return unmodifiableList( @@ -79,7 +82,8 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC .includeDefaults(renderDefaults) .names(names); getSettingsRequest.local(request.paramAsBoolean("local", getSettingsRequest.local())); - getSettingsRequest.masterNodeTimeout(request.paramAsTime("master_timeout", getSettingsRequest.masterNodeTimeout())); + getSettingsRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", getSettingsRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(getSettingsRequest, request, deprecationLogger, getName()); return channel -> client.admin().indices().getSettings(getSettingsRequest, new RestToXContentListener<>(channel)); } } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndexDeleteAliasesAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndexDeleteAliasesAction.java index 6a8098dfaf633..9f0b543a456f2 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndexDeleteAliasesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndexDeleteAliasesAction.java @@ -35,6 +35,7 @@ import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest.AliasActions; import org.opensearch.client.node.NodeClient; import org.opensearch.common.Strings; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; @@ -48,6 +49,8 @@ public class RestIndexDeleteAliasesAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestIndexPutAliasAction.class); + @Override public List routes() { return unmodifiableList(asList(new Route(DELETE, "/{index}/_alias/{name}"), new Route(DELETE, "/{index}/_aliases/{name}"))); @@ -65,7 +68,8 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC IndicesAliasesRequest indicesAliasesRequest = new IndicesAliasesRequest(); indicesAliasesRequest.timeout(request.paramAsTime("timeout", indicesAliasesRequest.timeout())); indicesAliasesRequest.addAliasAction(AliasActions.remove().indices(indices).aliases(aliases)); - indicesAliasesRequest.masterNodeTimeout(request.paramAsTime("master_timeout", indicesAliasesRequest.masterNodeTimeout())); + indicesAliasesRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", indicesAliasesRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(indicesAliasesRequest, request, deprecationLogger, getName()); return channel -> client.admin().indices().aliases(indicesAliasesRequest, new RestToXContentListener<>(channel)); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndexPutAliasAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndexPutAliasAction.java index cc31dc1117946..8f8eeaf1c8e1c 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndexPutAliasAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndexPutAliasAction.java @@ -35,6 +35,7 @@ import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest.AliasActions; import org.opensearch.client.node.NodeClient; import org.opensearch.common.Strings; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.xcontent.XContentParser; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; @@ -51,6 +52,8 @@ public class RestIndexPutAliasAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestIndexPutAliasAction.class); + @Override public List routes() { return unmodifiableList( @@ -124,7 +127,8 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC IndicesAliasesRequest indicesAliasesRequest = new IndicesAliasesRequest(); indicesAliasesRequest.timeout(request.paramAsTime("timeout", indicesAliasesRequest.timeout())); - indicesAliasesRequest.masterNodeTimeout(request.paramAsTime("master_timeout", indicesAliasesRequest.masterNodeTimeout())); + indicesAliasesRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", indicesAliasesRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(indicesAliasesRequest, request, deprecationLogger, getName()); IndicesAliasesRequest.AliasActions aliasAction = AliasActions.add().indices(indices).alias(alias); if (routing != null) { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndicesAliasesAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndicesAliasesAction.java index 138343a2e7335..20b67fa73a3f5 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndicesAliasesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndicesAliasesAction.java @@ -34,6 +34,7 @@ import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest; import org.opensearch.client.node.NodeClient; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.xcontent.XContentParser; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; @@ -47,6 +48,8 @@ public class RestIndicesAliasesAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestIndicesAliasesAction.class); + @Override public String getName() { return "indices_aliases_action"; @@ -60,7 +63,8 @@ public List routes() { @Override public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { IndicesAliasesRequest indicesAliasesRequest = new IndicesAliasesRequest(); - indicesAliasesRequest.masterNodeTimeout(request.paramAsTime("master_timeout", indicesAliasesRequest.masterNodeTimeout())); + indicesAliasesRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", indicesAliasesRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(indicesAliasesRequest, request, deprecationLogger, getName()); indicesAliasesRequest.timeout(request.paramAsTime("timeout", indicesAliasesRequest.timeout())); try (XContentParser parser = request.contentParser()) { IndicesAliasesRequest.PARSER.parse(parser, indicesAliasesRequest, null); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestOpenIndexAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestOpenIndexAction.java index 4b6450c35233f..a6d434b1e865e 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestOpenIndexAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestOpenIndexAction.java @@ -37,6 +37,7 @@ import org.opensearch.action.support.IndicesOptions; import org.opensearch.client.node.NodeClient; import org.opensearch.common.Strings; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; @@ -50,6 +51,8 @@ public class RestOpenIndexAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestOpenIndexAction.class); + @Override public List routes() { return unmodifiableList(asList(new Route(POST, "/_open"), new Route(POST, "/{index}/_open"))); @@ -64,7 +67,8 @@ public String getName() { public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { OpenIndexRequest openIndexRequest = new OpenIndexRequest(Strings.splitStringByCommaToArray(request.param("index"))); openIndexRequest.timeout(request.paramAsTime("timeout", openIndexRequest.timeout())); - openIndexRequest.masterNodeTimeout(request.paramAsTime("master_timeout", openIndexRequest.masterNodeTimeout())); + openIndexRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", openIndexRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(openIndexRequest, request, deprecationLogger, getName()); openIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, openIndexRequest.indicesOptions())); String waitForActiveShards = request.param("wait_for_active_shards"); if (waitForActiveShards != null) { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutMappingAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutMappingAction.java index f65dea1ebe3d2..5c305b7c75038 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutMappingAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutMappingAction.java @@ -36,6 +36,7 @@ import org.opensearch.action.support.IndicesOptions; import org.opensearch.client.node.NodeClient; import org.opensearch.common.Strings; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.xcontent.XContentHelper; import org.opensearch.index.mapper.MapperService; import org.opensearch.rest.BaseRestHandler; @@ -54,6 +55,8 @@ public class RestPutMappingAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestPutMappingAction.class); + @Override public List routes() { return unmodifiableList( @@ -83,7 +86,8 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC putMappingRequest.source(sourceAsMap); putMappingRequest.timeout(request.paramAsTime("timeout", putMappingRequest.timeout())); - putMappingRequest.masterNodeTimeout(request.paramAsTime("master_timeout", putMappingRequest.masterNodeTimeout())); + putMappingRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", putMappingRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(putMappingRequest, request, deprecationLogger, getName()); putMappingRequest.indicesOptions(IndicesOptions.fromRequest(request, putMappingRequest.indicesOptions())); putMappingRequest.writeIndexOnly(request.paramAsBoolean("write_index_only", false)); return channel -> client.admin().indices().putMapping(putMappingRequest, new RestToXContentListener<>(channel)); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestResizeHandler.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestResizeHandler.java index a0d479890f2d0..4168c7ad48e7c 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestResizeHandler.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestResizeHandler.java @@ -91,7 +91,8 @@ public final RestChannelConsumer prepareRequest(final RestRequest request, final resizeRequest.setCopySettings(copySettings); request.applyContentParser(resizeRequest::fromXContent); resizeRequest.timeout(request.paramAsTime("timeout", resizeRequest.timeout())); - resizeRequest.masterNodeTimeout(request.paramAsTime("master_timeout", resizeRequest.masterNodeTimeout())); + resizeRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", resizeRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(resizeRequest, request, deprecationLogger, getName()); resizeRequest.setWaitForActiveShards(ActiveShardCount.parseString(request.param("wait_for_active_shards"))); return channel -> client.admin().indices().resizeIndex(resizeRequest, new RestToXContentListener<>(channel)); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestRolloverIndexAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestRolloverIndexAction.java index 08b84cc6fe6cc..b9f8b936ff23e 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestRolloverIndexAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestRolloverIndexAction.java @@ -72,7 +72,8 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC request.applyContentParser(parser -> rolloverIndexRequest.fromXContent(parser)); rolloverIndexRequest.dryRun(request.paramAsBoolean("dry_run", false)); rolloverIndexRequest.timeout(request.paramAsTime("timeout", rolloverIndexRequest.timeout())); - rolloverIndexRequest.masterNodeTimeout(request.paramAsTime("master_timeout", rolloverIndexRequest.masterNodeTimeout())); + rolloverIndexRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", rolloverIndexRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(rolloverIndexRequest, request, deprecationLogger, getName()); rolloverIndexRequest.getCreateIndexRequest() .waitForActiveShards(ActiveShardCount.parseString(request.param("wait_for_active_shards"))); return channel -> client.admin().indices().rolloverIndex(rolloverIndexRequest, new RestToXContentListener<>(channel)); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestUpdateSettingsAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestUpdateSettingsAction.java index 8356901dbc7ab..bfb634d421f2d 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestUpdateSettingsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestUpdateSettingsAction.java @@ -36,6 +36,7 @@ import org.opensearch.action.support.IndicesOptions; import org.opensearch.client.node.NodeClient; import org.opensearch.common.Strings; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.settings.Settings; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; @@ -52,6 +53,8 @@ public class RestUpdateSettingsAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestUpdateSettingsAction.class); + @Override public List routes() { return unmodifiableList(asList(new Route(PUT, "/{index}/_settings"), new Route(PUT, "/_settings"))); @@ -67,7 +70,8 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC UpdateSettingsRequest updateSettingsRequest = updateSettingsRequest(Strings.splitStringByCommaToArray(request.param("index"))); updateSettingsRequest.timeout(request.paramAsTime("timeout", updateSettingsRequest.timeout())); updateSettingsRequest.setPreserveExisting(request.paramAsBoolean("preserve_existing", updateSettingsRequest.isPreserveExisting())); - updateSettingsRequest.masterNodeTimeout(request.paramAsTime("master_timeout", updateSettingsRequest.masterNodeTimeout())); + updateSettingsRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", updateSettingsRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(updateSettingsRequest, request, deprecationLogger, getName()); updateSettingsRequest.indicesOptions(IndicesOptions.fromRequest(request, updateSettingsRequest.indicesOptions())); updateSettingsRequest.fromXContent(request.contentParser()); diff --git a/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java b/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java index 8bc9afc152382..df93d5c16d8e0 100644 --- a/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java +++ b/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java @@ -24,6 +24,23 @@ import org.opensearch.rest.action.admin.cluster.RestClusterRerouteAction; import org.opensearch.rest.action.admin.cluster.RestClusterStateAction; import org.opensearch.rest.action.admin.cluster.RestClusterUpdateSettingsAction; +import org.opensearch.rest.action.admin.cluster.dangling.RestDeleteDanglingIndexAction; +import org.opensearch.rest.action.admin.cluster.dangling.RestImportDanglingIndexAction; +import org.opensearch.rest.action.admin.indices.RestAddIndexBlockAction; +import org.opensearch.rest.action.admin.indices.RestCloseIndexAction; +import org.opensearch.rest.action.admin.indices.RestCreateIndexAction; +import org.opensearch.rest.action.admin.indices.RestDeleteIndexAction; +import org.opensearch.rest.action.admin.indices.RestGetIndicesAction; +import org.opensearch.rest.action.admin.indices.RestGetMappingAction; +import org.opensearch.rest.action.admin.indices.RestGetSettingsAction; +import org.opensearch.rest.action.admin.indices.RestIndexDeleteAliasesAction; +import org.opensearch.rest.action.admin.indices.RestIndexPutAliasAction; +import org.opensearch.rest.action.admin.indices.RestIndicesAliasesAction; +import org.opensearch.rest.action.admin.indices.RestOpenIndexAction; +import org.opensearch.rest.action.admin.indices.RestPutMappingAction; +import org.opensearch.rest.action.admin.indices.RestResizeHandler; +import org.opensearch.rest.action.admin.indices.RestRolloverIndexAction; +import org.opensearch.rest.action.admin.indices.RestUpdateSettingsAction; import org.opensearch.rest.action.cat.RestAllocationAction; import org.opensearch.rest.action.cat.RestRepositoriesAction; import org.opensearch.rest.action.cat.RestThreadPoolAction; @@ -45,6 +62,7 @@ import java.util.Collections; import static org.hamcrest.Matchers.containsString; +import static org.opensearch.cluster.metadata.IndexMetadata.INDEX_READ_ONLY_SETTING; /** * As of 2.0, the request parameter 'master_timeout' in all applicable REST APIs is deprecated, @@ -253,6 +271,160 @@ public void testClusterPendingTasks() { assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } + public void testAddIndexBlock() { + FakeRestRequest request = new FakeRestRequest(); + request.params().put("cluster_manager_timeout", "1h"); + request.params().put("master_timeout", "3s"); + request.params().put("block", "metadata"); + NodeClient client = new NodeClient(Settings.builder().put(INDEX_READ_ONLY_SETTING.getKey(), Boolean.FALSE).build(), threadPool); + RestAddIndexBlockAction action = new RestAddIndexBlockAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(request, client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testCloseIndex() { + RestCloseIndexAction action = new RestCloseIndexAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testCreateIndex() { + RestCreateIndexAction action = new RestCreateIndexAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testDeleteIndex() { + RestDeleteIndexAction action = new RestDeleteIndexAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testGetIndices() { + RestGetIndicesAction action = new RestGetIndicesAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testGetMapping() { + RestGetMappingAction action = new RestGetMappingAction(threadPool); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testGetSettings() { + RestGetSettingsAction action = new RestGetSettingsAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testIndexDeleteAliases() { + FakeRestRequest request = new FakeRestRequest(); + request.params().put("cluster_manager_timeout", "1h"); + request.params().put("master_timeout", "3s"); + request.params().put("name", "*"); + request.params().put("index", "test"); + RestIndexDeleteAliasesAction action = new RestIndexDeleteAliasesAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(request, client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testIndexPutAlias() { + RestIndexPutAliasAction action = new RestIndexPutAliasAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testIndicesAliases() { + RestIndicesAliasesAction action = new RestIndicesAliasesAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testOpenIndex() { + RestOpenIndexAction action = new RestOpenIndexAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testPutMapping() { + RestPutMappingAction action = new RestPutMappingAction(); + Exception e = assertThrows( + OpenSearchParseException.class, + () -> action.prepareRequest(getRestRequestWithBodyWithBothParams(), client) + ); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testShrinkIndex() { + RestResizeHandler.RestShrinkIndexAction action = new RestResizeHandler.RestShrinkIndexAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testSplitIndex() { + RestResizeHandler.RestSplitIndexAction action = new RestResizeHandler.RestSplitIndexAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testCloneIndex() { + RestResizeHandler.RestCloneIndexAction action = new RestResizeHandler.RestCloneIndexAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testRolloverIndex() { + RestRolloverIndexAction action = new RestRolloverIndexAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testUpdateSettings() { + RestUpdateSettingsAction action = new RestUpdateSettingsAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testDeleteDanglingIndex() { + FakeRestRequest request = new FakeRestRequest(); + request.params().put("cluster_manager_timeout", "1h"); + request.params().put("master_timeout", "3s"); + request.params().put("index_uuid", "test"); + RestDeleteDanglingIndexAction action = new RestDeleteDanglingIndexAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(request, client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testImportDanglingIndex() { + FakeRestRequest request = new FakeRestRequest(); + request.params().put("cluster_manager_timeout", "1h"); + request.params().put("master_timeout", "3s"); + request.params().put("index_uuid", "test"); + RestImportDanglingIndexAction action = new RestImportDanglingIndexAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(request, client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + private MasterNodeRequest getMasterNodeRequest() { return new MasterNodeRequest() { @Override From 8f762826c251bc20fa7a5da6b07e8aa6a4fd7892 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 5 Apr 2022 18:44:25 -0700 Subject: [PATCH 037/514] Replace blacklist in Gradle build environment configuration (#2752) (#2780) - Replace `blacklist` with `denylist` in all `tests.rest.blacklist` and `REST_TESTS_BLACKLIST` Signed-off-by: Tianli Feng (cherry picked from commit ed040e9f1a36abc23b7605cc47b48bb57a569c04) --- TESTING.md | 2 +- plugins/repository-s3/build.gradle | 6 +++--- .../test/junit/listeners/ReproduceInfoPrinter.java | 2 +- .../rest/yaml/OpenSearchClientYamlSuiteTestCase.java | 12 ++++++------ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/TESTING.md b/TESTING.md index 4a2a786469b67..d6f246dbd6dcc 100644 --- a/TESTING.md +++ b/TESTING.md @@ -245,7 +245,7 @@ The YAML REST tests support all the options provided by the randomized runner, p - `tests.rest.suite`: comma separated paths of the test suites to be run (by default loaded from /rest-api-spec/test). It is possible to run only a subset of the tests providing a sub-folder or even a single yaml file (the default /rest-api-spec/test prefix is optional when files are loaded from classpath) e.g. `-Dtests.rest.suite=index,get,create/10_with_id` -- `tests.rest.blacklist`: comma separated globs that identify tests that are denylisted and need to be skipped e.g. `-Dtests.rest.blacklist=index/**/Index document,get/10_basic/**` +- `tests.rest.denylist`: comma separated globs that identify tests that are denylisted and need to be skipped e.g. `-Dtests.rest.denylist=index/**/Index document,get/10_basic/**` Java REST tests can be run with the "javaRestTest" task. diff --git a/plugins/repository-s3/build.gradle b/plugins/repository-s3/build.gradle index 072683e3bd5e5..33448b0039ce2 100644 --- a/plugins/repository-s3/build.gradle +++ b/plugins/repository-s3/build.gradle @@ -190,7 +190,7 @@ internalClusterTest { } yamlRestTest { - systemProperty 'tests.rest.blacklist', ( + systemProperty 'tests.rest.denylist', ( useFixture ? ['repository_s3/50_repository_ecs_credentials/*'] : @@ -246,7 +246,7 @@ if (useFixture) { setClasspath(yamlRestTestSourceSet.getRuntimeClasspath()) // Minio only supports a single access key, see https://github.com/minio/minio/pull/5968 - systemProperty 'tests.rest.blacklist', [ + systemProperty 'tests.rest.denylist', [ 'repository_s3/30_repository_temporary_credentials/*', 'repository_s3/40_repository_ec2_credentials/*', 'repository_s3/50_repository_ecs_credentials/*' @@ -272,7 +272,7 @@ if (useFixture) { SourceSet yamlRestTestSourceSet = sourceSets.getByName(YamlRestTestPlugin.SOURCE_SET_NAME) setTestClassesDirs(yamlRestTestSourceSet.getOutput().getClassesDirs()) setClasspath(yamlRestTestSourceSet.getRuntimeClasspath()) - systemProperty 'tests.rest.blacklist', [ + systemProperty 'tests.rest.denylist', [ 'repository_s3/10_basic/*', 'repository_s3/20_repository_permanent_credentials/*', 'repository_s3/30_repository_temporary_credentials/*', diff --git a/test/framework/src/main/java/org/opensearch/test/junit/listeners/ReproduceInfoPrinter.java b/test/framework/src/main/java/org/opensearch/test/junit/listeners/ReproduceInfoPrinter.java index 668526d9d6d0d..3d5a906e50836 100644 --- a/test/framework/src/main/java/org/opensearch/test/junit/listeners/ReproduceInfoPrinter.java +++ b/test/framework/src/main/java/org/opensearch/test/junit/listeners/ReproduceInfoPrinter.java @@ -200,7 +200,7 @@ private ReproduceErrorMessageBuilder appendESProperties() { public ReproduceErrorMessageBuilder appendClientYamlSuiteProperties() { return appendProperties( OpenSearchClientYamlSuiteTestCase.REST_TESTS_SUITE, - OpenSearchClientYamlSuiteTestCase.REST_TESTS_BLACKLIST + OpenSearchClientYamlSuiteTestCase.REST_TESTS_DENYLIST ); } diff --git a/test/framework/src/main/java/org/opensearch/test/rest/yaml/OpenSearchClientYamlSuiteTestCase.java b/test/framework/src/main/java/org/opensearch/test/rest/yaml/OpenSearchClientYamlSuiteTestCase.java index 5a404ccd4b9fc..70e3adbefbfc3 100644 --- a/test/framework/src/main/java/org/opensearch/test/rest/yaml/OpenSearchClientYamlSuiteTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/rest/yaml/OpenSearchClientYamlSuiteTestCase.java @@ -89,14 +89,14 @@ public abstract class OpenSearchClientYamlSuiteTestCase extends OpenSearchRestTe public static final String REST_TESTS_SUITE = "tests.rest.suite"; /** * Property that allows to denylist some of the REST tests based on a comma separated list of globs - * e.g. "-Dtests.rest.blacklist=get/10_basic/*" + * e.g. "-Dtests.rest.denylist=get/10_basic/*" */ - public static final String REST_TESTS_BLACKLIST = "tests.rest.blacklist"; + public static final String REST_TESTS_DENYLIST = "tests.rest.denylist"; /** - * We use tests.rest.blacklist in build files to denylist tests; this property enables a user to add additional denylisted tests on + * We use tests.rest.denylist in build files to denylist tests; this property enables a user to add additional denylisted tests on * top of the tests denylisted in the build. */ - public static final String REST_TESTS_BLACKLIST_ADDITIONS = "tests.rest.blacklist_additions"; + public static final String REST_TESTS_DENYLIST_ADDITIONS = "tests.rest.denylist_additions"; /** * Property that allows to control whether spec validation is enabled or not (default true). */ @@ -154,12 +154,12 @@ public void initAndResetContext() throws Exception { clientYamlTestClient = initClientYamlTestClient(restSpec, client(), hosts, minVersion, masterVersion); restTestExecutionContext = new ClientYamlTestExecutionContext(clientYamlTestClient, randomizeContentType()); adminExecutionContext = new ClientYamlTestExecutionContext(clientYamlTestClient, false); - final String[] denylist = resolvePathsProperty(REST_TESTS_BLACKLIST, null); + final String[] denylist = resolvePathsProperty(REST_TESTS_DENYLIST, null); denylistPathMatchers = new ArrayList<>(); for (final String entry : denylist) { denylistPathMatchers.add(new BlacklistedPathPatternMatcher(entry)); } - final String[] denylistAdditions = resolvePathsProperty(REST_TESTS_BLACKLIST_ADDITIONS, null); + final String[] denylistAdditions = resolvePathsProperty(REST_TESTS_DENYLIST_ADDITIONS, null); for (final String entry : denylistAdditions) { denylistPathMatchers.add(new BlacklistedPathPatternMatcher(entry)); } From 5fd845e40b33409a59d0af839d9377791c51381b Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 6 Apr 2022 10:37:27 -0400 Subject: [PATCH 038/514] Update azure-storage-blob to 12.15.0 (#2774) (#2777) Signed-off-by: Andriy Redko (cherry picked from commit 1dbeda0f325960a4562f39a75b3e50d6b468edbf) Co-authored-by: Andriy Redko --- plugins/repository-azure/build.gradle | 2 +- .../licenses/azure-storage-blob-12.14.4.jar.sha1 | 1 - .../licenses/azure-storage-blob-12.15.0.jar.sha1 | 1 + .../repositories/azure/AzureBlobContainerRetriesTests.java | 7 ++++++- .../src/main/java/fixture/azure/AzureHttpHandler.java | 4 +++- 5 files changed, 11 insertions(+), 4 deletions(-) delete mode 100644 plugins/repository-azure/licenses/azure-storage-blob-12.14.4.jar.sha1 create mode 100644 plugins/repository-azure/licenses/azure-storage-blob-12.15.0.jar.sha1 diff --git a/plugins/repository-azure/build.gradle b/plugins/repository-azure/build.gradle index a491e766eb7c7..2cae9a97f772c 100644 --- a/plugins/repository-azure/build.gradle +++ b/plugins/repository-azure/build.gradle @@ -54,7 +54,7 @@ dependencies { api "io.netty:netty-resolver-dns:${versions.netty}" api "io.netty:netty-transport-native-unix-common:${versions.netty}" implementation project(':modules:transport-netty4') - api 'com.azure:azure-storage-blob:12.14.4' + api 'com.azure:azure-storage-blob:12.15.0' api 'org.reactivestreams:reactive-streams:1.0.3' api 'io.projectreactor:reactor-core:3.4.15' api 'io.projectreactor.netty:reactor-netty:1.0.16' diff --git a/plugins/repository-azure/licenses/azure-storage-blob-12.14.4.jar.sha1 b/plugins/repository-azure/licenses/azure-storage-blob-12.14.4.jar.sha1 deleted file mode 100644 index 5333f8fa90ada..0000000000000 --- a/plugins/repository-azure/licenses/azure-storage-blob-12.14.4.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -2b92020693d09e4980b96d278e8038a1087afea0 \ No newline at end of file diff --git a/plugins/repository-azure/licenses/azure-storage-blob-12.15.0.jar.sha1 b/plugins/repository-azure/licenses/azure-storage-blob-12.15.0.jar.sha1 new file mode 100644 index 0000000000000..513cb017f798d --- /dev/null +++ b/plugins/repository-azure/licenses/azure-storage-blob-12.15.0.jar.sha1 @@ -0,0 +1 @@ +a53a6bdf7564f4e3a7b0b93cd96b7f5f95c03d36 \ No newline at end of file diff --git a/plugins/repository-azure/src/test/java/org/opensearch/repositories/azure/AzureBlobContainerRetriesTests.java b/plugins/repository-azure/src/test/java/org/opensearch/repositories/azure/AzureBlobContainerRetriesTests.java index c9e6e299c7120..c973cb325b658 100644 --- a/plugins/repository-azure/src/test/java/org/opensearch/repositories/azure/AzureBlobContainerRetriesTests.java +++ b/plugins/repository-azure/src/test/java/org/opensearch/repositories/azure/AzureBlobContainerRetriesTests.java @@ -231,6 +231,8 @@ public void testReadBlobWithRetries() throws Exception { exchange.getResponseHeaders().add("Content-Type", "application/octet-stream"); exchange.getResponseHeaders().add("Content-Length", String.valueOf(length)); exchange.getResponseHeaders().add("x-ms-blob-type", "blockblob"); + exchange.getResponseHeaders() + .add("Content-Range", String.format("bytes %d-%d/%d", rangeStart, bytes.length, bytes.length)); exchange.sendResponseHeaders(RestStatus.OK.getStatus(), length); exchange.getResponseBody().write(bytes, rangeStart, length); return; @@ -247,7 +249,8 @@ public void testReadBlobWithRetries() throws Exception { final BlobContainer blobContainer = createBlobContainer(maxRetries); try (InputStream inputStream = blobContainer.readBlob("read_blob_max_retries")) { assertArrayEquals(bytes, BytesReference.toBytes(Streams.readFully(inputStream))); - assertThat(countDownHead.isCountedDown(), is(true)); + // No more getProperties() calls in BlobClientBase::openInputStream(), HEAD should not be invoked + assertThat(countDownHead.isCountedDown(), is(false)); assertThat(countDownGet.isCountedDown(), is(true)); } } @@ -278,6 +281,8 @@ public void testReadRangeBlobWithRetries() throws Exception { assertThat(length, lessThanOrEqualTo(bytes.length - rangeStart)); exchange.getResponseHeaders().add("Content-Type", "application/octet-stream"); exchange.getResponseHeaders().add("Content-Length", String.valueOf(length)); + exchange.getResponseHeaders() + .add("Content-Range", String.format("bytes %d-%d/%d", rangeStart, rangeEnd.get(), bytes.length)); exchange.getResponseHeaders().add("x-ms-blob-type", "blockblob"); exchange.sendResponseHeaders(RestStatus.OK.getStatus(), length); exchange.getResponseBody().write(bytes, rangeStart, length); diff --git a/test/fixtures/azure-fixture/src/main/java/fixture/azure/AzureHttpHandler.java b/test/fixtures/azure-fixture/src/main/java/fixture/azure/AzureHttpHandler.java index f12a4579a2d0c..8389bd839d165 100644 --- a/test/fixtures/azure-fixture/src/main/java/fixture/azure/AzureHttpHandler.java +++ b/test/fixtures/azure-fixture/src/main/java/fixture/azure/AzureHttpHandler.java @@ -150,12 +150,14 @@ public void handle(final HttpExchange exchange) throws IOException { } final int start = Integer.parseInt(matcher.group(1)); - final int length = Integer.parseInt(matcher.group(2)) - start + 1; + final int end = Integer.parseInt(matcher.group(2)); + final int length = Math.min(end - start + 1, blob.length()); exchange.getResponseHeaders().add("Content-Type", "application/octet-stream"); exchange.getResponseHeaders().add("Content-Length", String.valueOf(length)); exchange.getResponseHeaders().add("x-ms-blob-type", "blockblob"); exchange.getResponseHeaders().add("x-ms-request-server-encrypted", "false"); + exchange.getResponseHeaders().add("Content-Range", String.format("bytes %d-%d/%d", start, Math.min(end, length), length)); exchange.sendResponseHeaders(RestStatus.OK.getStatus(), length); exchange.getResponseBody().write(blob.toBytesRef().bytes, start, length); From 5ddb1a09093814e4277f4a22aa8f3f7d1ce2920a Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 6 Apr 2022 10:39:28 -0400 Subject: [PATCH 039/514] Bump json-schema-validator from 1.0.67 to 1.0.68 in /buildSrc (#2610) (#2622) Bumps [json-schema-validator](https://github.com/networknt/json-schema-validator) from 1.0.67 to 1.0.68. - [Release notes](https://github.com/networknt/json-schema-validator/releases) - [Changelog](https://github.com/networknt/json-schema-validator/blob/master/CHANGELOG.md) - [Commits](https://github.com/networknt/json-schema-validator/compare/1.0.67...1.0.68) --- updated-dependencies: - dependency-name: com.networknt:json-schema-validator dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> (cherry picked from commit dd79352baa5d3ca95c5349c72a6f89142f2b6c8e) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tianli Feng --- buildSrc/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 17b16fd3eeadf..cc7742a0d4390 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -115,7 +115,7 @@ dependencies { api 'de.thetaphi:forbiddenapis:3.3' api 'com.avast.gradle:gradle-docker-compose-plugin:0.14.12' api 'org.apache.maven:maven-model:3.6.2' - api 'com.networknt:json-schema-validator:1.0.67' + api 'com.networknt:json-schema-validator:1.0.68' api "com.fasterxml.jackson.core:jackson-databind:${props.getProperty('jackson_databind')}" testFixturesApi "junit:junit:${props.getProperty('junit')}" From 5c2956ba4ecfb53c51a602325d66053a5b79fead Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 6 Apr 2022 16:13:08 -0400 Subject: [PATCH 040/514] Fix issue that deprecated setting 'cluster.initial_master_nodes' is not identified in node bootstrap check (#2779) (#2793) * Fix issue that deprecated setting 'cluster.initial_master_nodes' is not identified during node bootstrap Signed-off-by: Tianli Feng * Restore a variable name Signed-off-by: Tianli Feng (cherry picked from commit dd24e17ea6ed557829e6094c0a2af9f05c1cdebd) Co-authored-by: Tianli Feng --- .../coordination/ClusterBootstrapService.java | 13 +++++++------ .../opensearch/bootstrap/BootstrapChecksTests.java | 2 ++ .../coordination/ClusterBootstrapServiceTests.java | 11 ++++++++++- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/server/src/main/java/org/opensearch/cluster/coordination/ClusterBootstrapService.java b/server/src/main/java/org/opensearch/cluster/coordination/ClusterBootstrapService.java index 8df561149eb3d..c7708a54f9031 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/ClusterBootstrapService.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/ClusterBootstrapService.java @@ -113,12 +113,12 @@ public ClusterBootstrapService( BooleanSupplier isBootstrappedSupplier, Consumer votingConfigurationConsumer ) { + // TODO: Remove variable 'initialClusterManagerSettingName' after removing MASTER_ROLE. + String initialClusterManagerSettingName = INITIAL_CLUSTER_MANAGER_NODES_SETTING.exists(settings) + ? INITIAL_CLUSTER_MANAGER_NODES_SETTING.getKey() + : INITIAL_MASTER_NODES_SETTING.getKey(); if (DiscoveryModule.isSingleNodeDiscovery(settings)) { if (INITIAL_CLUSTER_MANAGER_NODES_SETTING.existsOrFallbackExists(settings)) { - // TODO: Remove variable 'initialClusterManagerSettingName' after removing MASTER_ROLE. - String initialClusterManagerSettingName = INITIAL_CLUSTER_MANAGER_NODES_SETTING.exists(settings) - ? INITIAL_CLUSTER_MANAGER_NODES_SETTING.getKey() - : INITIAL_MASTER_NODES_SETTING.getKey(); throw new IllegalArgumentException( "setting [" + initialClusterManagerSettingName @@ -145,7 +145,7 @@ public ClusterBootstrapService( bootstrapRequirements = unmodifiableSet(new LinkedHashSet<>(initialMasterNodes)); if (bootstrapRequirements.size() != initialMasterNodes.size()) { throw new IllegalArgumentException( - "setting [" + INITIAL_CLUSTER_MANAGER_NODES_SETTING.getKey() + "] contains duplicates: " + initialMasterNodes + "setting [" + initialClusterManagerSettingName + "] contains duplicates: " + initialMasterNodes ); } unconfiguredBootstrapTimeout = discoveryIsConfigured(settings) ? null : UNCONFIGURED_BOOTSTRAP_TIMEOUT_SETTING.get(settings); @@ -163,7 +163,8 @@ public static boolean discoveryIsConfigured(Settings settings) { LEGACY_DISCOVERY_HOSTS_PROVIDER_SETTING, DISCOVERY_SEED_HOSTS_SETTING, LEGACY_DISCOVERY_ZEN_PING_UNICAST_HOSTS_SETTING, - INITIAL_CLUSTER_MANAGER_NODES_SETTING + INITIAL_CLUSTER_MANAGER_NODES_SETTING, + INITIAL_MASTER_NODES_SETTING ).anyMatch(s -> s.exists(settings)); } diff --git a/server/src/test/java/org/opensearch/bootstrap/BootstrapChecksTests.java b/server/src/test/java/org/opensearch/bootstrap/BootstrapChecksTests.java index d941c624509da..c59ca1dd60dc7 100644 --- a/server/src/test/java/org/opensearch/bootstrap/BootstrapChecksTests.java +++ b/server/src/test/java/org/opensearch/bootstrap/BootstrapChecksTests.java @@ -818,5 +818,7 @@ public void testDiscoveryConfiguredCheck() throws NodeValidationException { ensureChecksPass.accept(Settings.builder().putList(ClusterBootstrapService.INITIAL_CLUSTER_MANAGER_NODES_SETTING.getKey())); ensureChecksPass.accept(Settings.builder().putList(DiscoveryModule.DISCOVERY_SEED_PROVIDERS_SETTING.getKey())); ensureChecksPass.accept(Settings.builder().putList(SettingsBasedSeedHostsProvider.DISCOVERY_SEED_HOSTS_SETTING.getKey())); + // Validate the deprecated setting is still valid during the node bootstrap. + ensureChecksPass.accept(Settings.builder().putList(ClusterBootstrapService.INITIAL_MASTER_NODES_SETTING.getKey())); } } diff --git a/server/src/test/java/org/opensearch/cluster/coordination/ClusterBootstrapServiceTests.java b/server/src/test/java/org/opensearch/cluster/coordination/ClusterBootstrapServiceTests.java index dd55d078fe2c6..3e4148cef61cd 100644 --- a/server/src/test/java/org/opensearch/cluster/coordination/ClusterBootstrapServiceTests.java +++ b/server/src/test/java/org/opensearch/cluster/coordination/ClusterBootstrapServiceTests.java @@ -166,10 +166,19 @@ public void testDoesNothingByDefaultIfSeedHostsConfigured() { testDoesNothingWithSettings(builder().putList(DISCOVERY_SEED_HOSTS_SETTING.getKey())); } - public void testDoesNothingByDefaultIfMasterNodesConfigured() { + public void testDoesNothingByDefaultIfClusterManagerNodesConfigured() { testDoesNothingWithSettings(builder().putList(INITIAL_CLUSTER_MANAGER_NODES_SETTING.getKey())); } + // Validate the deprecated setting is still valid during the cluster bootstrap. + public void testDoesNothingByDefaultIfMasterNodesConfigured() { + testDoesNothingWithSettings(builder().putList(INITIAL_MASTER_NODES_SETTING.getKey())); + assertWarnings( + "[cluster.initial_master_nodes] setting was deprecated in OpenSearch and will be removed in a future release! " + + "See the breaking changes documentation for the next major version." + ); + } + public void testDoesNothingByDefaultOnMasterIneligibleNodes() { localNode = new DiscoveryNode( "local", From a4ca46193ebc9c5c59af09df27b7ea9e7ce30bec Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 6 Apr 2022 13:25:46 -0700 Subject: [PATCH 041/514] Bump geoip2 from 2.16.1 to 3.0.1 in /modules/ingest-geoip (#2646) (#2789) * Bump geoip2 from 2.16.1 to 3.0.1 in /modules/ingest-geoip Bumps [geoip2](https://github.com/maxmind/GeoIP2-java) from 2.16.1 to 3.0.1. - [Release notes](https://github.com/maxmind/GeoIP2-java/releases) - [Changelog](https://github.com/maxmind/GeoIP2-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/maxmind/GeoIP2-java/compare/v2.16.1...v3.0.1) --- updated-dependencies: - dependency-name: com.maxmind.geoip2:geoip2 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Updating SHAs Signed-off-by: dependabot[bot] * Fix breaking change with geoip2 version 3.0.1. Signed-off-by: Marc Handalian * Fix precommit failures caused by ignoreMissingClasses check. Precommit is failing because forbiddenApis was configured to ignore missing classes that are present. Signed-off-by: Marc Handalian * Change asn in GeoIpProcessorTests from int to long. Signed-off-by: Marc Handalian Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] Co-authored-by: Marc Handalian (cherry picked from commit ce5c55dbbc58f9309662e2919834ed54358d28cb) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- modules/ingest-geoip/build.gradle | 20 +------------------ .../licenses/geoip2-2.16.1.jar.sha1 | 1 - .../licenses/geoip2-3.0.1.jar.sha1 | 1 + .../ingest/geoip/GeoIpProcessor.java | 2 +- .../ingest/geoip/GeoIpProcessorTests.java | 2 +- 5 files changed, 4 insertions(+), 22 deletions(-) delete mode 100644 modules/ingest-geoip/licenses/geoip2-2.16.1.jar.sha1 create mode 100644 modules/ingest-geoip/licenses/geoip2-3.0.1.jar.sha1 diff --git a/modules/ingest-geoip/build.gradle b/modules/ingest-geoip/build.gradle index b1d5afbe68a17..f3be0fe61d4be 100644 --- a/modules/ingest-geoip/build.gradle +++ b/modules/ingest-geoip/build.gradle @@ -39,7 +39,7 @@ opensearchplugin { } dependencies { - api('com.maxmind.geoip2:geoip2:2.16.1') + api('com.maxmind.geoip2:geoip2:3.0.1') // geoip2 dependencies: api("com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}") api("com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}") @@ -67,24 +67,6 @@ tasks.named("bundlePlugin").configure { } } -tasks.named("thirdPartyAudit").configure { - ignoreMissingClasses( - // geoip WebServiceClient needs apache http client, but we're not using WebServiceClient: - 'org.apache.http.HttpEntity', - 'org.apache.http.HttpResponse', - 'org.apache.http.StatusLine', - 'org.apache.http.client.config.RequestConfig$Builder', - 'org.apache.http.client.config.RequestConfig', - 'org.apache.http.client.methods.CloseableHttpResponse', - 'org.apache.http.client.methods.HttpGet', - 'org.apache.http.client.utils.URIBuilder', - 'org.apache.http.impl.auth.BasicScheme', - 'org.apache.http.impl.client.CloseableHttpClient', - 'org.apache.http.impl.client.HttpClientBuilder', - 'org.apache.http.util.EntityUtils' - ) -} - if (Os.isFamily(Os.FAMILY_WINDOWS)) { tasks.named("test").configure { // Windows cannot cleanup database files properly unless it loads everything on heap. diff --git a/modules/ingest-geoip/licenses/geoip2-2.16.1.jar.sha1 b/modules/ingest-geoip/licenses/geoip2-2.16.1.jar.sha1 deleted file mode 100644 index 0221476794d3a..0000000000000 --- a/modules/ingest-geoip/licenses/geoip2-2.16.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -c92040bd6ef2cb59be71c6749d08c141ca546caf \ No newline at end of file diff --git a/modules/ingest-geoip/licenses/geoip2-3.0.1.jar.sha1 b/modules/ingest-geoip/licenses/geoip2-3.0.1.jar.sha1 new file mode 100644 index 0000000000000..f1d5ac5aea546 --- /dev/null +++ b/modules/ingest-geoip/licenses/geoip2-3.0.1.jar.sha1 @@ -0,0 +1 @@ +8a814ae92a1d8c35f82d0ff76d86927c191b7916 \ No newline at end of file diff --git a/modules/ingest-geoip/src/main/java/org/opensearch/ingest/geoip/GeoIpProcessor.java b/modules/ingest-geoip/src/main/java/org/opensearch/ingest/geoip/GeoIpProcessor.java index 384ae6f14dc4d..030f75bf48e18 100644 --- a/modules/ingest-geoip/src/main/java/org/opensearch/ingest/geoip/GeoIpProcessor.java +++ b/modules/ingest-geoip/src/main/java/org/opensearch/ingest/geoip/GeoIpProcessor.java @@ -364,7 +364,7 @@ private Map retrieveAsnGeoData(InetAddress ipAddress) { }) ); - Integer asn = response.getAutonomousSystemNumber(); + Long asn = response.getAutonomousSystemNumber(); String organization_name = response.getAutonomousSystemOrganization(); Network network = response.getNetwork(); diff --git a/modules/ingest-geoip/src/test/java/org/opensearch/ingest/geoip/GeoIpProcessorTests.java b/modules/ingest-geoip/src/test/java/org/opensearch/ingest/geoip/GeoIpProcessorTests.java index f06802af8b571..34c80fec520aa 100644 --- a/modules/ingest-geoip/src/test/java/org/opensearch/ingest/geoip/GeoIpProcessorTests.java +++ b/modules/ingest-geoip/src/test/java/org/opensearch/ingest/geoip/GeoIpProcessorTests.java @@ -308,7 +308,7 @@ public void testAsn() throws Exception { Map geoData = (Map) ingestDocument.getSourceAndMetadata().get("target_field"); assertThat(geoData.size(), equalTo(4)); assertThat(geoData.get("ip"), equalTo(ip)); - assertThat(geoData.get("asn"), equalTo(1136)); + assertThat(geoData.get("asn"), equalTo(1136L)); assertThat(geoData.get("organization_name"), equalTo("KPN B.V.")); assertThat(geoData.get("network"), equalTo("82.168.0.0/14")); } From 2458c7a0e29d7bb90193f28701a8abe01775546a Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 6 Apr 2022 16:48:59 -0700 Subject: [PATCH 042/514] Update azure-storage-blob to 12.15.0: fix test flakiness (#2795) (#2798) Signed-off-by: Andriy Redko (cherry picked from commit 0244b2a2df1816cd7bdcca85bd079c7e3e580155) --- .../repositories/azure/AzureBlobContainerRetriesTests.java | 5 ++--- .../src/main/java/fixture/azure/AzureHttpHandler.java | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/repository-azure/src/test/java/org/opensearch/repositories/azure/AzureBlobContainerRetriesTests.java b/plugins/repository-azure/src/test/java/org/opensearch/repositories/azure/AzureBlobContainerRetriesTests.java index c973cb325b658..e8417f9ceaf2c 100644 --- a/plugins/repository-azure/src/test/java/org/opensearch/repositories/azure/AzureBlobContainerRetriesTests.java +++ b/plugins/repository-azure/src/test/java/org/opensearch/repositories/azure/AzureBlobContainerRetriesTests.java @@ -231,8 +231,7 @@ public void testReadBlobWithRetries() throws Exception { exchange.getResponseHeaders().add("Content-Type", "application/octet-stream"); exchange.getResponseHeaders().add("Content-Length", String.valueOf(length)); exchange.getResponseHeaders().add("x-ms-blob-type", "blockblob"); - exchange.getResponseHeaders() - .add("Content-Range", String.format("bytes %d-%d/%d", rangeStart, bytes.length, bytes.length)); + exchange.getResponseHeaders().add("Content-Range", "bytes " + rangeStart + "-" + bytes.length + "/" + bytes.length); exchange.sendResponseHeaders(RestStatus.OK.getStatus(), length); exchange.getResponseBody().write(bytes, rangeStart, length); return; @@ -282,7 +281,7 @@ public void testReadRangeBlobWithRetries() throws Exception { exchange.getResponseHeaders().add("Content-Type", "application/octet-stream"); exchange.getResponseHeaders().add("Content-Length", String.valueOf(length)); exchange.getResponseHeaders() - .add("Content-Range", String.format("bytes %d-%d/%d", rangeStart, rangeEnd.get(), bytes.length)); + .add("Content-Range", "bytes " + rangeStart + "-" + rangeEnd.get() + "/" + bytes.length); exchange.getResponseHeaders().add("x-ms-blob-type", "blockblob"); exchange.sendResponseHeaders(RestStatus.OK.getStatus(), length); exchange.getResponseBody().write(bytes, rangeStart, length); diff --git a/test/fixtures/azure-fixture/src/main/java/fixture/azure/AzureHttpHandler.java b/test/fixtures/azure-fixture/src/main/java/fixture/azure/AzureHttpHandler.java index 8389bd839d165..4879425b7bcd6 100644 --- a/test/fixtures/azure-fixture/src/main/java/fixture/azure/AzureHttpHandler.java +++ b/test/fixtures/azure-fixture/src/main/java/fixture/azure/AzureHttpHandler.java @@ -157,7 +157,9 @@ public void handle(final HttpExchange exchange) throws IOException { exchange.getResponseHeaders().add("Content-Length", String.valueOf(length)); exchange.getResponseHeaders().add("x-ms-blob-type", "blockblob"); exchange.getResponseHeaders().add("x-ms-request-server-encrypted", "false"); - exchange.getResponseHeaders().add("Content-Range", String.format("bytes %d-%d/%d", start, Math.min(end, length), length)); + exchange.getResponseHeaders() + .add("Content-Range", "bytes " + start + "-" + Math.min(end, length) + "/" + blob.length()); + exchange.sendResponseHeaders(RestStatus.OK.getStatus(), length); exchange.getResponseBody().write(blob.toBytesRef().bytes, start, length); From c89e1fcd878da3510789d60202047e0fb8c8d3dc Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 7 Apr 2022 17:21:25 -0700 Subject: [PATCH 043/514] Replace remaining 'blacklist' with 'denylist' in internal class and method names (#2784) (#2812) This is the last commit for replacing non-inclusive terminology `blacklist`. Most of the internal usages of non-inclusive terminology `blacklist/whitelist` was replaced by PR https://github.com/opensearch-project/OpenSearch/pull/2178, while there are a few remaining. - Replace `blacklist` with `denylist` in internal class and method names. Signed-off-by: Tianli Feng (cherry picked from commit 47a22bb08d09a1eada4cc4349a35f3eed45e6336) --- .../opensearch/common/inject/BindingProcessor.java | 2 +- .../opensearch/common/inject/InheritingState.java | 8 ++++---- .../org/opensearch/common/inject/InjectorImpl.java | 8 ++++---- .../java/org/opensearch/common/inject/State.java | 12 ++++++------ ...tcher.java => DenylistedPathPatternMatcher.java} | 4 ++-- .../yaml/OpenSearchClientYamlSuiteTestCase.java | 13 +++++-------- ....java => DenylistedPathPatternMatcherTests.java} | 6 +++--- 7 files changed, 25 insertions(+), 28 deletions(-) rename test/framework/src/main/java/org/opensearch/test/rest/yaml/{BlacklistedPathPatternMatcher.java => DenylistedPathPatternMatcher.java} (97%) rename test/framework/src/test/java/org/opensearch/test/rest/yaml/{BlacklistedPathPatternMatcherTests.java => DenylistedPathPatternMatcherTests.java} (93%) diff --git a/server/src/main/java/org/opensearch/common/inject/BindingProcessor.java b/server/src/main/java/org/opensearch/common/inject/BindingProcessor.java index 671123f2df767..2635ead8d7f51 100644 --- a/server/src/main/java/org/opensearch/common/inject/BindingProcessor.java +++ b/server/src/main/java/org/opensearch/common/inject/BindingProcessor.java @@ -274,7 +274,7 @@ private void putBinding(BindingImpl binding) { } // prevent the parent from creating a JIT binding for this key - injector.state.parent().blacklist(key); + injector.state.parent().denylist(key); injector.state.putBinding(key, binding); } diff --git a/server/src/main/java/org/opensearch/common/inject/InheritingState.java b/server/src/main/java/org/opensearch/common/inject/InheritingState.java index 70a2fb335cca5..a25017ab9a2c0 100644 --- a/server/src/main/java/org/opensearch/common/inject/InheritingState.java +++ b/server/src/main/java/org/opensearch/common/inject/InheritingState.java @@ -143,18 +143,18 @@ public List getTypeListenerBindings() { } @Override - public void blacklist(Key key) { - parent.blacklist(key); + public void denylist(Key key) { + parent.denylist(key); denylistedKeys.add(key); } @Override - public boolean isBlacklisted(Key key) { + public boolean isDenylisted(Key key) { return denylistedKeys.contains(key); } @Override - public void clearBlacklisted() { + public void clearDenylisted() { denylistedKeys = new WeakKeySet(); } diff --git a/server/src/main/java/org/opensearch/common/inject/InjectorImpl.java b/server/src/main/java/org/opensearch/common/inject/InjectorImpl.java index 3c888cd92b226..439ce8fbae33b 100644 --- a/server/src/main/java/org/opensearch/common/inject/InjectorImpl.java +++ b/server/src/main/java/org/opensearch/common/inject/InjectorImpl.java @@ -530,12 +530,12 @@ public T get(Errors errors, InternalContext context, Dependency dependency) t * other ancestor injectors until this injector is tried. */ private BindingImpl createJustInTimeBindingRecursive(Key key, Errors errors) throws ErrorsException { - if (state.isBlacklisted(key)) { + if (state.isDenylisted(key)) { throw errors.childBindingAlreadySet(key).toException(); } BindingImpl binding = createJustInTimeBinding(key, errors); - state.parent().blacklist(key); + state.parent().denylist(key); jitBindings.put(key, binding); return binding; } @@ -555,7 +555,7 @@ private BindingImpl createJustInTimeBindingRecursive(Key key, Errors e * if the binding cannot be created. */ BindingImpl createJustInTimeBinding(Key key, Errors errors) throws ErrorsException { - if (state.isBlacklisted(key)) { + if (state.isDenylisted(key)) { throw errors.childBindingAlreadySet(key).toException(); } @@ -805,7 +805,7 @@ public String toString() { // ES_GUICE: clear caches public void clearCache() { - state.clearBlacklisted(); + state.clearDenylisted(); constructors = new ConstructorInjectorStore(this); membersInjectorStore = new MembersInjectorStore(this, state.getTypeListenerBindings()); jitBindings = new HashMap<>(); diff --git a/server/src/main/java/org/opensearch/common/inject/State.java b/server/src/main/java/org/opensearch/common/inject/State.java index 6a69e9547d707..560824c065793 100644 --- a/server/src/main/java/org/opensearch/common/inject/State.java +++ b/server/src/main/java/org/opensearch/common/inject/State.java @@ -106,15 +106,15 @@ public List getTypeListenerBindings() { } @Override - public void blacklist(Key key) {} + public void denylist(Key key) {} @Override - public boolean isBlacklisted(Key key) { + public boolean isDenylisted(Key key) { return true; } @Override - public void clearBlacklisted() {} + public void clearDenylisted() {} @Override public void makeAllBindingsToEagerSingletons(Injector injector) {} @@ -167,13 +167,13 @@ public Object lock() { * denylist their bound keys on their parent injectors to prevent just-in-time bindings on the * parent injector that would conflict. */ - void blacklist(Key key); + void denylist(Key key); /** * Returns true if {@code key} is forbidden from being bound in this injector. This indicates that * one of this injector's descendent's has bound the key. */ - boolean isBlacklisted(Key key); + boolean isDenylisted(Key key); /** * Returns the shared lock for all injector data. This is a low-granularity, high-contention lock @@ -182,7 +182,7 @@ public Object lock() { Object lock(); // ES_GUICE: clean denylist keys - void clearBlacklisted(); + void clearDenylisted(); void makeAllBindingsToEagerSingletons(Injector injector); } diff --git a/test/framework/src/main/java/org/opensearch/test/rest/yaml/BlacklistedPathPatternMatcher.java b/test/framework/src/main/java/org/opensearch/test/rest/yaml/DenylistedPathPatternMatcher.java similarity index 97% rename from test/framework/src/main/java/org/opensearch/test/rest/yaml/BlacklistedPathPatternMatcher.java rename to test/framework/src/main/java/org/opensearch/test/rest/yaml/DenylistedPathPatternMatcher.java index 15510e368b1f5..eeaa76b6ca1b3 100644 --- a/test/framework/src/main/java/org/opensearch/test/rest/yaml/BlacklistedPathPatternMatcher.java +++ b/test/framework/src/main/java/org/opensearch/test/rest/yaml/DenylistedPathPatternMatcher.java @@ -47,7 +47,7 @@ * * Each denylist pattern is a suffix match on the path. Empty patterns are not allowed. */ -final class BlacklistedPathPatternMatcher { +final class DenylistedPathPatternMatcher { private final Pattern pattern; /** @@ -55,7 +55,7 @@ final class BlacklistedPathPatternMatcher { * * @param p The suffix pattern. Must be a non-empty string. */ - BlacklistedPathPatternMatcher(String p) { + DenylistedPathPatternMatcher(String p) { // guard against accidentally matching everything as an empty string lead to the pattern ".*" which matches everything if (p == null || p.trim().isEmpty()) { throw new IllegalArgumentException("Empty denylist patterns are not supported"); diff --git a/test/framework/src/main/java/org/opensearch/test/rest/yaml/OpenSearchClientYamlSuiteTestCase.java b/test/framework/src/main/java/org/opensearch/test/rest/yaml/OpenSearchClientYamlSuiteTestCase.java index 70e3adbefbfc3..1b19f03f46174 100644 --- a/test/framework/src/main/java/org/opensearch/test/rest/yaml/OpenSearchClientYamlSuiteTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/rest/yaml/OpenSearchClientYamlSuiteTestCase.java @@ -116,7 +116,7 @@ public abstract class OpenSearchClientYamlSuiteTestCase extends OpenSearchRestTe */ private static final String PATHS_SEPARATOR = "(? denylistPathMatchers; + private static List denylistPathMatchers; private static ClientYamlTestExecutionContext restTestExecutionContext; private static ClientYamlTestExecutionContext adminExecutionContext; private static ClientYamlTestClient clientYamlTestClient; @@ -157,11 +157,11 @@ public void initAndResetContext() throws Exception { final String[] denylist = resolvePathsProperty(REST_TESTS_DENYLIST, null); denylistPathMatchers = new ArrayList<>(); for (final String entry : denylist) { - denylistPathMatchers.add(new BlacklistedPathPatternMatcher(entry)); + denylistPathMatchers.add(new DenylistedPathPatternMatcher(entry)); } final String[] denylistAdditions = resolvePathsProperty(REST_TESTS_DENYLIST_ADDITIONS, null); for (final String entry : denylistAdditions) { - denylistPathMatchers.add(new BlacklistedPathPatternMatcher(entry)); + denylistPathMatchers.add(new DenylistedPathPatternMatcher(entry)); } } assert restTestExecutionContext != null; @@ -368,12 +368,9 @@ protected RequestOptions getCatNodesVersionMasterRequestOptions() { public void test() throws IOException { // skip test if it matches one of the denylist globs - for (BlacklistedPathPatternMatcher denylistedPathMatcher : denylistPathMatchers) { + for (DenylistedPathPatternMatcher denylistedPathMatcher : denylistPathMatchers) { String testPath = testCandidate.getSuitePath() + "/" + testCandidate.getTestSection().getName(); - assumeFalse( - "[" + testCandidate.getTestPath() + "] skipped, reason: blacklisted", - denylistedPathMatcher.isSuffixMatch(testPath) - ); + assumeFalse("[" + testCandidate.getTestPath() + "] skipped, reason: denylisted", denylistedPathMatcher.isSuffixMatch(testPath)); } // skip test if the whole suite (yaml file) is disabled diff --git a/test/framework/src/test/java/org/opensearch/test/rest/yaml/BlacklistedPathPatternMatcherTests.java b/test/framework/src/test/java/org/opensearch/test/rest/yaml/DenylistedPathPatternMatcherTests.java similarity index 93% rename from test/framework/src/test/java/org/opensearch/test/rest/yaml/BlacklistedPathPatternMatcherTests.java rename to test/framework/src/test/java/org/opensearch/test/rest/yaml/DenylistedPathPatternMatcherTests.java index 05cdec242e565..3d62f399fe271 100644 --- a/test/framework/src/test/java/org/opensearch/test/rest/yaml/BlacklistedPathPatternMatcherTests.java +++ b/test/framework/src/test/java/org/opensearch/test/rest/yaml/DenylistedPathPatternMatcherTests.java @@ -33,7 +33,7 @@ import org.opensearch.test.OpenSearchTestCase; -public class BlacklistedPathPatternMatcherTests extends OpenSearchTestCase { +public class DenylistedPathPatternMatcherTests extends OpenSearchTestCase { public void testMatchesExact() { // suffix match @@ -71,12 +71,12 @@ public void testMatchesMixedPatterns() { } private void assertMatch(String pattern, String path) { - BlacklistedPathPatternMatcher matcher = new BlacklistedPathPatternMatcher(pattern); + DenylistedPathPatternMatcher matcher = new DenylistedPathPatternMatcher(pattern); assertTrue("Pattern [" + pattern + "] should have matched path [" + path + "]", matcher.isSuffixMatch(path)); } private void assertNoMatch(String pattern, String path) { - BlacklistedPathPatternMatcher matcher = new BlacklistedPathPatternMatcher(pattern); + DenylistedPathPatternMatcher matcher = new DenylistedPathPatternMatcher(pattern); assertFalse("Pattern [" + pattern + "] should not have matched path [" + path + "]", matcher.isSuffixMatch(path)); } } From 21e3db96b515211b1197b44a3198148655245240 Mon Sep 17 00:00:00 2001 From: Kartik Date: Fri, 8 Apr 2022 10:19:06 -0700 Subject: [PATCH 044/514] [Backport] [2.x] Bugfix to guard against stack overflow errors caused by very large reg-ex input (#2817) * Bugfix to guard against stack overflow errors caused by very large reg-ex input (#2810) * Bugfix to guard against stack overflow errors caused by very large reg-ex input This change fixes a code path that did not properly impose the index-level max_regex_length limit. Therefore, it was possibly to provide ar arbitrarily large string as the include/exclude reg-ex value under search aggregations. This exposed the underlying node to crashes from a StackOverflowError, due to how the Lucene RegExp class processes strings using stack frames. Signed-off-by: Kartik Ganesh * Adding integration tests for large string RegEx Signed-off-by: Kartik Ganesh * Spotless Signed-off-by: Kartik Ganesh * Updates to the large string reg-ex check (#2814) * Updates to the large string reg-ex check Removed the null-case for IndexSettings since this only occurs in tests. The tests now use a dummy Index Setting. This change also fixes a bug with the base case handling of max regex length in the check. Signed-off-by: Kartik Ganesh --- .../AggregationsIntegrationIT.java | 60 +++++++++++++ .../bucket/terms/IncludeExclude.java | 85 +++++++++---------- .../terms/RareTermsAggregatorFactory.java | 6 +- .../SignificantTermsAggregatorFactory.java | 13 ++- .../SignificantTextAggregatorFactory.java | 6 +- .../bucket/terms/TermsAggregatorFactory.java | 11 ++- .../aggregations/bucket/RareTermsTests.java | 7 +- .../bucket/SignificantTermsTests.java | 7 +- .../aggregations/bucket/TermsTests.java | 7 +- .../terms/BinaryTermsAggregatorTests.java | 3 +- .../terms/NumericTermsAggregatorTests.java | 3 +- .../support/IncludeExcludeTests.java | 26 ++++-- 12 files changed, 161 insertions(+), 73 deletions(-) diff --git a/server/src/internalClusterTest/java/org/opensearch/search/aggregations/AggregationsIntegrationIT.java b/server/src/internalClusterTest/java/org/opensearch/search/aggregations/AggregationsIntegrationIT.java index 6778765599fe9..b73b7722f9728 100644 --- a/server/src/internalClusterTest/java/org/opensearch/search/aggregations/AggregationsIntegrationIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/search/aggregations/AggregationsIntegrationIT.java @@ -32,10 +32,18 @@ package org.opensearch.search.aggregations; +import org.opensearch.OpenSearchException; import org.opensearch.action.index.IndexRequestBuilder; +import org.opensearch.action.search.SearchPhaseExecutionException; import org.opensearch.action.search.SearchResponse; import org.opensearch.common.unit.TimeValue; +import org.opensearch.search.aggregations.bucket.terms.IncludeExclude; +import org.opensearch.search.aggregations.bucket.terms.RareTermsAggregationBuilder; +import org.opensearch.search.aggregations.bucket.terms.SignificantTermsAggregationBuilder; +import org.opensearch.search.aggregations.bucket.terms.SignificantTermsAggregatorFactory; import org.opensearch.search.aggregations.bucket.terms.Terms; +import org.opensearch.search.aggregations.bucket.terms.TermsAggregationBuilder; +import org.opensearch.search.aggregations.bucket.terms.TermsAggregatorFactory; import org.opensearch.test.OpenSearchIntegTestCase; import java.util.ArrayList; @@ -50,6 +58,11 @@ public class AggregationsIntegrationIT extends OpenSearchIntegTestCase { static int numDocs; + private static final String LARGE_STRING = "a".repeat(2000); + private static final String LARGE_STRING_EXCEPTION_MESSAGE = "The length of regex [" + + LARGE_STRING.length() + + "] used in the request has exceeded the allowed maximum"; + @Override public void setupSuiteScopeCluster() throws Exception { assertAcked(prepareCreate("index").setMapping("f", "type=keyword").get()); @@ -85,4 +98,51 @@ public void testScroll() { assertEquals(numDocs, total); } + public void testLargeRegExTermsAggregation() { + for (TermsAggregatorFactory.ExecutionMode executionMode : TermsAggregatorFactory.ExecutionMode.values()) { + TermsAggregationBuilder termsAggregation = terms("my_terms").field("f") + .includeExclude(getLargeStringInclude()) + .executionHint(executionMode.toString()); + runLargeStringAggregationTest(termsAggregation); + } + } + + public void testLargeRegExSignificantTermsAggregation() { + for (SignificantTermsAggregatorFactory.ExecutionMode executionMode : SignificantTermsAggregatorFactory.ExecutionMode.values()) { + SignificantTermsAggregationBuilder significantTerms = new SignificantTermsAggregationBuilder("my_terms").field("f") + .includeExclude(getLargeStringInclude()) + .executionHint(executionMode.toString()); + runLargeStringAggregationTest(significantTerms); + } + } + + public void testLargeRegExRareTermsAggregation() { + // currently this only supports "map" as an execution hint + RareTermsAggregationBuilder rareTerms = new RareTermsAggregationBuilder("my_terms").field("f") + .includeExclude(getLargeStringInclude()) + .maxDocCount(2); + runLargeStringAggregationTest(rareTerms); + } + + private IncludeExclude getLargeStringInclude() { + return new IncludeExclude(LARGE_STRING, null); + } + + private void runLargeStringAggregationTest(AggregationBuilder aggregation) { + boolean exceptionThrown = false; + IncludeExclude include = new IncludeExclude(LARGE_STRING, null); + try { + client().prepareSearch("index").addAggregation(aggregation).get(); + } catch (SearchPhaseExecutionException ex) { + exceptionThrown = true; + Throwable nestedException = ex.getCause(); + assertNotNull(nestedException); + assertTrue(nestedException instanceof OpenSearchException); + assertNotNull(nestedException.getCause()); + assertTrue(nestedException.getCause() instanceof IllegalArgumentException); + String actualExceptionMessage = nestedException.getCause().getMessage(); + assertTrue(actualExceptionMessage.startsWith(LARGE_STRING_EXCEPTION_MESSAGE)); + } + assertTrue("Exception should have been thrown", exceptionThrown); + } } diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/IncludeExclude.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/IncludeExclude.java index e632a13b95fb7..71320909ca5d2 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/IncludeExclude.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/IncludeExclude.java @@ -55,6 +55,7 @@ import org.opensearch.common.xcontent.ToXContentFragment; import org.opensearch.common.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.index.IndexSettings; import org.opensearch.search.DocValueFormat; import java.io.IOException; @@ -337,19 +338,16 @@ public LongBitSet acceptedGlobalOrdinals(SortedSetDocValues globalOrdinals) thro } - private final RegExp include, exclude; + private final String include, exclude; private final SortedSet includeValues, excludeValues; private final int incZeroBasedPartition; private final int incNumPartitions; /** - * @param include The regular expression pattern for the terms to be included - * @param exclude The regular expression pattern for the terms to be excluded + * @param include The string or regular expression pattern for the terms to be included + * @param exclude The string or regular expression pattern for the terms to be excluded */ - public IncludeExclude(RegExp include, RegExp exclude) { - if (include == null && exclude == null) { - throw new IllegalArgumentException(); - } + public IncludeExclude(String include, String exclude) { this.include = include; this.exclude = exclude; this.includeValues = null; @@ -358,10 +356,6 @@ public IncludeExclude(RegExp include, RegExp exclude) { this.incNumPartitions = 0; } - public IncludeExclude(String include, String exclude) { - this(include == null ? null : new RegExp(include), exclude == null ? null : new RegExp(exclude)); - } - /** * @param includeValues The terms to be included * @param excludeValues The terms to be excluded @@ -412,10 +406,8 @@ public IncludeExclude(StreamInput in) throws IOException { excludeValues = null; incZeroBasedPartition = 0; incNumPartitions = 0; - String includeString = in.readOptionalString(); - include = includeString == null ? null : new RegExp(includeString); - String excludeString = in.readOptionalString(); - exclude = excludeString == null ? null : new RegExp(excludeString); + include = in.readOptionalString(); + exclude = in.readOptionalString(); return; } include = null; @@ -447,8 +439,8 @@ public void writeTo(StreamOutput out) throws IOException { boolean regexBased = isRegexBased(); out.writeBoolean(regexBased); if (regexBased) { - out.writeOptionalString(include == null ? null : include.getOriginalString()); - out.writeOptionalString(exclude == null ? null : exclude.getOriginalString()); + out.writeOptionalString(include); + out.writeOptionalString(exclude); } else { boolean hasIncludes = includeValues != null; out.writeBoolean(hasIncludes); @@ -584,26 +576,46 @@ public boolean isPartitionBased() { return incNumPartitions > 0; } - private Automaton toAutomaton() { - Automaton a = null; + private Automaton toAutomaton(IndexSettings indexSettings) { + Automaton a; if (include != null) { - a = include.toAutomaton(); + validateRegExpStringLength(include, indexSettings); + a = new RegExp(include).toAutomaton(); } else if (includeValues != null) { a = Automata.makeStringUnion(includeValues); } else { a = Automata.makeAnyString(); } if (exclude != null) { - a = Operations.minus(a, exclude.toAutomaton(), Operations.DEFAULT_DETERMINIZE_WORK_LIMIT); + validateRegExpStringLength(exclude, indexSettings); + Automaton excludeAutomaton = new RegExp(exclude).toAutomaton(); + a = Operations.minus(a, excludeAutomaton, Operations.DEFAULT_DETERMINIZE_WORK_LIMIT); } else if (excludeValues != null) { a = Operations.minus(a, Automata.makeStringUnion(excludeValues), Operations.DEFAULT_DETERMINIZE_WORK_LIMIT); } return a; } - public StringFilter convertToStringFilter(DocValueFormat format) { + private static void validateRegExpStringLength(String source, IndexSettings indexSettings) { + int maxRegexLength = indexSettings.getMaxRegexLength(); + if (maxRegexLength > 0 && source.length() > maxRegexLength) { + throw new IllegalArgumentException( + "The length of regex [" + + source.length() + + "] used in the request has exceeded " + + "the allowed maximum of [" + + maxRegexLength + + "]. " + + "This maximum can be set by changing the [" + + IndexSettings.MAX_REGEX_LENGTH_SETTING.getKey() + + "] index level setting." + ); + } + } + + public StringFilter convertToStringFilter(DocValueFormat format, IndexSettings indexSettings) { if (isRegexBased()) { - return new AutomatonBackedStringFilter(toAutomaton()); + return new AutomatonBackedStringFilter(toAutomaton(indexSettings)); } if (isPartitionBased()) { return new PartitionedStringFilter(); @@ -624,10 +636,10 @@ private static SortedSet parseForDocValues(SortedSet endUser return result; } - public OrdinalsFilter convertToOrdinalsFilter(DocValueFormat format) { + public OrdinalsFilter convertToOrdinalsFilter(DocValueFormat format, IndexSettings indexSettings) { if (isRegexBased()) { - return new AutomatonBackedOrdinalsFilter(toAutomaton()); + return new AutomatonBackedOrdinalsFilter(toAutomaton(indexSettings)); } if (isPartitionBased()) { return new PartitionedOrdinalsFilter(); @@ -684,7 +696,7 @@ public LongFilter convertToDoubleFilter() { @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { if (include != null) { - builder.field(INCLUDE_FIELD.getPreferredName(), include.getOriginalString()); + builder.field(INCLUDE_FIELD.getPreferredName(), include); } else if (includeValues != null) { builder.startArray(INCLUDE_FIELD.getPreferredName()); for (BytesRef value : includeValues) { @@ -698,7 +710,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.endObject(); } if (exclude != null) { - builder.field(EXCLUDE_FIELD.getPreferredName(), exclude.getOriginalString()); + builder.field(EXCLUDE_FIELD.getPreferredName(), exclude); } else if (excludeValues != null) { builder.startArray(EXCLUDE_FIELD.getPreferredName()); for (BytesRef value : excludeValues) { @@ -711,14 +723,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws @Override public int hashCode() { - return Objects.hash( - include == null ? null : include.getOriginalString(), - exclude == null ? null : exclude.getOriginalString(), - includeValues, - excludeValues, - incZeroBasedPartition, - incNumPartitions - ); + return Objects.hash(include, exclude, includeValues, excludeValues, incZeroBasedPartition, incNumPartitions); } @Override @@ -730,14 +735,8 @@ public boolean equals(Object obj) { return false; } IncludeExclude other = (IncludeExclude) obj; - return Objects.equals( - include == null ? null : include.getOriginalString(), - other.include == null ? null : other.include.getOriginalString() - ) - && Objects.equals( - exclude == null ? null : exclude.getOriginalString(), - other.exclude == null ? null : other.exclude.getOriginalString() - ) + return Objects.equals(include, other.include) + && Objects.equals(exclude, other.exclude) && Objects.equals(includeValues, other.includeValues) && Objects.equals(excludeValues, other.excludeValues) && Objects.equals(incZeroBasedPartition, other.incZeroBasedPartition) diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTermsAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTermsAggregatorFactory.java index 0e03f87b070e1..c0a5c77a98170 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTermsAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTermsAggregatorFactory.java @@ -34,6 +34,7 @@ import org.opensearch.common.ParseField; import org.opensearch.common.logging.DeprecationLogger; +import org.opensearch.index.IndexSettings; import org.opensearch.index.query.QueryShardContext; import org.opensearch.search.DocValueFormat; import org.opensearch.search.aggregations.Aggregator; @@ -250,7 +251,10 @@ Aggregator create( double precision, CardinalityUpperBound cardinality ) throws IOException { - final IncludeExclude.StringFilter filter = includeExclude == null ? null : includeExclude.convertToStringFilter(format); + IndexSettings indexSettings = context.getQueryShardContext().getIndexSettings(); + final IncludeExclude.StringFilter filter = includeExclude == null + ? null + : includeExclude.convertToStringFilter(format, indexSettings); return new StringRareTermsAggregator( name, factories, diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTermsAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTermsAggregatorFactory.java index db6106d3ce9bc..4b93121ae06ef 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTermsAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTermsAggregatorFactory.java @@ -34,6 +34,7 @@ import org.opensearch.common.ParseField; import org.opensearch.common.logging.DeprecationLogger; +import org.opensearch.index.IndexSettings; import org.opensearch.index.query.QueryBuilder; import org.opensearch.index.query.QueryShardContext; import org.opensearch.search.DocValueFormat; @@ -325,8 +326,10 @@ Aggregator create( CardinalityUpperBound cardinality, Map metadata ) throws IOException { - - final IncludeExclude.StringFilter filter = includeExclude == null ? null : includeExclude.convertToStringFilter(format); + IndexSettings indexSettings = aggregationContext.getQueryShardContext().getIndexSettings(); + final IncludeExclude.StringFilter filter = includeExclude == null + ? null + : includeExclude.convertToStringFilter(format, indexSettings); return new MapStringTermsAggregator( name, factories, @@ -364,8 +367,10 @@ Aggregator create( CardinalityUpperBound cardinality, Map metadata ) throws IOException { - - final IncludeExclude.OrdinalsFilter filter = includeExclude == null ? null : includeExclude.convertToOrdinalsFilter(format); + IndexSettings indexSettings = aggregationContext.getQueryShardContext().getIndexSettings(); + final IncludeExclude.OrdinalsFilter filter = includeExclude == null + ? null + : includeExclude.convertToOrdinalsFilter(format, indexSettings); boolean remapGlobalOrd = true; if (cardinality == CardinalityUpperBound.ONE && factories == AggregatorFactories.EMPTY && includeExclude == null) { /* diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTextAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTextAggregatorFactory.java index 85b4282e4c55b..992035f1fbe97 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTextAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTextAggregatorFactory.java @@ -44,6 +44,7 @@ import org.opensearch.common.util.BigArrays; import org.opensearch.common.util.BytesRefHash; import org.opensearch.common.util.ObjectArray; +import org.opensearch.index.IndexSettings; import org.opensearch.index.mapper.MappedFieldType; import org.opensearch.index.query.QueryBuilder; import org.opensearch.index.query.QueryShardContext; @@ -137,7 +138,10 @@ protected Aggregator createInternal( // TODO - need to check with mapping that this is indeed a text field.... - IncludeExclude.StringFilter incExcFilter = includeExclude == null ? null : includeExclude.convertToStringFilter(DocValueFormat.RAW); + IndexSettings indexSettings = searchContext.getQueryShardContext().getIndexSettings(); + IncludeExclude.StringFilter incExcFilter = includeExclude == null + ? null + : includeExclude.convertToStringFilter(DocValueFormat.RAW, indexSettings); MapStringTermsAggregator.CollectorSource collectorSource = new SignificantTextCollectorSource( queryShardContext.lookup().source(), diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregatorFactory.java index d2272d0a63042..17b412f87107c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregatorFactory.java @@ -34,6 +34,7 @@ import org.apache.lucene.search.IndexSearcher; import org.opensearch.common.ParseField; +import org.opensearch.index.IndexSettings; import org.opensearch.index.query.QueryShardContext; import org.opensearch.search.DocValueFormat; import org.opensearch.search.aggregations.AggregationExecutionException; @@ -380,7 +381,10 @@ Aggregator create( CardinalityUpperBound cardinality, Map metadata ) throws IOException { - final IncludeExclude.StringFilter filter = includeExclude == null ? null : includeExclude.convertToStringFilter(format); + IndexSettings indexSettings = context.getQueryShardContext().getIndexSettings(); + final IncludeExclude.StringFilter filter = includeExclude == null + ? null + : includeExclude.convertToStringFilter(format, indexSettings); return new MapStringTermsAggregator( name, factories, @@ -458,7 +462,10 @@ Aggregator create( ); } - final IncludeExclude.OrdinalsFilter filter = includeExclude == null ? null : includeExclude.convertToOrdinalsFilter(format); + IndexSettings indexSettings = context.getQueryShardContext().getIndexSettings(); + final IncludeExclude.OrdinalsFilter filter = includeExclude == null + ? null + : includeExclude.convertToOrdinalsFilter(format, indexSettings); boolean remapGlobalOrds; if (cardinality == CardinalityUpperBound.ONE && REMAP_GLOBAL_ORDS != null) { /* diff --git a/server/src/test/java/org/opensearch/search/aggregations/bucket/RareTermsTests.java b/server/src/test/java/org/opensearch/search/aggregations/bucket/RareTermsTests.java index 799faecb5ab57..6b8655eccd74d 100644 --- a/server/src/test/java/org/opensearch/search/aggregations/bucket/RareTermsTests.java +++ b/server/src/test/java/org/opensearch/search/aggregations/bucket/RareTermsTests.java @@ -33,7 +33,6 @@ package org.opensearch.search.aggregations.bucket; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.automaton.RegExp; import org.opensearch.search.aggregations.BaseAggregationTestCase; import org.opensearch.search.aggregations.bucket.terms.IncludeExclude; import org.opensearch.search.aggregations.bucket.terms.RareTermsAggregationBuilder; @@ -59,13 +58,13 @@ protected RareTermsAggregationBuilder createTestAggregatorBuilder() { IncludeExclude incExc = null; switch (randomInt(6)) { case 0: - incExc = new IncludeExclude(new RegExp("foobar"), null); + incExc = new IncludeExclude("foobar", null); break; case 1: - incExc = new IncludeExclude(null, new RegExp("foobaz")); + incExc = new IncludeExclude(null, "foobaz"); break; case 2: - incExc = new IncludeExclude(new RegExp("foobar"), new RegExp("foobaz")); + incExc = new IncludeExclude("foobar", "foobaz"); break; case 3: SortedSet includeValues = new TreeSet<>(); diff --git a/server/src/test/java/org/opensearch/search/aggregations/bucket/SignificantTermsTests.java b/server/src/test/java/org/opensearch/search/aggregations/bucket/SignificantTermsTests.java index 3001f8ede7f4d..6312d6c175866 100644 --- a/server/src/test/java/org/opensearch/search/aggregations/bucket/SignificantTermsTests.java +++ b/server/src/test/java/org/opensearch/search/aggregations/bucket/SignificantTermsTests.java @@ -33,7 +33,6 @@ package org.opensearch.search.aggregations.bucket; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.automaton.RegExp; import org.opensearch.index.query.QueryBuilders; import org.opensearch.search.aggregations.BaseAggregationTestCase; import org.opensearch.search.aggregations.bucket.terms.IncludeExclude; @@ -160,13 +159,13 @@ static IncludeExclude getIncludeExclude() { IncludeExclude incExc = null; switch (randomInt(5)) { case 0: - incExc = new IncludeExclude(new RegExp("foobar"), null); + incExc = new IncludeExclude("foobar", null); break; case 1: - incExc = new IncludeExclude(null, new RegExp("foobaz")); + incExc = new IncludeExclude(null, "foobaz"); break; case 2: - incExc = new IncludeExclude(new RegExp("foobar"), new RegExp("foobaz")); + incExc = new IncludeExclude("foobar", "foobaz"); break; case 3: SortedSet includeValues = new TreeSet<>(); diff --git a/server/src/test/java/org/opensearch/search/aggregations/bucket/TermsTests.java b/server/src/test/java/org/opensearch/search/aggregations/bucket/TermsTests.java index eb4f33c6f8e19..04e7fad2105ec 100644 --- a/server/src/test/java/org/opensearch/search/aggregations/bucket/TermsTests.java +++ b/server/src/test/java/org/opensearch/search/aggregations/bucket/TermsTests.java @@ -33,7 +33,6 @@ package org.opensearch.search.aggregations.bucket; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.automaton.RegExp; import org.opensearch.search.aggregations.Aggregator.SubAggCollectionMode; import org.opensearch.search.aggregations.BaseAggregationTestCase; import org.opensearch.search.aggregations.BucketOrder; @@ -118,13 +117,13 @@ protected TermsAggregationBuilder createTestAggregatorBuilder() { IncludeExclude incExc = null; switch (randomInt(6)) { case 0: - incExc = new IncludeExclude(new RegExp("foobar"), null); + incExc = new IncludeExclude("foobar", null); break; case 1: - incExc = new IncludeExclude(null, new RegExp("foobaz")); + incExc = new IncludeExclude(null, "foobaz"); break; case 2: - incExc = new IncludeExclude(new RegExp("foobar"), new RegExp("foobaz")); + incExc = new IncludeExclude("foobar", "foobaz"); break; case 3: SortedSet includeValues = new TreeSet<>(); diff --git a/server/src/test/java/org/opensearch/search/aggregations/bucket/terms/BinaryTermsAggregatorTests.java b/server/src/test/java/org/opensearch/search/aggregations/bucket/terms/BinaryTermsAggregatorTests.java index 7703afa88d93c..34cc29d40a9fd 100644 --- a/server/src/test/java/org/opensearch/search/aggregations/bucket/terms/BinaryTermsAggregatorTests.java +++ b/server/src/test/java/org/opensearch/search/aggregations/bucket/terms/BinaryTermsAggregatorTests.java @@ -41,7 +41,6 @@ import org.apache.lucene.search.Query; import org.apache.lucene.store.Directory; import org.apache.lucene.util.BytesRef; -import org.apache.lucene.util.automaton.RegExp; import org.opensearch.common.Numbers; import org.opensearch.index.mapper.BinaryFieldMapper; import org.opensearch.index.mapper.MappedFieldType; @@ -97,7 +96,7 @@ public void testMatchAllDocs() throws IOException { } public void testBadIncludeExclude() throws IOException { - IncludeExclude includeExclude = new IncludeExclude(new RegExp("foo"), null); + IncludeExclude includeExclude = new IncludeExclude("foo", null); // Make sure the include/exclude fails regardless of how the user tries to type hint the agg AggregationExecutionException e = expectThrows( diff --git a/server/src/test/java/org/opensearch/search/aggregations/bucket/terms/NumericTermsAggregatorTests.java b/server/src/test/java/org/opensearch/search/aggregations/bucket/terms/NumericTermsAggregatorTests.java index 13e41d5a2e543..846f71b12dab0 100644 --- a/server/src/test/java/org/opensearch/search/aggregations/bucket/terms/NumericTermsAggregatorTests.java +++ b/server/src/test/java/org/opensearch/search/aggregations/bucket/terms/NumericTermsAggregatorTests.java @@ -42,7 +42,6 @@ import org.apache.lucene.search.MatchNoDocsQuery; import org.apache.lucene.search.Query; import org.apache.lucene.store.Directory; -import org.apache.lucene.util.automaton.RegExp; import org.opensearch.index.mapper.MappedFieldType; import org.opensearch.index.mapper.NumberFieldMapper; import org.opensearch.search.aggregations.AggregationExecutionException; @@ -116,7 +115,7 @@ public void testMatchAllDocs() throws IOException { } public void testBadIncludeExclude() throws IOException { - IncludeExclude includeExclude = new IncludeExclude(new RegExp("foo"), null); + IncludeExclude includeExclude = new IncludeExclude("foo", null); // Numerics don't support any regex include/exclude, so should fail no matter what we do diff --git a/server/src/test/java/org/opensearch/search/aggregations/support/IncludeExcludeTests.java b/server/src/test/java/org/opensearch/search/aggregations/support/IncludeExcludeTests.java index d84812557ab18..d104fc6783dc5 100644 --- a/server/src/test/java/org/opensearch/search/aggregations/support/IncludeExcludeTests.java +++ b/server/src/test/java/org/opensearch/search/aggregations/support/IncludeExcludeTests.java @@ -36,12 +36,16 @@ import org.apache.lucene.index.SortedSetDocValues; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.LongBitSet; +import org.opensearch.Version; +import org.opensearch.cluster.metadata.IndexMetadata; import org.opensearch.common.ParseField; +import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.ToXContent; import org.opensearch.common.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentParser; import org.opensearch.common.xcontent.XContentType; +import org.opensearch.index.IndexSettings; import org.opensearch.index.fielddata.AbstractSortedSetDocValues; import org.opensearch.search.DocValueFormat; import org.opensearch.search.aggregations.bucket.terms.IncludeExclude; @@ -53,14 +57,24 @@ import java.util.TreeSet; public class IncludeExcludeTests extends OpenSearchTestCase { + + private final IndexSettings dummyIndexSettings = new IndexSettings( + IndexMetadata.builder("index") + .settings(Settings.builder().put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT)) + .numberOfShards(1) + .numberOfReplicas(0) + .build(), + Settings.EMPTY + ); + public void testEmptyTermsWithOrds() throws IOException { IncludeExclude inexcl = new IncludeExclude(new TreeSet<>(Collections.singleton(new BytesRef("foo"))), null); - OrdinalsFilter filter = inexcl.convertToOrdinalsFilter(DocValueFormat.RAW); + OrdinalsFilter filter = inexcl.convertToOrdinalsFilter(DocValueFormat.RAW, dummyIndexSettings); LongBitSet acceptedOrds = filter.acceptedGlobalOrdinals(DocValues.emptySortedSet()); assertEquals(0, acceptedOrds.length()); inexcl = new IncludeExclude(null, new TreeSet<>(Collections.singleton(new BytesRef("foo")))); - filter = inexcl.convertToOrdinalsFilter(DocValueFormat.RAW); + filter = inexcl.convertToOrdinalsFilter(DocValueFormat.RAW, dummyIndexSettings); acceptedOrds = filter.acceptedGlobalOrdinals(DocValues.emptySortedSet()); assertEquals(0, acceptedOrds.length()); } @@ -99,13 +113,13 @@ public long getValueCount() { }; IncludeExclude inexcl = new IncludeExclude(new TreeSet<>(Collections.singleton(new BytesRef("foo"))), null); - OrdinalsFilter filter = inexcl.convertToOrdinalsFilter(DocValueFormat.RAW); + OrdinalsFilter filter = inexcl.convertToOrdinalsFilter(DocValueFormat.RAW, dummyIndexSettings); LongBitSet acceptedOrds = filter.acceptedGlobalOrdinals(ords); assertEquals(1, acceptedOrds.length()); assertTrue(acceptedOrds.get(0)); inexcl = new IncludeExclude(new TreeSet<>(Collections.singleton(new BytesRef("bar"))), null); - filter = inexcl.convertToOrdinalsFilter(DocValueFormat.RAW); + filter = inexcl.convertToOrdinalsFilter(DocValueFormat.RAW, dummyIndexSettings); acceptedOrds = filter.acceptedGlobalOrdinals(ords); assertEquals(1, acceptedOrds.length()); assertFalse(acceptedOrds.get(0)); @@ -114,7 +128,7 @@ public long getValueCount() { new TreeSet<>(Collections.singleton(new BytesRef("foo"))), new TreeSet<>(Collections.singleton(new BytesRef("foo"))) ); - filter = inexcl.convertToOrdinalsFilter(DocValueFormat.RAW); + filter = inexcl.convertToOrdinalsFilter(DocValueFormat.RAW, dummyIndexSettings); acceptedOrds = filter.acceptedGlobalOrdinals(ords); assertEquals(1, acceptedOrds.length()); assertFalse(acceptedOrds.get(0)); @@ -123,7 +137,7 @@ public long getValueCount() { null, // means everything included new TreeSet<>(Collections.singleton(new BytesRef("foo"))) ); - filter = inexcl.convertToOrdinalsFilter(DocValueFormat.RAW); + filter = inexcl.convertToOrdinalsFilter(DocValueFormat.RAW, dummyIndexSettings); acceptedOrds = filter.acceptedGlobalOrdinals(ords); assertEquals(1, acceptedOrds.length()); assertFalse(acceptedOrds.get(0)); From 3b5b06ae19cc7ab7e073c1f8321dec78d0c61970 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 11 Apr 2022 11:57:08 -0500 Subject: [PATCH 045/514] Bump cdi-api from 1.2 to 2.0 in /qa/wildfly (#2835) (#2840) Bumps [cdi-api](https://github.com/cdi-spec/cdi) from 1.2 to 2.0. - [Release notes](https://github.com/cdi-spec/cdi/releases) - [Commits](https://github.com/cdi-spec/cdi/compare/1.2...2.0) --- updated-dependencies: - dependency-name: javax.enterprise:cdi-api dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- qa/wildfly/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa/wildfly/build.gradle b/qa/wildfly/build.gradle index 0e1c566bd2b52..2945027eea8a1 100644 --- a/qa/wildfly/build.gradle +++ b/qa/wildfly/build.gradle @@ -39,7 +39,7 @@ apply plugin: 'opensearch.internal-distribution-download' testFixtures.useFixture() dependencies { - providedCompile 'javax.enterprise:cdi-api:1.2' + providedCompile 'javax.enterprise:cdi-api:2.0' providedCompile 'org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec:1.0.2.Final' providedCompile 'org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_2.0_spec:1.0.0.Final' api('org.jboss.resteasy:resteasy-jackson2-provider:3.0.19.Final') { From d5d00eab8d326d7878ba4d80de63a809cc8d1735 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 11 Apr 2022 11:57:45 -0500 Subject: [PATCH 046/514] Bump gradle-info-plugin from 7.1.3 to 11.3.3 in /buildSrc (#2831) (#2842) Bumps [gradle-info-plugin](https://github.com/nebula-plugins/gradle-info-plugin) from 7.1.3 to 11.3.3. - [Release notes](https://github.com/nebula-plugins/gradle-info-plugin/releases) - [Changelog](https://github.com/nebula-plugins/gradle-info-plugin/blob/main/CHANGELOG.md) - [Commits](https://github.com/nebula-plugins/gradle-info-plugin/compare/v7.1.3...v11.3.3) --- updated-dependencies: - dependency-name: com.netflix.nebula:gradle-info-plugin dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- buildSrc/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index cc7742a0d4390..1cb78fd832602 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -107,7 +107,7 @@ dependencies { api 'org.apache.ant:ant:1.10.12' api 'com.netflix.nebula:gradle-extra-configurations-plugin:7.0.0' api 'com.netflix.nebula:nebula-publishing-plugin:4.4.4' - api 'com.netflix.nebula:gradle-info-plugin:7.1.3' + api 'com.netflix.nebula:gradle-info-plugin:11.3.3' api 'org.apache.rat:apache-rat:0.13' api 'commons-io:commons-io:2.7' api "net.java.dev.jna:jna:5.10.0" From 9e9994199f30511bbdfe45eb00c4f0c003824dc7 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 11 Apr 2022 11:58:21 -0500 Subject: [PATCH 047/514] Bump asm-analysis from 9.2 to 9.3 in /test/logger-usage (#2829) (#2846) Bumps asm-analysis from 9.2 to 9.3. --- updated-dependencies: - dependency-name: org.ow2.asm:asm-analysis dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- test/logger-usage/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/logger-usage/build.gradle b/test/logger-usage/build.gradle index ecfccc9338410..3154e556a87cf 100644 --- a/test/logger-usage/build.gradle +++ b/test/logger-usage/build.gradle @@ -33,7 +33,7 @@ apply plugin: 'opensearch.java' dependencies { api 'org.ow2.asm:asm:9.2' api 'org.ow2.asm:asm-tree:9.2' - api 'org.ow2.asm:asm-analysis:9.2' + api 'org.ow2.asm:asm-analysis:9.3' api "org.apache.logging.log4j:log4j-api:${versions.log4j}" testImplementation project(":test:framework") } From 5a61baa356d890ff2e3389c1a78f09dcfcc156c0 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 11 Apr 2022 11:58:58 -0500 Subject: [PATCH 048/514] Bump protobuf-java from 3.19.3 to 3.20.0 in /plugins/repository-hdfs (#2836) (#2848) * Bump protobuf-java from 3.19.3 to 3.20.0 in /plugins/repository-hdfs Bumps [protobuf-java](https://github.com/protocolbuffers/protobuf) from 3.19.3 to 3.20.0. - [Release notes](https://github.com/protocolbuffers/protobuf/releases) - [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/generate_changelog.py) - [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.19.3...v3.20.0) --- updated-dependencies: - dependency-name: com.google.protobuf:protobuf-java dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Updating SHAs Signed-off-by: dependabot[bot] --- plugins/repository-hdfs/build.gradle | 2 +- plugins/repository-hdfs/licenses/protobuf-java-3.19.3.jar.sha1 | 1 - plugins/repository-hdfs/licenses/protobuf-java-3.20.0.jar.sha1 | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 plugins/repository-hdfs/licenses/protobuf-java-3.19.3.jar.sha1 create mode 100644 plugins/repository-hdfs/licenses/protobuf-java-3.20.0.jar.sha1 diff --git a/plugins/repository-hdfs/build.gradle b/plugins/repository-hdfs/build.gradle index d17a4060b9ab6..a028bd28cc842 100644 --- a/plugins/repository-hdfs/build.gradle +++ b/plugins/repository-hdfs/build.gradle @@ -67,7 +67,7 @@ dependencies { api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}" api 'com.google.code.gson:gson:2.9.0' runtimeOnly 'com.google.guava:guava:30.1.1-jre' - api 'com.google.protobuf:protobuf-java:3.19.3' + api 'com.google.protobuf:protobuf-java:3.20.0' api "commons-logging:commons-logging:${versions.commonslogging}" api 'commons-cli:commons-cli:1.2' api "commons-codec:commons-codec:${versions.commonscodec}" diff --git a/plugins/repository-hdfs/licenses/protobuf-java-3.19.3.jar.sha1 b/plugins/repository-hdfs/licenses/protobuf-java-3.19.3.jar.sha1 deleted file mode 100644 index 655ecd1f1c1c9..0000000000000 --- a/plugins/repository-hdfs/licenses/protobuf-java-3.19.3.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -4b57f1b1b9e281231c3fcfc039ce3021e29ff570 \ No newline at end of file diff --git a/plugins/repository-hdfs/licenses/protobuf-java-3.20.0.jar.sha1 b/plugins/repository-hdfs/licenses/protobuf-java-3.20.0.jar.sha1 new file mode 100644 index 0000000000000..c5b0169ce0dba --- /dev/null +++ b/plugins/repository-hdfs/licenses/protobuf-java-3.20.0.jar.sha1 @@ -0,0 +1 @@ +3c72ddaaab7ffafe789e4f732c1fd614eb798bf4 \ No newline at end of file From abe23c539993d7c0f56f3c0f1406ace374f09c98 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 11 Apr 2022 13:13:20 -0400 Subject: [PATCH 049/514] Bump joni from 2.1.41 to 2.1.43 in /libs/grok (#2832) (#2850) * Bump joni from 2.1.41 to 2.1.43 in /libs/grok Bumps [joni](https://github.com/jruby/joni) from 2.1.41 to 2.1.43. - [Release notes](https://github.com/jruby/joni/releases) - [Commits](https://github.com/jruby/joni/compare/joni-2.1.41...joni-2.1.43) --- updated-dependencies: - dependency-name: org.jruby.joni:joni dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Updating SHAs Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] (cherry picked from commit 725b5ca004bd075102f0d9a6a2c37cdc6c1fcab7) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- libs/grok/build.gradle | 2 +- libs/grok/licenses/joni-2.1.41.jar.sha1 | 1 - libs/grok/licenses/joni-2.1.43.jar.sha1 | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 libs/grok/licenses/joni-2.1.41.jar.sha1 create mode 100644 libs/grok/licenses/joni-2.1.43.jar.sha1 diff --git a/libs/grok/build.gradle b/libs/grok/build.gradle index ce23406721fe6..49885b57e7f70 100644 --- a/libs/grok/build.gradle +++ b/libs/grok/build.gradle @@ -29,7 +29,7 @@ */ dependencies { - api 'org.jruby.joni:joni:2.1.41' + api 'org.jruby.joni:joni:2.1.43' // joni dependencies: api 'org.jruby.jcodings:jcodings:1.0.44' diff --git a/libs/grok/licenses/joni-2.1.41.jar.sha1 b/libs/grok/licenses/joni-2.1.41.jar.sha1 deleted file mode 100644 index 4f0a0a8393dd0..0000000000000 --- a/libs/grok/licenses/joni-2.1.41.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -4a35f4eaef792073bc081b756b1f4949879cd41e \ No newline at end of file diff --git a/libs/grok/licenses/joni-2.1.43.jar.sha1 b/libs/grok/licenses/joni-2.1.43.jar.sha1 new file mode 100644 index 0000000000000..ef5dfabb2b391 --- /dev/null +++ b/libs/grok/licenses/joni-2.1.43.jar.sha1 @@ -0,0 +1 @@ +9a3bf154469d5ff1d1107755904279081a5fb618 \ No newline at end of file From 4755d0b83cae1b251f93647d688ef1684f5b8821 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 11 Apr 2022 13:14:13 -0400 Subject: [PATCH 050/514] Bump azure-core from 1.26.0 to 1.27.0 in /plugins/repository-azure (#2837) (#2844) * Bump azure-core from 1.26.0 to 1.27.0 in /plugins/repository-azure Bumps [azure-core](https://github.com/Azure/azure-sdk-for-java) from 1.26.0 to 1.27.0. - [Release notes](https://github.com/Azure/azure-sdk-for-java/releases) - [Commits](https://github.com/Azure/azure-sdk-for-java/compare/azure-core_1.26.0...azure-core_1.27.0) --- updated-dependencies: - dependency-name: com.azure:azure-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Updating SHAs Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] (cherry picked from commit c69ad3deca810f0470757e9a56180cbc574808dc) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- plugins/repository-azure/build.gradle | 2 +- plugins/repository-azure/licenses/azure-core-1.26.0.jar.sha1 | 1 - plugins/repository-azure/licenses/azure-core-1.27.0.jar.sha1 | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 plugins/repository-azure/licenses/azure-core-1.26.0.jar.sha1 create mode 100644 plugins/repository-azure/licenses/azure-core-1.27.0.jar.sha1 diff --git a/plugins/repository-azure/build.gradle b/plugins/repository-azure/build.gradle index 2cae9a97f772c..2a293be15bc0d 100644 --- a/plugins/repository-azure/build.gradle +++ b/plugins/repository-azure/build.gradle @@ -44,7 +44,7 @@ opensearchplugin { } dependencies { - api 'com.azure:azure-core:1.26.0' + api 'com.azure:azure-core:1.27.0' api 'com.azure:azure-storage-common:12.15.0' api 'com.azure:azure-core-http-netty:1.11.8' api "io.netty:netty-codec-dns:${versions.netty}" diff --git a/plugins/repository-azure/licenses/azure-core-1.26.0.jar.sha1 b/plugins/repository-azure/licenses/azure-core-1.26.0.jar.sha1 deleted file mode 100644 index 693c6a721959c..0000000000000 --- a/plugins/repository-azure/licenses/azure-core-1.26.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -461b89dcf8948a0c4a97d4f1d876f778d0cac7aa \ No newline at end of file diff --git a/plugins/repository-azure/licenses/azure-core-1.27.0.jar.sha1 b/plugins/repository-azure/licenses/azure-core-1.27.0.jar.sha1 new file mode 100644 index 0000000000000..9206b697ca648 --- /dev/null +++ b/plugins/repository-azure/licenses/azure-core-1.27.0.jar.sha1 @@ -0,0 +1 @@ +75a2db538d218e2bd3c2cbdf04c955b8f6db6626 \ No newline at end of file From e31ee8c8cadc2528be20032db703def58d346d20 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 11 Apr 2022 13:15:18 -0400 Subject: [PATCH 051/514] Bump protobuf-java-util from 3.19.3 to 3.20.0 in /plugins/repository-gcs (#2834) (#2854) * Bump protobuf-java-util from 3.19.3 to 3.20.0 in /plugins/repository-gcs Bumps [protobuf-java-util](https://github.com/protocolbuffers/protobuf) from 3.19.3 to 3.20.0. - [Release notes](https://github.com/protocolbuffers/protobuf/releases) - [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/generate_changelog.py) - [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.19.3...v3.20.0) --- updated-dependencies: - dependency-name: com.google.protobuf:protobuf-java-util dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Updating SHAs Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] (cherry picked from commit 7dd171d48ae0d416a745f92ce8fe732ef0cbcc02) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- plugins/repository-gcs/build.gradle | 2 +- .../repository-gcs/licenses/protobuf-java-util-3.19.3.jar.sha1 | 1 - .../repository-gcs/licenses/protobuf-java-util-3.20.0.jar.sha1 | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 plugins/repository-gcs/licenses/protobuf-java-util-3.19.3.jar.sha1 create mode 100644 plugins/repository-gcs/licenses/protobuf-java-util-3.20.0.jar.sha1 diff --git a/plugins/repository-gcs/build.gradle b/plugins/repository-gcs/build.gradle index 6e577d058ff67..0e1ed06879f91 100644 --- a/plugins/repository-gcs/build.gradle +++ b/plugins/repository-gcs/build.gradle @@ -61,7 +61,7 @@ dependencies { api 'com.google.api:api-common:1.8.1' api 'com.google.api:gax:1.54.0' api 'org.threeten:threetenbp:1.4.4' - api 'com.google.protobuf:protobuf-java-util:3.19.3' + api 'com.google.protobuf:protobuf-java-util:3.20.0' api 'com.google.protobuf:protobuf-java:3.19.3' api 'com.google.code.gson:gson:2.9.0' api 'com.google.api.grpc:proto-google-common-protos:2.8.0' diff --git a/plugins/repository-gcs/licenses/protobuf-java-util-3.19.3.jar.sha1 b/plugins/repository-gcs/licenses/protobuf-java-util-3.19.3.jar.sha1 deleted file mode 100644 index 9ba36d444c541..0000000000000 --- a/plugins/repository-gcs/licenses/protobuf-java-util-3.19.3.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -3e6812cbbb7e6faffa7b56438740dec510e1fc1a \ No newline at end of file diff --git a/plugins/repository-gcs/licenses/protobuf-java-util-3.20.0.jar.sha1 b/plugins/repository-gcs/licenses/protobuf-java-util-3.20.0.jar.sha1 new file mode 100644 index 0000000000000..1e9d00d8d5c03 --- /dev/null +++ b/plugins/repository-gcs/licenses/protobuf-java-util-3.20.0.jar.sha1 @@ -0,0 +1 @@ +ee4496b296418283cbe7ae784984347fc4717a9a \ No newline at end of file From fa43294db5fe3db1e722655b62aea395889c070b Mon Sep 17 00:00:00 2001 From: Raphael Lopez <85206537+raphlopez@users.noreply.github.com> Date: Mon, 11 Apr 2022 13:16:35 -0400 Subject: [PATCH 052/514] Remove endpoint_suffix dependency on account key (#2485) (#2807) Signed-off-by: Raphael Lopez (cherry picked from commit 365e07c) --- .../opensearch/repositories/azure/AzureStorageSettings.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/repository-azure/src/main/java/org/opensearch/repositories/azure/AzureStorageSettings.java b/plugins/repository-azure/src/main/java/org/opensearch/repositories/azure/AzureStorageSettings.java index c9a031451bccd..4a9aa51334d0a 100644 --- a/plugins/repository-azure/src/main/java/org/opensearch/repositories/azure/AzureStorageSettings.java +++ b/plugins/repository-azure/src/main/java/org/opensearch/repositories/azure/AzureStorageSettings.java @@ -91,8 +91,7 @@ final class AzureStorageSettings { AZURE_CLIENT_PREFIX_KEY, "endpoint_suffix", key -> Setting.simpleString(key, Property.NodeScope), - () -> ACCOUNT_SETTING, - () -> KEY_SETTING + () -> ACCOUNT_SETTING ); // The overall operation timeout From 2a43e4ea2f759605ca1f820c7cdfa44cb82f3690 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 11 Apr 2022 14:52:46 -0400 Subject: [PATCH 053/514] Bump google-oauth-client from 1.33.1 to 1.33.2 in /plugins/discovery-gce (#2828) (#2852) * Bump google-oauth-client from 1.33.1 to 1.33.2 in /plugins/discovery-gce Bumps [google-oauth-client](https://github.com/googleapis/google-oauth-java-client) from 1.33.1 to 1.33.2. - [Release notes](https://github.com/googleapis/google-oauth-java-client/releases) - [Changelog](https://github.com/googleapis/google-oauth-java-client/blob/main/CHANGELOG.md) - [Commits](https://github.com/googleapis/google-oauth-java-client/compare/v1.33.1...v1.33.2) --- updated-dependencies: - dependency-name: com.google.oauth-client:google-oauth-client dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Updating SHAs Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] (cherry picked from commit d308795bf0e62d39c45419c4c3e3a9f98dc4eaec) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- plugins/discovery-gce/build.gradle | 2 +- .../discovery-gce/licenses/google-oauth-client-1.33.1.jar.sha1 | 1 - .../discovery-gce/licenses/google-oauth-client-1.33.2.jar.sha1 | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 plugins/discovery-gce/licenses/google-oauth-client-1.33.1.jar.sha1 create mode 100644 plugins/discovery-gce/licenses/google-oauth-client-1.33.2.jar.sha1 diff --git a/plugins/discovery-gce/build.gradle b/plugins/discovery-gce/build.gradle index 2396b228d77a0..eb695f84b2bd0 100644 --- a/plugins/discovery-gce/build.gradle +++ b/plugins/discovery-gce/build.gradle @@ -24,7 +24,7 @@ versions << [ dependencies { api "com.google.apis:google-api-services-compute:v1-rev160-${versions.google}" api "com.google.api-client:google-api-client:${versions.google}" - api "com.google.oauth-client:google-oauth-client:1.33.1" + api "com.google.oauth-client:google-oauth-client:1.33.2" api "com.google.http-client:google-http-client:${versions.google}" api "com.google.http-client:google-http-client-jackson2:${versions.google}" api 'com.google.code.findbugs:jsr305:3.0.2' diff --git a/plugins/discovery-gce/licenses/google-oauth-client-1.33.1.jar.sha1 b/plugins/discovery-gce/licenses/google-oauth-client-1.33.1.jar.sha1 deleted file mode 100644 index 3897a85310ec6..0000000000000 --- a/plugins/discovery-gce/licenses/google-oauth-client-1.33.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -0a431f1a677c5f89507591ab47a7ccdb0b18b6f7 \ No newline at end of file diff --git a/plugins/discovery-gce/licenses/google-oauth-client-1.33.2.jar.sha1 b/plugins/discovery-gce/licenses/google-oauth-client-1.33.2.jar.sha1 new file mode 100644 index 0000000000000..289e8e8261fd3 --- /dev/null +++ b/plugins/discovery-gce/licenses/google-oauth-client-1.33.2.jar.sha1 @@ -0,0 +1 @@ +2810fb515fe110295dc6867fc9f70c401b66daf3 \ No newline at end of file From b4a3517a929ed0c0272125463de105abf0a134c5 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 11 Apr 2022 17:26:29 -0700 Subject: [PATCH 054/514] Change deprecation message for REST API parameter 'master_timeout' to specify the version of removal (#2863) (#2864) Signed-off-by: Tianli Feng (cherry picked from commit ba8657aca5d8918c5393308d248a711a75bd4905) --- .../rest-api-spec/test/indices.clone/10_basic.yml | 4 ++-- .../test/indices.clone/20_source_mapping.yml | 2 +- .../rest-api-spec/test/indices.clone/30_copy_settings.yml | 2 +- .../rest-api-spec/test/indices.shrink/10_basic.yml | 2 +- .../test/indices.shrink/20_source_mapping.yml | 2 +- .../test/indices.shrink/30_copy_settings.yml | 6 +++--- .../rest-api-spec/test/indices.split/10_basic.yml | 8 ++++---- .../test/indices.split/20_source_mapping.yml | 2 +- .../rest-api-spec/test/indices.split/30_copy_settings.yml | 6 +++--- .../main/java/org/opensearch/rest/BaseRestHandler.java | 2 +- .../rest/action/admin/indices/RestGetMappingAction.java | 2 +- .../org/opensearch/rest/action/cat/RestIndicesAction.java | 2 +- .../action/RenamedTimeoutRequestParameterTests.java | 2 +- 13 files changed, 21 insertions(+), 21 deletions(-) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.clone/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.clone/10_basic.yml index 6488e4960e08f..ca8342b2e91c2 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.clone/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.clone/10_basic.yml @@ -48,7 +48,7 @@ setup: # now we do the actual clone - do: allowed_warnings: - - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." + - "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead." indices.clone: index: "source" target: "target" @@ -102,7 +102,7 @@ setup: - do: catch: /illegal_argument_exception/ allowed_warnings: - - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." + - "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead." indices.clone: index: "source" target: "target" diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.clone/20_source_mapping.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.clone/20_source_mapping.yml index 1a3074d091399..21c476c76965c 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.clone/20_source_mapping.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.clone/20_source_mapping.yml @@ -52,7 +52,7 @@ # now we do the actual clone - do: allowed_warnings: - - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." + - "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead." indices.clone: index: "source" target: "target" diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.clone/30_copy_settings.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.clone/30_copy_settings.yml index 467f5266122eb..b0bd8056cb004 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.clone/30_copy_settings.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.clone/30_copy_settings.yml @@ -37,7 +37,7 @@ # now we do an actual clone and copy settings - do: allowed_warnings: - - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." + - "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead." indices.clone: index: "source" target: "copy-settings-target" diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.shrink/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.shrink/10_basic.yml index 4db7ca353334f..032f061d8a160 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.shrink/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.shrink/10_basic.yml @@ -57,7 +57,7 @@ # now we do the actual shrink - do: allowed_warnings: - - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." + - "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead." indices.shrink: index: "source" target: "target" diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.shrink/20_source_mapping.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.shrink/20_source_mapping.yml index 4ddf122d82691..8d08373208216 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.shrink/20_source_mapping.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.shrink/20_source_mapping.yml @@ -61,7 +61,7 @@ # now we do the actual shrink - do: allowed_warnings: - - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." + - "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead." indices.shrink: index: "source" target: "target" diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.shrink/30_copy_settings.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.shrink/30_copy_settings.yml index 112303a3a7298..33bcb18f8afb6 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.shrink/30_copy_settings.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.shrink/30_copy_settings.yml @@ -47,7 +47,7 @@ index.merge.scheduler.max_thread_count: 2 allowed_warnings: - "parameter [copy_settings] is deprecated and will be removed in 8.0.0" - - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." + - "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead." - do: cluster.health: @@ -66,7 +66,7 @@ # now we do a actual shrink and copy settings (by default) - do: allowed_warnings: - - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." + - "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead." indices.shrink: index: "source" target: "default-copy-settings-target" @@ -95,7 +95,7 @@ - do: catch: /illegal_argument_exception/ allowed_warnings: - - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." + - "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead." indices.shrink: index: "source" target: "explicit-no-copy-settings-target" diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.split/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.split/10_basic.yml index 01781e35b9ae9..2432f47d4dca7 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.split/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.split/10_basic.yml @@ -48,7 +48,7 @@ setup: # now we do the actual split - do: allowed_warnings: - - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." + - "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead." indices.split: index: "source" target: "target" @@ -139,7 +139,7 @@ setup: # now we do the actual split from 1 to 5 - do: allowed_warnings: - - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." + - "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead." indices.split: index: "source_one_shard" target: "target" @@ -192,7 +192,7 @@ setup: - do: catch: /illegal_argument_exception/ allowed_warnings: - - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." + - "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead." indices.split: index: "source" target: "target" @@ -208,7 +208,7 @@ setup: - do: catch: /illegal_state_exception/ allowed_warnings: - - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." + - "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead." indices.split: index: "source" target: "target" diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.split/20_source_mapping.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.split/20_source_mapping.yml index 0baae30238013..69061c6d0fbd4 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.split/20_source_mapping.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.split/20_source_mapping.yml @@ -52,7 +52,7 @@ # now we do the actual split - do: allowed_warnings: - - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." + - "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead." indices.split: index: "source" target: "target" diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.split/30_copy_settings.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.split/30_copy_settings.yml index ace49ff6dd917..5b7f8f9960774 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.split/30_copy_settings.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.split/30_copy_settings.yml @@ -49,7 +49,7 @@ index.merge.scheduler.max_thread_count: 2 allowed_warnings: - "parameter [copy_settings] is deprecated and will be removed in 8.0.0" - - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." + - "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead." - do: cluster.health: @@ -68,7 +68,7 @@ # now we do a actual shrink and copy settings (by default) - do: allowed_warnings: - - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." + - "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead." indices.split: index: "source" target: "default-copy-settings-target" @@ -97,7 +97,7 @@ - do: catch: /illegal_argument_exception/ allowed_warnings: - - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version." + - "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead." indices.split: index: "source" target: "explicit-no-copy-settings-target" diff --git a/server/src/main/java/org/opensearch/rest/BaseRestHandler.java b/server/src/main/java/org/opensearch/rest/BaseRestHandler.java index e0a62581447ac..e16e385910d98 100644 --- a/server/src/main/java/org/opensearch/rest/BaseRestHandler.java +++ b/server/src/main/java/org/opensearch/rest/BaseRestHandler.java @@ -219,7 +219,7 @@ public static void parseDeprecatedMasterTimeoutParameter( String logMsgKeyPrefix ) { final String MASTER_TIMEOUT_DEPRECATED_MESSAGE = - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version."; + "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead."; final String DUPLICATE_PARAMETER_ERROR_MESSAGE = "Please only use one of the request parameters [master_timeout, cluster_manager_timeout]."; if (request.hasParam("master_timeout")) { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetMappingAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetMappingAction.java index 62ea315fd89a0..86bf6b626c24a 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetMappingAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetMappingAction.java @@ -63,7 +63,7 @@ public class RestGetMappingAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestGetMappingAction.class); private static final String MASTER_TIMEOUT_DEPRECATED_MESSAGE = - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version."; + "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead."; private static final String DUPLICATE_PARAMETER_ERROR_MESSAGE = "Please only use one of the request parameters [master_timeout, cluster_manager_timeout]."; diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestIndicesAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestIndicesAction.java index a26b57aab0636..1b70603edf6e1 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestIndicesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestIndicesAction.java @@ -86,7 +86,7 @@ public class RestIndicesAction extends AbstractCatAction { private static final DateFormatter STRICT_DATE_TIME_FORMATTER = DateFormatter.forPattern("strict_date_time"); private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestIndicesAction.class); private static final String MASTER_TIMEOUT_DEPRECATED_MESSAGE = - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version."; + "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead."; private static final String DUPLICATE_PARAMETER_ERROR_MESSAGE = "Please only use one of the request parameters [master_timeout, cluster_manager_timeout]."; diff --git a/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java b/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java index df93d5c16d8e0..878730868a3b0 100644 --- a/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java +++ b/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java @@ -78,7 +78,7 @@ public class RenamedTimeoutRequestParameterTests extends OpenSearchTestCase { private static final String DUPLICATE_PARAMETER_ERROR_MESSAGE = "Please only use one of the request parameters [master_timeout, cluster_manager_timeout]."; private static final String MASTER_TIMEOUT_DEPRECATED_MESSAGE = - "Deprecated parameter [master_timeout] used. To promote inclusive language, please use [cluster_manager_timeout] instead. It will be unsupported in a future major version."; + "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead."; @After public void terminateThreadPool() { From 3f4b3c5d0ff979348cb4c81f6e4ae9312d12e72e Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 11 Apr 2022 20:40:40 -0700 Subject: [PATCH 055/514] Add request parameter 'cluster_manager_timeout' and deprecate 'master_timeout' - in Index Template APIs (#2678) (#2866) - Deprecate the request parameter `master_timeout` that used in Index Template APIs which have got the parameter. (The other Index APIs are addressed in PR https://github.com/opensearch-project/OpenSearch/pull/2660) - Add alternative new request parameter `cluster_manager_timeout`. - Add unit tests. Signed-off-by: Tianli Feng (cherry picked from commit ba3ed8a9cb9dc9eeee4a4b09db326cdb99cda50b) --- .../cluster.delete_component_template.json | 10 +- .../api/cluster.get_component_template.json | 10 +- .../api/cluster.put_component_template.json | 10 +- .../api/indices.delete_index_template.json | 10 +- .../api/indices.delete_template.json | 10 +- .../api/indices.get_index_template.json | 10 +- .../api/indices.get_template.json | 2 +- .../api/indices.put_index_template.json | 10 +- .../api/indices.put_template.json | 10 +- .../api/indices.simulate_index_template.json | 10 +- .../api/indices.simulate_template.json | 10 +- .../test/cluster.state/20_filtering.yml | 2 +- .../test/indices.exists_template/10_basic.yml | 4 + .../test/indices.get_template/10_basic.yml | 4 + .../RestDeleteComponentTemplateAction.java | 6 +- ...stDeleteComposableIndexTemplateAction.java | 6 +- .../RestDeleteIndexTemplateAction.java | 8 +- .../RestGetComponentTemplateAction.java | 6 +- .../RestGetComposableIndexTemplateAction.java | 6 +- .../indices/RestGetIndexTemplateAction.java | 8 +- .../RestPutComponentTemplateAction.java | 6 +- .../RestPutComposableIndexTemplateAction.java | 6 +- .../indices/RestPutIndexTemplateAction.java | 3 +- .../RestSimulateIndexTemplateAction.java | 6 +- .../indices/RestSimulateTemplateAction.java | 8 +- .../RenamedTimeoutRequestParameterTests.java | 92 +++++++++++++++++++ 26 files changed, 249 insertions(+), 24 deletions(-) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.delete_component_template.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.delete_component_template.json index 9beea52c86b37..43e14ad0e2dd8 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.delete_component_template.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.delete_component_template.json @@ -28,7 +28,15 @@ }, "master_timeout":{ "type":"time", - "description":"Specify timeout for connection to master" + "description":"Specify timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To support inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.get_component_template.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.get_component_template.json index ecf32f50c0a6c..aa4e395672ef3 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.get_component_template.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.get_component_template.json @@ -30,7 +30,15 @@ "params":{ "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To support inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "local":{ "type":"boolean", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.put_component_template.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.put_component_template.json index abc83fb15f48a..05558bc7bfc50 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.put_component_template.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cluster.put_component_template.json @@ -34,7 +34,15 @@ }, "master_timeout":{ "type":"time", - "description":"Specify timeout for connection to master" + "description":"Specify timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To support inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" } }, "body":{ diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.delete_index_template.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.delete_index_template.json index d037b03dc5277..c74771ffe4b81 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.delete_index_template.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.delete_index_template.json @@ -28,7 +28,15 @@ }, "master_timeout":{ "type":"time", - "description":"Specify timeout for connection to master" + "description":"Specify timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To support inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.delete_template.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.delete_template.json index ca484a73e99f9..74dbb1822b64a 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.delete_template.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.delete_template.json @@ -28,7 +28,15 @@ }, "master_timeout":{ "type":"time", - "description":"Specify timeout for connection to master" + "description":"Specify timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To support inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_index_template.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_index_template.json index 7ea6dd2944c79..fbd03f99d2547 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_index_template.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_index_template.json @@ -34,7 +34,15 @@ }, "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To support inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "local":{ "type":"boolean", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_template.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_template.json index 04d2f846e6ac1..52aeb17913db4 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_template.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_template.json @@ -37,7 +37,7 @@ "description":"Explicit operation timeout for connection to master node", "deprecated":{ "version":"2.0.0", - "description":"To promote inclusive language, use 'cluster_manager_timeout' instead." + "description":"To support inclusive language, use 'cluster_manager_timeout' instead." } }, "cluster_manager_timeout":{ diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_index_template.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_index_template.json index 3f758e18737e2..a2ceb259a4376 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_index_template.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_index_template.json @@ -35,7 +35,15 @@ }, "master_timeout":{ "type":"time", - "description":"Specify timeout for connection to master" + "description":"Specify timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To support inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" } }, "body":{ diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_template.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_template.json index 75a328af929ef..3b1c230178bb8 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_template.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_template.json @@ -34,7 +34,15 @@ }, "master_timeout":{ "type":"time", - "description":"Specify timeout for connection to master" + "description":"Specify timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To support inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" } }, "body":{ diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.simulate_index_template.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.simulate_index_template.json index 2b81572f0aaaf..0e42ba6028a9f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.simulate_index_template.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.simulate_index_template.json @@ -34,7 +34,15 @@ }, "master_timeout":{ "type":"time", - "description":"Specify timeout for connection to master" + "description":"Specify timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To support inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" } }, "body":{ diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.simulate_template.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.simulate_template.json index 364547dd318a2..65b555082c3b1 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.simulate_template.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.simulate_template.json @@ -40,7 +40,15 @@ }, "master_timeout":{ "type":"time", - "description":"Specify timeout for connection to master" + "description":"Specify timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To support inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" } }, "body":{ diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.state/20_filtering.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.state/20_filtering.yml index 3d20f1d0f7e52..b2c1e1e561933 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.state/20_filtering.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.state/20_filtering.yml @@ -169,7 +169,7 @@ setup: cluster.state: metric: [ master_node, version ] allowed_warnings: - - 'Deprecated value [master_node] used for parameter [metric]. To promote inclusive language, please use [cluster_manager_node] instead. It will be unsupported in a future major version.' + - 'Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead.' - match: { cluster_uuid: $cluster_uuid } - is_true: master_node diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.exists_template/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.exists_template/10_basic.yml index 67592a013e8f1..c7892f58a6f59 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.exists_template/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.exists_template/10_basic.yml @@ -6,6 +6,8 @@ setup: ignore: [404] --- "Test indices.exists_template": + - skip: + features: allowed_warnings - do: indices.exists_template: @@ -23,6 +25,8 @@ setup: number_of_replicas: 0 - do: + allowed_warnings: + - "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead." indices.exists_template: name: test master_timeout: 1m diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_template/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_template/10_basic.yml index 9becbd54a3773..32536f8f72650 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_template/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_template/10_basic.yml @@ -72,8 +72,12 @@ setup: --- "Get template with flat settings and master timeout": + - skip: + features: allowed_warnings - do: + allowed_warnings: + - "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead." indices.get_template: name: test flat_settings: true diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteComponentTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteComponentTemplateAction.java index e4f0347192dbe..05656cb250596 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteComponentTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteComponentTemplateAction.java @@ -34,6 +34,7 @@ import org.opensearch.action.admin.indices.template.delete.DeleteComponentTemplateAction; import org.opensearch.client.node.NodeClient; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; @@ -46,6 +47,8 @@ public class RestDeleteComponentTemplateAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestDeleteComponentTemplateAction.class); + @Override public List routes() { return Collections.singletonList(new Route(DELETE, "/_component_template/{name}")); @@ -60,7 +63,8 @@ public String getName() { public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { DeleteComponentTemplateAction.Request deleteReq = new DeleteComponentTemplateAction.Request(request.param("name")); - deleteReq.masterNodeTimeout(request.paramAsTime("master_timeout", deleteReq.masterNodeTimeout())); + deleteReq.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", deleteReq.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(deleteReq, request, deprecationLogger, getName()); return channel -> client.execute(DeleteComponentTemplateAction.INSTANCE, deleteReq, new RestToXContentListener<>(channel)); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteComposableIndexTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteComposableIndexTemplateAction.java index f5832b4167852..b08288593515b 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteComposableIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteComposableIndexTemplateAction.java @@ -34,6 +34,7 @@ import org.opensearch.action.admin.indices.template.delete.DeleteComposableIndexTemplateAction; import org.opensearch.client.node.NodeClient; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; @@ -46,6 +47,8 @@ public class RestDeleteComposableIndexTemplateAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestDeleteComposableIndexTemplateAction.class); + @Override public List routes() { return Collections.singletonList(new Route(DELETE, "/_index_template/{name}")); @@ -60,7 +63,8 @@ public String getName() { public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { DeleteComposableIndexTemplateAction.Request deleteReq = new DeleteComposableIndexTemplateAction.Request(request.param("name")); - deleteReq.masterNodeTimeout(request.paramAsTime("master_timeout", deleteReq.masterNodeTimeout())); + deleteReq.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", deleteReq.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(deleteReq, request, deprecationLogger, getName()); return channel -> client.execute(DeleteComposableIndexTemplateAction.INSTANCE, deleteReq, new RestToXContentListener<>(channel)); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteIndexTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteIndexTemplateAction.java index 51040082c2c47..ce49332a4abbd 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteIndexTemplateAction.java @@ -33,6 +33,7 @@ import org.opensearch.action.admin.indices.template.delete.DeleteIndexTemplateRequest; import org.opensearch.client.node.NodeClient; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; @@ -45,6 +46,8 @@ public class RestDeleteIndexTemplateAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestDeleteIndexTemplateAction.class); + @Override public List routes() { return singletonList(new Route(DELETE, "/_template/{name}")); @@ -58,7 +61,10 @@ public String getName() { @Override public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { DeleteIndexTemplateRequest deleteIndexTemplateRequest = new DeleteIndexTemplateRequest(request.param("name")); - deleteIndexTemplateRequest.masterNodeTimeout(request.paramAsTime("master_timeout", deleteIndexTemplateRequest.masterNodeTimeout())); + deleteIndexTemplateRequest.masterNodeTimeout( + request.paramAsTime("cluster_manager_timeout", deleteIndexTemplateRequest.masterNodeTimeout()) + ); + parseDeprecatedMasterTimeoutParameter(deleteIndexTemplateRequest, request, deprecationLogger, getName()); return channel -> client.admin().indices().deleteTemplate(deleteIndexTemplateRequest, new RestToXContentListener<>(channel)); } } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetComponentTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetComponentTemplateAction.java index 8a85a66eef635..e245c5a20848f 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetComponentTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetComponentTemplateAction.java @@ -34,6 +34,7 @@ import org.opensearch.action.admin.indices.template.get.GetComponentTemplateAction; import org.opensearch.client.node.NodeClient; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.settings.Settings; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; @@ -52,6 +53,8 @@ public class RestGetComponentTemplateAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestGetComponentTemplateAction.class); + @Override public List routes() { return Arrays.asList( @@ -72,7 +75,8 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC final GetComponentTemplateAction.Request getRequest = new GetComponentTemplateAction.Request(request.param("name")); getRequest.local(request.paramAsBoolean("local", getRequest.local())); - getRequest.masterNodeTimeout(request.paramAsTime("master_timeout", getRequest.masterNodeTimeout())); + getRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", getRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(getRequest, request, deprecationLogger, getName()); final boolean implicitAll = getRequest.name() == null; diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetComposableIndexTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetComposableIndexTemplateAction.java index 684198c6799f0..d860e8856571e 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetComposableIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetComposableIndexTemplateAction.java @@ -34,6 +34,7 @@ import org.opensearch.action.admin.indices.template.get.GetComposableIndexTemplateAction; import org.opensearch.client.node.NodeClient; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.settings.Settings; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; @@ -52,6 +53,8 @@ public class RestGetComposableIndexTemplateAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestGetComposableIndexTemplateAction.class); + @Override public List routes() { return Arrays.asList( @@ -71,7 +74,8 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC final GetComposableIndexTemplateAction.Request getRequest = new GetComposableIndexTemplateAction.Request(request.param("name")); getRequest.local(request.paramAsBoolean("local", getRequest.local())); - getRequest.masterNodeTimeout(request.paramAsTime("master_timeout", getRequest.masterNodeTimeout())); + getRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", getRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(getRequest, request, deprecationLogger, getName()); final boolean implicitAll = getRequest.name() == null; diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetIndexTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetIndexTemplateAction.java index 71e7ed098cf8d..cda29d2b0ad47 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetIndexTemplateAction.java @@ -36,6 +36,7 @@ import org.opensearch.action.admin.indices.template.get.GetIndexTemplatesResponse; import org.opensearch.client.node.NodeClient; import org.opensearch.common.Strings; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.settings.Settings; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; @@ -58,6 +59,8 @@ */ public class RestGetIndexTemplateAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestGetIndexTemplateAction.class); + @Override public List routes() { return unmodifiableList( @@ -76,7 +79,10 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC final GetIndexTemplatesRequest getIndexTemplatesRequest = new GetIndexTemplatesRequest(names); getIndexTemplatesRequest.local(request.paramAsBoolean("local", getIndexTemplatesRequest.local())); - getIndexTemplatesRequest.masterNodeTimeout(request.paramAsTime("master_timeout", getIndexTemplatesRequest.masterNodeTimeout())); + getIndexTemplatesRequest.masterNodeTimeout( + request.paramAsTime("cluster_manager_timeout", getIndexTemplatesRequest.masterNodeTimeout()) + ); + parseDeprecatedMasterTimeoutParameter(getIndexTemplatesRequest, request, deprecationLogger, getName()); final boolean implicitAll = getIndexTemplatesRequest.names().length == 0; diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutComponentTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutComponentTemplateAction.java index ab02eef51a072..0d956b4dd147f 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutComponentTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutComponentTemplateAction.java @@ -35,6 +35,7 @@ import org.opensearch.action.admin.indices.template.put.PutComponentTemplateAction; import org.opensearch.client.node.NodeClient; import org.opensearch.cluster.metadata.ComponentTemplate; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; @@ -48,6 +49,8 @@ public class RestPutComponentTemplateAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestPutComponentTemplateAction.class); + @Override public List routes() { return Arrays.asList(new Route(POST, "/_component_template/{name}"), new Route(PUT, "/_component_template/{name}")); @@ -62,7 +65,8 @@ public String getName() { public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { PutComponentTemplateAction.Request putRequest = new PutComponentTemplateAction.Request(request.param("name")); - putRequest.masterNodeTimeout(request.paramAsTime("master_timeout", putRequest.masterNodeTimeout())); + putRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", putRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(putRequest, request, deprecationLogger, getName()); putRequest.create(request.paramAsBoolean("create", false)); putRequest.cause(request.param("cause", "api")); putRequest.componentTemplate(ComponentTemplate.parse(request.contentParser())); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutComposableIndexTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutComposableIndexTemplateAction.java index 790aad33008b9..63352a73b281d 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutComposableIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutComposableIndexTemplateAction.java @@ -35,6 +35,7 @@ import org.opensearch.action.admin.indices.template.put.PutComposableIndexTemplateAction; import org.opensearch.client.node.NodeClient; import org.opensearch.cluster.metadata.ComposableIndexTemplate; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; @@ -48,6 +49,8 @@ public class RestPutComposableIndexTemplateAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestPutComposableIndexTemplateAction.class); + @Override public List routes() { return Arrays.asList(new Route(POST, "/_index_template/{name}"), new Route(PUT, "/_index_template/{name}")); @@ -62,7 +65,8 @@ public String getName() { public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { PutComposableIndexTemplateAction.Request putRequest = new PutComposableIndexTemplateAction.Request(request.param("name")); - putRequest.masterNodeTimeout(request.paramAsTime("master_timeout", putRequest.masterNodeTimeout())); + putRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", putRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(putRequest, request, deprecationLogger, getName()); putRequest.create(request.paramAsBoolean("create", false)); putRequest.cause(request.param("cause", "api")); putRequest.indexTemplate(ComposableIndexTemplate.parse(request.contentParser())); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutIndexTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutIndexTemplateAction.java index f17ac495b494b..42cd8e8103a18 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutIndexTemplateAction.java @@ -78,7 +78,8 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC putRequest.patterns(Arrays.asList(request.paramAsStringArray("index_patterns", Strings.EMPTY_ARRAY))); } putRequest.order(request.paramAsInt("order", putRequest.order())); - putRequest.masterNodeTimeout(request.paramAsTime("master_timeout", putRequest.masterNodeTimeout())); + putRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", putRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(putRequest, request, deprecationLogger, getName()); putRequest.create(request.paramAsBoolean("create", false)); putRequest.cause(request.param("cause", "")); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestSimulateIndexTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestSimulateIndexTemplateAction.java index 596b96c28be41..fb78b7b0a826d 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestSimulateIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestSimulateIndexTemplateAction.java @@ -37,6 +37,7 @@ import org.opensearch.action.admin.indices.template.put.PutComposableIndexTemplateAction; import org.opensearch.client.node.NodeClient; import org.opensearch.cluster.metadata.ComposableIndexTemplate; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; @@ -48,6 +49,8 @@ public class RestSimulateIndexTemplateAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestSimulateIndexTemplateAction.class); + @Override public List routes() { return org.opensearch.common.collect.List.of(new Route(POST, "/_index_template/_simulate_index/{name}")); @@ -62,8 +65,9 @@ public String getName() { public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { SimulateIndexTemplateRequest simulateIndexTemplateRequest = new SimulateIndexTemplateRequest(request.param("name")); simulateIndexTemplateRequest.masterNodeTimeout( - request.paramAsTime("master_timeout", simulateIndexTemplateRequest.masterNodeTimeout()) + request.paramAsTime("cluster_manager_timeout", simulateIndexTemplateRequest.masterNodeTimeout()) ); + parseDeprecatedMasterTimeoutParameter(simulateIndexTemplateRequest, request, deprecationLogger, getName()); if (request.hasContent()) { PutComposableIndexTemplateAction.Request indexTemplateRequest = new PutComposableIndexTemplateAction.Request( "simulating_template" diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestSimulateTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestSimulateTemplateAction.java index c3f0958f62718..58cc0c1e369d8 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestSimulateTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestSimulateTemplateAction.java @@ -36,6 +36,7 @@ import org.opensearch.action.admin.indices.template.put.PutComposableIndexTemplateAction; import org.opensearch.client.node.NodeClient; import org.opensearch.cluster.metadata.ComposableIndexTemplate; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; @@ -47,6 +48,8 @@ import static org.opensearch.rest.RestRequest.Method.POST; public class RestSimulateTemplateAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestSimulateTemplateAction.class); + @Override public List routes() { return Arrays.asList(new Route(POST, "/_index_template/_simulate"), new Route(POST, "/_index_template/_simulate/{name}")); @@ -58,7 +61,7 @@ public String getName() { } @Override - protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException { + public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException { SimulateTemplateAction.Request simulateRequest = new SimulateTemplateAction.Request(); simulateRequest.templateName(request.param("name")); if (request.hasContent()) { @@ -71,7 +74,8 @@ protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient cli simulateRequest.indexTemplateRequest(indexTemplateRequest); } - simulateRequest.masterNodeTimeout(request.paramAsTime("master_timeout", simulateRequest.masterNodeTimeout())); + simulateRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", simulateRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(simulateRequest, request, deprecationLogger, getName()); return channel -> client.execute(SimulateTemplateAction.INSTANCE, simulateRequest, new RestToXContentListener<>(channel)); } diff --git a/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java b/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java index 878730868a3b0..09c84f325739a 100644 --- a/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java +++ b/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java @@ -41,6 +41,17 @@ import org.opensearch.rest.action.admin.indices.RestResizeHandler; import org.opensearch.rest.action.admin.indices.RestRolloverIndexAction; import org.opensearch.rest.action.admin.indices.RestUpdateSettingsAction; +import org.opensearch.rest.action.admin.indices.RestDeleteComponentTemplateAction; +import org.opensearch.rest.action.admin.indices.RestDeleteComposableIndexTemplateAction; +import org.opensearch.rest.action.admin.indices.RestDeleteIndexTemplateAction; +import org.opensearch.rest.action.admin.indices.RestGetComponentTemplateAction; +import org.opensearch.rest.action.admin.indices.RestGetComposableIndexTemplateAction; +import org.opensearch.rest.action.admin.indices.RestGetIndexTemplateAction; +import org.opensearch.rest.action.admin.indices.RestPutComponentTemplateAction; +import org.opensearch.rest.action.admin.indices.RestPutComposableIndexTemplateAction; +import org.opensearch.rest.action.admin.indices.RestPutIndexTemplateAction; +import org.opensearch.rest.action.admin.indices.RestSimulateIndexTemplateAction; +import org.opensearch.rest.action.admin.indices.RestSimulateTemplateAction; import org.opensearch.rest.action.cat.RestAllocationAction; import org.opensearch.rest.action.cat.RestRepositoriesAction; import org.opensearch.rest.action.cat.RestThreadPoolAction; @@ -425,6 +436,87 @@ public void testImportDanglingIndex() { assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } + public void testDeleteComponentTemplate() { + RestDeleteComponentTemplateAction action = new RestDeleteComponentTemplateAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testDeleteComposableIndexTemplate() { + RestDeleteComposableIndexTemplateAction action = new RestDeleteComposableIndexTemplateAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testDeleteIndexTemplate() { + RestDeleteIndexTemplateAction action = new RestDeleteIndexTemplateAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testGetComponentTemplate() { + RestGetComponentTemplateAction action = new RestGetComponentTemplateAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testGetComposableIndexTemplate() { + RestGetComposableIndexTemplateAction action = new RestGetComposableIndexTemplateAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testGetIndexTemplate() { + RestGetIndexTemplateAction action = new RestGetIndexTemplateAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testPutComponentTemplate() { + RestPutComponentTemplateAction action = new RestPutComponentTemplateAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testPutComposableIndexTemplate() { + RestPutComposableIndexTemplateAction action = new RestPutComposableIndexTemplateAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testPutIndexTemplate() { + RestPutIndexTemplateAction action = new RestPutIndexTemplateAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testSimulateIndexTemplate() { + FakeRestRequest request = new FakeRestRequest(); + request.params().put("cluster_manager_timeout", randomFrom("1h", "2m")); + request.params().put("master_timeout", "3s"); + request.params().put("name", "test"); + RestSimulateIndexTemplateAction action = new RestSimulateIndexTemplateAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(request, client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testSimulateTemplate() { + RestSimulateTemplateAction action = new RestSimulateTemplateAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + private MasterNodeRequest getMasterNodeRequest() { return new MasterNodeRequest() { @Override From 8e062dca8de48fcb5eeeff7cb0efa61e0d6c691b Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 11 Apr 2022 21:37:42 -0700 Subject: [PATCH 056/514] Add request parameter 'cluster_manager_timeout' and deprecate 'master_timeout' - in Snapshot APIs (#2680) (#2870) * Deprecate the request parameter `master_timeout` that used in Snapshot APIs which have got the parameter. * Add alternative new request parameter `cluster_manager_timeout`. * Add unit tests. Signed-off-by: Tianli Feng (cherry picked from commit a89b7e6216354a5c5215918c7513174e9a57aec5) --- .../test/repository_azure/20_repository.yml | 7 ++ .../api/snapshot.cleanup_repository.json | 10 +- .../rest-api-spec/api/snapshot.clone.json | 10 +- .../rest-api-spec/api/snapshot.create.json | 10 +- .../api/snapshot.create_repository.json | 10 +- .../rest-api-spec/api/snapshot.delete.json | 10 +- .../api/snapshot.delete_repository.json | 10 +- .../rest-api-spec/api/snapshot.get.json | 10 +- .../api/snapshot.get_repository.json | 10 +- .../rest-api-spec/api/snapshot.restore.json | 10 +- .../rest-api-spec/api/snapshot.status.json | 10 +- .../api/snapshot.verify_repository.json | 10 +- .../cluster/RestCleanupRepositoryAction.java | 8 +- .../cluster/RestCloneSnapshotAction.java | 6 +- .../cluster/RestCreateSnapshotAction.java | 6 +- .../cluster/RestDeleteRepositoryAction.java | 8 +- .../cluster/RestDeleteSnapshotAction.java | 6 +- .../cluster/RestGetRepositoriesAction.java | 8 +- .../admin/cluster/RestGetSnapshotsAction.java | 6 +- .../cluster/RestPutRepositoryAction.java | 6 +- .../cluster/RestRestoreSnapshotAction.java | 8 +- .../cluster/RestSnapshotsStatusAction.java | 8 +- .../cluster/RestVerifyRepositoryAction.java | 8 +- .../RenamedTimeoutRequestParameterTests.java | 95 +++++++++++++++++++ 24 files changed, 268 insertions(+), 22 deletions(-) diff --git a/plugins/repository-azure/src/yamlRestTest/resources/rest-api-spec/test/repository_azure/20_repository.yml b/plugins/repository-azure/src/yamlRestTest/resources/rest-api-spec/test/repository_azure/20_repository.yml index beaa95b732d52..04ff4e8c34033 100644 --- a/plugins/repository-azure/src/yamlRestTest/resources/rest-api-spec/test/repository_azure/20_repository.yml +++ b/plugins/repository-azure/src/yamlRestTest/resources/rest-api-spec/test/repository_azure/20_repository.yml @@ -29,6 +29,9 @@ setup: --- "Snapshot/Restore with repository-azure": + - skip: + features: allowed_warnings + # Get repository - do: snapshot.get_repository: @@ -169,12 +172,16 @@ setup: # Remove the snapshots - do: + allowed_warnings: + - "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead." snapshot.delete: repository: repository snapshot: snapshot-two master_timeout: 5m - do: + allowed_warnings: + - "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead." snapshot.delete: repository: repository snapshot: snapshot-one diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.cleanup_repository.json b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.cleanup_repository.json index 727fe79176797..05eb3309b11e6 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.cleanup_repository.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.cleanup_repository.json @@ -24,7 +24,15 @@ "params": { "master_timeout": { "type" : "time", - "description" : "Explicit operation timeout for connection to master node" + "description" : "Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To support inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "timeout": { "type" : "time", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.clone.json b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.clone.json index 18122bc209b0e..c79460fc30a48 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.clone.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.clone.json @@ -32,7 +32,15 @@ "params":{ "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To support inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" } }, "body":{ diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.create.json b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.create.json index da8cb9916f584..64aaeaef9d897 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.create.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.create.json @@ -29,7 +29,15 @@ "params":{ "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To support inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "wait_for_completion":{ "type":"boolean", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.create_repository.json b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.create_repository.json index 431ac3c68c0bd..4965162bcd86c 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.create_repository.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.create_repository.json @@ -25,7 +25,15 @@ "params":{ "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To support inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "timeout":{ "type":"time", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.delete.json b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.delete.json index 30053cd5b94d3..2e21a08219942 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.delete.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.delete.json @@ -28,7 +28,15 @@ "params":{ "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To support inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.delete_repository.json b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.delete_repository.json index b60aeba83a329..3fc22f969784c 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.delete_repository.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.delete_repository.json @@ -24,7 +24,15 @@ "params":{ "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To support inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "timeout":{ "type":"time", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.get.json b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.get.json index 20006f6f499b6..e084a997a61b1 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.get.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.get.json @@ -28,7 +28,15 @@ "params":{ "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To support inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "ignore_unavailable":{ "type":"boolean", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.get_repository.json b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.get_repository.json index 8c91caa4fe81f..cf03bab18c03f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.get_repository.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.get_repository.json @@ -30,7 +30,15 @@ "params":{ "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To support inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "local":{ "type":"boolean", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.restore.json b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.restore.json index 697ea395dcc2b..87ab8117ec489 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.restore.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.restore.json @@ -28,7 +28,15 @@ "params":{ "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To support inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "wait_for_completion":{ "type":"boolean", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.status.json b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.status.json index 70a7ba23ef506..4f22c24fd9a56 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.status.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.status.json @@ -46,7 +46,15 @@ "params":{ "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To support inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "ignore_unavailable":{ "type":"boolean", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.verify_repository.json b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.verify_repository.json index de638c19d4a0b..865eb15d11310 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.verify_repository.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/snapshot.verify_repository.json @@ -24,7 +24,15 @@ "params":{ "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To support inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "timeout":{ "type":"time", diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCleanupRepositoryAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCleanupRepositoryAction.java index 2371581cefccb..c568eae91a528 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCleanupRepositoryAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCleanupRepositoryAction.java @@ -34,6 +34,7 @@ import org.opensearch.action.admin.cluster.repositories.cleanup.CleanupRepositoryRequest; import org.opensearch.client.node.NodeClient; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; @@ -50,6 +51,8 @@ */ public class RestCleanupRepositoryAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestCleanupRepositoryAction.class); + @Override public List routes() { return singletonList(new Route(POST, "/_snapshot/{repository}/_cleanup")); @@ -64,7 +67,10 @@ public String getName() { public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { CleanupRepositoryRequest cleanupRepositoryRequest = cleanupRepositoryRequest(request.param("repository")); cleanupRepositoryRequest.timeout(request.paramAsTime("timeout", cleanupRepositoryRequest.timeout())); - cleanupRepositoryRequest.masterNodeTimeout(request.paramAsTime("master_timeout", cleanupRepositoryRequest.masterNodeTimeout())); + cleanupRepositoryRequest.masterNodeTimeout( + request.paramAsTime("cluster_manager_timeout", cleanupRepositoryRequest.masterNodeTimeout()) + ); + parseDeprecatedMasterTimeoutParameter(cleanupRepositoryRequest, request, deprecationLogger, getName()); return channel -> client.admin().cluster().cleanupRepository(cleanupRepositoryRequest, new RestToXContentListener<>(channel)); } } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCloneSnapshotAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCloneSnapshotAction.java index 5c10c96c17227..abf1efa19f79b 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCloneSnapshotAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCloneSnapshotAction.java @@ -35,6 +35,7 @@ import org.opensearch.action.admin.cluster.snapshots.clone.CloneSnapshotRequest; import org.opensearch.action.support.IndicesOptions; import org.opensearch.client.node.NodeClient; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.xcontent.support.XContentMapValues; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; @@ -52,6 +53,8 @@ */ public class RestCloneSnapshotAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestCloneSnapshotAction.class); + @Override public List routes() { return Collections.singletonList(new Route(PUT, "/_snapshot/{repository}/{snapshot}/_clone/{target_snapshot}")); @@ -71,7 +74,8 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC request.param("target_snapshot"), XContentMapValues.nodeStringArrayValue(source.getOrDefault("indices", Collections.emptyList())) ); - cloneSnapshotRequest.masterNodeTimeout(request.paramAsTime("master_timeout", cloneSnapshotRequest.masterNodeTimeout())); + cloneSnapshotRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", cloneSnapshotRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(cloneSnapshotRequest, request, deprecationLogger, getName()); cloneSnapshotRequest.indicesOptions(IndicesOptions.fromMap(source, cloneSnapshotRequest.indicesOptions())); return channel -> client.admin().cluster().cloneSnapshot(cloneSnapshotRequest, new RestToXContentListener<>(channel)); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCreateSnapshotAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCreateSnapshotAction.java index c53f1d0cd5637..b3503f0dfbb56 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCreateSnapshotAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCreateSnapshotAction.java @@ -34,6 +34,7 @@ import org.opensearch.action.admin.cluster.snapshots.create.CreateSnapshotRequest; import org.opensearch.client.node.NodeClient; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; @@ -52,6 +53,8 @@ */ public class RestCreateSnapshotAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestCreateSnapshotAction.class); + @Override public List routes() { return unmodifiableList( @@ -68,7 +71,8 @@ public String getName() { public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { CreateSnapshotRequest createSnapshotRequest = createSnapshotRequest(request.param("repository"), request.param("snapshot")); request.applyContentParser(p -> createSnapshotRequest.source(p.mapOrdered())); - createSnapshotRequest.masterNodeTimeout(request.paramAsTime("master_timeout", createSnapshotRequest.masterNodeTimeout())); + createSnapshotRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", createSnapshotRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(createSnapshotRequest, request, deprecationLogger, getName()); createSnapshotRequest.waitForCompletion(request.paramAsBoolean("wait_for_completion", false)); return channel -> client.admin().cluster().createSnapshot(createSnapshotRequest, new RestToXContentListener<>(channel)); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteRepositoryAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteRepositoryAction.java index 4f8771b5db171..5e53595e3a49b 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteRepositoryAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteRepositoryAction.java @@ -34,6 +34,7 @@ import org.opensearch.action.admin.cluster.repositories.delete.DeleteRepositoryRequest; import org.opensearch.client.node.NodeClient; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; @@ -50,6 +51,8 @@ */ public class RestDeleteRepositoryAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestDeleteRepositoryAction.class); + @Override public List routes() { return singletonList(new Route(DELETE, "/_snapshot/{repository}")); @@ -64,7 +67,10 @@ public String getName() { public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { DeleteRepositoryRequest deleteRepositoryRequest = deleteRepositoryRequest(request.param("repository")); deleteRepositoryRequest.timeout(request.paramAsTime("timeout", deleteRepositoryRequest.timeout())); - deleteRepositoryRequest.masterNodeTimeout(request.paramAsTime("master_timeout", deleteRepositoryRequest.masterNodeTimeout())); + deleteRepositoryRequest.masterNodeTimeout( + request.paramAsTime("cluster_manager_timeout", deleteRepositoryRequest.masterNodeTimeout()) + ); + parseDeprecatedMasterTimeoutParameter(deleteRepositoryRequest, request, deprecationLogger, getName()); return channel -> client.admin().cluster().deleteRepository(deleteRepositoryRequest, new RestToXContentListener<>(channel)); } } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteSnapshotAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteSnapshotAction.java index 57b651215bc4f..891b84f8d0869 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteSnapshotAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteSnapshotAction.java @@ -35,6 +35,7 @@ import org.opensearch.action.admin.cluster.snapshots.delete.DeleteSnapshotRequest; import org.opensearch.client.node.NodeClient; import org.opensearch.common.Strings; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; @@ -51,6 +52,8 @@ */ public class RestDeleteSnapshotAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestDeleteSnapshotAction.class); + @Override public List routes() { return singletonList(new Route(DELETE, "/_snapshot/{repository}/{snapshot}")); @@ -67,7 +70,8 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC request.param("repository"), Strings.splitStringByCommaToArray(request.param("snapshot")) ); - deleteSnapshotRequest.masterNodeTimeout(request.paramAsTime("master_timeout", deleteSnapshotRequest.masterNodeTimeout())); + deleteSnapshotRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", deleteSnapshotRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(deleteSnapshotRequest, request, deprecationLogger, getName()); return channel -> client.admin().cluster().deleteSnapshot(deleteSnapshotRequest, new RestToXContentListener<>(channel)); } } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetRepositoriesAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetRepositoriesAction.java index 2a359fa08eb59..780d9266549ae 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetRepositoriesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetRepositoriesAction.java @@ -35,6 +35,7 @@ import org.opensearch.action.admin.cluster.repositories.get.GetRepositoriesRequest; import org.opensearch.client.node.NodeClient; import org.opensearch.common.Strings; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.settings.Settings; import org.opensearch.common.settings.SettingsFilter; import org.opensearch.rest.BaseRestHandler; @@ -55,6 +56,8 @@ */ public class RestGetRepositoriesAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestGetRepositoriesAction.class); + private final SettingsFilter settingsFilter; public RestGetRepositoriesAction(SettingsFilter settingsFilter) { @@ -75,7 +78,10 @@ public List routes() { public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { final String[] repositories = request.paramAsStringArray("repository", Strings.EMPTY_ARRAY); GetRepositoriesRequest getRepositoriesRequest = getRepositoryRequest(repositories); - getRepositoriesRequest.masterNodeTimeout(request.paramAsTime("master_timeout", getRepositoriesRequest.masterNodeTimeout())); + getRepositoriesRequest.masterNodeTimeout( + request.paramAsTime("cluster_manager_timeout", getRepositoriesRequest.masterNodeTimeout()) + ); + parseDeprecatedMasterTimeoutParameter(getRepositoriesRequest, request, deprecationLogger, getName()); getRepositoriesRequest.local(request.paramAsBoolean("local", getRepositoriesRequest.local())); settingsFilter.addFilterSettingParams(request); return channel -> client.admin().cluster().getRepositories(getRepositoriesRequest, new RestToXContentListener<>(channel)); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetSnapshotsAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetSnapshotsAction.java index 383369ce595c5..189795516adbd 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetSnapshotsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetSnapshotsAction.java @@ -35,6 +35,7 @@ import org.opensearch.action.admin.cluster.snapshots.get.GetSnapshotsRequest; import org.opensearch.client.node.NodeClient; import org.opensearch.common.Strings; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; @@ -51,6 +52,8 @@ */ public class RestGetSnapshotsAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestGetSnapshotsAction.class); + @Override public List routes() { return singletonList(new Route(GET, "/_snapshot/{repository}/{snapshot}")); @@ -69,7 +72,8 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC GetSnapshotsRequest getSnapshotsRequest = getSnapshotsRequest(repository).snapshots(snapshots); getSnapshotsRequest.ignoreUnavailable(request.paramAsBoolean("ignore_unavailable", getSnapshotsRequest.ignoreUnavailable())); getSnapshotsRequest.verbose(request.paramAsBoolean("verbose", getSnapshotsRequest.verbose())); - getSnapshotsRequest.masterNodeTimeout(request.paramAsTime("master_timeout", getSnapshotsRequest.masterNodeTimeout())); + getSnapshotsRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", getSnapshotsRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(getSnapshotsRequest, request, deprecationLogger, getName()); return channel -> client.admin().cluster().getSnapshots(getSnapshotsRequest, new RestToXContentListener<>(channel)); } } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPutRepositoryAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPutRepositoryAction.java index afc4a142b689a..a1f34294d630d 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPutRepositoryAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPutRepositoryAction.java @@ -34,6 +34,7 @@ import org.opensearch.action.admin.cluster.repositories.put.PutRepositoryRequest; import org.opensearch.client.node.NodeClient; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.xcontent.XContentParser; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; @@ -53,6 +54,8 @@ */ public class RestPutRepositoryAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestPutRepositoryAction.class); + @Override public List routes() { return unmodifiableList(asList(new Route(POST, "/_snapshot/{repository}"), new Route(PUT, "/_snapshot/{repository}"))); @@ -70,7 +73,8 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC putRepositoryRequest.source(parser.mapOrdered()); } putRepositoryRequest.verify(request.paramAsBoolean("verify", true)); - putRepositoryRequest.masterNodeTimeout(request.paramAsTime("master_timeout", putRepositoryRequest.masterNodeTimeout())); + putRepositoryRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", putRepositoryRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(putRepositoryRequest, request, deprecationLogger, getName()); putRepositoryRequest.timeout(request.paramAsTime("timeout", putRepositoryRequest.timeout())); return channel -> client.admin().cluster().putRepository(putRepositoryRequest, new RestToXContentListener<>(channel)); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestRestoreSnapshotAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestRestoreSnapshotAction.java index 4f6032d58b633..6c607b48a89fb 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestRestoreSnapshotAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestRestoreSnapshotAction.java @@ -34,6 +34,7 @@ import org.opensearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequest; import org.opensearch.client.node.NodeClient; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; @@ -50,6 +51,8 @@ */ public class RestRestoreSnapshotAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestRestoreSnapshotAction.class); + @Override public List routes() { return singletonList(new Route(POST, "/_snapshot/{repository}/{snapshot}/_restore")); @@ -63,7 +66,10 @@ public String getName() { @Override public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { RestoreSnapshotRequest restoreSnapshotRequest = restoreSnapshotRequest(request.param("repository"), request.param("snapshot")); - restoreSnapshotRequest.masterNodeTimeout(request.paramAsTime("master_timeout", restoreSnapshotRequest.masterNodeTimeout())); + restoreSnapshotRequest.masterNodeTimeout( + request.paramAsTime("cluster_manager_timeout", restoreSnapshotRequest.masterNodeTimeout()) + ); + parseDeprecatedMasterTimeoutParameter(restoreSnapshotRequest, request, deprecationLogger, getName()); restoreSnapshotRequest.waitForCompletion(request.paramAsBoolean("wait_for_completion", false)); request.applyContentParser(p -> restoreSnapshotRequest.source(p.mapOrdered())); return channel -> client.admin().cluster().restoreSnapshot(restoreSnapshotRequest, new RestToXContentListener<>(channel)); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestSnapshotsStatusAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestSnapshotsStatusAction.java index a0db762a68c19..469c1eac348d1 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestSnapshotsStatusAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestSnapshotsStatusAction.java @@ -35,6 +35,7 @@ import org.opensearch.action.admin.cluster.snapshots.status.SnapshotsStatusRequest; import org.opensearch.client.node.NodeClient; import org.opensearch.common.Strings; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; @@ -52,6 +53,8 @@ */ public class RestSnapshotsStatusAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestSnapshotsStatusAction.class); + @Override public List routes() { return unmodifiableList( @@ -78,7 +81,10 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC SnapshotsStatusRequest snapshotsStatusRequest = snapshotsStatusRequest(repository).snapshots(snapshots); snapshotsStatusRequest.ignoreUnavailable(request.paramAsBoolean("ignore_unavailable", snapshotsStatusRequest.ignoreUnavailable())); - snapshotsStatusRequest.masterNodeTimeout(request.paramAsTime("master_timeout", snapshotsStatusRequest.masterNodeTimeout())); + snapshotsStatusRequest.masterNodeTimeout( + request.paramAsTime("cluster_manager_timeout", snapshotsStatusRequest.masterNodeTimeout()) + ); + parseDeprecatedMasterTimeoutParameter(snapshotsStatusRequest, request, deprecationLogger, getName()); return channel -> client.admin().cluster().snapshotsStatus(snapshotsStatusRequest, new RestToXContentListener<>(channel)); } } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestVerifyRepositoryAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestVerifyRepositoryAction.java index 735325a69c2ed..4792d0e6db148 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestVerifyRepositoryAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestVerifyRepositoryAction.java @@ -34,6 +34,7 @@ import org.opensearch.action.admin.cluster.repositories.verify.VerifyRepositoryRequest; import org.opensearch.client.node.NodeClient; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; @@ -47,6 +48,8 @@ public class RestVerifyRepositoryAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestVerifyRepositoryAction.class); + @Override public List routes() { return singletonList(new Route(POST, "/_snapshot/{repository}/_verify")); @@ -60,7 +63,10 @@ public String getName() { @Override public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { VerifyRepositoryRequest verifyRepositoryRequest = verifyRepositoryRequest(request.param("repository")); - verifyRepositoryRequest.masterNodeTimeout(request.paramAsTime("master_timeout", verifyRepositoryRequest.masterNodeTimeout())); + verifyRepositoryRequest.masterNodeTimeout( + request.paramAsTime("cluster_manager_timeout", verifyRepositoryRequest.masterNodeTimeout()) + ); + parseDeprecatedMasterTimeoutParameter(verifyRepositoryRequest, request, deprecationLogger, getName()); verifyRepositoryRequest.timeout(request.paramAsTime("timeout", verifyRepositoryRequest.timeout())); return channel -> client.admin().cluster().verifyRepository(verifyRepositoryRequest, new RestToXContentListener<>(channel)); } diff --git a/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java b/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java index 09c84f325739a..86529d96573f8 100644 --- a/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java +++ b/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java @@ -52,6 +52,17 @@ import org.opensearch.rest.action.admin.indices.RestPutIndexTemplateAction; import org.opensearch.rest.action.admin.indices.RestSimulateIndexTemplateAction; import org.opensearch.rest.action.admin.indices.RestSimulateTemplateAction; +import org.opensearch.rest.action.admin.cluster.RestCleanupRepositoryAction; +import org.opensearch.rest.action.admin.cluster.RestCloneSnapshotAction; +import org.opensearch.rest.action.admin.cluster.RestCreateSnapshotAction; +import org.opensearch.rest.action.admin.cluster.RestDeleteRepositoryAction; +import org.opensearch.rest.action.admin.cluster.RestDeleteSnapshotAction; +import org.opensearch.rest.action.admin.cluster.RestGetRepositoriesAction; +import org.opensearch.rest.action.admin.cluster.RestGetSnapshotsAction; +import org.opensearch.rest.action.admin.cluster.RestPutRepositoryAction; +import org.opensearch.rest.action.admin.cluster.RestRestoreSnapshotAction; +import org.opensearch.rest.action.admin.cluster.RestSnapshotsStatusAction; +import org.opensearch.rest.action.admin.cluster.RestVerifyRepositoryAction; import org.opensearch.rest.action.cat.RestAllocationAction; import org.opensearch.rest.action.cat.RestRepositoriesAction; import org.opensearch.rest.action.cat.RestThreadPoolAction; @@ -517,6 +528,90 @@ public void testSimulateTemplate() { assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } + public void testCleanupRepository() { + RestCleanupRepositoryAction action = new RestCleanupRepositoryAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testCloneSnapshot() { + RestCloneSnapshotAction action = new RestCloneSnapshotAction(); + Exception e = assertThrows( + OpenSearchParseException.class, + () -> action.prepareRequest(getRestRequestWithBodyWithBothParams(), client) + ); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testCreateSnapshot() { + RestCreateSnapshotAction action = new RestCreateSnapshotAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testDeleteRepository() { + RestDeleteRepositoryAction action = new RestDeleteRepositoryAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testDeleteSnapshot() { + RestDeleteSnapshotAction action = new RestDeleteSnapshotAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testGetRepositories() { + final SettingsFilter filter = new SettingsFilter(Collections.singleton("foo.filtered")); + RestGetRepositoriesAction action = new RestGetRepositoriesAction(filter); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testGetSnapshots() { + RestGetSnapshotsAction action = new RestGetSnapshotsAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testPutRepository() { + RestPutRepositoryAction action = new RestPutRepositoryAction(); + Exception e = assertThrows( + OpenSearchParseException.class, + () -> action.prepareRequest(getRestRequestWithBodyWithBothParams(), client) + ); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testRestoreSnapshot() { + RestRestoreSnapshotAction action = new RestRestoreSnapshotAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testSnapshotsStatus() { + RestSnapshotsStatusAction action = new RestSnapshotsStatusAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testVerifyRepository() { + RestVerifyRepositoryAction action = new RestVerifyRepositoryAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + private MasterNodeRequest getMasterNodeRequest() { return new MasterNodeRequest() { @Override From 223d297dc34574c127a8b89b87a3dc68256a15af Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 12 Apr 2022 16:46:49 -0700 Subject: [PATCH 057/514] Change deprecation message for API parameter value 'master_node' of parameter 'metric' (#2880) (#2881) Signed-off-by: Tianli Feng (cherry picked from commit 455fad34eea2cb6d606f54a41ef170066b87b04e) --- .../resources/rest-api-spec/test/cluster.state/20_filtering.yml | 2 +- .../rest/action/admin/cluster/RestClusterRerouteAction.java | 2 +- .../rest/action/admin/cluster/RestClusterStateAction.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.state/20_filtering.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.state/20_filtering.yml index b2c1e1e561933..b17201a911290 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.state/20_filtering.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.state/20_filtering.yml @@ -169,7 +169,7 @@ setup: cluster.state: metric: [ master_node, version ] allowed_warnings: - - 'Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead.' + - 'Assigning [master_node] to parameter [metric] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_node] instead.' - match: { cluster_uuid: $cluster_uuid } - is_true: master_node diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterRerouteAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterRerouteAction.java index 9c0e09b7629e0..dc5e0ba57e4db 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterRerouteAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterRerouteAction.java @@ -83,7 +83,7 @@ public RestClusterRerouteAction(SettingsFilter settingsFilter) { // It's used to log deprecation when request parameter 'metric' contains 'master_node', or request parameter 'master_timeout' is used. private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestClusterRerouteAction.class); private static final String DEPRECATED_MESSAGE_MASTER_NODE = - "Deprecated value [master_node] used for parameter [metric]. To promote inclusive language, please use [cluster_manager_node] instead. It will be unsupported in a future major version."; + "Assigning [master_node] to parameter [metric] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_node] instead."; @Override public List routes() { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterStateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterStateAction.java index 7f18a19b5cd54..02b1eaa741c9e 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterStateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterStateAction.java @@ -76,7 +76,7 @@ public RestClusterStateAction(SettingsFilter settingsFilter) { // It's used to log deprecation when request parameter 'metric' contains 'master_node', or request parameter 'master_timeout' is used. private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestClusterStateAction.class); private static final String DEPRECATED_MESSAGE_MASTER_NODE = - "Deprecated value [master_node] used for parameter [metric]. To promote inclusive language, please use [cluster_manager_node] instead. It will be unsupported in a future major version."; + "Assigning [master_node] to parameter [metric] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_node] instead."; @Override public String getName() { From 0310c9451c07ac099dd845dce83bcbf3244ad820 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 13 Apr 2022 14:11:25 -0400 Subject: [PATCH 058/514] [Backport 2.x] Update commons-logging to 1.2 (#2823) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update commons-logging to 1.2 (#2806) * Upgrade to Apache Commons Logging 1.2 Signed-off-by: Yoann Rodière * Clarify that Apache HTTP/commons-* dependencies are not just for tests Signed-off-by: Yoann Rodière (cherry picked from commit b5d5616d44a08c609fb96c7467732480d7333285) * Remove unused commons-logging-1.2.jar sha sumcheck file Signed-off-by: Tianli Feng Co-authored-by: Yoann Rodière Co-authored-by: Tianli Feng --- buildSrc/version.properties | 12 +++++++----- client/rest/build.gradle | 1 - client/rest/licenses/commons-logging-1.1.3.jar.sha1 | 1 - client/rest/licenses/commons-logging-1.2.jar.sha1 | 1 + client/sniffer/build.gradle | 1 - .../sniffer/licenses/commons-logging-1.1.3.jar.sha1 | 1 - client/sniffer/licenses/commons-logging-1.2.jar.sha1 | 1 + .../licenses/commons-logging-1.2.jar.sha1 | 1 + .../licenses/commons-logging-1.1.3.jar.sha1 | 1 - .../licenses/commons-logging-1.2.jar.sha1 | 1 + .../licenses/commons-logging-1.1.3.jar.sha1 | 1 - .../licenses/commons-logging-1.2.jar.sha1 | 1 + .../licenses/commons-logging-1.1.3.jar.sha1 | 1 - .../licenses/commons-logging-1.2.jar.sha1 | 1 + .../licenses/commons-logging-1.1.3.jar.sha1 | 1 - .../licenses/commons-logging-1.2.jar.sha1 | 1 + .../licenses/commons-logging-1.1.3.jar.sha1 | 1 - .../licenses/commons-logging-1.2.jar.sha1 | 1 + .../licenses/commons-logging-1.1.3.jar.sha1 | 1 - .../licenses/commons-logging-1.2.jar.sha1 | 1 + .../licenses/commons-logging-1.1.3.jar.sha1 | 1 - .../licenses/commons-logging-1.2.jar.sha1 | 1 + test/framework/build.gradle | 1 - 23 files changed, 17 insertions(+), 17 deletions(-) delete mode 100644 client/rest/licenses/commons-logging-1.1.3.jar.sha1 create mode 100644 client/rest/licenses/commons-logging-1.2.jar.sha1 delete mode 100644 client/sniffer/licenses/commons-logging-1.1.3.jar.sha1 create mode 100644 client/sniffer/licenses/commons-logging-1.2.jar.sha1 create mode 100644 modules/repository-s3/licenses/commons-logging-1.2.jar.sha1 delete mode 100644 plugins/discovery-azure-classic/licenses/commons-logging-1.1.3.jar.sha1 create mode 100644 plugins/discovery-azure-classic/licenses/commons-logging-1.2.jar.sha1 delete mode 100644 plugins/discovery-ec2/licenses/commons-logging-1.1.3.jar.sha1 create mode 100644 plugins/discovery-ec2/licenses/commons-logging-1.2.jar.sha1 delete mode 100644 plugins/discovery-gce/licenses/commons-logging-1.1.3.jar.sha1 create mode 100644 plugins/discovery-gce/licenses/commons-logging-1.2.jar.sha1 delete mode 100644 plugins/ingest-attachment/licenses/commons-logging-1.1.3.jar.sha1 create mode 100644 plugins/ingest-attachment/licenses/commons-logging-1.2.jar.sha1 delete mode 100644 plugins/repository-gcs/licenses/commons-logging-1.1.3.jar.sha1 create mode 100644 plugins/repository-gcs/licenses/commons-logging-1.2.jar.sha1 delete mode 100644 plugins/repository-hdfs/licenses/commons-logging-1.1.3.jar.sha1 create mode 100644 plugins/repository-hdfs/licenses/commons-logging-1.2.jar.sha1 delete mode 100644 plugins/repository-s3/licenses/commons-logging-1.1.3.jar.sha1 create mode 100644 plugins/repository-s3/licenses/commons-logging-1.2.jar.sha1 diff --git a/buildSrc/version.properties b/buildSrc/version.properties index 4c09afd961c20..3d6c4faddea53 100644 --- a/buildSrc/version.properties +++ b/buildSrc/version.properties @@ -23,6 +23,13 @@ jna = 5.5.0 netty = 4.1.73.Final joda = 2.10.12 +# client dependencies +httpclient = 4.5.13 +httpcore = 4.4.12 +httpasyncclient = 4.1.4 +commonslogging = 1.2 +commonscodec = 1.13 + # when updating this version, you need to ensure compatibility with: # - plugins/ingest-attachment (transitive dependency, check the upstream POM) # - distribution/tools/plugin-cli @@ -30,11 +37,6 @@ bouncycastle=1.70 # test dependencies randomizedrunner = 2.7.1 junit = 4.13.2 -httpclient = 4.5.13 -httpcore = 4.4.12 -httpasyncclient = 4.1.4 -commonslogging = 1.1.3 -commonscodec = 1.13 hamcrest = 2.1 mockito = 4.3.1 objenesis = 3.2 diff --git a/client/rest/build.gradle b/client/rest/build.gradle index 5c1252061443a..01c186ed83fc2 100644 --- a/client/rest/build.gradle +++ b/client/rest/build.gradle @@ -89,7 +89,6 @@ thirdPartyAudit.ignoreMissingClasses( 'org.apache.avalon.framework.logger.Logger', 'org.apache.log.Hierarchy', 'org.apache.log.Logger', - 'org.apache.log4j.Category', 'org.apache.log4j.Level', 'org.apache.log4j.Logger', 'org.apache.log4j.Priority', diff --git a/client/rest/licenses/commons-logging-1.1.3.jar.sha1 b/client/rest/licenses/commons-logging-1.1.3.jar.sha1 deleted file mode 100644 index 5b8f029e58293..0000000000000 --- a/client/rest/licenses/commons-logging-1.1.3.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -f6f66e966c70a83ffbdb6f17a0919eaf7c8aca7f \ No newline at end of file diff --git a/client/rest/licenses/commons-logging-1.2.jar.sha1 b/client/rest/licenses/commons-logging-1.2.jar.sha1 new file mode 100644 index 0000000000000..f40f0242448e8 --- /dev/null +++ b/client/rest/licenses/commons-logging-1.2.jar.sha1 @@ -0,0 +1 @@ +4bfc12adfe4842bf07b657f0369c4cb522955686 \ No newline at end of file diff --git a/client/sniffer/build.gradle b/client/sniffer/build.gradle index bc4be1dd153e8..b7cb0d87c02d9 100644 --- a/client/sniffer/build.gradle +++ b/client/sniffer/build.gradle @@ -88,7 +88,6 @@ thirdPartyAudit.ignoreMissingClasses( 'org.apache.avalon.framework.logger.Logger', 'org.apache.log.Hierarchy', 'org.apache.log.Logger', - 'org.apache.log4j.Category', 'org.apache.log4j.Level', 'org.apache.log4j.Logger', 'org.apache.log4j.Priority', diff --git a/client/sniffer/licenses/commons-logging-1.1.3.jar.sha1 b/client/sniffer/licenses/commons-logging-1.1.3.jar.sha1 deleted file mode 100644 index 5b8f029e58293..0000000000000 --- a/client/sniffer/licenses/commons-logging-1.1.3.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -f6f66e966c70a83ffbdb6f17a0919eaf7c8aca7f \ No newline at end of file diff --git a/client/sniffer/licenses/commons-logging-1.2.jar.sha1 b/client/sniffer/licenses/commons-logging-1.2.jar.sha1 new file mode 100644 index 0000000000000..f40f0242448e8 --- /dev/null +++ b/client/sniffer/licenses/commons-logging-1.2.jar.sha1 @@ -0,0 +1 @@ +4bfc12adfe4842bf07b657f0369c4cb522955686 \ No newline at end of file diff --git a/modules/repository-s3/licenses/commons-logging-1.2.jar.sha1 b/modules/repository-s3/licenses/commons-logging-1.2.jar.sha1 new file mode 100644 index 0000000000000..f40f0242448e8 --- /dev/null +++ b/modules/repository-s3/licenses/commons-logging-1.2.jar.sha1 @@ -0,0 +1 @@ +4bfc12adfe4842bf07b657f0369c4cb522955686 \ No newline at end of file diff --git a/plugins/discovery-azure-classic/licenses/commons-logging-1.1.3.jar.sha1 b/plugins/discovery-azure-classic/licenses/commons-logging-1.1.3.jar.sha1 deleted file mode 100644 index c8756c438320f..0000000000000 --- a/plugins/discovery-azure-classic/licenses/commons-logging-1.1.3.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -f6f66e966c70a83ffbdb6f17a0919eaf7c8aca7f diff --git a/plugins/discovery-azure-classic/licenses/commons-logging-1.2.jar.sha1 b/plugins/discovery-azure-classic/licenses/commons-logging-1.2.jar.sha1 new file mode 100644 index 0000000000000..f40f0242448e8 --- /dev/null +++ b/plugins/discovery-azure-classic/licenses/commons-logging-1.2.jar.sha1 @@ -0,0 +1 @@ +4bfc12adfe4842bf07b657f0369c4cb522955686 \ No newline at end of file diff --git a/plugins/discovery-ec2/licenses/commons-logging-1.1.3.jar.sha1 b/plugins/discovery-ec2/licenses/commons-logging-1.1.3.jar.sha1 deleted file mode 100644 index c8756c438320f..0000000000000 --- a/plugins/discovery-ec2/licenses/commons-logging-1.1.3.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -f6f66e966c70a83ffbdb6f17a0919eaf7c8aca7f diff --git a/plugins/discovery-ec2/licenses/commons-logging-1.2.jar.sha1 b/plugins/discovery-ec2/licenses/commons-logging-1.2.jar.sha1 new file mode 100644 index 0000000000000..f40f0242448e8 --- /dev/null +++ b/plugins/discovery-ec2/licenses/commons-logging-1.2.jar.sha1 @@ -0,0 +1 @@ +4bfc12adfe4842bf07b657f0369c4cb522955686 \ No newline at end of file diff --git a/plugins/discovery-gce/licenses/commons-logging-1.1.3.jar.sha1 b/plugins/discovery-gce/licenses/commons-logging-1.1.3.jar.sha1 deleted file mode 100644 index c8756c438320f..0000000000000 --- a/plugins/discovery-gce/licenses/commons-logging-1.1.3.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -f6f66e966c70a83ffbdb6f17a0919eaf7c8aca7f diff --git a/plugins/discovery-gce/licenses/commons-logging-1.2.jar.sha1 b/plugins/discovery-gce/licenses/commons-logging-1.2.jar.sha1 new file mode 100644 index 0000000000000..f40f0242448e8 --- /dev/null +++ b/plugins/discovery-gce/licenses/commons-logging-1.2.jar.sha1 @@ -0,0 +1 @@ +4bfc12adfe4842bf07b657f0369c4cb522955686 \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/commons-logging-1.1.3.jar.sha1 b/plugins/ingest-attachment/licenses/commons-logging-1.1.3.jar.sha1 deleted file mode 100644 index 5b8f029e58293..0000000000000 --- a/plugins/ingest-attachment/licenses/commons-logging-1.1.3.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -f6f66e966c70a83ffbdb6f17a0919eaf7c8aca7f \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/commons-logging-1.2.jar.sha1 b/plugins/ingest-attachment/licenses/commons-logging-1.2.jar.sha1 new file mode 100644 index 0000000000000..f40f0242448e8 --- /dev/null +++ b/plugins/ingest-attachment/licenses/commons-logging-1.2.jar.sha1 @@ -0,0 +1 @@ +4bfc12adfe4842bf07b657f0369c4cb522955686 \ No newline at end of file diff --git a/plugins/repository-gcs/licenses/commons-logging-1.1.3.jar.sha1 b/plugins/repository-gcs/licenses/commons-logging-1.1.3.jar.sha1 deleted file mode 100644 index 5b8f029e58293..0000000000000 --- a/plugins/repository-gcs/licenses/commons-logging-1.1.3.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -f6f66e966c70a83ffbdb6f17a0919eaf7c8aca7f \ No newline at end of file diff --git a/plugins/repository-gcs/licenses/commons-logging-1.2.jar.sha1 b/plugins/repository-gcs/licenses/commons-logging-1.2.jar.sha1 new file mode 100644 index 0000000000000..f40f0242448e8 --- /dev/null +++ b/plugins/repository-gcs/licenses/commons-logging-1.2.jar.sha1 @@ -0,0 +1 @@ +4bfc12adfe4842bf07b657f0369c4cb522955686 \ No newline at end of file diff --git a/plugins/repository-hdfs/licenses/commons-logging-1.1.3.jar.sha1 b/plugins/repository-hdfs/licenses/commons-logging-1.1.3.jar.sha1 deleted file mode 100644 index 5b8f029e58293..0000000000000 --- a/plugins/repository-hdfs/licenses/commons-logging-1.1.3.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -f6f66e966c70a83ffbdb6f17a0919eaf7c8aca7f \ No newline at end of file diff --git a/plugins/repository-hdfs/licenses/commons-logging-1.2.jar.sha1 b/plugins/repository-hdfs/licenses/commons-logging-1.2.jar.sha1 new file mode 100644 index 0000000000000..f40f0242448e8 --- /dev/null +++ b/plugins/repository-hdfs/licenses/commons-logging-1.2.jar.sha1 @@ -0,0 +1 @@ +4bfc12adfe4842bf07b657f0369c4cb522955686 \ No newline at end of file diff --git a/plugins/repository-s3/licenses/commons-logging-1.1.3.jar.sha1 b/plugins/repository-s3/licenses/commons-logging-1.1.3.jar.sha1 deleted file mode 100644 index c8756c438320f..0000000000000 --- a/plugins/repository-s3/licenses/commons-logging-1.1.3.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -f6f66e966c70a83ffbdb6f17a0919eaf7c8aca7f diff --git a/plugins/repository-s3/licenses/commons-logging-1.2.jar.sha1 b/plugins/repository-s3/licenses/commons-logging-1.2.jar.sha1 new file mode 100644 index 0000000000000..f40f0242448e8 --- /dev/null +++ b/plugins/repository-s3/licenses/commons-logging-1.2.jar.sha1 @@ -0,0 +1 @@ +4bfc12adfe4842bf07b657f0369c4cb522955686 \ No newline at end of file diff --git a/test/framework/build.gradle b/test/framework/build.gradle index 42197bf5e2980..096e8c1e58243 100644 --- a/test/framework/build.gradle +++ b/test/framework/build.gradle @@ -71,7 +71,6 @@ thirdPartyAudit.ignoreMissingClasses( 'org.apache.avalon.framework.logger.Logger', 'org.apache.log.Hierarchy', 'org.apache.log.Logger', - 'org.apache.log4j.Category', 'org.apache.log4j.Level', 'org.apache.log4j.Logger', 'org.apache.log4j.Priority', From 3b1f54c73259a118dee7f481d6aa36ef387c7557 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 13 Apr 2022 14:12:29 -0400 Subject: [PATCH 059/514] Decouple IndexSettings from IncludeExclude (#2860) (#2862) This change refactors an earlier change to impose a reg-ex size limit on the include/exclude string. Instead of accepting an IndexSettings instance, the class now accepts a integer limit value. This is necessary because the IncludeExclude class is used outside the core codebase, whose use-cases may be unaware of indices and their settings. To ensure that a limit is always imposed, a default limit is defined in the class. (cherry picked from commit ba1966853e728b153e42be59ba449420e79b09ee) Signed-off-by: Kartik Ganesh Co-authored-by: Kartik Ganesh --- .../bucket/terms/IncludeExclude.java | 41 +++++++++++++++---- .../terms/RareTermsAggregatorFactory.java | 5 +-- .../SignificantTermsAggregatorFactory.java | 9 ++-- .../SignificantTextAggregatorFactory.java | 5 +-- .../bucket/terms/TermsAggregatorFactory.java | 9 ++-- .../support/IncludeExcludeTests.java | 25 +++-------- 6 files changed, 50 insertions(+), 44 deletions(-) diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/IncludeExclude.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/IncludeExclude.java index 71320909ca5d2..f32abd1892592 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/IncludeExclude.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/IncludeExclude.java @@ -79,6 +79,14 @@ public class IncludeExclude implements Writeable, ToXContentFragment { // can disagree on which terms hash to the required partition. private static final int HASH_PARTITIONING_SEED = 31; + /** + * The default length limit for a reg-ex string. The value is derived from {@link IndexSettings#MAX_REGEX_LENGTH_SETTING}. + * For context, see: + * https://github.com/opensearch-project/OpenSearch/issues/1992 + * https://github.com/opensearch-project/OpenSearch/issues/2858 + */ + private static final int DEFAULT_MAX_REGEX_LENGTH = 1000; + // for parsing purposes only // TODO: move all aggs to the same package so that this stuff could be pkg-private public static IncludeExclude merge(IncludeExclude include, IncludeExclude exclude) { @@ -576,10 +584,10 @@ public boolean isPartitionBased() { return incNumPartitions > 0; } - private Automaton toAutomaton(IndexSettings indexSettings) { + private Automaton toAutomaton(int maxRegExLength) { Automaton a; if (include != null) { - validateRegExpStringLength(include, indexSettings); + validateRegExpStringLength(include, maxRegExLength); a = new RegExp(include).toAutomaton(); } else if (includeValues != null) { a = Automata.makeStringUnion(includeValues); @@ -587,7 +595,7 @@ private Automaton toAutomaton(IndexSettings indexSettings) { a = Automata.makeAnyString(); } if (exclude != null) { - validateRegExpStringLength(exclude, indexSettings); + validateRegExpStringLength(exclude, maxRegExLength); Automaton excludeAutomaton = new RegExp(exclude).toAutomaton(); a = Operations.minus(a, excludeAutomaton, Operations.DEFAULT_DETERMINIZE_WORK_LIMIT); } else if (excludeValues != null) { @@ -596,8 +604,7 @@ private Automaton toAutomaton(IndexSettings indexSettings) { return a; } - private static void validateRegExpStringLength(String source, IndexSettings indexSettings) { - int maxRegexLength = indexSettings.getMaxRegexLength(); + private static void validateRegExpStringLength(String source, int maxRegexLength) { if (maxRegexLength > 0 && source.length() > maxRegexLength) { throw new IllegalArgumentException( "The length of regex [" @@ -613,9 +620,17 @@ private static void validateRegExpStringLength(String source, IndexSettings inde } } - public StringFilter convertToStringFilter(DocValueFormat format, IndexSettings indexSettings) { + /** + * Wrapper method that imposes a default regex limit. + * See https://github.com/opensearch-project/OpenSearch/issues/2858 + */ + public StringFilter convertToStringFilter(DocValueFormat format) { + return convertToStringFilter(format, DEFAULT_MAX_REGEX_LENGTH); + } + + public StringFilter convertToStringFilter(DocValueFormat format, int maxRegexLength) { if (isRegexBased()) { - return new AutomatonBackedStringFilter(toAutomaton(indexSettings)); + return new AutomatonBackedStringFilter(toAutomaton(maxRegexLength)); } if (isPartitionBased()) { return new PartitionedStringFilter(); @@ -636,10 +651,18 @@ private static SortedSet parseForDocValues(SortedSet endUser return result; } - public OrdinalsFilter convertToOrdinalsFilter(DocValueFormat format, IndexSettings indexSettings) { + /** + * Wrapper method that imposes a default regex limit. + * See https://github.com/opensearch-project/OpenSearch/issues/2858 + */ + public OrdinalsFilter convertToOrdinalsFilter(DocValueFormat format) { + return convertToOrdinalsFilter(format, DEFAULT_MAX_REGEX_LENGTH); + } + + public OrdinalsFilter convertToOrdinalsFilter(DocValueFormat format, int maxRegexLength) { if (isRegexBased()) { - return new AutomatonBackedOrdinalsFilter(toAutomaton(indexSettings)); + return new AutomatonBackedOrdinalsFilter(toAutomaton(maxRegexLength)); } if (isPartitionBased()) { return new PartitionedOrdinalsFilter(); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTermsAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTermsAggregatorFactory.java index c0a5c77a98170..ed70a9b310ea1 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTermsAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTermsAggregatorFactory.java @@ -34,7 +34,6 @@ import org.opensearch.common.ParseField; import org.opensearch.common.logging.DeprecationLogger; -import org.opensearch.index.IndexSettings; import org.opensearch.index.query.QueryShardContext; import org.opensearch.search.DocValueFormat; import org.opensearch.search.aggregations.Aggregator; @@ -251,10 +250,10 @@ Aggregator create( double precision, CardinalityUpperBound cardinality ) throws IOException { - IndexSettings indexSettings = context.getQueryShardContext().getIndexSettings(); + int maxRegexLength = context.getQueryShardContext().getIndexSettings().getMaxRegexLength(); final IncludeExclude.StringFilter filter = includeExclude == null ? null - : includeExclude.convertToStringFilter(format, indexSettings); + : includeExclude.convertToStringFilter(format, maxRegexLength); return new StringRareTermsAggregator( name, factories, diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTermsAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTermsAggregatorFactory.java index 4b93121ae06ef..8935c9715a1e0 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTermsAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTermsAggregatorFactory.java @@ -34,7 +34,6 @@ import org.opensearch.common.ParseField; import org.opensearch.common.logging.DeprecationLogger; -import org.opensearch.index.IndexSettings; import org.opensearch.index.query.QueryBuilder; import org.opensearch.index.query.QueryShardContext; import org.opensearch.search.DocValueFormat; @@ -326,10 +325,10 @@ Aggregator create( CardinalityUpperBound cardinality, Map metadata ) throws IOException { - IndexSettings indexSettings = aggregationContext.getQueryShardContext().getIndexSettings(); + int maxRegexLength = aggregationContext.getQueryShardContext().getIndexSettings().getMaxRegexLength(); final IncludeExclude.StringFilter filter = includeExclude == null ? null - : includeExclude.convertToStringFilter(format, indexSettings); + : includeExclude.convertToStringFilter(format, maxRegexLength); return new MapStringTermsAggregator( name, factories, @@ -367,10 +366,10 @@ Aggregator create( CardinalityUpperBound cardinality, Map metadata ) throws IOException { - IndexSettings indexSettings = aggregationContext.getQueryShardContext().getIndexSettings(); + int maxRegexLength = aggregationContext.getQueryShardContext().getIndexSettings().getMaxRegexLength(); final IncludeExclude.OrdinalsFilter filter = includeExclude == null ? null - : includeExclude.convertToOrdinalsFilter(format, indexSettings); + : includeExclude.convertToOrdinalsFilter(format, maxRegexLength); boolean remapGlobalOrd = true; if (cardinality == CardinalityUpperBound.ONE && factories == AggregatorFactories.EMPTY && includeExclude == null) { /* diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTextAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTextAggregatorFactory.java index 992035f1fbe97..9085df1ccd749 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTextAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTextAggregatorFactory.java @@ -44,7 +44,6 @@ import org.opensearch.common.util.BigArrays; import org.opensearch.common.util.BytesRefHash; import org.opensearch.common.util.ObjectArray; -import org.opensearch.index.IndexSettings; import org.opensearch.index.mapper.MappedFieldType; import org.opensearch.index.query.QueryBuilder; import org.opensearch.index.query.QueryShardContext; @@ -138,10 +137,10 @@ protected Aggregator createInternal( // TODO - need to check with mapping that this is indeed a text field.... - IndexSettings indexSettings = searchContext.getQueryShardContext().getIndexSettings(); + int maxRegexLength = searchContext.getQueryShardContext().getIndexSettings().getMaxRegexLength(); IncludeExclude.StringFilter incExcFilter = includeExclude == null ? null - : includeExclude.convertToStringFilter(DocValueFormat.RAW, indexSettings); + : includeExclude.convertToStringFilter(DocValueFormat.RAW, maxRegexLength); MapStringTermsAggregator.CollectorSource collectorSource = new SignificantTextCollectorSource( queryShardContext.lookup().source(), diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregatorFactory.java index 17b412f87107c..b320126dff24b 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregatorFactory.java @@ -34,7 +34,6 @@ import org.apache.lucene.search.IndexSearcher; import org.opensearch.common.ParseField; -import org.opensearch.index.IndexSettings; import org.opensearch.index.query.QueryShardContext; import org.opensearch.search.DocValueFormat; import org.opensearch.search.aggregations.AggregationExecutionException; @@ -381,10 +380,10 @@ Aggregator create( CardinalityUpperBound cardinality, Map metadata ) throws IOException { - IndexSettings indexSettings = context.getQueryShardContext().getIndexSettings(); + int maxRegexLength = context.getQueryShardContext().getIndexSettings().getMaxRegexLength(); final IncludeExclude.StringFilter filter = includeExclude == null ? null - : includeExclude.convertToStringFilter(format, indexSettings); + : includeExclude.convertToStringFilter(format, maxRegexLength); return new MapStringTermsAggregator( name, factories, @@ -462,10 +461,10 @@ Aggregator create( ); } - IndexSettings indexSettings = context.getQueryShardContext().getIndexSettings(); + int maxRegexLength = context.getQueryShardContext().getIndexSettings().getMaxRegexLength(); final IncludeExclude.OrdinalsFilter filter = includeExclude == null ? null - : includeExclude.convertToOrdinalsFilter(format, indexSettings); + : includeExclude.convertToOrdinalsFilter(format, maxRegexLength); boolean remapGlobalOrds; if (cardinality == CardinalityUpperBound.ONE && REMAP_GLOBAL_ORDS != null) { /* diff --git a/server/src/test/java/org/opensearch/search/aggregations/support/IncludeExcludeTests.java b/server/src/test/java/org/opensearch/search/aggregations/support/IncludeExcludeTests.java index d104fc6783dc5..d0995abd07f32 100644 --- a/server/src/test/java/org/opensearch/search/aggregations/support/IncludeExcludeTests.java +++ b/server/src/test/java/org/opensearch/search/aggregations/support/IncludeExcludeTests.java @@ -36,16 +36,12 @@ import org.apache.lucene.index.SortedSetDocValues; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.LongBitSet; -import org.opensearch.Version; -import org.opensearch.cluster.metadata.IndexMetadata; import org.opensearch.common.ParseField; -import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.ToXContent; import org.opensearch.common.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentParser; import org.opensearch.common.xcontent.XContentType; -import org.opensearch.index.IndexSettings; import org.opensearch.index.fielddata.AbstractSortedSetDocValues; import org.opensearch.search.DocValueFormat; import org.opensearch.search.aggregations.bucket.terms.IncludeExclude; @@ -58,23 +54,14 @@ public class IncludeExcludeTests extends OpenSearchTestCase { - private final IndexSettings dummyIndexSettings = new IndexSettings( - IndexMetadata.builder("index") - .settings(Settings.builder().put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT)) - .numberOfShards(1) - .numberOfReplicas(0) - .build(), - Settings.EMPTY - ); - public void testEmptyTermsWithOrds() throws IOException { IncludeExclude inexcl = new IncludeExclude(new TreeSet<>(Collections.singleton(new BytesRef("foo"))), null); - OrdinalsFilter filter = inexcl.convertToOrdinalsFilter(DocValueFormat.RAW, dummyIndexSettings); + OrdinalsFilter filter = inexcl.convertToOrdinalsFilter(DocValueFormat.RAW); LongBitSet acceptedOrds = filter.acceptedGlobalOrdinals(DocValues.emptySortedSet()); assertEquals(0, acceptedOrds.length()); inexcl = new IncludeExclude(null, new TreeSet<>(Collections.singleton(new BytesRef("foo")))); - filter = inexcl.convertToOrdinalsFilter(DocValueFormat.RAW, dummyIndexSettings); + filter = inexcl.convertToOrdinalsFilter(DocValueFormat.RAW); acceptedOrds = filter.acceptedGlobalOrdinals(DocValues.emptySortedSet()); assertEquals(0, acceptedOrds.length()); } @@ -113,13 +100,13 @@ public long getValueCount() { }; IncludeExclude inexcl = new IncludeExclude(new TreeSet<>(Collections.singleton(new BytesRef("foo"))), null); - OrdinalsFilter filter = inexcl.convertToOrdinalsFilter(DocValueFormat.RAW, dummyIndexSettings); + OrdinalsFilter filter = inexcl.convertToOrdinalsFilter(DocValueFormat.RAW); LongBitSet acceptedOrds = filter.acceptedGlobalOrdinals(ords); assertEquals(1, acceptedOrds.length()); assertTrue(acceptedOrds.get(0)); inexcl = new IncludeExclude(new TreeSet<>(Collections.singleton(new BytesRef("bar"))), null); - filter = inexcl.convertToOrdinalsFilter(DocValueFormat.RAW, dummyIndexSettings); + filter = inexcl.convertToOrdinalsFilter(DocValueFormat.RAW); acceptedOrds = filter.acceptedGlobalOrdinals(ords); assertEquals(1, acceptedOrds.length()); assertFalse(acceptedOrds.get(0)); @@ -128,7 +115,7 @@ public long getValueCount() { new TreeSet<>(Collections.singleton(new BytesRef("foo"))), new TreeSet<>(Collections.singleton(new BytesRef("foo"))) ); - filter = inexcl.convertToOrdinalsFilter(DocValueFormat.RAW, dummyIndexSettings); + filter = inexcl.convertToOrdinalsFilter(DocValueFormat.RAW); acceptedOrds = filter.acceptedGlobalOrdinals(ords); assertEquals(1, acceptedOrds.length()); assertFalse(acceptedOrds.get(0)); @@ -137,7 +124,7 @@ public long getValueCount() { null, // means everything included new TreeSet<>(Collections.singleton(new BytesRef("foo"))) ); - filter = inexcl.convertToOrdinalsFilter(DocValueFormat.RAW, dummyIndexSettings); + filter = inexcl.convertToOrdinalsFilter(DocValueFormat.RAW); acceptedOrds = filter.acceptedGlobalOrdinals(ords); assertEquals(1, acceptedOrds.length()); assertFalse(acceptedOrds.get(0)); From 261daf797323f4628c632371f9e6307dc70e1f96 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 13 Apr 2022 13:04:24 -0700 Subject: [PATCH 060/514] Add request parameter 'cluster_manager_timeout' and deprecate 'master_timeout' - in Ingest APIs and Script APIs (#2682) (#2890) - Deprecate the request parameter `master_timeout` that used in Ingest APIs and Script APIs which have got the parameter. - Add alternative new request parameter `cluster_manager_timeout`. - Add unit tests. Signed-off-by: Tianli Feng (cherry picked from commit 08e4a358399d5d931666fed8471ac00bcdec8a61) --- .../rest-api-spec/api/delete_script.json | 10 +++- .../rest-api-spec/api/get_script.json | 10 +++- .../api/ingest.delete_pipeline.json | 10 +++- .../api/ingest.get_pipeline.json | 10 +++- .../api/ingest.put_pipeline.json | 10 +++- .../rest-api-spec/api/put_script.json | 10 +++- .../cluster/RestDeleteStoredScriptAction.java | 8 ++- .../cluster/RestGetStoredScriptAction.java | 6 +- .../cluster/RestPutStoredScriptAction.java | 6 +- .../ingest/RestDeletePipelineAction.java | 6 +- .../action/ingest/RestGetPipelineAction.java | 6 +- .../action/ingest/RestPutPipelineAction.java | 6 +- .../RenamedTimeoutRequestParameterTests.java | 59 +++++++++++++++++++ 13 files changed, 145 insertions(+), 12 deletions(-) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/delete_script.json b/rest-api-spec/src/main/resources/rest-api-spec/api/delete_script.json index b38b97ae57c2e..acaa389738606 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/delete_script.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/delete_script.json @@ -28,7 +28,15 @@ }, "master_timeout":{ "type":"time", - "description":"Specify timeout for connection to master" + "description":"Specify timeout for connection to master", + "deprecated":{ + "version":"2.0.0", + "description":"To support inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/get_script.json b/rest-api-spec/src/main/resources/rest-api-spec/api/get_script.json index 14307bea2ef0b..9cdac886b1b27 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/get_script.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/get_script.json @@ -24,7 +24,15 @@ "params":{ "master_timeout":{ "type":"time", - "description":"Specify timeout for connection to master" + "description":"Specify timeout for connection to master", + "deprecated":{ + "version":"2.0.0", + "description":"To support inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.delete_pipeline.json b/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.delete_pipeline.json index 29b4219038cd2..3e40136f556fa 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.delete_pipeline.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.delete_pipeline.json @@ -24,7 +24,15 @@ "params":{ "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To support inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "timeout":{ "type":"time", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.get_pipeline.json b/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.get_pipeline.json index 65fc4f91b2b42..cde980e67c8c9 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.get_pipeline.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.get_pipeline.json @@ -30,7 +30,15 @@ "params":{ "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To support inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.put_pipeline.json b/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.put_pipeline.json index 4d2105866791c..5475905e7b99f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.put_pipeline.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/ingest.put_pipeline.json @@ -24,7 +24,15 @@ "params":{ "master_timeout":{ "type":"time", - "description":"Explicit operation timeout for connection to master node" + "description":"Explicit operation timeout for connection to master node", + "deprecated":{ + "version":"2.0.0", + "description":"To support inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to cluster-manager node" }, "timeout":{ "type":"time", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/put_script.json b/rest-api-spec/src/main/resources/rest-api-spec/api/put_script.json index 750f7fdf4eb62..c8413d1476402 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/put_script.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/put_script.json @@ -46,7 +46,15 @@ }, "master_timeout":{ "type":"time", - "description":"Specify timeout for connection to master" + "description":"Specify timeout for connection to master", + "deprecated":{ + "version":"2.0.0", + "description":"To support inclusive language, use 'cluster_manager_timeout' instead." + } + }, + "cluster_manager_timeout":{ + "type":"time", + "description":"Specify timeout for connection to cluster-manager node" }, "context":{ "type":"string", diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteStoredScriptAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteStoredScriptAction.java index 8703899d5ed14..b303f769d216b 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteStoredScriptAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteStoredScriptAction.java @@ -33,6 +33,7 @@ import org.opensearch.action.admin.cluster.storedscripts.DeleteStoredScriptRequest; import org.opensearch.client.node.NodeClient; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; @@ -45,6 +46,8 @@ public class RestDeleteStoredScriptAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestDeleteStoredScriptAction.class); + @Override public List routes() { return singletonList(new Route(DELETE, "/_scripts/{id}")); @@ -60,7 +63,10 @@ public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client String id = request.param("id"); DeleteStoredScriptRequest deleteStoredScriptRequest = new DeleteStoredScriptRequest(id); deleteStoredScriptRequest.timeout(request.paramAsTime("timeout", deleteStoredScriptRequest.timeout())); - deleteStoredScriptRequest.masterNodeTimeout(request.paramAsTime("master_timeout", deleteStoredScriptRequest.masterNodeTimeout())); + deleteStoredScriptRequest.masterNodeTimeout( + request.paramAsTime("cluster_manager_timeout", deleteStoredScriptRequest.masterNodeTimeout()) + ); + parseDeprecatedMasterTimeoutParameter(deleteStoredScriptRequest, request, deprecationLogger, getName()); return channel -> client.admin().cluster().deleteStoredScript(deleteStoredScriptRequest, new RestToXContentListener<>(channel)); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetStoredScriptAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetStoredScriptAction.java index b75fb7693f865..5a904b99be469 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetStoredScriptAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetStoredScriptAction.java @@ -33,6 +33,7 @@ import org.opensearch.action.admin.cluster.storedscripts.GetStoredScriptRequest; import org.opensearch.client.node.NodeClient; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestStatusToXContentListener; @@ -45,6 +46,8 @@ public class RestGetStoredScriptAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestGetStoredScriptAction.class); + @Override public List routes() { return singletonList(new Route(GET, "/_scripts/{id}")); @@ -59,7 +62,8 @@ public String getName() { public RestChannelConsumer prepareRequest(final RestRequest request, NodeClient client) throws IOException { String id = request.param("id"); GetStoredScriptRequest getRequest = new GetStoredScriptRequest(id); - getRequest.masterNodeTimeout(request.paramAsTime("master_timeout", getRequest.masterNodeTimeout())); + getRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", getRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(getRequest, request, deprecationLogger, getName()); return channel -> client.admin().cluster().getStoredScript(getRequest, new RestStatusToXContentListener<>(channel)); } } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPutStoredScriptAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPutStoredScriptAction.java index f4fe21b8adbe0..1568a80278bb9 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPutStoredScriptAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPutStoredScriptAction.java @@ -34,6 +34,7 @@ import org.opensearch.action.admin.cluster.storedscripts.PutStoredScriptRequest; import org.opensearch.client.node.NodeClient; import org.opensearch.common.bytes.BytesReference; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.xcontent.XContentType; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; @@ -50,6 +51,8 @@ public class RestPutStoredScriptAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestPutStoredScriptAction.class); + @Override public List routes() { return unmodifiableList( @@ -76,7 +79,8 @@ public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client StoredScriptSource source = StoredScriptSource.parse(content, xContentType); PutStoredScriptRequest putRequest = new PutStoredScriptRequest(id, context, content, request.getXContentType(), source); - putRequest.masterNodeTimeout(request.paramAsTime("master_timeout", putRequest.masterNodeTimeout())); + putRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", putRequest.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(putRequest, request, deprecationLogger, getName()); putRequest.timeout(request.paramAsTime("timeout", putRequest.timeout())); return channel -> client.admin().cluster().putStoredScript(putRequest, new RestToXContentListener<>(channel)); } diff --git a/server/src/main/java/org/opensearch/rest/action/ingest/RestDeletePipelineAction.java b/server/src/main/java/org/opensearch/rest/action/ingest/RestDeletePipelineAction.java index 179736b4b1816..69f9316bc3d9c 100644 --- a/server/src/main/java/org/opensearch/rest/action/ingest/RestDeletePipelineAction.java +++ b/server/src/main/java/org/opensearch/rest/action/ingest/RestDeletePipelineAction.java @@ -34,6 +34,7 @@ import org.opensearch.action.ingest.DeletePipelineRequest; import org.opensearch.client.node.NodeClient; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestToXContentListener; @@ -45,6 +46,8 @@ import static org.opensearch.rest.RestRequest.Method.DELETE; public class RestDeletePipelineAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestDeletePipelineAction.class); + @Override public List routes() { return singletonList(new Route(DELETE, "/_ingest/pipeline/{id}")); @@ -58,7 +61,8 @@ public String getName() { @Override public RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException { DeletePipelineRequest request = new DeletePipelineRequest(restRequest.param("id")); - request.masterNodeTimeout(restRequest.paramAsTime("master_timeout", request.masterNodeTimeout())); + request.masterNodeTimeout(restRequest.paramAsTime("cluster_manager_timeout", request.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(request, restRequest, deprecationLogger, getName()); request.timeout(restRequest.paramAsTime("timeout", request.timeout())); return channel -> client.admin().cluster().deletePipeline(request, new RestToXContentListener<>(channel)); } diff --git a/server/src/main/java/org/opensearch/rest/action/ingest/RestGetPipelineAction.java b/server/src/main/java/org/opensearch/rest/action/ingest/RestGetPipelineAction.java index cf86541ca8cd9..5555bf53a5ee9 100644 --- a/server/src/main/java/org/opensearch/rest/action/ingest/RestGetPipelineAction.java +++ b/server/src/main/java/org/opensearch/rest/action/ingest/RestGetPipelineAction.java @@ -35,6 +35,7 @@ import org.opensearch.action.ingest.GetPipelineRequest; import org.opensearch.client.node.NodeClient; import org.opensearch.common.Strings; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestStatusToXContentListener; @@ -48,6 +49,8 @@ public class RestGetPipelineAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestGetPipelineAction.class); + @Override public List routes() { return unmodifiableList(asList(new Route(GET, "/_ingest/pipeline"), new Route(GET, "/_ingest/pipeline/{id}"))); @@ -61,7 +64,8 @@ public String getName() { @Override public RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException { GetPipelineRequest request = new GetPipelineRequest(Strings.splitStringByCommaToArray(restRequest.param("id"))); - request.masterNodeTimeout(restRequest.paramAsTime("master_timeout", request.masterNodeTimeout())); + request.masterNodeTimeout(restRequest.paramAsTime("cluster_manager_timeout", request.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(request, restRequest, deprecationLogger, getName()); return channel -> client.admin().cluster().getPipeline(request, new RestStatusToXContentListener<>(channel)); } } diff --git a/server/src/main/java/org/opensearch/rest/action/ingest/RestPutPipelineAction.java b/server/src/main/java/org/opensearch/rest/action/ingest/RestPutPipelineAction.java index 09f40c962dda7..8a9abc860fbc9 100644 --- a/server/src/main/java/org/opensearch/rest/action/ingest/RestPutPipelineAction.java +++ b/server/src/main/java/org/opensearch/rest/action/ingest/RestPutPipelineAction.java @@ -36,6 +36,7 @@ import org.opensearch.client.node.NodeClient; import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.collect.Tuple; +import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.xcontent.XContentType; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; @@ -49,6 +50,8 @@ public class RestPutPipelineAction extends BaseRestHandler { + private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestPutPipelineAction.class); + @Override public List routes() { return singletonList(new Route(PUT, "/_ingest/pipeline/{id}")); @@ -63,7 +66,8 @@ public String getName() { public RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException { Tuple sourceTuple = restRequest.contentOrSourceParam(); PutPipelineRequest request = new PutPipelineRequest(restRequest.param("id"), sourceTuple.v2(), sourceTuple.v1()); - request.masterNodeTimeout(restRequest.paramAsTime("master_timeout", request.masterNodeTimeout())); + request.masterNodeTimeout(restRequest.paramAsTime("cluster_manager_timeout", request.masterNodeTimeout())); + parseDeprecatedMasterTimeoutParameter(request, restRequest, deprecationLogger, getName()); request.timeout(restRequest.paramAsTime("timeout", request.timeout())); return channel -> client.admin().cluster().putPipeline(request, new RestToXContentListener<>(channel)); } diff --git a/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java b/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java index 86529d96573f8..648766681a377 100644 --- a/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java +++ b/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java @@ -63,6 +63,9 @@ import org.opensearch.rest.action.admin.cluster.RestRestoreSnapshotAction; import org.opensearch.rest.action.admin.cluster.RestSnapshotsStatusAction; import org.opensearch.rest.action.admin.cluster.RestVerifyRepositoryAction; +import org.opensearch.rest.action.admin.cluster.RestDeleteStoredScriptAction; +import org.opensearch.rest.action.admin.cluster.RestGetStoredScriptAction; +import org.opensearch.rest.action.admin.cluster.RestPutStoredScriptAction; import org.opensearch.rest.action.cat.RestAllocationAction; import org.opensearch.rest.action.cat.RestRepositoriesAction; import org.opensearch.rest.action.cat.RestThreadPoolAction; @@ -76,6 +79,9 @@ import org.opensearch.rest.action.cat.RestPendingClusterTasksAction; import org.opensearch.rest.action.cat.RestSegmentsAction; import org.opensearch.rest.action.cat.RestSnapshotAction; +import org.opensearch.rest.action.ingest.RestDeletePipelineAction; +import org.opensearch.rest.action.ingest.RestGetPipelineAction; +import org.opensearch.rest.action.ingest.RestPutPipelineAction; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.rest.FakeRestRequest; import org.opensearch.threadpool.TestThreadPool; @@ -612,6 +618,59 @@ public void testVerifyRepository() { assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } + public void testDeletePipeline() { + FakeRestRequest request = new FakeRestRequest(); + request.params().put("cluster_manager_timeout", "1h"); + request.params().put("master_timeout", "3s"); + request.params().put("id", "test"); + RestDeletePipelineAction action = new RestDeletePipelineAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(request, client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testGetPipeline() { + RestGetPipelineAction action = new RestGetPipelineAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testPutPipeline() { + FakeRestRequest request = getFakeRestRequestWithBody(); + request.params().put("cluster_manager_timeout", "2m"); + request.params().put("master_timeout", "3s"); + request.params().put("id", "test"); + RestPutPipelineAction action = new RestPutPipelineAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(request, client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testDeleteStoredScript() { + RestDeleteStoredScriptAction action = new RestDeleteStoredScriptAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testGetStoredScript() { + RestGetStoredScriptAction action = new RestGetStoredScriptAction(); + Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + } + + public void testPutStoredScript() { + RestPutStoredScriptAction action = new RestPutStoredScriptAction(); + Exception e = assertThrows( + OpenSearchParseException.class, + () -> action.prepareRequest(getRestRequestWithBodyWithBothParams(), client) + ); + assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); + assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE, "empty templates should no longer be used"); + } + private MasterNodeRequest getMasterNodeRequest() { return new MasterNodeRequest() { @Override From 9b389bcadcca06530e0741eb84ffb5ed03c18467 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 13 Apr 2022 17:16:55 -0400 Subject: [PATCH 061/514] [Backport 2.x] Added a new line linter (#2892) * Added a new line linter (#2875) * Added linter to add new line Signed-off-by: Owais Kazi * Fixed new lines Signed-off-by: Owais Kazi * Ignore empty files Signed-off-by: Owais Kazi * Updated DEVELOPER GUIDE Signed-off-by: Owais Kazi * Renamed workflow file Signed-off-by: Owais Kazi * Fixed failing tests Signed-off-by: Owais Kazi (cherry picked from commit 3c5d997a765e24ffa32d35219fd5026cfb143a9d) * Fixed new lines Signed-off-by: Owais Kazi Co-authored-by: Owais Kazi --- .ci/dockerOnLinuxExclusions | 2 +- .github/workflows/code-hygiene.yml | 14 +++++ .github/workflows/delete_backport_branch.yml | 2 +- .github/workflows/links.yml | 2 +- .github/workflows/wrapper.yml | 2 +- .linelint.yml | 49 ++++++++++++++++++ DEVELOPER_GUIDE.md | 16 ++++++ README.md | 2 +- RELEASING.md | 2 +- SECURITY.md | 2 +- .../org.eclipse.core.resources.prefs | 2 +- .../src/main/resources/minimumGradleVersion | 2 +- .../testKit/testingConventions/build.gradle | 3 -- .../testingConventions/settings.gradle | 2 +- .../testKit/thirdPartyAudit/settings.gradle | 2 +- .../prepare_release_update_documentation.py | 1 - dev-tools/signoff-check.sh | 1 - .../resources/rest-api-spec/test/10_info.yml | 1 - .../resources/rest-api-spec/test/11_nodes.yml | 1 - distribution/src/bin/opensearch-env-from-file | 1 - distribution/src/bin/opensearch-env.bat | 1 - doc-tools/build.gradle | 1 - .../missingdoclet/MissingDoclet.class | Bin 0 -> 14156 bytes libs/dissect/build.gradle | 1 - .../test/resources/specification/tests.json | 2 +- libs/geo/build.gradle | 1 - libs/grok/build.gradle | 2 +- libs/grok/src/main/resources/patterns/exim | 1 - libs/grok/src/main/resources/patterns/junos | 1 - .../src/main/resources/patterns/postgresql | 1 - libs/ssl-config/build.gradle | 1 - .../analysis/common/cjk_analysis.json | 2 +- .../analysis/common/pattern_capture.json | 2 +- .../analysis-common/60_analysis_scripting.yml | 1 - .../test/cluster.stats/10_analysis_stats.yml | 1 - .../test/indices.analyze/10_synonyms.yml | 1 - .../test/search.query/60_synonym_graph.yml | 1 - .../test/search.query/70_intervals.yml | 1 - .../test/ingest/220_drop_processor.yml | 1 - modules/ingest-user-agent/build.gradle | 1 - .../src/test/test-regexes.yml | 2 +- modules/lang-expression/build.gradle | 1 - .../src/main/antlr/PainlessLexer.g4 | 2 +- .../test/painless/100_terms_agg.yml | 1 - modules/opensearch-dashboards/build.gradle | 1 - modules/repository-url/build.gradle | 1 - modules/systemd/build.gradle | 1 - .../index/analysis/KeywordTokenizer.rbbi | 2 +- plugins/analysis-kuromoji/build.gradle | 1 - .../test/analysis_phonetic/10_metaphone.yml | 1 - .../analysis_phonetic/20_double_metaphone.yml | 1 - .../analysis_phonetic/30_beider_morse.yml | 1 - .../analysis_phonetic/50_daitch_mokotoff.yml | 1 - plugins/analysis-smartcn/build.gradle | 1 - .../attributes/google-compute-default-zone | 2 +- .../gce/computeMetadata/v1/project/project-id | 2 +- plugins/examples/build.gradle | 1 - plugins/examples/custom-settings/build.gradle | 1 - .../src/main/config/custom.yml | 2 +- plugins/examples/rest-handler/build.gradle | 1 - .../script-expert-scoring/build.gradle | 1 - .../test/sample-files/asciidoc.asciidoc | 1 - .../test/ingest_attachment/10_basic.yml | 1 - .../test/mapper_annotatedtext/10_basic.yml | 1 - .../test/hdfs_repository/30_snapshot.yml | 1 - .../secure_hdfs_repository/30_snapshot.yml | 1 - plugins/transport-nio/build.gradle | 1 - qa/die-with-dignity/build.gradle | 1 - .../org/opensearch/common/cli/tool-cmd1.help | 2 +- .../org/opensearch/common/cli/tool.help | 2 +- .../test/multi_cluster/70_skip_shards.yml | 1 - .../test/old_cluster/10_basic.yml | 1 - .../test/old_cluster/20_date_range.yml | 2 - .../test/upgraded_cluster/10_basic.yml | 2 - .../test/upgraded_cluster/20_date_range.yml | 1 - .../ingest_mustache/10_ingest_disabled.yml | 1 - .../50_script_processor_using_painless.yml | 1 - .../60_pipeline_timestamp_date_mapping.yml | 1 - .../test/resources/scripts/master.painless | 2 +- ...SmokeTestPluginsClientYamlTestSuiteIT.java | 1 - .../opensearch.release-notes-1.0.0-rc1.md | 2 - .../opensearch.release-notes-1.1.0.md | 2 - .../opensearch.release-notes-1.2.0.md | 1 - .../opensearch.release-notes-1.2.4.md | 2 - .../opensearch.release-notes-1.3.0.md | 2 - .../rest-api-spec/test/bulk/10_basic.yml | 1 - .../test/bulk/20_list_of_strings.yml | 1 - .../rest-api-spec/test/bulk/30_big_string.yml | 1 - .../rest-api-spec/test/bulk/40_source.yml | 1 - .../rest-api-spec/test/cat.nodes/10_basic.yml | 1 - .../test/cluster.pending_tasks/10_basic.yml | 1 - .../test/cluster.remote_info/10_info.yml | 1 - .../10_basic.yml | 1 - .../rest-api-spec/test/create/40_routing.yml | 1 - .../rest-api-spec/test/delete/30_routing.yml | 1 - .../test/get/15_default_values.yml | 1 - .../test/get/20_stored_fields.yml | 2 - .../rest-api-spec/test/get/40_routing.yml | 1 - .../rest-api-spec/test/get/90_versions.yml | 1 - .../rest-api-spec/test/index/40_routing.yml | 1 - .../indices.delete_alias/all_path_options.yml | 1 - .../test/indices.exists_template/10_basic.yml | 1 - .../test/indices.forcemerge/10_basic.yml | 2 - .../40_missing_index.yml | 2 - .../50_field_wildcards.yml | 1 - .../20_get_missing.yml | 1 - .../indices.get_mapping/30_missing_index.yml | 1 - .../test/indices.get_settings/20_aliases.yml | 1 - .../indices.get_template/20_get_missing.yml | 1 - .../test/indices.open/20_multiple_indices.yml | 1 - .../indices.put_alias/all_path_options.yml | 1 - .../test/indices.put_mapping/10_basic.yml | 1 - .../indices.put_mapping/all_path_options.yml | 1 - .../indices.put_settings/all_path_options.yml | 1 - .../test/indices.refresh/10_basic.yml | 1 - .../test/indices.rollover/10_basic.yml | 1 - .../indices.rollover/20_max_doc_condition.yml | 1 - .../indices.update_aliases/20_routing.yml | 1 - .../test/indices.upgrade/10_basic.yml | 1 - .../test/info/20_lucene_version.yml | 3 -- .../test/nodes.stats/11_indices_metrics.yml | 1 - .../rest-api-spec/test/ping/10_ping.yml | 1 - .../search.aggregation/240_max_buckets.yml | 1 - .../test/search.aggregation/250_moving_fn.yml | 1 - .../350_variable_width_histogram.yml | 1 - .../test/search/10_source_filtering.yml | 1 - .../search/140_pre_filter_search_shards.yml | 1 - .../test/search/230_interval_query.yml | 2 - .../test/search/240_date_nanos.yml | 1 - .../test/search/90_search_after.yml | 1 - .../test/tasks.list/10_basic.yml | 1 - .../test/update/20_doc_upsert.yml | 2 - .../test/update/22_doc_as_upsert.yml | 2 - .../test/update/35_if_seq_no.yml | 1 - .../rest-api-spec/test/update/40_routing.yml | 1 - .../test/update/85_fields_meta.yml | 2 - .../plugins/concurrent-search/build.gradle | 2 +- .../search/aggregations/bucket/package-info | 1 - .../src/test/resources/config/opensearch.yml | 1 - .../hunspell/en_US_custom/settings.yml | 2 +- .../action/admin/invalid.txt.keystore | 1 - .../fieldstats-index-constraints-request.json | 2 +- .../index/analysis/shingle_analysis.json | 2 +- .../index/analysis/shingle_analysis2.json | 2 +- .../org/opensearch/index/analysis/stop.json | 2 +- .../genericstore/test-data.json | 2 +- .../dynamictemplate/pathmatch/test-data.json | 2 +- .../dynamictemplate/simple/test-data.json | 2 +- .../mapper/multifield/merge/test-data.json | 2 +- .../index/mapper/multifield/test-data.json | 2 +- settings.gradle | 1 - .../src/main/resources/provision/addprinc.sh | 2 +- .../resources/provision/krb5.conf.template | 1 - test/fixtures/minio-fixture/build.gradle | 1 - .../org.mockito.plugins.MockMaker | 2 +- .../test/suite1/20_another_test.yml | 1 - 156 files changed, 116 insertions(+), 169 deletions(-) create mode 100644 .github/workflows/code-hygiene.yml create mode 100644 .linelint.yml create mode 100644 doc-tools/missing-doclet/bin/main/org/opensearch/missingdoclet/MissingDoclet.class diff --git a/.ci/dockerOnLinuxExclusions b/.ci/dockerOnLinuxExclusions index 8061248a87df4..dd518c7043e2f 100644 --- a/.ci/dockerOnLinuxExclusions +++ b/.ci/dockerOnLinuxExclusions @@ -12,4 +12,4 @@ ol-7.7 sles-12.3 # older version used in Vagrant image sles-12.5 sles-15.1 -sles-15.2 \ No newline at end of file +sles-15.2 diff --git a/.github/workflows/code-hygiene.yml b/.github/workflows/code-hygiene.yml new file mode 100644 index 0000000000000..1952630e5bdfa --- /dev/null +++ b/.github/workflows/code-hygiene.yml @@ -0,0 +1,14 @@ +name: Code Hygiene + +on: [push, pull_request] + +jobs: + linelint: + runs-on: ubuntu-latest + name: Check if all files end in newline + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Linelint + uses: fernandrone/linelint@0.0.4 diff --git a/.github/workflows/delete_backport_branch.yml b/.github/workflows/delete_backport_branch.yml index d654df6b40257..387a124b8cb6a 100644 --- a/.github/workflows/delete_backport_branch.yml +++ b/.github/workflows/delete_backport_branch.yml @@ -12,4 +12,4 @@ jobs: - name: Delete merged branch uses: SvanBoxel/delete-merged-branch@main env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index 21fb7ab9086ee..ca05aee8be378 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -16,4 +16,4 @@ jobs: args: --accept=200,403,429 --exclude-mail **/*.html **/*.md **/*.txt **/*.json --exclude-file .lychee.excludes fail: true env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/wrapper.yml b/.github/workflows/wrapper.yml index d577699b66dc0..be5e7afb56ba0 100644 --- a/.github/workflows/wrapper.yml +++ b/.github/workflows/wrapper.yml @@ -7,4 +7,4 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: gradle/wrapper-validation-action@v1 \ No newline at end of file + - uses: gradle/wrapper-validation-action@v1 diff --git a/.linelint.yml b/.linelint.yml new file mode 100644 index 0000000000000..7b7bc162eef28 --- /dev/null +++ b/.linelint.yml @@ -0,0 +1,49 @@ +# 'true' will fix files +autofix: true + +ignore: + - .git/ + - .gradle/ + - .idea/ + - '*.sha1' + - '*.txt' + - '.github/CODEOWNERS' + - 'buildSrc/src/testKit/opensearch.build/LICENSE' + - 'buildSrc/src/testKit/opensearch.build/NOTICE' + - 'server/licenses/apache-log4j-extras-DEPENDENCIES' + # Empty files + - 'doc-tools/missing-doclet/bin/main/org/opensearch/missingdoclet/MissingDoclet.class' + - 'buildSrc/src/integTest/resources/org/opensearch/gradle/internal/fake_git/remote/build.gradle' + - 'buildSrc/src/integTest/resources/org/opensearch/gradle/internal/fake_git/remote/distribution/archives/oss-darwin-tar/build.gradle' + - 'buildSrc/src/integTest/resources/org/opensearch/gradle/internal/fake_git/remote/distribution/bwc/bugfix/build.gradle' + - 'buildSrc/src/integTest/resources/org/opensearch/gradle/internal/fake_git/remote/distribution/bwc/minor/build.gradle' + - 'buildSrc/src/main/resources/buildSrc.marker' + - 'buildSrc/src/testKit/opensearch-build-resources/settings.gradle' + - 'buildSrc/src/testKit/opensearch.build/settings.gradle' + - 'buildSrc/src/testKit/reaper/settings.gradle' + - 'buildSrc/src/testKit/symbolic-link-preserving-tar/settings.gradle' + - 'buildSrc/src/testKit/testingConventions/empty_test_task/.gitignore' + - 'client/rest-high-level/src/main/resources/META-INF/services/org.opensearch.plugins.spi.NamedXContentProvider' + - 'distribution/bwc/bugfix/build.gradle' + - 'distribution/bwc/maintenance/build.gradle' + - 'distribution/bwc/minor/build.gradle' + - 'distribution/bwc/staged/build.gradle' + - 'libs/ssl-config/src/test/resources/certs/pem-utils/empty.pem' + - 'qa/evil-tests/src/test/resources/org/opensearch/common/logging/does_not_exist/nothing_to_see_here' + - 'qa/os/centos-6/build.gradle' + - 'qa/os/debian-8/build.gradle' + - 'qa/os/oel-6/build.gradle' + - 'qa/os/oel-7/build.gradle' + - 'qa/os/sles-12/build.gradle' + # Test requires no new line for these files + - 'server/src/test/resources/org/opensearch/action/bulk/simple-bulk11.json' + - 'server/src/test/resources/org/opensearch/action/search/simple-msearch5.json' + +rules: + # checks if file ends in a newline character + end-of-file: + # set to true to enable this rule + enable: true + + # if true also checks if file ends in a single newline character + single-new-line: true diff --git a/DEVELOPER_GUIDE.md b/DEVELOPER_GUIDE.md index 9b1bc933eb1e3..11fcb324c8cae 100644 --- a/DEVELOPER_GUIDE.md +++ b/DEVELOPER_GUIDE.md @@ -48,6 +48,7 @@ - [Distributed Framework](#distributed-framework) - [Submitting Changes](#submitting-changes) - [Backports](#backports) + - [LineLint](#linelint) # Developer Guide @@ -472,3 +473,18 @@ See [CONTRIBUTING](CONTRIBUTING.md). ## Backports The Github workflow in [`backport.yml`](.github/workflows/backport.yml) creates backport PRs automatically when the original PR with an appropriate label `backport ` is merged to main with the backport workflow run successfully on the PR. For example, if a PR on main needs to be backported to `1.x` branch, add a label `backport 1.x` to the PR and make sure the backport workflow runs on the PR along with other checks. Once this PR is merged to main, the workflow will create a backport PR to the `1.x` branch. + +## LineLint +A linter in [`code-hygiene.yml`](.github/workflows/code-hygiene.yml) that validates simple newline and whitespace rules in all sorts of files. It can: +- Recursively check a directory tree for files that do not end in a newline +- Automatically fix these files by adding a newline or trimming extra newlines. + +Rules are defined in `.linelint.yml`. + +Executing the binary will automatically search the local directory tree for linting errors. + + linelint . + +Pass a list of files or directories to limit your search. + + linelint README.md LICENSE diff --git a/README.md b/README.md index 6a9a2a69d7367..bb1def63340fe 100644 --- a/README.md +++ b/README.md @@ -45,4 +45,4 @@ Copyright OpenSearch Contributors. See [NOTICE](NOTICE.txt) for details. OpenSearch is a registered trademark of Amazon Web Services. -OpenSearch includes certain Apache-licensed Elasticsearch code from Elasticsearch B.V. and other source code. Elasticsearch B.V. is not the source of that other source code. ELASTICSEARCH is a registered trademark of Elasticsearch B.V. \ No newline at end of file +OpenSearch includes certain Apache-licensed Elasticsearch code from Elasticsearch B.V. and other source code. Elasticsearch B.V. is not the source of that other source code. ELASTICSEARCH is a registered trademark of Elasticsearch B.V. diff --git a/RELEASING.md b/RELEASING.md index 50bb965b8d551..1ef59446f6e31 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -1,3 +1,3 @@ ## Releasing -This project follows [OpenSearch project branching, labelling, and releasing](https://github.com/opensearch-project/.github/blob/main/RELEASING.md). \ No newline at end of file +This project follows [OpenSearch project branching, labelling, and releasing](https://github.com/opensearch-project/.github/blob/main/RELEASING.md). diff --git a/SECURITY.md b/SECURITY.md index 0b85ca04ed260..b86292104335f 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,3 +1,3 @@ ## Reporting a Vulnerability -If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/) or directly via email to aws-security@amazon.com. Please do **not** create a public GitHub issue. \ No newline at end of file +If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/) or directly via email to aws-security@amazon.com. Please do **not** create a public GitHub issue. diff --git a/buildSrc/src/main/resources/eclipse.settings/org.eclipse.core.resources.prefs b/buildSrc/src/main/resources/eclipse.settings/org.eclipse.core.resources.prefs index 6fd0a9aab1327..29abf99956411 100644 --- a/buildSrc/src/main/resources/eclipse.settings/org.eclipse.core.resources.prefs +++ b/buildSrc/src/main/resources/eclipse.settings/org.eclipse.core.resources.prefs @@ -3,4 +3,4 @@ encoding//src/main/java=UTF-8 encoding//src/main/resources=UTF-8 encoding//src/test/java=UTF-8 encoding//src/test/resources=UTF-8 -encoding/=UTF-8 \ No newline at end of file +encoding/=UTF-8 diff --git a/buildSrc/src/main/resources/minimumGradleVersion b/buildSrc/src/main/resources/minimumGradleVersion index 6b0e58e78f5ee..815da58b7a9ed 100644 --- a/buildSrc/src/main/resources/minimumGradleVersion +++ b/buildSrc/src/main/resources/minimumGradleVersion @@ -1 +1 @@ -7.4.1 \ No newline at end of file +7.4.1 diff --git a/buildSrc/src/testKit/testingConventions/build.gradle b/buildSrc/src/testKit/testingConventions/build.gradle index 418e833e8cb14..676960bcc8b70 100644 --- a/buildSrc/src/testKit/testingConventions/build.gradle +++ b/buildSrc/src/testKit/testingConventions/build.gradle @@ -88,6 +88,3 @@ project(':valid_setup_with_base') { } } } - - - diff --git a/buildSrc/src/testKit/testingConventions/settings.gradle b/buildSrc/src/testKit/testingConventions/settings.gradle index c4206edd63ff7..bb64f39e020c5 100644 --- a/buildSrc/src/testKit/testingConventions/settings.gradle +++ b/buildSrc/src/testKit/testingConventions/settings.gradle @@ -16,4 +16,4 @@ include 'all_classes_in_tasks' include 'not_implementing_base' include 'valid_setup_no_base' include 'valid_setup_with_base' -include 'tests_in_main' \ No newline at end of file +include 'tests_in_main' diff --git a/buildSrc/src/testKit/thirdPartyAudit/settings.gradle b/buildSrc/src/testKit/thirdPartyAudit/settings.gradle index 582faadddaef1..603d8b7da6e5d 100644 --- a/buildSrc/src/testKit/thirdPartyAudit/settings.gradle +++ b/buildSrc/src/testKit/thirdPartyAudit/settings.gradle @@ -9,4 +9,4 @@ * GitHub history for details. */ -include 'sample_jars' \ No newline at end of file +include 'sample_jars' diff --git a/dev-tools/prepare_release_update_documentation.py b/dev-tools/prepare_release_update_documentation.py index c7eae4eeb3245..d4edbb110f278 100644 --- a/dev-tools/prepare_release_update_documentation.py +++ b/dev-tools/prepare_release_update_documentation.py @@ -136,4 +136,3 @@ def callback(line): print('WARNING: no documentation references updates for release %s' % (release_version)) print('*** Done.') - diff --git a/dev-tools/signoff-check.sh b/dev-tools/signoff-check.sh index 56cb49455165e..5fe00c430ca79 100755 --- a/dev-tools/signoff-check.sh +++ b/dev-tools/signoff-check.sh @@ -28,4 +28,3 @@ done # Return non-zero error code if any commits were missing signoff exit $missingSignoff - diff --git a/distribution/docker/src/test/resources/rest-api-spec/test/10_info.yml b/distribution/docker/src/test/resources/rest-api-spec/test/10_info.yml index 2b0f6683a24cf..97b3b7b5d0f4d 100644 --- a/distribution/docker/src/test/resources/rest-api-spec/test/10_info.yml +++ b/distribution/docker/src/test/resources/rest-api-spec/test/10_info.yml @@ -7,4 +7,3 @@ - is_true: version - is_true: version.number - match: { version.build_type: "docker" } - diff --git a/distribution/docker/src/test/resources/rest-api-spec/test/11_nodes.yml b/distribution/docker/src/test/resources/rest-api-spec/test/11_nodes.yml index 95ea022696942..a6b78645087f4 100644 --- a/distribution/docker/src/test/resources/rest-api-spec/test/11_nodes.yml +++ b/distribution/docker/src/test/resources/rest-api-spec/test/11_nodes.yml @@ -123,4 +123,3 @@ - match: $body: | /^(\S{5,}\n)+$/ - diff --git a/distribution/src/bin/opensearch-env-from-file b/distribution/src/bin/opensearch-env-from-file index 73cd11123bfff..be5b428c268c8 100644 --- a/distribution/src/bin/opensearch-env-from-file +++ b/distribution/src/bin/opensearch-env-from-file @@ -47,4 +47,3 @@ for VAR_NAME_FILE in OPENSEARCH_PASSWORD_FILE KEYSTORE_PASSWORD_FILE ; do unset "$VAR_NAME_FILE" fi done - diff --git a/distribution/src/bin/opensearch-env.bat b/distribution/src/bin/opensearch-env.bat index bc8a6ce53a5f5..96770f72f35c8 100644 --- a/distribution/src/bin/opensearch-env.bat +++ b/distribution/src/bin/opensearch-env.bat @@ -74,4 +74,3 @@ if defined JAVA_OPTS ( rem check the Java version %JAVA% -cp "%OPENSEARCH_CLASSPATH%" "org.opensearch.tools.java_version_checker.JavaVersionChecker" || exit /b 1 - diff --git a/doc-tools/build.gradle b/doc-tools/build.gradle index 98b2149cb59a9..c47097c3d6035 100644 --- a/doc-tools/build.gradle +++ b/doc-tools/build.gradle @@ -8,4 +8,3 @@ version '1.0.0-SNAPSHOT' repositories { mavenCentral() } - diff --git a/doc-tools/missing-doclet/bin/main/org/opensearch/missingdoclet/MissingDoclet.class b/doc-tools/missing-doclet/bin/main/org/opensearch/missingdoclet/MissingDoclet.class new file mode 100644 index 0000000000000000000000000000000000000000..8729def18e4b3eda7184b1e3e49f1bf055d152db GIT binary patch literal 14156 zcmbta34B!5)j#KEd6UTlhOlT*aeyetJXqnwXLEAqD9eG+uHWi?weigVi&vE(nYJ4?|<%lZKq+q?oGXiS2dq0V|fYLW!QhZ13X7?aV_*tEX!q827@Wt!3yk0mi8wJ{VOvnnHFkALg_(-mTe{ZHS zRvL5x_&zff!%Vu6Rsr9kaJVrFW-hPH!cGQ}4ON#Iv>NA}{4pz*c&U+^gqGhVYBfVEL#m#T_Ss2VNw~*D5WcDt3e^Aipk71sfR$kQZT%$si2v_ z=o9KP*>0OjGijD=*K1OQu7XHn5l2-xDsH|bF%u{`St@GMY&uDnikTD_g&+dh8taJ; zhOMxx4~6A+n3N#MvnK+59!kZb(`V;MWvkQPP)dUYQw3dKmcg&vYtk;-4VuQRU7+bq zcZF=$HRzo{giOr=-cgBl4p3e|e~n51MgI+Z)6;A9^g;94EHcrw1`(h^y3VBQ>D^%3 z-cT~2L4i8G1a)T@rumvzCtL~|1BSGxuRS#2=)6e*&{|3#pqmW35r%8bDYfNt@ov%w z>1J3jki;<^!EH?KlR4%1&^s$Rdw^OWrjHnO3)8|ez&OaL%bjA{d z7O}#CP(K7}UOuLC7m*>@?RL7uppU^J7&`l|E(CX>=bLv$E<^5NHqWH|YQkfg^BC z+x%8ebUFu}GP1!-pP>f~`m88||AUKVyh#tz=R|)d!jV`AmIkcYYS0(p3ynLyJsuv6 zTF$1W^m%&Nq=UlHC6VNYSPU2p%c&kU>5vGBsRg7d-Y-s&bQ~5R;eB$>5tAOH$8EW9 zf!xQF8My}zT>;g6*%nErK*FQ6!=NYN)o4VfdrENZV3?7e zBgwAau~e^>ioly3>~Gg@*CZ7K?Dz{zCynNg)q{~}*h+Zl+f1jn`orDR0E-;EmaPIEM@%=_ zvmGcJJoFQw#J}50Etb`ODy#i$)FSSFWBA`)L}uP0czemDU(&Czpp{67Mn88Fs%6Zo zP^nDbvIdV$vT)bc?MWP$WqY z{TX7QyMx<=H(xdBuk^QU-h@N#>;mDMggj~v`@2d15WXoCz7bH<0Eyvy&7{|bcf66L zYxlhLhG?lbb99C6Sb6C!z(^;+3lrIClbI12O~>(J+#SJ_XoP9~Byc>&2?)n~QkX3< zP1a%!rCi9x1{ZdMwB^mzeC;CNYw1k(dDd!KTSm z1UEBbCR<~@RszO9ybh9$<&z$sh8__Ysrf?*%kRXZvfOl&%XkKq8TJx+XwBwn$4NDK z7Hr`7kPE`VCw!90Co>`s1My@u)B_~Wu54<`UeIBA8GMS#r;6<;MEKQT!gJYg@aZlk zZDpnXKa=MXEPi2UFbExTH!m=`g3o{+O2ymaS6hjuP!b!R=}2eR#D;M;F7dELTU#Nu zecF8iTKqViqjS01|44mz%L2+XiDgB(3W}ydCKYrQjy;`MlC##ALQQ*4WQk*5nI$ z6^wo;w!1x)>gg5dW8yX8s`F}YHn<7!%I>@BQt@~+S=Ss1A=XdAWK?K#%q_eIpaz27 zEjn*8{?G;wuSEdoh=5;*(*CW3DgUbAPH5Cf*z$+1o+uIGE{o)a8G(?7QX33Ap<&s%4A)(@N8~s|RT~ZNKt5^w zsk^M6!IXsbj?OKEO6Wu!z+FtSw-vTd0N?0Ma>PrA4FCWfu>oEO!_wG6g+8g<>*b62 z5`#A*9W&-Insprb*F>TaIFm2s%it;5IT`4+jFjiB>H=bmzIJ^$NUs{aWg^F}8{w|A z9sGO_nY@*Iuv^^W2#EW2E-mwsYYaNx4(i4qn*|nf10IHcSU#3-ZIt-au)?>A!<$NE zaW9-n7z3BTaTbW+Xy3}oe5y2SX5Wnsw zMG&h!dnR-=vyaTQBG1Zpwr;{0PqKHj(-5wSCmb`_90yS^n23(@9+U#t4-OunAq4KnwKK;{*B_fJn4e|s;#hu>%L zdma65AHadoN!Y=Fnf!kK0FDbY51EGlkptl9;Tpc1O#UDv5I1`4{3+8}*)WcolkFfl zu1*NlbX&N zcG2%KgFLm_`ZCJm7I|#@8<*X9-3QltI^ql>}8%S zft(o)2Hy`D^26Hf82N6Tuat-QvnD?vaZ5=k>6!wN@+1fcx><$mVgacI7`@Q@t{*A%Eb}w!8{LVqp z3kgAfnSTo!!;4BH7=dH%s_pDi6&vmD1~31fUorR(V1J>8?NB&Nxr0ppqt3f+v-Dja zGEDqulZxmmi4$Hm`L7ZN6t#4A20O)NKQ12m-_!RH<3ta6{cOP9ZzYqs`a^iRZ7>>b zcWaJt=D`%Q^ZdFbCFcT3{Dz6t3Gxx(>`TWdnZsAMF2t<2Og;Wdp-dgW=R@=5E|wqR3ZTh69srkWvL z#qGi74K^IJOf_4Yih|v1TO=!}PBsav%GVrIouY?#wloDhB|)f8Gu2#a^4U#D5w>>( z11$j!kKa`Dq;q;_OIL71Cm_u}@d8s-NN*`l(cRjVKE;`)S}5&P1#er@M>kXz)0_-z z1>#+UJ-urpRy5oqVX{GUVP2x4{;lCq#aT>?ZCS}HXrn`H_~)f+u{z68bs+e-%4GC3 zQ!P#lk^;;yiGu~&_wP~(HpcI0m54`L)Rhw!DYa_aIn~*Zk*51xcJGfel zw;@q0S7cd4l^RI4!V5}!gM$<6cWQ#n3+_Kr@I zPhBAkhD_C@nlbrGpK3Ij5QP|LaRRJyv zAcfa%$?K0K%_GP?-u##}2Zpm4HA9{Rkq7mXthyKV(yY3SpORIdidlHGf?tx`dR^j1 zU6;7()+O$#b&1y~*k=yD6`g`#yh+K_ee1+xqIEjjPA5Np=b_e#v5fNM>ccd@y7&-P zR3D);4^gdMEPfb$iq69CY@CB=ITg}MoS+HNG-Kc8v;?iDy#_6%WvH<{9>FXdlI41z zyD(3oZ}sDJ&gR3&In-do^G2va(WaWmsc|!^O(V3%uC9}6Te{jV)u2;-2&)umh~{X# ztOZV6fsu7IA2;Yra6P(;j%cW6+dDc?d8nQ`G)CUxKy0^k0$!H)5BRk)QeacAy7mxl zsII9!Oq()Tn5z4Z0vAt!Zcplc{0^n<(+f5>(q~&@%ixx0aLQ+K>aWnbC|A+fvY=e;U<3Qh%M8G@6tixi_W-K*V!fH9PEaKk8iWgx zE3xb#(Ny%|PSk<_I@E--tEwN>puS%L)DH=~w;`5B*YDET2g!-8H z0@(IjAlA33g1(ytT2&gfDh&{B3;@n2=#vg;9^yBt!ocmAlE)1;IN+%wS(WD!e<1@B?bL_=IYyr!p@)EedZfB$m>wCT z2b}UgDTfR1rG2^qpd1mLd{NVIb%usO4q!Y;PwuCM?)TIC=@j?-nf)}){r>6!^5oF` z@gZu^`xM0y)Hw5X096i6e>|2NFJ1!!=U-si+dU2S3K1{z59=7FXqt+Wg zqcFWh1GwfKq+dgFUZ!hsGkGoj32!j|Odq1Z&=BqzAECd2%a7C7fuJAYvhYQ;{|48B zzoQfMI&k|IF7p_Xs-KH9q~v)nDe)z|#aL@Oc5%6EJ(avc;TgsW=qQ`j_Smd;g3far z4BDf)?*zy@YD_7?^#*_Lf!>-6ZomyUwh-aH#bM56z`$=@o~$kV-7x)OADOjff5OLJ znvLGSNUx^E@dH#;_+UYXO|_=usbumrIIBLY|u!1Ngy_t?v+V3Gk7Y$F zsmxl4St6Ik_fiSe+b~yUSfdjXM|>Jh;kh)G7vT66bUL4j$C3-Fo~!VjubP^;me%uP zyoRfzEBP$yZey+&KLeeN{cZgJ37iP?*=mckRN zX_)^>U`W)^R5GUe-lRDO7ka!)rywJX+g1mQuVO7P#vH8~VFVB(43G0M?1wK{lM7DW zOS5pi4F|aqhrMWoTfsjM);z_*y>wH}F%AZ*7d^(X0riFDg(KX}R9`$q+slhxHCta) zUZkb>2yfB?T<;m83(7rqKL_iLMI(GUG%{aNUxJ*Kx{o^Oo{f>)cstO&0vFo7909r;aj$t5 z_W`M!>0*vTMvG`SE#`jo8ko0$V;qOY2gbCWx5p1)yb!8~ir)m7C&*8REt70;&;U%1 z@SaX3Iqi;E>)!KDVBP%FN~pk@hE0^@_W-nZC|H~;!eI-r1<}nQ=@sn|0oX`~6|NRm z*rmV}?~<=;6;$yJBYY#IgN_D3JTQz9-~Ot8j6Wp9J|e?zt1rY-cgj+CK}++!2dLI= zIL1RG{25`E^1|}sBmAHqTwYjRUOdbXITi6uY^v6Sg^5E{#9Kkx9`bP*RJEvrw?Ut5 zrL(vfRE>FFeLaNBBv>;+JGF9E1AeMZ*2! z-^mm$1<#5!j__Bq)@wTs!rqN%g*VWh{2n@l`jh;DEO|PXrp7Tx zo`54qeNBT`@GbaV1yn~1`P=**?A%Tz{9UNDVi@ zQSk{{K*cumL;V?e$ft#6sR)Z>2%UD=;Ie!}-=Ibr>_`v>V__xlnH&P&20*0kxHt@l z`3Hd<-{}GL5cT7~82_;G)Zlzygi;to%2KB^ol<N9>CkO2k9mL9BwndkY(bIr+MUfnn#ZFKeT7y zp;!2y{4a;ni0a;?4uhUAJ;VD3b@_ZA1Zel!6jIk<5HQc@9^}_HKTCxV;mrSj;)~w( z)d%@MaBz*_5EX8!KB&ao_04i?1*jD}6?$5_Ot*F%wIa9jRq1jEsv@a*-M(j}mR{c@ zwW&^@Dn-rXR^WZy?<;YqJt?(Pw{N=C%G?@UlKXu=r^fKX?k{w^PLi(llI2pH;r5*> zwV7`1bg4~uYxAWx#jTwowP|*3^CSG)L-25Ykj7J0C6Kz1s!`S;Dm@qF3Pe6FDA!Ps zI#G7f<#Z*=5JH3)$~dgwyHH+3@1q-0-bA<29VqXlPtksq2k0Ss1m&ZM0G~qnG<}1f zNBIK%h+ahbQ+UyTK=}&1<=0TY4)?8CRl+Pz=b0#H;my^2lnbCa&O*P}Xoz zWYGn?sAjF9s!vFmhEjeisZD;6;2QI#J2F3+A(^&Ob4PV#sy?q|ifmSdC9yLEv#Lkb zB4}d;>p4T6J*>`wFP(9k^#S0*ECJwlI$)NnSE4ywMMvbc_>?4_oaO7Wyd2nv_*c9t z7}F88l7VD5@nEmKK5J#4Eo1-_i7IEE%?_Al)fv-m6hca}TrGR0aMns?s!^@ZfzfRd z0u+(*tzvA0l$Nv28kC|Ez16NmkjY2b%UfB?d&eyAwiK!stfJH!CCc<{DpCO|P(jtH zy7X7K+N3VlUz^os>T>Qnvj09LD*8dz1X ecBrHpEG~hEXaB8p%67X{J5hSTe~rkUwEr(LO30D` literal 0 HcmV?d00001 diff --git a/libs/dissect/build.gradle b/libs/dissect/build.gradle index 47f7970ea5ac0..dc98d2820ef52 100644 --- a/libs/dissect/build.gradle +++ b/libs/dissect/build.gradle @@ -40,4 +40,3 @@ dependencies { tasks.named('forbiddenApisMain').configure { replaceSignatureFiles 'jdk-signatures' } - diff --git a/libs/dissect/src/test/resources/specification/tests.json b/libs/dissect/src/test/resources/specification/tests.json index 1cb85ce651940..490383ba3fedb 100644 --- a/libs/dissect/src/test/resources/specification/tests.json +++ b/libs/dissect/src/test/resources/specification/tests.json @@ -360,4 +360,4 @@ "append": "" } -] \ No newline at end of file +] diff --git a/libs/geo/build.gradle b/libs/geo/build.gradle index fac5c1b84d2b0..8b81129f43b67 100644 --- a/libs/geo/build.gradle +++ b/libs/geo/build.gradle @@ -42,4 +42,3 @@ tasks.named('forbiddenApisMain').configure { // TODO: Need to decide how we want to handle for forbidden signatures with the changes to core replaceSignatureFiles 'jdk-signatures' } - diff --git a/libs/grok/build.gradle b/libs/grok/build.gradle index 49885b57e7f70..f4a7c0d198399 100644 --- a/libs/grok/build.gradle +++ b/libs/grok/build.gradle @@ -44,4 +44,4 @@ tasks.named('forbiddenApisMain').configure { thirdPartyAudit.ignoreMissingClasses( 'org.jcodings.unicode.UnicodeCodeRange' -) \ No newline at end of file +) diff --git a/libs/grok/src/main/resources/patterns/exim b/libs/grok/src/main/resources/patterns/exim index 68c4e5cd7d0d7..e81eace04d32d 100644 --- a/libs/grok/src/main/resources/patterns/exim +++ b/libs/grok/src/main/resources/patterns/exim @@ -10,4 +10,3 @@ EXIM_PROTOCOL (P=%{NOTSPACE:protocol}) EXIM_MSG_SIZE (S=%{NUMBER:exim_msg_size}) EXIM_HEADER_ID (id=%{NOTSPACE:exim_header_id}) EXIM_SUBJECT (T=%{QS:exim_subject}) - diff --git a/libs/grok/src/main/resources/patterns/junos b/libs/grok/src/main/resources/patterns/junos index 4eea59d08ccf9..2da91cc6ce3df 100644 --- a/libs/grok/src/main/resources/patterns/junos +++ b/libs/grok/src/main/resources/patterns/junos @@ -6,4 +6,3 @@ RT_FLOW1 %{RT_FLOW_EVENT:event}: %{GREEDYDATA:close-reason}: %{IP:src-ip}/%{INT: RT_FLOW2 %{RT_FLOW_EVENT:event}: session created %{IP:src-ip}/%{INT:src-port}->%{IP:dst-ip}/%{INT:dst-port} %{DATA:service} %{IP:nat-src-ip}/%{INT:nat-src-port}->%{IP:nat-dst-ip}/%{INT:nat-dst-port} %{DATA:src-nat-rule-name} %{DATA:dst-nat-rule-name} %{INT:protocol-id} %{DATA:policy-name} %{DATA:from-zone} %{DATA:to-zone} %{INT:session-id} .* RT_FLOW3 %{RT_FLOW_EVENT:event}: session denied %{IP:src-ip}/%{INT:src-port}->%{IP:dst-ip}/%{INT:dst-port} %{DATA:service} %{INT:protocol-id}\(\d\) %{DATA:policy-name} %{DATA:from-zone} %{DATA:to-zone} .* - diff --git a/libs/grok/src/main/resources/patterns/postgresql b/libs/grok/src/main/resources/patterns/postgresql index c5b3e90b7250f..6901c6253e926 100644 --- a/libs/grok/src/main/resources/patterns/postgresql +++ b/libs/grok/src/main/resources/patterns/postgresql @@ -1,3 +1,2 @@ # Default postgresql pg_log format pattern POSTGRESQL %{DATESTAMP:timestamp} %{TZ} %{DATA:user_id} %{GREEDYDATA:connection_id} %{POSINT:pid} - diff --git a/libs/ssl-config/build.gradle b/libs/ssl-config/build.gradle index 740d5e309350c..456641f0d7645 100644 --- a/libs/ssl-config/build.gradle +++ b/libs/ssl-config/build.gradle @@ -61,4 +61,3 @@ tasks.test { jvmArgs += ["--add-opens", "java.base/java.security.cert=ALL-UNNAMED"] } } - diff --git a/modules/analysis-common/src/test/resources/org/opensearch/analysis/common/cjk_analysis.json b/modules/analysis-common/src/test/resources/org/opensearch/analysis/common/cjk_analysis.json index 89a1281473cd7..c69b889c914a4 100644 --- a/modules/analysis-common/src/test/resources/org/opensearch/analysis/common/cjk_analysis.json +++ b/modules/analysis-common/src/test/resources/org/opensearch/analysis/common/cjk_analysis.json @@ -34,4 +34,4 @@ } } } -} \ No newline at end of file +} diff --git a/modules/analysis-common/src/test/resources/org/opensearch/analysis/common/pattern_capture.json b/modules/analysis-common/src/test/resources/org/opensearch/analysis/common/pattern_capture.json index d82fb987e6ed2..5057a1e6d7f9e 100644 --- a/modules/analysis-common/src/test/resources/org/opensearch/analysis/common/pattern_capture.json +++ b/modules/analysis-common/src/test/resources/org/opensearch/analysis/common/pattern_capture.json @@ -43,4 +43,4 @@ } } } -} \ No newline at end of file +} diff --git a/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/analysis-common/60_analysis_scripting.yml b/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/analysis-common/60_analysis_scripting.yml index 2015fe31fccb5..1637c8736134f 100644 --- a/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/analysis-common/60_analysis_scripting.yml +++ b/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/analysis-common/60_analysis_scripting.yml @@ -68,4 +68,3 @@ - match: { tokens.1.token: "f" } - match: { tokens.2.token: "g" } - match: { tokens.3.token: "h" } - diff --git a/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/cluster.stats/10_analysis_stats.yml b/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/cluster.stats/10_analysis_stats.yml index a19a1f2721910..5468da5216bb4 100644 --- a/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/cluster.stats/10_analysis_stats.yml +++ b/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/cluster.stats/10_analysis_stats.yml @@ -119,4 +119,3 @@ - match: { indices.analysis.built_in_analyzers.2.name: spanish } - match: { indices.analysis.built_in_analyzers.2.count: 2 } - match: { indices.analysis.built_in_analyzers.2.index_count: 2 } - diff --git a/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/indices.analyze/10_synonyms.yml b/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/indices.analyze/10_synonyms.yml index f0f8765ab5130..42d1c23001300 100644 --- a/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/indices.analyze/10_synonyms.yml +++ b/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/indices.analyze/10_synonyms.yml @@ -76,4 +76,3 @@ - match: { tokens.5.token: dude } - match: { tokens.5.position: 4 } - match: { tokens.5.positionLength: null } - diff --git a/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/search.query/60_synonym_graph.yml b/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/search.query/60_synonym_graph.yml index ae039e453be6c..4388de3eef30a 100644 --- a/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/search.query/60_synonym_graph.yml +++ b/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/search.query/60_synonym_graph.yml @@ -229,4 +229,3 @@ setup: query: bar baz analyzer: lower_graph_syns - match: { hits.total: 1 } - diff --git a/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/search.query/70_intervals.yml b/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/search.query/70_intervals.yml index 35a611d13f359..9ad68e960421c 100644 --- a/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/search.query/70_intervals.yml +++ b/modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/search.query/70_intervals.yml @@ -56,4 +56,3 @@ setup: use_field: text_en max_gaps: 1 - match: { hits.total.value: 1 } - diff --git a/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/220_drop_processor.yml b/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/220_drop_processor.yml index 77a1df81a296a..ef8332c2670d0 100644 --- a/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/220_drop_processor.yml +++ b/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/220_drop_processor.yml @@ -91,4 +91,3 @@ teardown: get: index: test id: 3 - diff --git a/modules/ingest-user-agent/build.gradle b/modules/ingest-user-agent/build.gradle index cd04925287b8f..a3752ad1c7f7e 100644 --- a/modules/ingest-user-agent/build.gradle +++ b/modules/ingest-user-agent/build.gradle @@ -43,4 +43,3 @@ restResources { testClusters.all { extraConfigFile 'ingest-user-agent/test-regexes.yml', file('src/test/test-regexes.yml') } - diff --git a/modules/ingest-user-agent/src/test/test-regexes.yml b/modules/ingest-user-agent/src/test/test-regexes.yml index e41dec700c047..8815c85c7c6e9 100644 --- a/modules/ingest-user-agent/src/test/test-regexes.yml +++ b/modules/ingest-user-agent/src/test/test-regexes.yml @@ -1,3 +1,3 @@ user_agent_parsers: - regex: '.*' - family_replacement: 'Test' \ No newline at end of file + family_replacement: 'Test' diff --git a/modules/lang-expression/build.gradle b/modules/lang-expression/build.gradle index e3feacd71f060..9d7b0e2f0979c 100644 --- a/modules/lang-expression/build.gradle +++ b/modules/lang-expression/build.gradle @@ -52,4 +52,3 @@ tasks.named("dependencyLicenses").configure { mapping from: /lucene-.*/, to: 'lucene' mapping from: /asm-.*/, to: 'asm' } - diff --git a/modules/lang-painless/src/main/antlr/PainlessLexer.g4 b/modules/lang-painless/src/main/antlr/PainlessLexer.g4 index 7dd168833e347..21b03b85d8edd 100644 --- a/modules/lang-painless/src/main/antlr/PainlessLexer.g4 +++ b/modules/lang-painless/src/main/antlr/PainlessLexer.g4 @@ -124,4 +124,4 @@ ID: [_a-zA-Z] [_a-zA-Z0-9]*; mode AFTER_DOT; DOTINTEGER: ( '0' | [1-9] [0-9]* ) -> mode(DEFAULT_MODE); -DOTID: [_a-zA-Z] [_a-zA-Z0-9]* -> mode(DEFAULT_MODE); \ No newline at end of file +DOTID: [_a-zA-Z] [_a-zA-Z0-9]* -> mode(DEFAULT_MODE); diff --git a/modules/lang-painless/src/yamlRestTest/resources/rest-api-spec/test/painless/100_terms_agg.yml b/modules/lang-painless/src/yamlRestTest/resources/rest-api-spec/test/painless/100_terms_agg.yml index 000e1af694d7d..aa01647811c83 100644 --- a/modules/lang-painless/src/yamlRestTest/resources/rest-api-spec/test/painless/100_terms_agg.yml +++ b/modules/lang-painless/src/yamlRestTest/resources/rest-api-spec/test/painless/100_terms_agg.yml @@ -139,4 +139,3 @@ setup: - is_false: aggregations.placeholder.buckets.0.str_terms.buckets.1.key_as_string - match: { aggregations.placeholder.buckets.0.str_terms.buckets.1.doc_count: 1 } - match: { aggregations.placeholder.buckets.0.the_bucket_script.value: 2.0 } - diff --git a/modules/opensearch-dashboards/build.gradle b/modules/opensearch-dashboards/build.gradle index 9bda17243bdb4..f76ca739faf81 100644 --- a/modules/opensearch-dashboards/build.gradle +++ b/modules/opensearch-dashboards/build.gradle @@ -41,4 +41,3 @@ dependencies { testClusters.all { module ':modules:reindex' } - diff --git a/modules/repository-url/build.gradle b/modules/repository-url/build.gradle index 24742416de6f2..702f0e9bb0f8b 100644 --- a/modules/repository-url/build.gradle +++ b/modules/repository-url/build.gradle @@ -75,4 +75,3 @@ testClusters.all { "http://snapshot.test*,http://${urlFixture.addressAndPort}" }, PropertyNormalization.IGNORE_VALUE } - diff --git a/modules/systemd/build.gradle b/modules/systemd/build.gradle index b157fd9321fc9..26e094a9eeae1 100644 --- a/modules/systemd/build.gradle +++ b/modules/systemd/build.gradle @@ -32,4 +32,3 @@ opensearchplugin { description 'Integrates OpenSearch with systemd' classname 'org.opensearch.systemd.SystemdPlugin' } - diff --git a/plugins/analysis-icu/src/test/resources/org/opensearch/index/analysis/KeywordTokenizer.rbbi b/plugins/analysis-icu/src/test/resources/org/opensearch/index/analysis/KeywordTokenizer.rbbi index 8e6de8aa94abb..86eb398ee9157 100644 --- a/plugins/analysis-icu/src/test/resources/org/opensearch/index/analysis/KeywordTokenizer.rbbi +++ b/plugins/analysis-icu/src/test/resources/org/opensearch/index/analysis/KeywordTokenizer.rbbi @@ -18,4 +18,4 @@ # Apply rule status {200}=RBBI.WORD_LETTER, which is mapped # to token type by DefaultICUTokenizerConfig. -.+ {200}; \ No newline at end of file +.+ {200}; diff --git a/plugins/analysis-kuromoji/build.gradle b/plugins/analysis-kuromoji/build.gradle index 60738fb28b6d5..426b85f44bf55 100644 --- a/plugins/analysis-kuromoji/build.gradle +++ b/plugins/analysis-kuromoji/build.gradle @@ -46,4 +46,3 @@ restResources { tasks.named("dependencyLicenses").configure { mapping from: /lucene-.*/, to: 'lucene' } - diff --git a/plugins/analysis-phonetic/src/yamlRestTest/resources/rest-api-spec/test/analysis_phonetic/10_metaphone.yml b/plugins/analysis-phonetic/src/yamlRestTest/resources/rest-api-spec/test/analysis_phonetic/10_metaphone.yml index 1be0d8525a1c6..2268d30c986df 100644 --- a/plugins/analysis-phonetic/src/yamlRestTest/resources/rest-api-spec/test/analysis_phonetic/10_metaphone.yml +++ b/plugins/analysis-phonetic/src/yamlRestTest/resources/rest-api-spec/test/analysis_phonetic/10_metaphone.yml @@ -31,4 +31,3 @@ - match: { tokens.1.token: joe } - match: { tokens.2.token: BLKS } - match: { tokens.3.token: bloggs } - diff --git a/plugins/analysis-phonetic/src/yamlRestTest/resources/rest-api-spec/test/analysis_phonetic/20_double_metaphone.yml b/plugins/analysis-phonetic/src/yamlRestTest/resources/rest-api-spec/test/analysis_phonetic/20_double_metaphone.yml index 84b0129414c8e..40215cc469fc9 100644 --- a/plugins/analysis-phonetic/src/yamlRestTest/resources/rest-api-spec/test/analysis_phonetic/20_double_metaphone.yml +++ b/plugins/analysis-phonetic/src/yamlRestTest/resources/rest-api-spec/test/analysis_phonetic/20_double_metaphone.yml @@ -28,4 +28,3 @@ - length: { tokens: 1 } - match: { tokens.0.token: SPRKLF } - diff --git a/plugins/analysis-phonetic/src/yamlRestTest/resources/rest-api-spec/test/analysis_phonetic/30_beider_morse.yml b/plugins/analysis-phonetic/src/yamlRestTest/resources/rest-api-spec/test/analysis_phonetic/30_beider_morse.yml index bdd1ddef388df..dcc46484780dc 100644 --- a/plugins/analysis-phonetic/src/yamlRestTest/resources/rest-api-spec/test/analysis_phonetic/30_beider_morse.yml +++ b/plugins/analysis-phonetic/src/yamlRestTest/resources/rest-api-spec/test/analysis_phonetic/30_beider_morse.yml @@ -30,4 +30,3 @@ - length: { tokens: 1 } - match: { tokens.0.token: Svarts } - diff --git a/plugins/analysis-phonetic/src/yamlRestTest/resources/rest-api-spec/test/analysis_phonetic/50_daitch_mokotoff.yml b/plugins/analysis-phonetic/src/yamlRestTest/resources/rest-api-spec/test/analysis_phonetic/50_daitch_mokotoff.yml index bee4c8bf5f432..9b173a710ea43 100644 --- a/plugins/analysis-phonetic/src/yamlRestTest/resources/rest-api-spec/test/analysis_phonetic/50_daitch_mokotoff.yml +++ b/plugins/analysis-phonetic/src/yamlRestTest/resources/rest-api-spec/test/analysis_phonetic/50_daitch_mokotoff.yml @@ -27,4 +27,3 @@ - length: { tokens: 1 } - match: { tokens.0.token: "645740" } - diff --git a/plugins/analysis-smartcn/build.gradle b/plugins/analysis-smartcn/build.gradle index 92f2774854715..d74d314ab0673 100644 --- a/plugins/analysis-smartcn/build.gradle +++ b/plugins/analysis-smartcn/build.gradle @@ -47,4 +47,3 @@ restResources { tasks.named("dependencyLicenses").configure { mapping from: /lucene-.*/, to: 'lucene' } - diff --git a/plugins/discovery-gce/src/test/resources/org/opensearch/discovery/gce/computeMetadata/v1/project/attributes/google-compute-default-zone b/plugins/discovery-gce/src/test/resources/org/opensearch/discovery/gce/computeMetadata/v1/project/attributes/google-compute-default-zone index 6cf886270bef1..218127ccfb695 100644 --- a/plugins/discovery-gce/src/test/resources/org/opensearch/discovery/gce/computeMetadata/v1/project/attributes/google-compute-default-zone +++ b/plugins/discovery-gce/src/test/resources/org/opensearch/discovery/gce/computeMetadata/v1/project/attributes/google-compute-default-zone @@ -1 +1 @@ -europe-west1-b \ No newline at end of file +europe-west1-b diff --git a/plugins/discovery-gce/src/test/resources/org/opensearch/discovery/gce/computeMetadata/v1/project/project-id b/plugins/discovery-gce/src/test/resources/org/opensearch/discovery/gce/computeMetadata/v1/project/project-id index 25b8069381897..44be476f3ae83 100644 --- a/plugins/discovery-gce/src/test/resources/org/opensearch/discovery/gce/computeMetadata/v1/project/project-id +++ b/plugins/discovery-gce/src/test/resources/org/opensearch/discovery/gce/computeMetadata/v1/project/project-id @@ -1 +1 @@ -metadataserver \ No newline at end of file +metadataserver diff --git a/plugins/examples/build.gradle b/plugins/examples/build.gradle index e4e0ca6f7be99..460c6e81eac5c 100644 --- a/plugins/examples/build.gradle +++ b/plugins/examples/build.gradle @@ -36,4 +36,3 @@ configure(project('painless-whitelist')) { } } } - diff --git a/plugins/examples/custom-settings/build.gradle b/plugins/examples/custom-settings/build.gradle index 104660c458991..5b35d887b3db1 100644 --- a/plugins/examples/custom-settings/build.gradle +++ b/plugins/examples/custom-settings/build.gradle @@ -42,4 +42,3 @@ testClusters.all { // Adds a setting in the OpenSearch keystore before running the integration tests keystore 'custom.secured', 'password' } - diff --git a/plugins/examples/custom-settings/src/main/config/custom.yml b/plugins/examples/custom-settings/src/main/config/custom.yml index 1759e0ff96d40..258e050a0664b 100644 --- a/plugins/examples/custom-settings/src/main/config/custom.yml +++ b/plugins/examples/custom-settings/src/main/config/custom.yml @@ -2,4 +2,4 @@ custom: simple: foo list: [0, 1, 1, 2, 3, 5, 8, 13, 21] - filtered: secret \ No newline at end of file + filtered: secret diff --git a/plugins/examples/rest-handler/build.gradle b/plugins/examples/rest-handler/build.gradle index cc939b15854d5..b97d091af9d08 100644 --- a/plugins/examples/rest-handler/build.gradle +++ b/plugins/examples/rest-handler/build.gradle @@ -56,4 +56,3 @@ javaRestTest { dependsOn exampleFixture nonInputProperties.systemProperty 'external.address', "${-> exampleFixture.addressAndPort}" } - diff --git a/plugins/examples/script-expert-scoring/build.gradle b/plugins/examples/script-expert-scoring/build.gradle index 9f2bab20a7db0..e4ddd97abbe4c 100644 --- a/plugins/examples/script-expert-scoring/build.gradle +++ b/plugins/examples/script-expert-scoring/build.gradle @@ -39,4 +39,3 @@ opensearchplugin { } test.enabled = false - diff --git a/plugins/ingest-attachment/src/test/resources/org/opensearch/ingest/attachment/test/sample-files/asciidoc.asciidoc b/plugins/ingest-attachment/src/test/resources/org/opensearch/ingest/attachment/test/sample-files/asciidoc.asciidoc index dc06d4e83dd30..4a2b2c388cfc1 100644 --- a/plugins/ingest-attachment/src/test/resources/org/opensearch/ingest/attachment/test/sample-files/asciidoc.asciidoc +++ b/plugins/ingest-attachment/src/test/resources/org/opensearch/ingest/attachment/test/sample-files/asciidoc.asciidoc @@ -2,4 +2,3 @@ = AsciiDoc test Here is a test of the asciidoc format. - diff --git a/plugins/ingest-attachment/src/yamlRestTest/resources/rest-api-spec/test/ingest_attachment/10_basic.yml b/plugins/ingest-attachment/src/yamlRestTest/resources/rest-api-spec/test/ingest_attachment/10_basic.yml index 607fa5bf8b781..88f6f33ad0a66 100644 --- a/plugins/ingest-attachment/src/yamlRestTest/resources/rest-api-spec/test/ingest_attachment/10_basic.yml +++ b/plugins/ingest-attachment/src/yamlRestTest/resources/rest-api-spec/test/ingest_attachment/10_basic.yml @@ -12,4 +12,3 @@ - contains: { 'nodes.$master.plugins': { name: ingest-attachment } } - contains: { 'nodes.$master.ingest.processors': { type: attachment } } - diff --git a/plugins/mapper-annotated-text/src/yamlRestTest/resources/rest-api-spec/test/mapper_annotatedtext/10_basic.yml b/plugins/mapper-annotated-text/src/yamlRestTest/resources/rest-api-spec/test/mapper_annotatedtext/10_basic.yml index b4acccf36879d..0e43e9e40b619 100644 --- a/plugins/mapper-annotated-text/src/yamlRestTest/resources/rest-api-spec/test/mapper_annotatedtext/10_basic.yml +++ b/plugins/mapper-annotated-text/src/yamlRestTest/resources/rest-api-spec/test/mapper_annotatedtext/10_basic.yml @@ -142,4 +142,3 @@ request_cache: false body: { "query" : {"match_phrase" : { "my_field" : {"query": "~MARK0", "analyzer": "whitespace"} } }, "highlight" : { "type" : "annotated", "fields" : { "my_field" : {} } } } - match: {_shards.failed: 0} - diff --git a/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/hdfs_repository/30_snapshot.yml b/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/hdfs_repository/30_snapshot.yml index 20019686d3db1..fbe0e0a8b0066 100644 --- a/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/hdfs_repository/30_snapshot.yml +++ b/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/hdfs_repository/30_snapshot.yml @@ -45,4 +45,3 @@ - do: snapshot.delete_repository: repository: test_snapshot_repository - diff --git a/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/30_snapshot.yml b/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/30_snapshot.yml index 44f29fe0341a6..821110dc52bed 100644 --- a/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/30_snapshot.yml +++ b/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/30_snapshot.yml @@ -47,4 +47,3 @@ - do: snapshot.delete_repository: repository: test_snapshot_repository - diff --git a/plugins/transport-nio/build.gradle b/plugins/transport-nio/build.gradle index 88355cdf22728..2b9e11cb2521f 100644 --- a/plugins/transport-nio/build.gradle +++ b/plugins/transport-nio/build.gradle @@ -183,4 +183,3 @@ thirdPartyAudit { 'io.netty.handler.ssl.util.OpenJdkSelfSignedCertGenerator' ) } - diff --git a/qa/die-with-dignity/build.gradle b/qa/die-with-dignity/build.gradle index 008e2e19bf72f..db8762fe921bf 100644 --- a/qa/die-with-dignity/build.gradle +++ b/qa/die-with-dignity/build.gradle @@ -35,4 +35,3 @@ testClusters.javaRestTest { } test.enabled = false - diff --git a/qa/evil-tests/src/test/resources/org/opensearch/common/cli/tool-cmd1.help b/qa/evil-tests/src/test/resources/org/opensearch/common/cli/tool-cmd1.help index d083e3a65348f..60acabffb6544 100644 --- a/qa/evil-tests/src/test/resources/org/opensearch/common/cli/tool-cmd1.help +++ b/qa/evil-tests/src/test/resources/org/opensearch/common/cli/tool-cmd1.help @@ -1 +1 @@ -cmd1 help \ No newline at end of file +cmd1 help diff --git a/qa/evil-tests/src/test/resources/org/opensearch/common/cli/tool.help b/qa/evil-tests/src/test/resources/org/opensearch/common/cli/tool.help index 023b1accdffb1..2a5850ba79db2 100644 --- a/qa/evil-tests/src/test/resources/org/opensearch/common/cli/tool.help +++ b/qa/evil-tests/src/test/resources/org/opensearch/common/cli/tool.help @@ -1 +1 @@ -tool help \ No newline at end of file +tool help diff --git a/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/multi_cluster/70_skip_shards.yml b/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/multi_cluster/70_skip_shards.yml index 92ae11c712b25..23cd1567b49ba 100644 --- a/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/multi_cluster/70_skip_shards.yml +++ b/qa/multi-cluster-search/src/test/resources/rest-api-spec/test/multi_cluster/70_skip_shards.yml @@ -220,4 +220,3 @@ # When all shards are skipped current logic returns 1 to produce a valid search result - match: { _shards.skipped : 1} - match: { _shards.failed: 0 } - diff --git a/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/old_cluster/10_basic.yml b/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/old_cluster/10_basic.yml index e1ffcea930a42..840c7f5f6297e 100644 --- a/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/old_cluster/10_basic.yml +++ b/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/old_cluster/10_basic.yml @@ -204,4 +204,3 @@ tasks.get: wait_for_completion: true task_id: $task - diff --git a/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/old_cluster/20_date_range.yml b/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/old_cluster/20_date_range.yml index 89992eeba616f..6427a45e19f58 100644 --- a/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/old_cluster/20_date_range.yml +++ b/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/old_cluster/20_date_range.yml @@ -111,5 +111,3 @@ gte: "2019-02-01T00:00+01:00" lte: "2019-02-01T00:00+01:00" - match: { hits.total: 1 } - - diff --git a/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/10_basic.yml b/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/10_basic.yml index cb74c33cbd31a..f1c00ee896f92 100644 --- a/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/10_basic.yml +++ b/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/10_basic.yml @@ -133,5 +133,3 @@ wait_for_completion: true task_id: $task_id - match: { task.headers.X-Opaque-Id: "Reindexing Again" } - - diff --git a/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/20_date_range.yml b/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/20_date_range.yml index 7dae2a4d6241a..026dcff32e175 100644 --- a/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/20_date_range.yml +++ b/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/20_date_range.yml @@ -38,4 +38,3 @@ time_frame: gte: "2019-02-01T00:00+01:00" lte: "2019-02-01T00:00+01:00" - diff --git a/qa/smoke-test-ingest-disabled/src/test/resources/rest-api-spec/test/ingest_mustache/10_ingest_disabled.yml b/qa/smoke-test-ingest-disabled/src/test/resources/rest-api-spec/test/ingest_mustache/10_ingest_disabled.yml index 7a0cdcbef0786..c8fcebfba67ab 100644 --- a/qa/smoke-test-ingest-disabled/src/test/resources/rest-api-spec/test/ingest_mustache/10_ingest_disabled.yml +++ b/qa/smoke-test-ingest-disabled/src/test/resources/rest-api-spec/test/ingest_mustache/10_ingest_disabled.yml @@ -112,4 +112,3 @@ _id: test_id2 pipeline: my_pipeline_1 - f1: v2 - diff --git a/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/50_script_processor_using_painless.yml b/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/50_script_processor_using_painless.yml index eaf6b24030a06..c58735f7862e6 100644 --- a/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/50_script_processor_using_painless.yml +++ b/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/50_script_processor_using_painless.yml @@ -102,4 +102,3 @@ - match: { error.processor_type: "script" } - match: { error.type: "script_exception" } - match: { error.reason: "compile error" } - diff --git a/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/60_pipeline_timestamp_date_mapping.yml b/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/60_pipeline_timestamp_date_mapping.yml index 0f514f2213492..d7f565f30c93d 100644 --- a/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/60_pipeline_timestamp_date_mapping.yml +++ b/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/60_pipeline_timestamp_date_mapping.yml @@ -34,4 +34,3 @@ id: 1 pipeline: "my_timely_pipeline" body: {} - diff --git a/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/scripts/master.painless b/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/scripts/master.painless index 29880e8fd5f57..82f007e8e4dac 100644 --- a/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/scripts/master.painless +++ b/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/scripts/master.painless @@ -1 +1 @@ -ctx.bytes_total = ctx.bytes_in + ctx.bytes_out \ No newline at end of file +ctx.bytes_total = ctx.bytes_in + ctx.bytes_out diff --git a/qa/smoke-test-plugins/src/test/java/org/opensearch/smoketest/SmokeTestPluginsClientYamlTestSuiteIT.java b/qa/smoke-test-plugins/src/test/java/org/opensearch/smoketest/SmokeTestPluginsClientYamlTestSuiteIT.java index a7e50601ad9df..a1c61ca97f877 100644 --- a/qa/smoke-test-plugins/src/test/java/org/opensearch/smoketest/SmokeTestPluginsClientYamlTestSuiteIT.java +++ b/qa/smoke-test-plugins/src/test/java/org/opensearch/smoketest/SmokeTestPluginsClientYamlTestSuiteIT.java @@ -49,4 +49,3 @@ public static Iterable parameters() throws Exception { return OpenSearchClientYamlSuiteTestCase.createParameters(); } } - diff --git a/release-notes/opensearch.release-notes-1.0.0-rc1.md b/release-notes/opensearch.release-notes-1.0.0-rc1.md index 2223d732abb98..205873fd282b2 100644 --- a/release-notes/opensearch.release-notes-1.0.0-rc1.md +++ b/release-notes/opensearch.release-notes-1.0.0-rc1.md @@ -411,5 +411,3 @@ Signed-off-by: Abbas Hussain <abbas_10690@yahoo.com> - - diff --git a/release-notes/opensearch.release-notes-1.1.0.md b/release-notes/opensearch.release-notes-1.1.0.md index 0545e106a15a5..ba5a5d4c95c60 100644 --- a/release-notes/opensearch.release-notes-1.1.0.md +++ b/release-notes/opensearch.release-notes-1.1.0.md @@ -386,5 +386,3 @@ Signed-off-by: Sooraj Sinha <soosinha@amazon.com> - - diff --git a/release-notes/opensearch.release-notes-1.2.0.md b/release-notes/opensearch.release-notes-1.2.0.md index 86860e5f872da..d7c75f3c0eaf2 100644 --- a/release-notes/opensearch.release-notes-1.2.0.md +++ b/release-notes/opensearch.release-notes-1.2.0.md @@ -458,4 +458,3 @@ Signed-off-by: Nicholas Walter Knize <nknize@apache.org> - diff --git a/release-notes/opensearch.release-notes-1.2.4.md b/release-notes/opensearch.release-notes-1.2.4.md index dc2852a102c44..dc0bce20a2a00 100644 --- a/release-notes/opensearch.release-notes-1.2.4.md +++ b/release-notes/opensearch.release-notes-1.2.4.md @@ -72,5 +72,3 @@ Signed-off-by: dblock <dblock@amazon.com> - - diff --git a/release-notes/opensearch.release-notes-1.3.0.md b/release-notes/opensearch.release-notes-1.3.0.md index 62c5be8413943..7dd71fa47b72f 100644 --- a/release-notes/opensearch.release-notes-1.3.0.md +++ b/release-notes/opensearch.release-notes-1.3.0.md @@ -1295,5 +1295,3 @@ [Nick Knize](mailto:nknize@apache.org) - Thu, 4 Nov 2021 14:46:57 -0500 Signed-off-by: Nicholas Walter Knize <nknize@apache.org> - - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/10_basic.yml index 8c8c6d50abf41..c91ec511a0fdb 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/10_basic.yml @@ -223,4 +223,3 @@ - match: { items.0.index.status: 400 } - match: { items.0.index.error.type: illegal_argument_exception } - match: { items.0.index.error.reason: "no write index is defined for alias [test_index]. The write index may be explicitly disabled using is_write_index=false or the alias points to multiple indices without one being designated as a write index" } - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/20_list_of_strings.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/20_list_of_strings.yml index 3d956dce54289..cb3553abbd435 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/20_list_of_strings.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/20_list_of_strings.yml @@ -14,4 +14,3 @@ index: test_index - match: {count: 2} - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/30_big_string.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/30_big_string.yml index 8b6467eeed975..fabe674697cde 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/30_big_string.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/30_big_string.yml @@ -14,4 +14,3 @@ index: test_index - match: {count: 2} - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/40_source.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/40_source.yml index e29e84740ee5c..fb9554619a818 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/40_source.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/40_source.yml @@ -68,4 +68,3 @@ - match: { items.0.update.get._source.foo: garply } - is_false: items.0.update.get._source.bar - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.nodes/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.nodes/10_basic.yml index 789ea5fc19c3f..f04c674d420ee 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.nodes/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.nodes/10_basic.yml @@ -131,4 +131,3 @@ - match: $body: | /^(\S{5,}\n)+$/ - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.pending_tasks/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.pending_tasks/10_basic.yml index f8fd8ebef170d..885f6c4a97912 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.pending_tasks/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.pending_tasks/10_basic.yml @@ -11,4 +11,3 @@ local: true - is_true: tasks - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.remote_info/10_info.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.remote_info/10_info.yml index e11eff2b78a3c..75058cefd5c53 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.remote_info/10_info.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.remote_info/10_info.yml @@ -3,4 +3,3 @@ - do: cluster.remote_info: {} - is_true: '' - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.voting_config_exclusions/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.voting_config_exclusions/10_basic.yml index 5474c9bdf4da0..23eebacabf3f3 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.voting_config_exclusions/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/cluster.voting_config_exclusions/10_basic.yml @@ -104,4 +104,3 @@ teardown: cluster.post_voting_config_exclusions: node_ids: nodeId node_names: nodeName - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/create/40_routing.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/create/40_routing.yml index 9c048c361bd5c..e1341ac2b5380 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/create/40_routing.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/create/40_routing.yml @@ -39,4 +39,3 @@ get: index: test_1 id: 1 - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/30_routing.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/delete/30_routing.yml index 27e9350caed70..c3c407cd9173a 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/30_routing.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/delete/30_routing.yml @@ -30,4 +30,3 @@ index: test_1 id: 1 routing: 5 - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get/15_default_values.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get/15_default_values.yml index 921397b238f51..fabf8fb87a7b6 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get/15_default_values.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/get/15_default_values.yml @@ -14,4 +14,3 @@ - match: { _index: test_1 } - match: { _id: '1' } - match: { _source: { foo: "bar" } } - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get/20_stored_fields.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get/20_stored_fields.yml index 23c7e5cbc90a6..1bafdc3dab21f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get/20_stored_fields.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/get/20_stored_fields.yml @@ -48,5 +48,3 @@ - match: { fields.foo: [bar] } - match: { fields.count: [1] } - match: { _source.foo: bar } - - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get/40_routing.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get/40_routing.yml index 9ba546d6ef942..7f45b39add8a7 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get/40_routing.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/get/40_routing.yml @@ -41,4 +41,3 @@ get: index: test_1 id: 1 - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get/90_versions.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get/90_versions.yml index 9037a9113e937..3f45a1da09dce 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get/90_versions.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/get/90_versions.yml @@ -80,4 +80,3 @@ id: 1 version: 1 version_type: external_gte - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/index/40_routing.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/index/40_routing.yml index 630cf39dbe65c..f6f497269b043 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/index/40_routing.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/index/40_routing.yml @@ -40,4 +40,3 @@ get: index: test_1 id: 1 - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.delete_alias/all_path_options.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.delete_alias/all_path_options.yml index d1d01cbaaa7e6..67369b67b3249 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.delete_alias/all_path_options.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.delete_alias/all_path_options.yml @@ -221,4 +221,3 @@ setup: catch: param indices.delete_alias: index: "test_index1" - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.exists_template/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.exists_template/10_basic.yml index c7892f58a6f59..32b692b16c5d6 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.exists_template/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.exists_template/10_basic.yml @@ -41,4 +41,3 @@ setup: local: true - is_false: '' - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.forcemerge/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.forcemerge/10_basic.yml index 137736e6823a9..d62c4c8882b13 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.forcemerge/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.forcemerge/10_basic.yml @@ -27,5 +27,3 @@ index: test max_num_segments: 10 only_expunge_deletes: true - - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_field_mapping/40_missing_index.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_field_mapping/40_missing_index.yml index 7c7b07b587849..690f83d5f3c2b 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_field_mapping/40_missing_index.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_field_mapping/40_missing_index.yml @@ -6,5 +6,3 @@ indices.get_field_mapping: index: test_index fields: field - - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_field_mapping/50_field_wildcards.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_field_mapping/50_field_wildcards.yml index 2c9ff58b445df..814bd1e3a4063 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_field_mapping/50_field_wildcards.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_field_mapping/50_field_wildcards.yml @@ -127,4 +127,3 @@ setup: - match: {test_index_2.mappings.t1.full_name: t1 } - match: {test_index_2.mappings.t2.full_name: t2 } - length: {test_index_2.mappings: 2} - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_index_template/20_get_missing.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_index_template/20_get_missing.yml index 2dfa466ba0eca..4c855d928d1c0 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_index_template/20_get_missing.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_index_template/20_get_missing.yml @@ -17,4 +17,3 @@ setup: catch: missing indices.get_index_template: name: test - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_mapping/30_missing_index.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_mapping/30_missing_index.yml index 1bbfbc4f4c967..e9502cdc08436 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_mapping/30_missing_index.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_mapping/30_missing_index.yml @@ -29,4 +29,3 @@ index: test_index ignore_unavailable: true allow_no_indices: false - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_settings/20_aliases.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_settings/20_aliases.yml index da7678202ed34..4f8d1371d90b1 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_settings/20_aliases.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_settings/20_aliases.yml @@ -23,4 +23,3 @@ - match: { test-index.settings.index.number_of_replicas: "3" } - match: { test-index.settings.index.number_of_shards: "2" } - match: { test-index.settings.index.refresh_interval: "-1" } - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_template/20_get_missing.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_template/20_get_missing.yml index 2751f57dacb6c..ee7ba62c9beb4 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_template/20_get_missing.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_template/20_get_missing.yml @@ -10,4 +10,3 @@ setup: catch: missing indices.get_template: name: test - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.open/20_multiple_indices.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.open/20_multiple_indices.yml index bef5ea8a54651..2720b08514ba3 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.open/20_multiple_indices.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.open/20_multiple_indices.yml @@ -101,4 +101,3 @@ setup: search: rest_total_hits_as_int: true index: test_index3 - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_alias/all_path_options.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_alias/all_path_options.yml index bef57bbddf165..47828c43350b7 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_alias/all_path_options.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_alias/all_path_options.yml @@ -113,4 +113,3 @@ setup: - do: catch: param indices.put_alias: {} - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_mapping/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_mapping/10_basic.yml index 36317c7ae173c..23f87ea1ec2b3 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_mapping/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_mapping/10_basic.yml @@ -143,4 +143,3 @@ - is_false: test_index.mappings.properties.foo.meta.bar - match: { test_index.mappings.properties.foo.meta.baz: "quux" } - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_mapping/all_path_options.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_mapping/all_path_options.yml index c1daa76fe3d6e..ca7a21df20ea4 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_mapping/all_path_options.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_mapping/all_path_options.yml @@ -159,4 +159,3 @@ setup: indices.get_mapping: {} - match: {test_index1.mappings.properties.text.type: text} - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_settings/all_path_options.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_settings/all_path_options.yml index 07f1956f0fcca..ac45c4e098e6e 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_settings/all_path_options.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_settings/all_path_options.yml @@ -110,4 +110,3 @@ setup: - match: {test_index1.settings.index.refresh_interval: 1s} - match: {test_index2.settings.index.refresh_interval: 1s} - match: {foo.settings.index.refresh_interval: 1s} - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.refresh/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.refresh/10_basic.yml index 6e493a0cce936..bf20d51bc97cd 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.refresh/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.refresh/10_basic.yml @@ -55,4 +55,3 @@ setup: - match: { _shards.total: 0 } - match: { _shards.successful: 0 } - match: { _shards.failed: 0 } - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/10_basic.yml index dc68ffc9a3b86..a36db0cda8526 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/10_basic.yml @@ -148,4 +148,3 @@ body: conditions: max_docs: 1 - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/20_max_doc_condition.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/20_max_doc_condition.yml index f5d223259dc06..7d1b447b4e293 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/20_max_doc_condition.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/20_max_doc_condition.yml @@ -52,4 +52,3 @@ - match: { conditions: { "[max_docs: 2]": true } } - match: { rolled_over: true } - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.update_aliases/20_routing.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.update_aliases/20_routing.yml index ecedcef0c1a48..c812d84dfe7e3 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.update_aliases/20_routing.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.update_aliases/20_routing.yml @@ -132,4 +132,3 @@ setup: index: test_index - match: {test_index.aliases.test_alias: {'index_routing': '5', 'search_routing': '5'}} - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.upgrade/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.upgrade/10_basic.yml index 55070cb8c1f97..62c1a51dace52 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.upgrade/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.upgrade/10_basic.yml @@ -69,4 +69,3 @@ indices.upgrade: index: ["test_index", "does_not_exist"] ignore_unavailable: false - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/info/20_lucene_version.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/info/20_lucene_version.yml index 83414fbabc565..427a585815db0 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/info/20_lucene_version.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/info/20_lucene_version.yml @@ -2,6 +2,3 @@ "Lucene Version": - do: {info: {}} - is_true: version.lucene_version - - - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/nodes.stats/11_indices_metrics.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/nodes.stats/11_indices_metrics.yml index a09619b7255c3..1f1f42890355e 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/nodes.stats/11_indices_metrics.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/nodes.stats/11_indices_metrics.yml @@ -224,4 +224,3 @@ - is_false: nodes.$node_id.indices.translog - is_false: nodes.$node_id.indices.recovery - is_true: nodes.$node_id.indices.segments.file_sizes - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/ping/10_ping.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/ping/10_ping.yml index ec07c218dabd9..da160503caab4 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/ping/10_ping.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/ping/10_ping.yml @@ -2,4 +2,3 @@ "Ping": - do: { ping: {}} - is_true: '' - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/240_max_buckets.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/240_max_buckets.yml index 82965bda51576..c540814a1690d 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/240_max_buckets.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/240_max_buckets.yml @@ -118,4 +118,3 @@ setup: 2: terms: field: date - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/250_moving_fn.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/250_moving_fn.yml index 339fe72b77730..c0a8d2fb4500c 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/250_moving_fn.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/250_moving_fn.yml @@ -74,4 +74,3 @@ buckets_path: "the_avg" window: -1 script: "MovingFunctions.windowMax(values)" - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/350_variable_width_histogram.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/350_variable_width_histogram.yml index 071e543e8a25e..cc41ef1fa6cd3 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/350_variable_width_histogram.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/350_variable_width_histogram.yml @@ -47,4 +47,3 @@ setup: - match: { aggregations.histo.buckets.1.doc_count: 1 } - match: { aggregations.histo.buckets.2.key: 4.5 } - match: { aggregations.histo.buckets.2.doc_count: 2 } - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/search/10_source_filtering.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/search/10_source_filtering.yml index 091638d6a07fb..4de2e8142f6ec 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/search/10_source_filtering.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/search/10_source_filtering.yml @@ -196,4 +196,3 @@ setup: # When this test is run during runtime-field's tests we *don't* get floating point errors. Thus the funny assertion here that matches both. - lt: { hits.hits.0.fields.d.0: 3.141 } - gte: { hits.hits.0.fields.d.0: 3.14 } - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/search/140_pre_filter_search_shards.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/search/140_pre_filter_search_shards.yml index 31f6f35003e2d..40e1fbcf7a2ab 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/search/140_pre_filter_search_shards.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/search/140_pre_filter_search_shards.yml @@ -154,4 +154,3 @@ setup: - match: { _shards.failed: 0 } - match: { hits.total: 2 } - length: { aggregations.idx_terms.buckets: 2 } - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/search/230_interval_query.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/search/230_interval_query.yml index 0286d3caf66b8..0b9172e0740ea 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/search/230_interval_query.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/search/230_interval_query.yml @@ -750,5 +750,3 @@ setup: - prefix: prefix: out - match: { hits.total.value: 3 } - - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/search/240_date_nanos.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/search/240_date_nanos.yml index feb875e81a785..1ddba45c97c72 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/search/240_date_nanos.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/search/240_date_nanos.yml @@ -164,4 +164,3 @@ setup: - match: { aggregations.date.buckets.1.key: 1540857600000 } - match: { aggregations.date.buckets.1.key_as_string: "2018-10-30T00:00:00.000Z" } - match: { aggregations.date.buckets.1.doc_count: 2 } - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/search/90_search_after.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/search/90_search_after.yml index 5f5d88dba7687..d7690ac6097ef 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/search/90_search_after.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/search/90_search_after.yml @@ -224,4 +224,3 @@ - match: {hits.hits.0._index: test } - match: {hits.hits.0._source.timestamp: "2019-10-21 00:30:04.828740" } - match: {hits.hits.0.sort: [1571617804828740000] } - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/tasks.list/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/tasks.list/10_basic.yml index d0385ac0125f4..fd6bb7f96eb9d 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/tasks.list/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/tasks.list/10_basic.yml @@ -32,4 +32,3 @@ - is_true: tasks - match: { tasks.0.headers.X-Opaque-Id: "That is me" } - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/update/20_doc_upsert.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/update/20_doc_upsert.yml index 4d03971aba252..cfdd38b9ffd1c 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/update/20_doc_upsert.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/update/20_doc_upsert.yml @@ -32,5 +32,3 @@ - match: { _source.foo: bar } - match: { _source.count: 1 } - - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/update/22_doc_as_upsert.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/update/22_doc_as_upsert.yml index c65fc5af27fcc..7ee5c01089ff1 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/update/22_doc_as_upsert.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/update/22_doc_as_upsert.yml @@ -32,5 +32,3 @@ - match: { _source.foo: bar } - match: { _source.count: 2 } - - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/update/35_if_seq_no.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/update/35_if_seq_no.yml index f982adf693ad0..c93be37be49f5 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/update/35_if_seq_no.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/update/35_if_seq_no.yml @@ -61,4 +61,3 @@ - match: { errors: true } - match: { items.0.update.status: 409 } - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/update/40_routing.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/update/40_routing.yml index 6f43d381e0537..28e42f9dafea9 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/update/40_routing.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/update/40_routing.yml @@ -55,4 +55,3 @@ doc: { foo: baz } - match: { get._source.foo: baz } - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/update/85_fields_meta.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/update/85_fields_meta.yml index fe76ab5299cda..2d4fda22f4442 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/update/85_fields_meta.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/update/85_fields_meta.yml @@ -27,5 +27,3 @@ id: 1 parent: 5 stored_fields: [ _routing ] - - diff --git a/sandbox/plugins/concurrent-search/build.gradle b/sandbox/plugins/concurrent-search/build.gradle index acc3cb5092cd8..0e766dc4fc1ba 100644 --- a/sandbox/plugins/concurrent-search/build.gradle +++ b/sandbox/plugins/concurrent-search/build.gradle @@ -39,4 +39,4 @@ opensearchplugin { } yamlRestTest.enabled = false; -testingConventions.enabled = false; \ No newline at end of file +testingConventions.enabled = false; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/package-info b/server/src/main/java/org/opensearch/search/aggregations/bucket/package-info index a2cb4a9493c56..52b88548dacdd 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/package-info +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/package-info @@ -21,4 +21,3 @@ * Aggregations module */ package org.opensearch.search.aggregations.bucket; - diff --git a/server/src/test/resources/config/opensearch.yml b/server/src/test/resources/config/opensearch.yml index b6ebc6bd10576..21f4f7b1b933a 100644 --- a/server/src/test/resources/config/opensearch.yml +++ b/server/src/test/resources/config/opensearch.yml @@ -1,3 +1,2 @@ yaml.config.exists: true - diff --git a/server/src/test/resources/indices/analyze/conf_dir/hunspell/en_US_custom/settings.yml b/server/src/test/resources/indices/analyze/conf_dir/hunspell/en_US_custom/settings.yml index 1a91653e56a1d..7e9eed5920f2e 100644 --- a/server/src/test/resources/indices/analyze/conf_dir/hunspell/en_US_custom/settings.yml +++ b/server/src/test/resources/indices/analyze/conf_dir/hunspell/en_US_custom/settings.yml @@ -1,2 +1,2 @@ ignore_case: true -strict_affix_parsing: true \ No newline at end of file +strict_affix_parsing: true diff --git a/server/src/test/resources/org/opensearch/action/admin/invalid.txt.keystore b/server/src/test/resources/org/opensearch/action/admin/invalid.txt.keystore index 04613ffab7f36..a18f3707ac0d9 100644 --- a/server/src/test/resources/org/opensearch/action/admin/invalid.txt.keystore +++ b/server/src/test/resources/org/opensearch/action/admin/invalid.txt.keystore @@ -1,3 +1,2 @@ admin admin dragon 12345 - diff --git a/server/src/test/resources/org/opensearch/action/fieldstats/fieldstats-index-constraints-request.json b/server/src/test/resources/org/opensearch/action/fieldstats/fieldstats-index-constraints-request.json index eb8ca972dcd52..8fbf7684b6819 100644 --- a/server/src/test/resources/org/opensearch/action/fieldstats/fieldstats-index-constraints-request.json +++ b/server/src/test/resources/org/opensearch/action/fieldstats/fieldstats-index-constraints-request.json @@ -40,4 +40,4 @@ } } } -} \ No newline at end of file +} diff --git a/server/src/test/resources/org/opensearch/index/analysis/shingle_analysis.json b/server/src/test/resources/org/opensearch/index/analysis/shingle_analysis.json index 33c09fe8dbd9f..53e5bbd9fa946 100644 --- a/server/src/test/resources/org/opensearch/index/analysis/shingle_analysis.json +++ b/server/src/test/resources/org/opensearch/index/analysis/shingle_analysis.json @@ -20,4 +20,4 @@ } } } -} \ No newline at end of file +} diff --git a/server/src/test/resources/org/opensearch/index/analysis/shingle_analysis2.json b/server/src/test/resources/org/opensearch/index/analysis/shingle_analysis2.json index a81ea538f19fe..19b4d24063b8e 100644 --- a/server/src/test/resources/org/opensearch/index/analysis/shingle_analysis2.json +++ b/server/src/test/resources/org/opensearch/index/analysis/shingle_analysis2.json @@ -12,4 +12,4 @@ } } } -} \ No newline at end of file +} diff --git a/server/src/test/resources/org/opensearch/index/analysis/stop.json b/server/src/test/resources/org/opensearch/index/analysis/stop.json index 717c9fdee5b08..c59b0fb5056d0 100644 --- a/server/src/test/resources/org/opensearch/index/analysis/stop.json +++ b/server/src/test/resources/org/opensearch/index/analysis/stop.json @@ -15,4 +15,4 @@ } } } -} \ No newline at end of file +} diff --git a/server/src/test/resources/org/opensearch/index/mapper/dynamictemplate/genericstore/test-data.json b/server/src/test/resources/org/opensearch/index/mapper/dynamictemplate/genericstore/test-data.json index b7439dcb9fe6f..14ebf16d92f36 100644 --- a/server/src/test/resources/org/opensearch/index/mapper/dynamictemplate/genericstore/test-data.json +++ b/server/src/test/resources/org/opensearch/index/mapper/dynamictemplate/genericstore/test-data.json @@ -1,4 +1,4 @@ { "name":"some name", "age":1 -} \ No newline at end of file +} diff --git a/server/src/test/resources/org/opensearch/index/mapper/dynamictemplate/pathmatch/test-data.json b/server/src/test/resources/org/opensearch/index/mapper/dynamictemplate/pathmatch/test-data.json index 2e6ec997c4612..765a850b0b663 100644 --- a/server/src/test/resources/org/opensearch/index/mapper/dynamictemplate/pathmatch/test-data.json +++ b/server/src/test/resources/org/opensearch/index/mapper/dynamictemplate/pathmatch/test-data.json @@ -11,4 +11,4 @@ "prop1":"prop1_value" } } -} \ No newline at end of file +} diff --git a/server/src/test/resources/org/opensearch/index/mapper/dynamictemplate/simple/test-data.json b/server/src/test/resources/org/opensearch/index/mapper/dynamictemplate/simple/test-data.json index 1ed3c50b98d59..8509d846c13bb 100644 --- a/server/src/test/resources/org/opensearch/index/mapper/dynamictemplate/simple/test-data.json +++ b/server/src/test/resources/org/opensearch/index/mapper/dynamictemplate/simple/test-data.json @@ -3,4 +3,4 @@ "age":1, "multi1":"multi 1", "multi2":"multi 2" -} \ No newline at end of file +} diff --git a/server/src/test/resources/org/opensearch/index/mapper/multifield/merge/test-data.json b/server/src/test/resources/org/opensearch/index/mapper/multifield/merge/test-data.json index c539fcc885d3c..ec6b1b95ed888 100644 --- a/server/src/test/resources/org/opensearch/index/mapper/multifield/merge/test-data.json +++ b/server/src/test/resources/org/opensearch/index/mapper/multifield/merge/test-data.json @@ -1,4 +1,4 @@ { _id:1, name:"some name" -} \ No newline at end of file +} diff --git a/server/src/test/resources/org/opensearch/index/mapper/multifield/test-data.json b/server/src/test/resources/org/opensearch/index/mapper/multifield/test-data.json index 2e8ab256df92a..fd7ecad71b894 100644 --- a/server/src/test/resources/org/opensearch/index/mapper/multifield/test-data.json +++ b/server/src/test/resources/org/opensearch/index/mapper/multifield/test-data.json @@ -4,4 +4,4 @@ "object1":{ "multi1":"2010-01-01" } -} \ No newline at end of file +} diff --git a/settings.gradle b/settings.gradle index cb8167ee02efe..183a5ec8d1ae1 100644 --- a/settings.gradle +++ b/settings.gradle @@ -136,4 +136,3 @@ if (extraProjects.exists()) { addSubProjects('', extraProjectDir) } } - diff --git a/test/fixtures/krb5kdc-fixture/src/main/resources/provision/addprinc.sh b/test/fixtures/krb5kdc-fixture/src/main/resources/provision/addprinc.sh index a58df6d47f36f..201c437f00b73 100755 --- a/test/fixtures/krb5kdc-fixture/src/main/resources/provision/addprinc.sh +++ b/test/fixtures/krb5kdc-fixture/src/main/resources/provision/addprinc.sh @@ -72,4 +72,4 @@ echo "Copying conf to local" # make the configuration available externally cp -v $LOCALSTATEDIR/krb5.conf $BUILD_DIR/krb5.conf.template # We are running as root in the container, allow non root users running the container to be able to clean these up -chmod -R 777 $BUILD_DIR \ No newline at end of file +chmod -R 777 $BUILD_DIR diff --git a/test/fixtures/krb5kdc-fixture/src/main/resources/provision/krb5.conf.template b/test/fixtures/krb5kdc-fixture/src/main/resources/provision/krb5.conf.template index ba0832b2b7d99..207fe939fb7a5 100644 --- a/test/fixtures/krb5kdc-fixture/src/main/resources/provision/krb5.conf.template +++ b/test/fixtures/krb5kdc-fixture/src/main/resources/provision/krb5.conf.template @@ -59,4 +59,3 @@ .${BUILD_ZONE} = ${REALM_NAME} ${OPENSEARCH_ZONE} = ${REALM_NAME} .${OPENSEARCH_ZONE} = ${REALM_NAME} - diff --git a/test/fixtures/minio-fixture/build.gradle b/test/fixtures/minio-fixture/build.gradle index ba5e0a7d2d814..61f417690b210 100644 --- a/test/fixtures/minio-fixture/build.gradle +++ b/test/fixtures/minio-fixture/build.gradle @@ -30,4 +30,3 @@ apply plugin: 'opensearch.test.fixtures' description = 'Fixture for MinIO Storage service' - diff --git a/test/framework/src/main/resources/mockito-extensions/org.mockito.plugins.MockMaker b/test/framework/src/main/resources/mockito-extensions/org.mockito.plugins.MockMaker index e1795b7b9b3d6..99b0d419fc445 100644 --- a/test/framework/src/main/resources/mockito-extensions/org.mockito.plugins.MockMaker +++ b/test/framework/src/main/resources/mockito-extensions/org.mockito.plugins.MockMaker @@ -1 +1 @@ -org.opensearch.mockito.plugin.PriviledgedMockMaker \ No newline at end of file +org.opensearch.mockito.plugin.PriviledgedMockMaker diff --git a/test/framework/src/test/resources/rest-api-spec/test/suite1/20_another_test.yml b/test/framework/src/test/resources/rest-api-spec/test/suite1/20_another_test.yml index 5e08112253ef0..0d27f91a83dd3 100644 --- a/test/framework/src/test/resources/rest-api-spec/test/suite1/20_another_test.yml +++ b/test/framework/src/test/resources/rest-api-spec/test/suite1/20_another_test.yml @@ -18,4 +18,3 @@ - match: { _type: test } - match: { _id: '1' } - match: { _source: { foo: "bar" } } - From 7bd7f2ffef1ca7c15997486cf738fccd5f8a1a4a Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 14 Apr 2022 13:26:43 -0700 Subject: [PATCH 062/514] Adding a null pointer check to fix index_prefix query (#2879) (#2902) * Adding a null pointer check to fix index_prefix query Signed-off-by: Vacha Shah * Adding test Signed-off-by: Vacha Shah (cherry picked from commit 452e368bdeb623f4d6b72631069a4fe5264177c6) Co-authored-by: Vacha Shah --- .../org/opensearch/index/mapper/TextFieldMapper.java | 4 +++- .../opensearch/index/mapper/TextFieldTypeTests.java | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/org/opensearch/index/mapper/TextFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/TextFieldMapper.java index 049c85dc910ed..4b2c20586834d 100644 --- a/server/src/main/java/org/opensearch/index/mapper/TextFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/TextFieldMapper.java @@ -583,7 +583,9 @@ public Query prefixQuery(String value, MultiTermQuery.RewriteMethod method, bool } Automaton automaton = Operations.concatenate(automata); AutomatonQuery query = new AutomatonQuery(new Term(name(), value + "*"), automaton); - query.setRewriteMethod(method); + if (method != null) { + query.setRewriteMethod(method); + } return new BooleanQuery.Builder().add(query, BooleanClause.Occur.SHOULD) .add(new TermQuery(new Term(parentField.name(), value)), BooleanClause.Occur.SHOULD) .build(); diff --git a/server/src/test/java/org/opensearch/index/mapper/TextFieldTypeTests.java b/server/src/test/java/org/opensearch/index/mapper/TextFieldTypeTests.java index 18b04c1be5668..b9ec5a07b207d 100644 --- a/server/src/test/java/org/opensearch/index/mapper/TextFieldTypeTests.java +++ b/server/src/test/java/org/opensearch/index/mapper/TextFieldTypeTests.java @@ -190,6 +190,17 @@ public void testIndexPrefixes() { ); assertThat(q, equalTo(expected)); + + q = ft.prefixQuery("g", null, false, randomMockShardContext()); + automaton = Operations.concatenate(Arrays.asList(Automata.makeChar('g'), Automata.makeAnyChar())); + + expected = new ConstantScoreQuery( + new BooleanQuery.Builder().add(new AutomatonQuery(new Term("field._index_prefix", "g*"), automaton), BooleanClause.Occur.SHOULD) + .add(new TermQuery(new Term("field", "g")), BooleanClause.Occur.SHOULD) + .build() + ); + + assertThat(q, equalTo(expected)); } public void testFetchSourceValue() throws IOException { From 2069aa372dddccadf8d5087fd76687f1a37cf2ec Mon Sep 17 00:00:00 2001 From: Sai Date: Fri, 15 Apr 2022 21:48:38 +0530 Subject: [PATCH 063/514] Add deprecated API for creating History Ops Snapshot from translog (#2886) * Add deprecated API for creating History Ops Snapshot from translog Adds a deprecated API to create a history operations snapshot from the translog. This was superseded by always using the lucene index for peer recovery since the index saves on costly storage but this API enables plugins to selectively use the uncompressed xlog file for speed over disk savings. Note: this API will be either completely removed or refactored in the next release. Signed-off-by: Nicholas Walter Knize Signed-off-by: Sai Kumar * fix javadoc casing for deprecated Signed-off-by: Nicholas Walter Knize Co-authored-by: Nicholas Walter Knize --- .../org/opensearch/index/engine/Engine.java | 13 ++++++++++++ .../index/engine/InternalEngine.java | 14 +++++++++++++ .../index/engine/ReadOnlyEngine.java | 14 +++++++++++++ .../opensearch/index/shard/IndexShard.java | 14 ++++++++++++- .../index/engine/InternalEngineTests.java | 20 +++++++++++++++++++ 5 files changed, 74 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/org/opensearch/index/engine/Engine.java b/server/src/main/java/org/opensearch/index/engine/Engine.java index bba1d8c069c68..83da0ea6b52f3 100644 --- a/server/src/main/java/org/opensearch/index/engine/Engine.java +++ b/server/src/main/java/org/opensearch/index/engine/Engine.java @@ -742,6 +742,19 @@ public abstract Translog.Snapshot newChangesSnapshot( boolean accurateCount ) throws IOException; + /** + * Reads history operations from the translog file instead of the lucene index + * + * @deprecated reading history operations from the translog file is deprecated and will be removed in the next release + */ + @Deprecated + public abstract Translog.Snapshot newChangesSnapshotFromTranslogFile( + String source, + long fromSeqNo, + long toSeqNo, + boolean requiredFullRange + ) throws IOException; + /** * Counts the number of history operations in the given sequence number range * @param source source of the request diff --git a/server/src/main/java/org/opensearch/index/engine/InternalEngine.java b/server/src/main/java/org/opensearch/index/engine/InternalEngine.java index 6bef118e0b61f..8e5308973ae64 100644 --- a/server/src/main/java/org/opensearch/index/engine/InternalEngine.java +++ b/server/src/main/java/org/opensearch/index/engine/InternalEngine.java @@ -2821,6 +2821,20 @@ public Translog.Snapshot newChangesSnapshot( } } + /** + * Creates a new history snapshot from the translog file instead of the lucene index + * + * @deprecated reading history operations from the translog file is deprecated and will be removed in the next release + * + * Use {@link Engine#newChangesSnapshot(String, long, long, boolean, boolean)} instead + */ + @Deprecated + @Override + public Translog.Snapshot newChangesSnapshotFromTranslogFile(String source, long fromSeqNo, long toSeqNo, boolean requiredFullRange) + throws IOException { + return getTranslog().newSnapshot(fromSeqNo, toSeqNo, requiredFullRange); + } + public int countNumberOfHistoryOperations(String source, long fromSeqNo, long toSeqNo) throws IOException { ensureOpen(); refreshIfNeeded(source, toSeqNo); diff --git a/server/src/main/java/org/opensearch/index/engine/ReadOnlyEngine.java b/server/src/main/java/org/opensearch/index/engine/ReadOnlyEngine.java index 43fe10c217270..a9037de730398 100644 --- a/server/src/main/java/org/opensearch/index/engine/ReadOnlyEngine.java +++ b/server/src/main/java/org/opensearch/index/engine/ReadOnlyEngine.java @@ -335,6 +335,20 @@ public Translog.Snapshot newChangesSnapshot( return newEmptySnapshot(); } + /** + * Creates a new history snapshot from the translog file instead of the lucene index + * + * @deprecated reading history operations from the translog file is deprecated and will be removed in the next release + * + * Use {@link Engine#newChangesSnapshot(String, long, long, boolean, boolean)} instead + */ + @Deprecated + @Override + public Translog.Snapshot newChangesSnapshotFromTranslogFile(String source, long fromSeqNo, long toSeqNo, boolean requiredFullRange) + throws IOException { + return newEmptySnapshot(); + } + @Override public int countNumberOfHistoryOperations(String source, long fromSeqNo, long toSeqNo) throws IOException { try (Translog.Snapshot snapshot = newChangesSnapshot(source, fromSeqNo, toSeqNo, false, true)) { diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShard.java b/server/src/main/java/org/opensearch/index/shard/IndexShard.java index f2630ad05b488..ed851808f5023 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShard.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShard.java @@ -2233,13 +2233,25 @@ public Closeable acquireHistoryRetentionLock() { /** * Creates a new history snapshot for reading operations since * the provided starting seqno (inclusive) and ending seqno (inclusive) - * The returned snapshot can be retrieved from either Lucene index or translog files. + * The returned snapshot is retrieved from a Lucene index. */ public Translog.Snapshot getHistoryOperations(String reason, long startingSeqNo, long endSeqNo, boolean accurateCount) throws IOException { return getEngine().newChangesSnapshot(reason, startingSeqNo, endSeqNo, true, accurateCount); } + /** + * Creates a new history snapshot from the translog file instead of the lucene index + * + * @deprecated reading history operations from the translog file is deprecated and will be removed in the next release + * + * Use {@link IndexShard#getHistoryOperations(String, long, long, boolean)} instead + */ + @Deprecated + public Translog.Snapshot getHistoryOperationsFromTranslogFile(String reason, long startingSeqNo, long endSeqNo) throws IOException { + return getEngine().newChangesSnapshotFromTranslogFile(reason, startingSeqNo, endSeqNo, true); + } + /** * Checks if we have a completed history of operations since the given starting seqno (inclusive). * This method should be called after acquiring the retention lock; See {@link #acquireHistoryRetentionLock()} diff --git a/server/src/test/java/org/opensearch/index/engine/InternalEngineTests.java b/server/src/test/java/org/opensearch/index/engine/InternalEngineTests.java index c33adf3bcb558..ec177f460d606 100644 --- a/server/src/test/java/org/opensearch/index/engine/InternalEngineTests.java +++ b/server/src/test/java/org/opensearch/index/engine/InternalEngineTests.java @@ -6318,10 +6318,30 @@ public void testHistoryBasedOnSource() throws Exception { } } List luceneOps = readAllOperationsBasedOnSource(engine); + // todo remove in next release + List translogOps = readAllOperationsBasedOnTranslog(engine); assertThat(luceneOps.stream().map(o -> o.seqNo()).collect(Collectors.toList()), containsInAnyOrder(expectedSeqNos.toArray())); + assertThat(translogOps.stream().map(o -> o.seqNo()).collect(Collectors.toList()), containsInAnyOrder(expectedSeqNos.toArray())); } } + /** + * Test creating new snapshot from translog file + * + * @deprecated reading history operations from the translog file is deprecated and will be removed in the next release + */ + @Deprecated + private static List readAllOperationsBasedOnTranslog(Engine engine) throws IOException { + final List operations = new ArrayList<>(); + try (Translog.Snapshot snapshot = engine.newChangesSnapshotFromTranslogFile("test", 0, Long.MAX_VALUE, false)) { + Translog.Operation op; + while ((op = snapshot.next()) != null) { + operations.add(op); + } + } + return operations; + } + public void testLuceneHistoryOnPrimary() throws Exception { final List operations = generateSingleDocHistory( false, From 35ae7febf7dd55049627ca52e53f0c9d7d3eb412 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Fri, 15 Apr 2022 10:04:02 -0700 Subject: [PATCH 064/514] Excluding system indices from max shard limit validator (#2894) (#2911) * Excluding system indices from max shard limit validator Signed-off-by: Ankit Jain * Fixing spotless check violations Signed-off-by: Ankit Jain * Fixing NPE due to null isHidden Signed-off-by: Ankit Jain * Adding unit tests for shard opening scenario Signed-off-by: Ankit Jain * Addressing review comments Signed-off-by: Ankit Jain (cherry picked from commit d39c18f7fe77d886a00672613ce50119821030d1) Co-authored-by: Ankit Jain --- .../metadata/MetadataCreateIndexService.java | 17 +-- .../indices/ShardLimitValidator.java | 14 ++- .../org/opensearch/indices/SystemIndices.java | 25 +++++ .../main/java/org/opensearch/node/Node.java | 2 +- .../opensearch/snapshots/RestoreService.java | 6 +- .../MetadataRolloverServiceTests.java | 10 +- .../indices/ShardLimitValidatorTests.java | 106 +++++++++++++++++- .../indices/cluster/ClusterStateChanges.java | 5 +- .../snapshots/SnapshotResiliencyTests.java | 5 +- 9 files changed, 160 insertions(+), 30 deletions(-) diff --git a/server/src/main/java/org/opensearch/cluster/metadata/MetadataCreateIndexService.java b/server/src/main/java/org/opensearch/cluster/metadata/MetadataCreateIndexService.java index cb76b7217624f..024024754484a 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/MetadataCreateIndexService.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/MetadataCreateIndexService.java @@ -88,7 +88,6 @@ import org.opensearch.indices.IndicesService; import org.opensearch.indices.InvalidIndexNameException; import org.opensearch.indices.ShardLimitValidator; -import org.opensearch.indices.SystemIndexDescriptor; import org.opensearch.indices.SystemIndices; import org.opensearch.threadpool.ThreadPool; @@ -214,17 +213,9 @@ public void validateIndexName(String index, ClusterState state) { * @param isHidden Whether or not this is a hidden index */ public boolean validateDotIndex(String index, @Nullable Boolean isHidden) { - boolean isSystem = false; if (index.charAt(0) == '.') { - SystemIndexDescriptor matchingDescriptor = systemIndices.findMatchingDescriptor(index); - if (matchingDescriptor != null) { - logger.trace( - "index [{}] is a system index because it matches index pattern [{}] with description [{}]", - index, - matchingDescriptor.getIndexPattern(), - matchingDescriptor.getDescription() - ); - isSystem = true; + if (systemIndices.validateSystemIndex(index)) { + return true; } else if (isHidden) { logger.trace("index [{}] is a hidden index", index); } else { @@ -237,7 +228,7 @@ public boolean validateDotIndex(String index, @Nullable Boolean isHidden) { } } - return isSystem; + return false; } /** @@ -890,7 +881,7 @@ static Settings aggregateIndexSettings( * We can not validate settings until we have applied templates, otherwise we do not know the actual settings * that will be used to create this index. */ - shardLimitValidator.validateShardLimit(indexSettings, currentState); + shardLimitValidator.validateShardLimit(request.index(), indexSettings, currentState); if (IndexSettings.INDEX_SOFT_DELETES_SETTING.get(indexSettings) == false && IndexMetadata.SETTING_INDEX_VERSION_CREATED.get(indexSettings).onOrAfter(Version.V_2_0_0)) { throw new IllegalArgumentException( diff --git a/server/src/main/java/org/opensearch/indices/ShardLimitValidator.java b/server/src/main/java/org/opensearch/indices/ShardLimitValidator.java index 3ed0dbee59e71..7e4376e8ea8de 100644 --- a/server/src/main/java/org/opensearch/indices/ShardLimitValidator.java +++ b/server/src/main/java/org/opensearch/indices/ShardLimitValidator.java @@ -63,10 +63,12 @@ public class ShardLimitValidator { Setting.Property.NodeScope ); protected final AtomicInteger shardLimitPerNode = new AtomicInteger(); + private final SystemIndices systemIndices; - public ShardLimitValidator(final Settings settings, ClusterService clusterService) { + public ShardLimitValidator(final Settings settings, ClusterService clusterService, SystemIndices systemIndices) { this.shardLimitPerNode.set(SETTING_CLUSTER_MAX_SHARDS_PER_NODE.get(settings)); clusterService.getClusterSettings().addSettingsUpdateConsumer(SETTING_CLUSTER_MAX_SHARDS_PER_NODE, this::setShardLimitPerNode); + this.systemIndices = systemIndices; } private void setShardLimitPerNode(int newValue) { @@ -84,11 +86,17 @@ public int getShardLimitPerNode() { /** * Checks whether an index can be created without going over the cluster shard limit. * + * @param indexName the name of the index being created * @param settings the settings of the index to be created * @param state the current cluster state * @throws ValidationException if creating this index would put the cluster over the cluster shard limit */ - public void validateShardLimit(final Settings settings, final ClusterState state) { + public void validateShardLimit(final String indexName, final Settings settings, final ClusterState state) { + // Validate shard limit only for non system indices as it is not hard limit anyways + if (systemIndices.validateSystemIndex(indexName)) { + return; + } + final int numberOfShards = INDEX_NUMBER_OF_SHARDS_SETTING.get(settings); final int numberOfReplicas = IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.get(settings); final int shardsToCreate = numberOfShards * (1 + numberOfReplicas); @@ -111,6 +119,8 @@ public void validateShardLimit(final Settings settings, final ClusterState state */ public void validateShardLimit(ClusterState currentState, Index[] indicesToOpen) { int shardsToOpen = Arrays.stream(indicesToOpen) + // Validate shard limit only for non system indices as it is not hard limit anyways + .filter(index -> !systemIndices.validateSystemIndex(index.getName())) .filter(index -> currentState.metadata().index(index).getState().equals(IndexMetadata.State.CLOSE)) .mapToInt(index -> getTotalShardCount(currentState, index)) .sum(); diff --git a/server/src/main/java/org/opensearch/indices/SystemIndices.java b/server/src/main/java/org/opensearch/indices/SystemIndices.java index fc34645b4326f..042291554670c 100644 --- a/server/src/main/java/org/opensearch/indices/SystemIndices.java +++ b/server/src/main/java/org/opensearch/indices/SystemIndices.java @@ -32,6 +32,8 @@ package org.opensearch.indices; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.apache.lucene.util.automaton.Automata; import org.apache.lucene.util.automaton.Automaton; import org.apache.lucene.util.automaton.CharacterRunAutomaton; @@ -63,6 +65,8 @@ * to reduce the locations within the code that need to deal with {@link SystemIndexDescriptor}s. */ public class SystemIndices { + private static final Logger logger = LogManager.getLogger(SystemIndices.class); + private static final Map> SERVER_SYSTEM_INDEX_DESCRIPTORS = singletonMap( TaskResultsService.class.getName(), singletonList(new SystemIndexDescriptor(TASK_INDEX + "*", "Task Result Index")) @@ -135,6 +139,27 @@ public boolean isSystemIndex(String indexName) { } } + /** + * Validates (if this index has a dot-prefixed name) and it is system index. + * @param index The name of the index in question + */ + public boolean validateSystemIndex(String index) { + if (index.charAt(0) == '.') { + SystemIndexDescriptor matchingDescriptor = findMatchingDescriptor(index); + if (matchingDescriptor != null) { + logger.trace( + "index [{}] is a system index because it matches index pattern [{}] with description [{}]", + index, + matchingDescriptor.getIndexPattern(), + matchingDescriptor.getDescription() + ); + return true; + } + } + + return false; + } + private static CharacterRunAutomaton buildCharacterRunAutomaton(Collection descriptors) { Optional automaton = descriptors.stream() .map(descriptor -> Regex.simpleMatchToAutomaton(descriptor.getIndexPattern())) diff --git a/server/src/main/java/org/opensearch/node/Node.java b/server/src/main/java/org/opensearch/node/Node.java index 73c2f221bc7cc..dc51af0fcfcfb 100644 --- a/server/src/main/java/org/opensearch/node/Node.java +++ b/server/src/main/java/org/opensearch/node/Node.java @@ -635,7 +635,7 @@ protected Node( final AliasValidator aliasValidator = new AliasValidator(); - final ShardLimitValidator shardLimitValidator = new ShardLimitValidator(settings, clusterService); + final ShardLimitValidator shardLimitValidator = new ShardLimitValidator(settings, clusterService, systemIndices); final MetadataCreateIndexService metadataCreateIndexService = new MetadataCreateIndexService( settings, clusterService, diff --git a/server/src/main/java/org/opensearch/snapshots/RestoreService.java b/server/src/main/java/org/opensearch/snapshots/RestoreService.java index ad5cfe6e443ff..e1b143b5f5274 100644 --- a/server/src/main/java/org/opensearch/snapshots/RestoreService.java +++ b/server/src/main/java/org/opensearch/snapshots/RestoreService.java @@ -384,7 +384,11 @@ public ClusterState execute(ClusterState currentState) { .put(snapshotIndexMetadata.getSettings()) .put(IndexMetadata.SETTING_INDEX_UUID, UUIDs.randomBase64UUID()) ); - shardLimitValidator.validateShardLimit(snapshotIndexMetadata.getSettings(), currentState); + shardLimitValidator.validateShardLimit( + renamedIndexName, + snapshotIndexMetadata.getSettings(), + currentState + ); if (!request.includeAliases() && !snapshotIndexMetadata.getAliases().isEmpty()) { // Remove all aliases - they shouldn't be restored indexMdBuilder.removeAllAliases(); diff --git a/server/src/test/java/org/opensearch/action/admin/indices/rollover/MetadataRolloverServiceTests.java b/server/src/test/java/org/opensearch/action/admin/indices/rollover/MetadataRolloverServiceTests.java index 6265bcab82966..9ebfc33617920 100644 --- a/server/src/test/java/org/opensearch/action/admin/indices/rollover/MetadataRolloverServiceTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/rollover/MetadataRolloverServiceTests.java @@ -603,7 +603,8 @@ public void testRolloverClusterState() throws Exception { IndexNameExpressionResolver mockIndexNameExpressionResolver = mock(IndexNameExpressionResolver.class); when(mockIndexNameExpressionResolver.resolveDateMathExpression(any())).then(returnsFirstArg()); - ShardLimitValidator shardLimitValidator = new ShardLimitValidator(Settings.EMPTY, clusterService); + final SystemIndices systemIndices = new SystemIndices(emptyMap()); + ShardLimitValidator shardLimitValidator = new ShardLimitValidator(Settings.EMPTY, clusterService, systemIndices); MetadataCreateIndexService createIndexService = new MetadataCreateIndexService( Settings.EMPTY, clusterService, @@ -615,7 +616,7 @@ public void testRolloverClusterState() throws Exception { IndexScopedSettings.DEFAULT_SCOPED_SETTINGS, testThreadPool, null, - new SystemIndices(emptyMap()), + systemIndices, false ); MetadataIndexAliasesService indexAliasesService = new MetadataIndexAliasesService( @@ -739,7 +740,8 @@ public void testRolloverClusterStateForDataStream() throws Exception { IndexNameExpressionResolver mockIndexNameExpressionResolver = mock(IndexNameExpressionResolver.class); when(mockIndexNameExpressionResolver.resolveDateMathExpression(any())).then(returnsFirstArg()); - ShardLimitValidator shardLimitValidator = new ShardLimitValidator(Settings.EMPTY, clusterService); + final SystemIndices systemIndices = new SystemIndices(emptyMap()); + ShardLimitValidator shardLimitValidator = new ShardLimitValidator(Settings.EMPTY, clusterService, systemIndices); MetadataCreateIndexService createIndexService = new MetadataCreateIndexService( Settings.EMPTY, clusterService, @@ -751,7 +753,7 @@ public void testRolloverClusterStateForDataStream() throws Exception { IndexScopedSettings.DEFAULT_SCOPED_SETTINGS, testThreadPool, null, - new SystemIndices(emptyMap()), + systemIndices, false ); MetadataIndexAliasesService indexAliasesService = new MetadataIndexAliasesService( diff --git a/server/src/test/java/org/opensearch/indices/ShardLimitValidatorTests.java b/server/src/test/java/org/opensearch/indices/ShardLimitValidatorTests.java index 7e9c971cae1e8..a61ca13df0215 100644 --- a/server/src/test/java/org/opensearch/indices/ShardLimitValidatorTests.java +++ b/server/src/test/java/org/opensearch/indices/ShardLimitValidatorTests.java @@ -52,6 +52,8 @@ import java.util.Optional; import java.util.stream.Collectors; +import static java.util.Collections.emptyMap; +import static org.opensearch.cluster.metadata.IndexMetadata.*; import static org.opensearch.cluster.metadata.MetadataIndexStateServiceTests.addClosedIndex; import static org.opensearch.cluster.metadata.MetadataIndexStateServiceTests.addOpenedIndex; import static org.opensearch.cluster.shards.ShardCounts.forDataNodeCount; @@ -104,7 +106,54 @@ public void testUnderShardLimit() { assertFalse(errorMessage.isPresent()); } - public void testValidateShardLimit() { + /** + * This test validates that system index creation succeeds + * even though it exceeds the cluster max shard limit + */ + public void testSystemIndexCreationSucceeds() { + final ShardLimitValidator shardLimitValidator = createTestShardLimitService(1); + final Settings settings = Settings.builder() + .put(SETTING_VERSION_CREATED, Version.CURRENT) + .put(SETTING_NUMBER_OF_SHARDS, 1) + .put(SETTING_NUMBER_OF_REPLICAS, 1) + .build(); + final ClusterState state = createClusterForShardLimitTest(1, 1, 0); + shardLimitValidator.validateShardLimit(".tasks", settings, state); + } + + /** + * This test validates that non-system index creation + * fails when it exceeds the cluster max shard limit + */ + public void testNonSystemIndexCreationFails() { + final ShardLimitValidator shardLimitValidator = createTestShardLimitService(1); + final Settings settings = Settings.builder() + .put(SETTING_VERSION_CREATED, Version.CURRENT) + .put(SETTING_NUMBER_OF_SHARDS, 1) + .put(SETTING_NUMBER_OF_REPLICAS, 1) + .build(); + final ClusterState state = createClusterForShardLimitTest(1, 1, 0); + final ValidationException exception = expectThrows( + ValidationException.class, + () -> shardLimitValidator.validateShardLimit("abc", settings, state) + ); + assertEquals( + "Validation Failed: 1: this action would add [" + + 2 + + "] total shards, but this cluster currently has [" + + 1 + + "]/[" + + 1 + + "] maximum shards open;", + exception.getMessage() + ); + } + + /** + * This test validates that non-system index opening + * fails when it exceeds the cluster max shard limit + */ + public void testNonSystemIndexOpeningFails() { int nodesInCluster = randomIntBetween(2, 90); ShardCounts counts = forDataNodeCount(nodesInCluster); ClusterState state = createClusterForShardLimitTest( @@ -140,6 +189,33 @@ public void testValidateShardLimit() { ); } + /** + * This test validates that system index opening succeeds + * even when it exceeds the cluster max shard limit + */ + public void testSystemIndexOpeningSucceeds() { + int nodesInCluster = randomIntBetween(2, 90); + ShardCounts counts = forDataNodeCount(nodesInCluster); + ClusterState state = createClusterForShardLimitTest( + nodesInCluster, + randomAlphaOfLengthBetween(5, 15), + counts.getFirstIndexShards(), + counts.getFirstIndexReplicas(), + ".tasks", // Adding closed system index to cluster state + counts.getFailingIndexShards(), + counts.getFailingIndexReplicas() + ); + + Index[] indices = Arrays.stream(state.metadata().indices().values().toArray(IndexMetadata.class)) + .map(IndexMetadata::getIndex) + .collect(Collectors.toList()) + .toArray(new Index[2]); + + // Shard limit validation succeeds without any issues as system index is being opened + ShardLimitValidator shardLimitValidator = createTestShardLimitService(counts.getShardsPerNode()); + shardLimitValidator.validateShardLimit(state, indices); + } + public static ClusterState createClusterForShardLimitTest(int nodesInCluster, int shardsInIndex, int replicas) { ImmutableOpenMap.Builder dataNodes = ImmutableOpenMap.builder(); for (int i = 0; i < nodesInCluster; i++) { @@ -165,8 +241,10 @@ public static ClusterState createClusterForShardLimitTest(int nodesInCluster, in public static ClusterState createClusterForShardLimitTest( int nodesInCluster, + String openIndexName, int openIndexShards, int openIndexReplicas, + String closeIndexName, int closedIndexShards, int closedIndexReplicas ) { @@ -178,8 +256,8 @@ public static ClusterState createClusterForShardLimitTest( when(nodes.getDataNodes()).thenReturn(dataNodes.build()); ClusterState state = ClusterState.builder(ClusterName.DEFAULT).build(); - state = addOpenedIndex(randomAlphaOfLengthBetween(5, 15), openIndexShards, openIndexReplicas, state); - state = addClosedIndex(randomAlphaOfLengthBetween(5, 15), closedIndexShards, closedIndexReplicas, state); + state = addOpenedIndex(openIndexName, openIndexShards, openIndexReplicas, state); + state = addClosedIndex(closeIndexName, closedIndexShards, closedIndexReplicas, state); final Metadata.Builder metadata = Metadata.builder(state.metadata()); if (randomBoolean()) { @@ -190,6 +268,24 @@ public static ClusterState createClusterForShardLimitTest( return ClusterState.builder(state).metadata(metadata).nodes(nodes).build(); } + public static ClusterState createClusterForShardLimitTest( + int nodesInCluster, + int openIndexShards, + int openIndexReplicas, + int closedIndexShards, + int closedIndexReplicas + ) { + return createClusterForShardLimitTest( + nodesInCluster, + randomAlphaOfLengthBetween(5, 15), + openIndexShards, + openIndexReplicas, + randomAlphaOfLengthBetween(5, 15), + closedIndexShards, + closedIndexReplicas + ); + } + /** * Creates a {@link ShardLimitValidator} for testing with the given setting and a mocked cluster service. * @@ -204,7 +300,7 @@ public static ShardLimitValidator createTestShardLimitService(int maxShardsPerNo new ClusterSettings(limitOnlySettings, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS) ); - return new ShardLimitValidator(limitOnlySettings, clusterService); + return new ShardLimitValidator(limitOnlySettings, clusterService, new SystemIndices(emptyMap())); } /** @@ -217,6 +313,6 @@ public static ShardLimitValidator createTestShardLimitService(int maxShardsPerNo public static ShardLimitValidator createTestShardLimitService(int maxShardsPerNode, ClusterService clusterService) { Settings limitOnlySettings = Settings.builder().put(SETTING_CLUSTER_MAX_SHARDS_PER_NODE.getKey(), maxShardsPerNode).build(); - return new ShardLimitValidator(limitOnlySettings, clusterService); + return new ShardLimitValidator(limitOnlySettings, clusterService, new SystemIndices(emptyMap())); } } diff --git a/server/src/test/java/org/opensearch/indices/cluster/ClusterStateChanges.java b/server/src/test/java/org/opensearch/indices/cluster/ClusterStateChanges.java index 99ec043cc7801..a7d9ba0bf3d4b 100644 --- a/server/src/test/java/org/opensearch/indices/cluster/ClusterStateChanges.java +++ b/server/src/test/java/org/opensearch/indices/cluster/ClusterStateChanges.java @@ -259,7 +259,8 @@ public IndexMetadata upgradeIndexMetadata(IndexMetadata indexMetadata, Version m null, actionFilters ); - ShardLimitValidator shardLimitValidator = new ShardLimitValidator(SETTINGS, clusterService); + final SystemIndices systemIndices = new SystemIndices(emptyMap()); + ShardLimitValidator shardLimitValidator = new ShardLimitValidator(SETTINGS, clusterService, systemIndices); MetadataIndexStateService indexStateService = new MetadataIndexStateService( clusterService, allocationService, @@ -290,7 +291,7 @@ public IndexMetadata upgradeIndexMetadata(IndexMetadata indexMetadata, Version m IndexScopedSettings.DEFAULT_SCOPED_SETTINGS, threadPool, xContentRegistry, - new SystemIndices(emptyMap()), + systemIndices, true ); diff --git a/server/src/test/java/org/opensearch/snapshots/SnapshotResiliencyTests.java b/server/src/test/java/org/opensearch/snapshots/SnapshotResiliencyTests.java index 26e19e532b6bc..a896aab0f70c9 100644 --- a/server/src/test/java/org/opensearch/snapshots/SnapshotResiliencyTests.java +++ b/server/src/test/java/org/opensearch/snapshots/SnapshotResiliencyTests.java @@ -1863,7 +1863,8 @@ public void onFailure(final Exception e) { RetentionLeaseSyncer.EMPTY ); Map actions = new HashMap<>(); - final ShardLimitValidator shardLimitValidator = new ShardLimitValidator(settings, clusterService); + final SystemIndices systemIndices = new SystemIndices(emptyMap()); + final ShardLimitValidator shardLimitValidator = new ShardLimitValidator(settings, clusterService, systemIndices); final MetadataCreateIndexService metadataCreateIndexService = new MetadataCreateIndexService( settings, clusterService, @@ -1875,7 +1876,7 @@ public void onFailure(final Exception e) { indexScopedSettings, threadPool, namedXContentRegistry, - new SystemIndices(emptyMap()), + systemIndices, false ); actions.put( From 8bc5765866939db680280058e664bbcd5efe4e30 Mon Sep 17 00:00:00 2001 From: Tianli Feng Date: Fri, 15 Apr 2022 15:47:22 -0700 Subject: [PATCH 065/514] [2.x] Remove deprecation warning of using REST API request parameter 'master_timeout' (#2920) The plan of deprecation parameter "master_timeout" changed to not show deprecation warning of 'master_timeout' parameter in 2.x version, but start to emit warning from version 3.0 . For the detailed plan, see issue https://github.com/opensearch-project/OpenSearch/issues/2928. Signed-off-by: Tianli Feng --- .../org/opensearch/rest/BaseRestHandler.java | 21 ++-- .../cluster/RestCleanupRepositoryAction.java | 2 +- .../cluster/RestCloneSnapshotAction.java | 2 +- .../cluster/RestClusterGetSettingsAction.java | 2 +- .../cluster/RestClusterHealthAction.java | 2 +- .../cluster/RestClusterRerouteAction.java | 2 +- .../admin/cluster/RestClusterStateAction.java | 2 +- .../RestClusterUpdateSettingsAction.java | 2 +- .../cluster/RestCreateSnapshotAction.java | 2 +- .../cluster/RestDeleteRepositoryAction.java | 2 +- .../cluster/RestDeleteSnapshotAction.java | 2 +- .../cluster/RestDeleteStoredScriptAction.java | 2 +- .../cluster/RestGetRepositoriesAction.java | 2 +- .../admin/cluster/RestGetSnapshotsAction.java | 2 +- .../cluster/RestGetStoredScriptAction.java | 2 +- .../RestPendingClusterTasksAction.java | 2 +- .../cluster/RestPutRepositoryAction.java | 2 +- .../cluster/RestPutStoredScriptAction.java | 2 +- .../cluster/RestRestoreSnapshotAction.java | 2 +- .../cluster/RestSnapshotsStatusAction.java | 2 +- .../cluster/RestVerifyRepositoryAction.java | 2 +- .../RestDeleteDanglingIndexAction.java | 2 +- .../RestImportDanglingIndexAction.java | 2 +- .../indices/RestAddIndexBlockAction.java | 2 +- .../admin/indices/RestCloseIndexAction.java | 2 +- .../admin/indices/RestCreateIndexAction.java | 2 +- .../RestDeleteComponentTemplateAction.java | 2 +- ...stDeleteComposableIndexTemplateAction.java | 2 +- .../admin/indices/RestDeleteIndexAction.java | 2 +- .../RestDeleteIndexTemplateAction.java | 2 +- .../RestGetComponentTemplateAction.java | 2 +- .../RestGetComposableIndexTemplateAction.java | 2 +- .../indices/RestGetIndexTemplateAction.java | 2 +- .../admin/indices/RestGetIndicesAction.java | 2 +- .../admin/indices/RestGetMappingAction.java | 10 +- .../admin/indices/RestGetSettingsAction.java | 2 +- .../indices/RestIndexDeleteAliasesAction.java | 2 +- .../indices/RestIndexPutAliasAction.java | 2 +- .../indices/RestIndicesAliasesAction.java | 2 +- .../admin/indices/RestOpenIndexAction.java | 2 +- .../RestPutComponentTemplateAction.java | 2 +- .../RestPutComposableIndexTemplateAction.java | 2 +- .../indices/RestPutIndexTemplateAction.java | 2 +- .../admin/indices/RestPutMappingAction.java | 2 +- .../admin/indices/RestResizeHandler.java | 2 +- .../indices/RestRolloverIndexAction.java | 2 +- .../RestSimulateIndexTemplateAction.java | 2 +- .../indices/RestSimulateTemplateAction.java | 2 +- .../indices/RestUpdateSettingsAction.java | 2 +- .../rest/action/cat/RestAllocationAction.java | 2 +- .../rest/action/cat/RestIndicesAction.java | 9 +- .../rest/action/cat/RestMasterAction.java | 2 +- .../rest/action/cat/RestNodeAttrsAction.java | 2 +- .../rest/action/cat/RestNodesAction.java | 2 +- .../cat/RestPendingClusterTasksAction.java | 2 +- .../rest/action/cat/RestPluginsAction.java | 2 +- .../action/cat/RestRepositoriesAction.java | 2 +- .../rest/action/cat/RestSegmentsAction.java | 2 +- .../rest/action/cat/RestShardsAction.java | 2 +- .../rest/action/cat/RestSnapshotAction.java | 2 +- .../rest/action/cat/RestTemplatesAction.java | 2 +- .../rest/action/cat/RestThreadPoolAction.java | 2 +- .../ingest/RestDeletePipelineAction.java | 2 +- .../action/ingest/RestGetPipelineAction.java | 2 +- .../action/ingest/RestPutPipelineAction.java | 2 +- .../RenamedTimeoutRequestParameterTests.java | 96 +------------------ 66 files changed, 73 insertions(+), 187 deletions(-) diff --git a/server/src/main/java/org/opensearch/rest/BaseRestHandler.java b/server/src/main/java/org/opensearch/rest/BaseRestHandler.java index e16e385910d98..bf2fe0f16cb0d 100644 --- a/server/src/main/java/org/opensearch/rest/BaseRestHandler.java +++ b/server/src/main/java/org/opensearch/rest/BaseRestHandler.java @@ -41,7 +41,6 @@ import org.opensearch.client.node.NodeClient; import org.opensearch.common.CheckedConsumer; import org.opensearch.common.collect.Tuple; -import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.settings.Setting; import org.opensearch.common.settings.Setting.Property; import org.opensearch.plugins.ActionPlugin; @@ -203,27 +202,19 @@ protected Set responseParams() { return Collections.emptySet(); } + protected static final String DUPLICATE_PARAMETER_ERROR_MESSAGE = + "Please only use one of the request parameters [master_timeout, cluster_manager_timeout]."; + /** * Parse the deprecated request parameter 'master_timeout', and add deprecated log if the parameter is used. * It also validates whether the two parameters 'master_timeout' and 'cluster_manager_timeout' are not assigned together. - * The method is temporarily added in 2.0 duing applying inclusive language. Remove the method along with MASTER_ROLE. + * Deprecation log is not emitted intentionally, because 'master_timeout' is remained in High-Level-REST-Client to keep compatibility with server 1.x. + * The method is temporarily added in 2.0 during applying inclusive language. Remove the method along with the parameter 'master_timeout'. * @param mnr the action request * @param request the REST request to handle - * @param logger the logger that logs deprecation notices - * @param logMsgKeyPrefix the key prefix of a deprecation message to avoid duplicate messages. */ - public static void parseDeprecatedMasterTimeoutParameter( - MasterNodeRequest mnr, - RestRequest request, - DeprecationLogger logger, - String logMsgKeyPrefix - ) { - final String MASTER_TIMEOUT_DEPRECATED_MESSAGE = - "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead."; - final String DUPLICATE_PARAMETER_ERROR_MESSAGE = - "Please only use one of the request parameters [master_timeout, cluster_manager_timeout]."; + public static void parseDeprecatedMasterTimeoutParameter(MasterNodeRequest mnr, RestRequest request) { if (request.hasParam("master_timeout")) { - logger.deprecate(logMsgKeyPrefix + "_master_timeout_parameter", MASTER_TIMEOUT_DEPRECATED_MESSAGE); if (request.hasParam("cluster_manager_timeout")) { throw new OpenSearchParseException(DUPLICATE_PARAMETER_ERROR_MESSAGE); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCleanupRepositoryAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCleanupRepositoryAction.java index c568eae91a528..befd643167238 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCleanupRepositoryAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCleanupRepositoryAction.java @@ -70,7 +70,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC cleanupRepositoryRequest.masterNodeTimeout( request.paramAsTime("cluster_manager_timeout", cleanupRepositoryRequest.masterNodeTimeout()) ); - parseDeprecatedMasterTimeoutParameter(cleanupRepositoryRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(cleanupRepositoryRequest, request); return channel -> client.admin().cluster().cleanupRepository(cleanupRepositoryRequest, new RestToXContentListener<>(channel)); } } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCloneSnapshotAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCloneSnapshotAction.java index abf1efa19f79b..4aa8bd44c3620 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCloneSnapshotAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCloneSnapshotAction.java @@ -75,7 +75,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC XContentMapValues.nodeStringArrayValue(source.getOrDefault("indices", Collections.emptyList())) ); cloneSnapshotRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", cloneSnapshotRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(cloneSnapshotRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(cloneSnapshotRequest, request); cloneSnapshotRequest.indicesOptions(IndicesOptions.fromMap(source, cloneSnapshotRequest.indicesOptions())); return channel -> client.admin().cluster().cloneSnapshot(cloneSnapshotRequest, new RestToXContentListener<>(channel)); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterGetSettingsAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterGetSettingsAction.java index 1238cd2a818d5..3917505c42496 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterGetSettingsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterGetSettingsAction.java @@ -88,7 +88,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC final boolean renderDefaults = request.paramAsBoolean("include_defaults", false); clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); clusterStateRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", clusterStateRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request); return channel -> client.admin().cluster().state(clusterStateRequest, new RestBuilderListener(channel) { @Override public RestResponse buildResponse(ClusterStateResponse response, XContentBuilder builder) throws Exception { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterHealthAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterHealthAction.java index 877e387a15ec3..b00db3a7f6daf 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterHealthAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterHealthAction.java @@ -85,7 +85,7 @@ public static ClusterHealthRequest fromRequest(final RestRequest request) { clusterHealthRequest.indicesOptions(IndicesOptions.fromRequest(request, clusterHealthRequest.indicesOptions())); clusterHealthRequest.local(request.paramAsBoolean("local", clusterHealthRequest.local())); clusterHealthRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", clusterHealthRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(clusterHealthRequest, request, deprecationLogger, "cluster_health"); + parseDeprecatedMasterTimeoutParameter(clusterHealthRequest, request); clusterHealthRequest.timeout(request.paramAsTime("timeout", clusterHealthRequest.timeout())); String waitForStatus = request.param("wait_for_status"); if (waitForStatus != null) { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterRerouteAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterRerouteAction.java index dc5e0ba57e4db..f375b572ef110 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterRerouteAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterRerouteAction.java @@ -144,7 +144,7 @@ public static ClusterRerouteRequest createRequest(RestRequest request) throws IO clusterRerouteRequest.timeout(request.paramAsTime("timeout", clusterRerouteRequest.timeout())); clusterRerouteRequest.setRetryFailed(request.paramAsBoolean("retry_failed", clusterRerouteRequest.isRetryFailed())); clusterRerouteRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", clusterRerouteRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(clusterRerouteRequest, request, deprecationLogger, "cluster_reroute"); + parseDeprecatedMasterTimeoutParameter(clusterRerouteRequest, request); request.applyContentParser(parser -> PARSER.parse(parser, clusterRerouteRequest, null)); return clusterRerouteRequest; } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterStateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterStateAction.java index 02b1eaa741c9e..d97d1a0a30e28 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterStateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterStateAction.java @@ -105,7 +105,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC clusterStateRequest.indicesOptions(IndicesOptions.fromRequest(request, clusterStateRequest.indicesOptions())); clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); clusterStateRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", clusterStateRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request); if (request.hasParam("wait_for_metadata_version")) { clusterStateRequest.waitForMetadataVersion(request.paramAsLong("wait_for_metadata_version", 0)); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterUpdateSettingsAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterUpdateSettingsAction.java index c05cdc752b5f7..f42abcfbc6e29 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterUpdateSettingsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterUpdateSettingsAction.java @@ -74,7 +74,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC clusterUpdateSettingsRequest.masterNodeTimeout( request.paramAsTime("cluster_manager_timeout", clusterUpdateSettingsRequest.masterNodeTimeout()) ); - parseDeprecatedMasterTimeoutParameter(clusterUpdateSettingsRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(clusterUpdateSettingsRequest, request); Map source; try (XContentParser parser = request.contentParser()) { source = parser.map(); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCreateSnapshotAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCreateSnapshotAction.java index b3503f0dfbb56..78c19732b5475 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCreateSnapshotAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCreateSnapshotAction.java @@ -72,7 +72,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC CreateSnapshotRequest createSnapshotRequest = createSnapshotRequest(request.param("repository"), request.param("snapshot")); request.applyContentParser(p -> createSnapshotRequest.source(p.mapOrdered())); createSnapshotRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", createSnapshotRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(createSnapshotRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(createSnapshotRequest, request); createSnapshotRequest.waitForCompletion(request.paramAsBoolean("wait_for_completion", false)); return channel -> client.admin().cluster().createSnapshot(createSnapshotRequest, new RestToXContentListener<>(channel)); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteRepositoryAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteRepositoryAction.java index 5e53595e3a49b..7c8a797b9c924 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteRepositoryAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteRepositoryAction.java @@ -70,7 +70,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC deleteRepositoryRequest.masterNodeTimeout( request.paramAsTime("cluster_manager_timeout", deleteRepositoryRequest.masterNodeTimeout()) ); - parseDeprecatedMasterTimeoutParameter(deleteRepositoryRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(deleteRepositoryRequest, request); return channel -> client.admin().cluster().deleteRepository(deleteRepositoryRequest, new RestToXContentListener<>(channel)); } } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteSnapshotAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteSnapshotAction.java index 891b84f8d0869..380a04dbcd387 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteSnapshotAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteSnapshotAction.java @@ -71,7 +71,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC Strings.splitStringByCommaToArray(request.param("snapshot")) ); deleteSnapshotRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", deleteSnapshotRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(deleteSnapshotRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(deleteSnapshotRequest, request); return channel -> client.admin().cluster().deleteSnapshot(deleteSnapshotRequest, new RestToXContentListener<>(channel)); } } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteStoredScriptAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteStoredScriptAction.java index b303f769d216b..e1e705383e66b 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteStoredScriptAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteStoredScriptAction.java @@ -66,7 +66,7 @@ public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client deleteStoredScriptRequest.masterNodeTimeout( request.paramAsTime("cluster_manager_timeout", deleteStoredScriptRequest.masterNodeTimeout()) ); - parseDeprecatedMasterTimeoutParameter(deleteStoredScriptRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(deleteStoredScriptRequest, request); return channel -> client.admin().cluster().deleteStoredScript(deleteStoredScriptRequest, new RestToXContentListener<>(channel)); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetRepositoriesAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetRepositoriesAction.java index 780d9266549ae..ddbad64cfd3dc 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetRepositoriesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetRepositoriesAction.java @@ -81,7 +81,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC getRepositoriesRequest.masterNodeTimeout( request.paramAsTime("cluster_manager_timeout", getRepositoriesRequest.masterNodeTimeout()) ); - parseDeprecatedMasterTimeoutParameter(getRepositoriesRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(getRepositoriesRequest, request); getRepositoriesRequest.local(request.paramAsBoolean("local", getRepositoriesRequest.local())); settingsFilter.addFilterSettingParams(request); return channel -> client.admin().cluster().getRepositories(getRepositoriesRequest, new RestToXContentListener<>(channel)); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetSnapshotsAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetSnapshotsAction.java index 189795516adbd..355071720c4ac 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetSnapshotsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetSnapshotsAction.java @@ -73,7 +73,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC getSnapshotsRequest.ignoreUnavailable(request.paramAsBoolean("ignore_unavailable", getSnapshotsRequest.ignoreUnavailable())); getSnapshotsRequest.verbose(request.paramAsBoolean("verbose", getSnapshotsRequest.verbose())); getSnapshotsRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", getSnapshotsRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(getSnapshotsRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(getSnapshotsRequest, request); return channel -> client.admin().cluster().getSnapshots(getSnapshotsRequest, new RestToXContentListener<>(channel)); } } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetStoredScriptAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetStoredScriptAction.java index 5a904b99be469..43d386a4f3852 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetStoredScriptAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetStoredScriptAction.java @@ -63,7 +63,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, NodeClient String id = request.param("id"); GetStoredScriptRequest getRequest = new GetStoredScriptRequest(id); getRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", getRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(getRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(getRequest, request); return channel -> client.admin().cluster().getStoredScript(getRequest, new RestStatusToXContentListener<>(channel)); } } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPendingClusterTasksAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPendingClusterTasksAction.java index 155adc8cc7e19..c6091adf9a57c 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPendingClusterTasksAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPendingClusterTasksAction.java @@ -65,7 +65,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC pendingClusterTasksRequest.masterNodeTimeout( request.paramAsTime("cluster_manager_timeout", pendingClusterTasksRequest.masterNodeTimeout()) ); - parseDeprecatedMasterTimeoutParameter(pendingClusterTasksRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(pendingClusterTasksRequest, request); pendingClusterTasksRequest.local(request.paramAsBoolean("local", pendingClusterTasksRequest.local())); return channel -> client.admin().cluster().pendingClusterTasks(pendingClusterTasksRequest, new RestToXContentListener<>(channel)); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPutRepositoryAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPutRepositoryAction.java index a1f34294d630d..87aea07767b40 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPutRepositoryAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPutRepositoryAction.java @@ -74,7 +74,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC } putRepositoryRequest.verify(request.paramAsBoolean("verify", true)); putRepositoryRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", putRepositoryRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(putRepositoryRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(putRepositoryRequest, request); putRepositoryRequest.timeout(request.paramAsTime("timeout", putRepositoryRequest.timeout())); return channel -> client.admin().cluster().putRepository(putRepositoryRequest, new RestToXContentListener<>(channel)); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPutStoredScriptAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPutStoredScriptAction.java index 1568a80278bb9..4b5979d566b8c 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPutStoredScriptAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPutStoredScriptAction.java @@ -80,7 +80,7 @@ public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client PutStoredScriptRequest putRequest = new PutStoredScriptRequest(id, context, content, request.getXContentType(), source); putRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", putRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(putRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(putRequest, request); putRequest.timeout(request.paramAsTime("timeout", putRequest.timeout())); return channel -> client.admin().cluster().putStoredScript(putRequest, new RestToXContentListener<>(channel)); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestRestoreSnapshotAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestRestoreSnapshotAction.java index 6c607b48a89fb..091e1abdbe2ab 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestRestoreSnapshotAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestRestoreSnapshotAction.java @@ -69,7 +69,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC restoreSnapshotRequest.masterNodeTimeout( request.paramAsTime("cluster_manager_timeout", restoreSnapshotRequest.masterNodeTimeout()) ); - parseDeprecatedMasterTimeoutParameter(restoreSnapshotRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(restoreSnapshotRequest, request); restoreSnapshotRequest.waitForCompletion(request.paramAsBoolean("wait_for_completion", false)); request.applyContentParser(p -> restoreSnapshotRequest.source(p.mapOrdered())); return channel -> client.admin().cluster().restoreSnapshot(restoreSnapshotRequest, new RestToXContentListener<>(channel)); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestSnapshotsStatusAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestSnapshotsStatusAction.java index 469c1eac348d1..78caad8f18522 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestSnapshotsStatusAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestSnapshotsStatusAction.java @@ -84,7 +84,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC snapshotsStatusRequest.masterNodeTimeout( request.paramAsTime("cluster_manager_timeout", snapshotsStatusRequest.masterNodeTimeout()) ); - parseDeprecatedMasterTimeoutParameter(snapshotsStatusRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(snapshotsStatusRequest, request); return channel -> client.admin().cluster().snapshotsStatus(snapshotsStatusRequest, new RestToXContentListener<>(channel)); } } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestVerifyRepositoryAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestVerifyRepositoryAction.java index 4792d0e6db148..ee6d24119ca41 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestVerifyRepositoryAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestVerifyRepositoryAction.java @@ -66,7 +66,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC verifyRepositoryRequest.masterNodeTimeout( request.paramAsTime("cluster_manager_timeout", verifyRepositoryRequest.masterNodeTimeout()) ); - parseDeprecatedMasterTimeoutParameter(verifyRepositoryRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(verifyRepositoryRequest, request); verifyRepositoryRequest.timeout(request.paramAsTime("timeout", verifyRepositoryRequest.timeout())); return channel -> client.admin().cluster().verifyRepository(verifyRepositoryRequest, new RestToXContentListener<>(channel)); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/dangling/RestDeleteDanglingIndexAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/dangling/RestDeleteDanglingIndexAction.java index 3e8883058d18e..40fbd028bde7a 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/dangling/RestDeleteDanglingIndexAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/dangling/RestDeleteDanglingIndexAction.java @@ -71,7 +71,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, NodeClient deleteRequest.timeout(request.paramAsTime("timeout", deleteRequest.timeout())); deleteRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", deleteRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(deleteRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(deleteRequest, request); return channel -> client.admin() .cluster() diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/dangling/RestImportDanglingIndexAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/dangling/RestImportDanglingIndexAction.java index 5a48159bd9651..74c7340c2a7c5 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/dangling/RestImportDanglingIndexAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/dangling/RestImportDanglingIndexAction.java @@ -70,7 +70,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, NodeClient importRequest.timeout(request.paramAsTime("timeout", importRequest.timeout())); importRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", importRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(importRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(importRequest, request); return channel -> client.admin() .cluster() diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestAddIndexBlockAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestAddIndexBlockAction.java index 6854662e3bb18..0df8721543a2c 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestAddIndexBlockAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestAddIndexBlockAction.java @@ -69,7 +69,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC Strings.splitStringByCommaToArray(request.param("index")) ); addIndexBlockRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", addIndexBlockRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(addIndexBlockRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(addIndexBlockRequest, request); addIndexBlockRequest.timeout(request.paramAsTime("timeout", addIndexBlockRequest.timeout())); addIndexBlockRequest.indicesOptions(IndicesOptions.fromRequest(request, addIndexBlockRequest.indicesOptions())); return channel -> client.admin().indices().addBlock(addIndexBlockRequest, new RestToXContentListener<>(channel)); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestCloseIndexAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestCloseIndexAction.java index 168d553112fe1..98d75782bc741 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestCloseIndexAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestCloseIndexAction.java @@ -67,7 +67,7 @@ public String getName() { public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { CloseIndexRequest closeIndexRequest = new CloseIndexRequest(Strings.splitStringByCommaToArray(request.param("index"))); closeIndexRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", closeIndexRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(closeIndexRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(closeIndexRequest, request); closeIndexRequest.timeout(request.paramAsTime("timeout", closeIndexRequest.timeout())); closeIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, closeIndexRequest.indicesOptions())); String waitForActiveShards = request.param("wait_for_active_shards"); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestCreateIndexAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestCreateIndexAction.java index 54199b8e68516..3c634106e68f1 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestCreateIndexAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestCreateIndexAction.java @@ -78,7 +78,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC createIndexRequest.timeout(request.paramAsTime("timeout", createIndexRequest.timeout())); createIndexRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", createIndexRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(createIndexRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(createIndexRequest, request); createIndexRequest.waitForActiveShards(ActiveShardCount.parseString(request.param("wait_for_active_shards"))); return channel -> client.admin().indices().create(createIndexRequest, new RestToXContentListener<>(channel)); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteComponentTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteComponentTemplateAction.java index 05656cb250596..4486b090ec333 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteComponentTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteComponentTemplateAction.java @@ -64,7 +64,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC DeleteComponentTemplateAction.Request deleteReq = new DeleteComponentTemplateAction.Request(request.param("name")); deleteReq.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", deleteReq.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(deleteReq, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(deleteReq, request); return channel -> client.execute(DeleteComponentTemplateAction.INSTANCE, deleteReq, new RestToXContentListener<>(channel)); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteComposableIndexTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteComposableIndexTemplateAction.java index b08288593515b..69db0b273ca73 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteComposableIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteComposableIndexTemplateAction.java @@ -64,7 +64,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC DeleteComposableIndexTemplateAction.Request deleteReq = new DeleteComposableIndexTemplateAction.Request(request.param("name")); deleteReq.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", deleteReq.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(deleteReq, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(deleteReq, request); return channel -> client.execute(DeleteComposableIndexTemplateAction.INSTANCE, deleteReq, new RestToXContentListener<>(channel)); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteIndexAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteIndexAction.java index 63fa8a4b29d85..50673e12fa623 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteIndexAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteIndexAction.java @@ -67,7 +67,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC DeleteIndexRequest deleteIndexRequest = new DeleteIndexRequest(Strings.splitStringByCommaToArray(request.param("index"))); deleteIndexRequest.timeout(request.paramAsTime("timeout", deleteIndexRequest.timeout())); deleteIndexRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", deleteIndexRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(deleteIndexRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(deleteIndexRequest, request); deleteIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, deleteIndexRequest.indicesOptions())); return channel -> client.admin().indices().delete(deleteIndexRequest, new RestToXContentListener<>(channel)); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteIndexTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteIndexTemplateAction.java index ce49332a4abbd..d17214d41b75c 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteIndexTemplateAction.java @@ -64,7 +64,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC deleteIndexTemplateRequest.masterNodeTimeout( request.paramAsTime("cluster_manager_timeout", deleteIndexTemplateRequest.masterNodeTimeout()) ); - parseDeprecatedMasterTimeoutParameter(deleteIndexTemplateRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(deleteIndexTemplateRequest, request); return channel -> client.admin().indices().deleteTemplate(deleteIndexTemplateRequest, new RestToXContentListener<>(channel)); } } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetComponentTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetComponentTemplateAction.java index e245c5a20848f..69e983d547a1f 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetComponentTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetComponentTemplateAction.java @@ -76,7 +76,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC getRequest.local(request.paramAsBoolean("local", getRequest.local())); getRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", getRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(getRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(getRequest, request); final boolean implicitAll = getRequest.name() == null; diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetComposableIndexTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetComposableIndexTemplateAction.java index d860e8856571e..8f3e58fd2298a 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetComposableIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetComposableIndexTemplateAction.java @@ -75,7 +75,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC getRequest.local(request.paramAsBoolean("local", getRequest.local())); getRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", getRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(getRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(getRequest, request); final boolean implicitAll = getRequest.name() == null; diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetIndexTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetIndexTemplateAction.java index cda29d2b0ad47..617695f572817 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetIndexTemplateAction.java @@ -82,7 +82,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC getIndexTemplatesRequest.masterNodeTimeout( request.paramAsTime("cluster_manager_timeout", getIndexTemplatesRequest.masterNodeTimeout()) ); - parseDeprecatedMasterTimeoutParameter(getIndexTemplatesRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(getIndexTemplatesRequest, request); final boolean implicitAll = getIndexTemplatesRequest.names().length == 0; diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetIndicesAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetIndicesAction.java index c94d691d4e99b..d2ae85c32a3ef 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetIndicesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetIndicesAction.java @@ -76,7 +76,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC getIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, getIndexRequest.indicesOptions())); getIndexRequest.local(request.paramAsBoolean("local", getIndexRequest.local())); getIndexRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", getIndexRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(getIndexRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(getIndexRequest, request); getIndexRequest.humanReadable(request.paramAsBoolean("human", false)); getIndexRequest.includeDefaults(request.paramAsBoolean("include_defaults", false)); return channel -> client.admin().indices().getIndex(getIndexRequest, new RestToXContentListener<>(channel)); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetMappingAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetMappingAction.java index 86bf6b626c24a..8d00528c9c60e 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetMappingAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetMappingAction.java @@ -40,7 +40,6 @@ import org.opensearch.action.support.IndicesOptions; import org.opensearch.client.node.NodeClient; import org.opensearch.common.Strings; -import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.unit.TimeValue; import org.opensearch.common.xcontent.XContentBuilder; import org.opensearch.rest.BaseRestHandler; @@ -61,12 +60,6 @@ public class RestGetMappingAction extends BaseRestHandler { - private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestGetMappingAction.class); - private static final String MASTER_TIMEOUT_DEPRECATED_MESSAGE = - "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead."; - private static final String DUPLICATE_PARAMETER_ERROR_MESSAGE = - "Please only use one of the request parameters [master_timeout, cluster_manager_timeout]."; - private final ThreadPool threadPool; public RestGetMappingAction(ThreadPool threadPool) { @@ -98,9 +91,8 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC getMappingsRequest.indices(indices); getMappingsRequest.indicesOptions(IndicesOptions.fromRequest(request, getMappingsRequest.indicesOptions())); TimeValue clusterManagerTimeout = request.paramAsTime("cluster_manager_timeout", getMappingsRequest.masterNodeTimeout()); - // TODO: Remove the if condition and statements inside after removing MASTER_ROLE. + // TODO: Remove the if condition and statements inside after removing parameter 'master_timeout'. if (request.hasParam("master_timeout")) { - deprecationLogger.deprecate("get_mapping_master_timeout_parameter", MASTER_TIMEOUT_DEPRECATED_MESSAGE); if (request.hasParam("cluster_manager_timeout")) { throw new OpenSearchParseException(DUPLICATE_PARAMETER_ERROR_MESSAGE); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetSettingsAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetSettingsAction.java index 293078b3568e3..81d98b9bc9cc1 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetSettingsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetSettingsAction.java @@ -83,7 +83,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC .names(names); getSettingsRequest.local(request.paramAsBoolean("local", getSettingsRequest.local())); getSettingsRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", getSettingsRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(getSettingsRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(getSettingsRequest, request); return channel -> client.admin().indices().getSettings(getSettingsRequest, new RestToXContentListener<>(channel)); } } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndexDeleteAliasesAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndexDeleteAliasesAction.java index 9f0b543a456f2..44422c910d367 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndexDeleteAliasesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndexDeleteAliasesAction.java @@ -69,7 +69,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC indicesAliasesRequest.timeout(request.paramAsTime("timeout", indicesAliasesRequest.timeout())); indicesAliasesRequest.addAliasAction(AliasActions.remove().indices(indices).aliases(aliases)); indicesAliasesRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", indicesAliasesRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(indicesAliasesRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(indicesAliasesRequest, request); return channel -> client.admin().indices().aliases(indicesAliasesRequest, new RestToXContentListener<>(channel)); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndexPutAliasAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndexPutAliasAction.java index 8f8eeaf1c8e1c..f53a1c6d5b71a 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndexPutAliasAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndexPutAliasAction.java @@ -128,7 +128,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC IndicesAliasesRequest indicesAliasesRequest = new IndicesAliasesRequest(); indicesAliasesRequest.timeout(request.paramAsTime("timeout", indicesAliasesRequest.timeout())); indicesAliasesRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", indicesAliasesRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(indicesAliasesRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(indicesAliasesRequest, request); IndicesAliasesRequest.AliasActions aliasAction = AliasActions.add().indices(indices).alias(alias); if (routing != null) { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndicesAliasesAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndicesAliasesAction.java index 20b67fa73a3f5..9524428f172ea 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndicesAliasesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndicesAliasesAction.java @@ -64,7 +64,7 @@ public List routes() { public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { IndicesAliasesRequest indicesAliasesRequest = new IndicesAliasesRequest(); indicesAliasesRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", indicesAliasesRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(indicesAliasesRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(indicesAliasesRequest, request); indicesAliasesRequest.timeout(request.paramAsTime("timeout", indicesAliasesRequest.timeout())); try (XContentParser parser = request.contentParser()) { IndicesAliasesRequest.PARSER.parse(parser, indicesAliasesRequest, null); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestOpenIndexAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestOpenIndexAction.java index a6d434b1e865e..4193a12807b32 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestOpenIndexAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestOpenIndexAction.java @@ -68,7 +68,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC OpenIndexRequest openIndexRequest = new OpenIndexRequest(Strings.splitStringByCommaToArray(request.param("index"))); openIndexRequest.timeout(request.paramAsTime("timeout", openIndexRequest.timeout())); openIndexRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", openIndexRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(openIndexRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(openIndexRequest, request); openIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, openIndexRequest.indicesOptions())); String waitForActiveShards = request.param("wait_for_active_shards"); if (waitForActiveShards != null) { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutComponentTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutComponentTemplateAction.java index 0d956b4dd147f..f7b4200dc5307 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutComponentTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutComponentTemplateAction.java @@ -66,7 +66,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC PutComponentTemplateAction.Request putRequest = new PutComponentTemplateAction.Request(request.param("name")); putRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", putRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(putRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(putRequest, request); putRequest.create(request.paramAsBoolean("create", false)); putRequest.cause(request.param("cause", "api")); putRequest.componentTemplate(ComponentTemplate.parse(request.contentParser())); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutComposableIndexTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutComposableIndexTemplateAction.java index 63352a73b281d..23a527a368d7d 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutComposableIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutComposableIndexTemplateAction.java @@ -66,7 +66,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC PutComposableIndexTemplateAction.Request putRequest = new PutComposableIndexTemplateAction.Request(request.param("name")); putRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", putRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(putRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(putRequest, request); putRequest.create(request.paramAsBoolean("create", false)); putRequest.cause(request.param("cause", "api")); putRequest.indexTemplate(ComposableIndexTemplate.parse(request.contentParser())); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutIndexTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutIndexTemplateAction.java index 42cd8e8103a18..ffd18356d0f5e 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutIndexTemplateAction.java @@ -79,7 +79,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC } putRequest.order(request.paramAsInt("order", putRequest.order())); putRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", putRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(putRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(putRequest, request); putRequest.create(request.paramAsBoolean("create", false)); putRequest.cause(request.param("cause", "")); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutMappingAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutMappingAction.java index 5c305b7c75038..9290e313fd939 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutMappingAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutMappingAction.java @@ -87,7 +87,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC putMappingRequest.source(sourceAsMap); putMappingRequest.timeout(request.paramAsTime("timeout", putMappingRequest.timeout())); putMappingRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", putMappingRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(putMappingRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(putMappingRequest, request); putMappingRequest.indicesOptions(IndicesOptions.fromRequest(request, putMappingRequest.indicesOptions())); putMappingRequest.writeIndexOnly(request.paramAsBoolean("write_index_only", false)); return channel -> client.admin().indices().putMapping(putMappingRequest, new RestToXContentListener<>(channel)); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestResizeHandler.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestResizeHandler.java index 4168c7ad48e7c..3cdb63aa389be 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestResizeHandler.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestResizeHandler.java @@ -92,7 +92,7 @@ public final RestChannelConsumer prepareRequest(final RestRequest request, final request.applyContentParser(resizeRequest::fromXContent); resizeRequest.timeout(request.paramAsTime("timeout", resizeRequest.timeout())); resizeRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", resizeRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(resizeRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(resizeRequest, request); resizeRequest.setWaitForActiveShards(ActiveShardCount.parseString(request.param("wait_for_active_shards"))); return channel -> client.admin().indices().resizeIndex(resizeRequest, new RestToXContentListener<>(channel)); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestRolloverIndexAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestRolloverIndexAction.java index b9f8b936ff23e..f57ec5d0e6606 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestRolloverIndexAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestRolloverIndexAction.java @@ -73,7 +73,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC rolloverIndexRequest.dryRun(request.paramAsBoolean("dry_run", false)); rolloverIndexRequest.timeout(request.paramAsTime("timeout", rolloverIndexRequest.timeout())); rolloverIndexRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", rolloverIndexRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(rolloverIndexRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(rolloverIndexRequest, request); rolloverIndexRequest.getCreateIndexRequest() .waitForActiveShards(ActiveShardCount.parseString(request.param("wait_for_active_shards"))); return channel -> client.admin().indices().rolloverIndex(rolloverIndexRequest, new RestToXContentListener<>(channel)); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestSimulateIndexTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestSimulateIndexTemplateAction.java index fb78b7b0a826d..064fb686a1f67 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestSimulateIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestSimulateIndexTemplateAction.java @@ -67,7 +67,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC simulateIndexTemplateRequest.masterNodeTimeout( request.paramAsTime("cluster_manager_timeout", simulateIndexTemplateRequest.masterNodeTimeout()) ); - parseDeprecatedMasterTimeoutParameter(simulateIndexTemplateRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(simulateIndexTemplateRequest, request); if (request.hasContent()) { PutComposableIndexTemplateAction.Request indexTemplateRequest = new PutComposableIndexTemplateAction.Request( "simulating_template" diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestSimulateTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestSimulateTemplateAction.java index 58cc0c1e369d8..09ea8795b750f 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestSimulateTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestSimulateTemplateAction.java @@ -75,7 +75,7 @@ public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client simulateRequest.indexTemplateRequest(indexTemplateRequest); } simulateRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", simulateRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(simulateRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(simulateRequest, request); return channel -> client.execute(SimulateTemplateAction.INSTANCE, simulateRequest, new RestToXContentListener<>(channel)); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestUpdateSettingsAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestUpdateSettingsAction.java index bfb634d421f2d..a616a86cee2bc 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestUpdateSettingsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestUpdateSettingsAction.java @@ -71,7 +71,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC updateSettingsRequest.timeout(request.paramAsTime("timeout", updateSettingsRequest.timeout())); updateSettingsRequest.setPreserveExisting(request.paramAsBoolean("preserve_existing", updateSettingsRequest.isPreserveExisting())); updateSettingsRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", updateSettingsRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(updateSettingsRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(updateSettingsRequest, request); updateSettingsRequest.indicesOptions(IndicesOptions.fromRequest(request, updateSettingsRequest.indicesOptions())); updateSettingsRequest.fromXContent(request.contentParser()); diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestAllocationAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestAllocationAction.java index eb03b9e25a294..400fcb7cf0039 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestAllocationAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestAllocationAction.java @@ -83,7 +83,7 @@ public RestChannelConsumer doCatRequest(final RestRequest request, final NodeCli clusterStateRequest.clear().routingTable(true); clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); clusterStateRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", clusterStateRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request); return channel -> client.admin().cluster().state(clusterStateRequest, new RestActionListener(channel) { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestIndicesAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestIndicesAction.java index 1b70603edf6e1..8d3a6e8b93916 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestIndicesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestIndicesAction.java @@ -53,7 +53,6 @@ import org.opensearch.cluster.metadata.IndexMetadata; import org.opensearch.common.Strings; import org.opensearch.common.Table; -import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.settings.Settings; import org.opensearch.common.time.DateFormatter; import org.opensearch.common.unit.TimeValue; @@ -84,11 +83,6 @@ public class RestIndicesAction extends AbstractCatAction { private static final DateFormatter STRICT_DATE_TIME_FORMATTER = DateFormatter.forPattern("strict_date_time"); - private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestIndicesAction.class); - private static final String MASTER_TIMEOUT_DEPRECATED_MESSAGE = - "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead."; - private static final String DUPLICATE_PARAMETER_ERROR_MESSAGE = - "Please only use one of the request parameters [master_timeout, cluster_manager_timeout]."; @Override public List routes() { @@ -117,9 +111,8 @@ public RestChannelConsumer doCatRequest(final RestRequest request, final NodeCli final IndicesOptions indicesOptions = IndicesOptions.fromRequest(request, IndicesOptions.strictExpand()); final boolean local = request.paramAsBoolean("local", false); TimeValue clusterManagerTimeout = request.paramAsTime("cluster_manager_timeout", DEFAULT_MASTER_NODE_TIMEOUT); - // Remove the if condition and statements inside after removing MASTER_ROLE. + // TODO: Remove the if condition and statements inside after removing parameter 'master_timeout'. if (request.hasParam("master_timeout")) { - deprecationLogger.deprecate("cat_indices_master_timeout_parameter", MASTER_TIMEOUT_DEPRECATED_MESSAGE); if (request.hasParam("cluster_manager_timeout")) { throw new OpenSearchParseException(DUPLICATE_PARAMETER_ERROR_MESSAGE); } diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java index 4bcb16c741ecf..6abadc00181b7 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java @@ -74,7 +74,7 @@ public RestChannelConsumer doCatRequest(final RestRequest request, final NodeCli clusterStateRequest.clear().nodes(true); clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); clusterStateRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", clusterStateRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request); return channel -> client.admin().cluster().state(clusterStateRequest, new RestResponseListener(channel) { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestNodeAttrsAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestNodeAttrsAction.java index 6ea36267d39ed..b8291c43183f0 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestNodeAttrsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestNodeAttrsAction.java @@ -80,7 +80,7 @@ public RestChannelConsumer doCatRequest(final RestRequest request, final NodeCli clusterStateRequest.clear().nodes(true); clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); clusterStateRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", clusterStateRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request); return channel -> client.admin().cluster().state(clusterStateRequest, new RestActionListener(channel) { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestNodesAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestNodesAction.java index 3052a9736f9a3..751ce9f8bb57a 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestNodesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestNodesAction.java @@ -111,7 +111,7 @@ public RestChannelConsumer doCatRequest(final RestRequest request, final NodeCli } clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); clusterStateRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", clusterStateRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request); final boolean fullId = request.paramAsBoolean("full_id", false); return channel -> client.admin().cluster().state(clusterStateRequest, new RestActionListener(channel) { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestPendingClusterTasksAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestPendingClusterTasksAction.java index 7e261510ee742..27aa4c81d1dcc 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestPendingClusterTasksAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestPendingClusterTasksAction.java @@ -72,7 +72,7 @@ public RestChannelConsumer doCatRequest(final RestRequest request, final NodeCli pendingClusterTasksRequest.masterNodeTimeout( request.paramAsTime("cluster_manager_timeout", pendingClusterTasksRequest.masterNodeTimeout()) ); - parseDeprecatedMasterTimeoutParameter(pendingClusterTasksRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(pendingClusterTasksRequest, request); pendingClusterTasksRequest.local(request.paramAsBoolean("local", pendingClusterTasksRequest.local())); return channel -> client.admin() .cluster() diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestPluginsAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestPluginsAction.java index 8975c8ab4b3de..f6a63baddbbe0 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestPluginsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestPluginsAction.java @@ -79,7 +79,7 @@ public RestChannelConsumer doCatRequest(final RestRequest request, final NodeCli clusterStateRequest.clear().nodes(true); clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); clusterStateRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", clusterStateRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request); return channel -> client.admin().cluster().state(clusterStateRequest, new RestActionListener(channel) { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestRepositoriesAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestRepositoriesAction.java index 76c71bee791ef..65c01ab16a99e 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestRepositoriesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestRepositoriesAction.java @@ -66,7 +66,7 @@ public RestChannelConsumer doCatRequest(RestRequest request, NodeClient client) getRepositoriesRequest.masterNodeTimeout( request.paramAsTime("cluster_manager_timeout", getRepositoriesRequest.masterNodeTimeout()) ); - parseDeprecatedMasterTimeoutParameter(getRepositoriesRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(getRepositoriesRequest, request); return channel -> client.admin() .cluster() diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestSegmentsAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestSegmentsAction.java index 3a31fdab125b1..3adcce989ebe0 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestSegmentsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestSegmentsAction.java @@ -83,7 +83,7 @@ public RestChannelConsumer doCatRequest(final RestRequest request, final NodeCli final ClusterStateRequest clusterStateRequest = new ClusterStateRequest(); clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); clusterStateRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", clusterStateRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request); clusterStateRequest.clear().nodes(true).routingTable(true).indices(indices); return channel -> client.admin().cluster().state(clusterStateRequest, new RestActionListener(channel) { diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestShardsAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestShardsAction.java index 32e2ca8481f83..7ca8d053e19cf 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestShardsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestShardsAction.java @@ -105,7 +105,7 @@ public RestChannelConsumer doCatRequest(final RestRequest request, final NodeCli final ClusterStateRequest clusterStateRequest = new ClusterStateRequest(); clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); clusterStateRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", clusterStateRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request); clusterStateRequest.clear().nodes(true).routingTable(true).indices(indices); return channel -> client.admin().cluster().state(clusterStateRequest, new RestActionListener(channel) { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestSnapshotAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestSnapshotAction.java index 5adb9228d9869..c1a0b2773a7f5 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestSnapshotAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestSnapshotAction.java @@ -79,7 +79,7 @@ public RestChannelConsumer doCatRequest(final RestRequest request, NodeClient cl getSnapshotsRequest.ignoreUnavailable(request.paramAsBoolean("ignore_unavailable", getSnapshotsRequest.ignoreUnavailable())); getSnapshotsRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", getSnapshotsRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(getSnapshotsRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(getSnapshotsRequest, request); return channel -> client.admin() .cluster() diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestTemplatesAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestTemplatesAction.java index bedc57453cb9b..b18f81a939682 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestTemplatesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestTemplatesAction.java @@ -79,7 +79,7 @@ public RestChannelConsumer doCatRequest(final RestRequest request, NodeClient cl clusterStateRequest.clear().metadata(true); clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); clusterStateRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", clusterStateRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request); return channel -> client.admin().cluster().state(clusterStateRequest, new RestResponseListener(channel) { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestThreadPoolAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestThreadPoolAction.java index 2f43a3a66d01b..dbfe12288940d 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestThreadPoolAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestThreadPoolAction.java @@ -93,7 +93,7 @@ public RestChannelConsumer doCatRequest(final RestRequest request, final NodeCli clusterStateRequest.clear().nodes(true); clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); clusterStateRequest.masterNodeTimeout(request.paramAsTime("cluster_manager_timeout", clusterStateRequest.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(clusterStateRequest, request); return channel -> client.admin().cluster().state(clusterStateRequest, new RestActionListener(channel) { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/ingest/RestDeletePipelineAction.java b/server/src/main/java/org/opensearch/rest/action/ingest/RestDeletePipelineAction.java index 69f9316bc3d9c..2e7c99fc89f5f 100644 --- a/server/src/main/java/org/opensearch/rest/action/ingest/RestDeletePipelineAction.java +++ b/server/src/main/java/org/opensearch/rest/action/ingest/RestDeletePipelineAction.java @@ -62,7 +62,7 @@ public String getName() { public RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException { DeletePipelineRequest request = new DeletePipelineRequest(restRequest.param("id")); request.masterNodeTimeout(restRequest.paramAsTime("cluster_manager_timeout", request.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(request, restRequest, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(request, restRequest); request.timeout(restRequest.paramAsTime("timeout", request.timeout())); return channel -> client.admin().cluster().deletePipeline(request, new RestToXContentListener<>(channel)); } diff --git a/server/src/main/java/org/opensearch/rest/action/ingest/RestGetPipelineAction.java b/server/src/main/java/org/opensearch/rest/action/ingest/RestGetPipelineAction.java index 5555bf53a5ee9..e652f45b95180 100644 --- a/server/src/main/java/org/opensearch/rest/action/ingest/RestGetPipelineAction.java +++ b/server/src/main/java/org/opensearch/rest/action/ingest/RestGetPipelineAction.java @@ -65,7 +65,7 @@ public String getName() { public RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException { GetPipelineRequest request = new GetPipelineRequest(Strings.splitStringByCommaToArray(restRequest.param("id"))); request.masterNodeTimeout(restRequest.paramAsTime("cluster_manager_timeout", request.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(request, restRequest, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(request, restRequest); return channel -> client.admin().cluster().getPipeline(request, new RestStatusToXContentListener<>(channel)); } } diff --git a/server/src/main/java/org/opensearch/rest/action/ingest/RestPutPipelineAction.java b/server/src/main/java/org/opensearch/rest/action/ingest/RestPutPipelineAction.java index 8a9abc860fbc9..d044f3cfd6e58 100644 --- a/server/src/main/java/org/opensearch/rest/action/ingest/RestPutPipelineAction.java +++ b/server/src/main/java/org/opensearch/rest/action/ingest/RestPutPipelineAction.java @@ -67,7 +67,7 @@ public RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient cl Tuple sourceTuple = restRequest.contentOrSourceParam(); PutPipelineRequest request = new PutPipelineRequest(restRequest.param("id"), sourceTuple.v2(), sourceTuple.v1()); request.masterNodeTimeout(restRequest.paramAsTime("cluster_manager_timeout", request.masterNodeTimeout())); - parseDeprecatedMasterTimeoutParameter(request, restRequest, deprecationLogger, getName()); + parseDeprecatedMasterTimeoutParameter(request, restRequest); request.timeout(restRequest.paramAsTime("timeout", request.timeout())); return channel -> client.admin().cluster().putPipeline(request, new RestToXContentListener<>(channel)); } diff --git a/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java b/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java index 648766681a377..7b6f6bf8ba3c9 100644 --- a/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java +++ b/server/src/test/java/org/opensearch/action/RenamedTimeoutRequestParameterTests.java @@ -13,7 +13,6 @@ import org.opensearch.action.support.master.MasterNodeRequest; import org.opensearch.client.node.NodeClient; import org.opensearch.common.bytes.BytesArray; -import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.settings.Settings; import org.opensearch.common.settings.SettingsFilter; import org.opensearch.common.xcontent.NamedXContentRegistry; @@ -101,12 +100,9 @@ public class RenamedTimeoutRequestParameterTests extends OpenSearchTestCase { private final TestThreadPool threadPool = new TestThreadPool(RenamedTimeoutRequestParameterTests.class.getName()); private final NodeClient client = new NodeClient(Settings.EMPTY, threadPool); - private final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RenamedTimeoutRequestParameterTests.class); private static final String DUPLICATE_PARAMETER_ERROR_MESSAGE = "Please only use one of the request parameters [master_timeout, cluster_manager_timeout]."; - private static final String MASTER_TIMEOUT_DEPRECATED_MESSAGE = - "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead."; @After public void terminateThreadPool() { @@ -114,127 +110,93 @@ public void terminateThreadPool() { } public void testNoWarningsForNewParam() { - BaseRestHandler.parseDeprecatedMasterTimeoutParameter( - getMasterNodeRequest(), - getRestRequestWithNewParam(), - deprecationLogger, - "test" - ); - } - - public void testDeprecationWarningForOldParam() { - BaseRestHandler.parseDeprecatedMasterTimeoutParameter( - getMasterNodeRequest(), - getRestRequestWithDeprecatedParam(), - deprecationLogger, - "test" - ); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); + BaseRestHandler.parseDeprecatedMasterTimeoutParameter(getMasterNodeRequest(), getRestRequestWithNewParam()); } public void testBothParamsNotValid() { Exception e = assertThrows( OpenSearchParseException.class, - () -> BaseRestHandler.parseDeprecatedMasterTimeoutParameter( - getMasterNodeRequest(), - getRestRequestWithBothParams(), - deprecationLogger, - "test" - ) + () -> BaseRestHandler.parseDeprecatedMasterTimeoutParameter(getMasterNodeRequest(), getRestRequestWithBothParams()) ); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testCatAllocation() { RestAllocationAction action = new RestAllocationAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.doCatRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testCatIndices() { RestIndicesAction action = new RestIndicesAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.doCatRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testCatClusterManager() { RestMasterAction action = new RestMasterAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.doCatRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testCatNodeattrs() { RestNodeAttrsAction action = new RestNodeAttrsAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.doCatRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testCatNodes() { RestNodesAction action = new RestNodesAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.doCatRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testCatPendingTasks() { RestPendingClusterTasksAction action = new RestPendingClusterTasksAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.doCatRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testCatPlugins() { RestPluginsAction action = new RestPluginsAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.doCatRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testCatRepositories() { RestRepositoriesAction action = new RestRepositoriesAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.doCatRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testCatShards() { RestShardsAction action = new RestShardsAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.doCatRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testCatSnapshots() { RestSnapshotAction action = new RestSnapshotAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.doCatRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testCatTemplates() { RestTemplatesAction action = new RestTemplatesAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.doCatRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testCatThreadPool() { RestThreadPoolAction action = new RestThreadPoolAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.doCatRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testCatSegments() { RestSegmentsAction action = new RestSegmentsAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.doCatRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testClusterHealth() { @@ -243,7 +205,6 @@ public void testClusterHealth() { () -> RestClusterHealthAction.fromRequest(getRestRequestWithBodyWithBothParams()) ); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testClusterReroute() throws IOException { @@ -254,7 +215,6 @@ public void testClusterReroute() throws IOException { () -> action.prepareRequest(getRestRequestWithBodyWithBothParams(), client) ); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testClusterState() throws IOException { @@ -265,7 +225,6 @@ public void testClusterState() throws IOException { () -> action.prepareRequest(getRestRequestWithBodyWithBothParams(), client) ); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testClusterGetSettings() throws IOException { @@ -276,7 +235,6 @@ public void testClusterGetSettings() throws IOException { () -> action.prepareRequest(getRestRequestWithBodyWithBothParams(), client) ); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testClusterUpdateSettings() throws IOException { @@ -286,7 +244,6 @@ public void testClusterUpdateSettings() throws IOException { () -> action.prepareRequest(getRestRequestWithBodyWithBothParams(), client) ); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testClusterPendingTasks() { @@ -296,7 +253,6 @@ public void testClusterPendingTasks() { () -> action.prepareRequest(getRestRequestWithBodyWithBothParams(), client) ); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testAddIndexBlock() { @@ -308,49 +264,42 @@ public void testAddIndexBlock() { RestAddIndexBlockAction action = new RestAddIndexBlockAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(request, client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testCloseIndex() { RestCloseIndexAction action = new RestCloseIndexAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testCreateIndex() { RestCreateIndexAction action = new RestCreateIndexAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testDeleteIndex() { RestDeleteIndexAction action = new RestDeleteIndexAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testGetIndices() { RestGetIndicesAction action = new RestGetIndicesAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testGetMapping() { RestGetMappingAction action = new RestGetMappingAction(threadPool); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testGetSettings() { RestGetSettingsAction action = new RestGetSettingsAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testIndexDeleteAliases() { @@ -362,28 +311,24 @@ public void testIndexDeleteAliases() { RestIndexDeleteAliasesAction action = new RestIndexDeleteAliasesAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(request, client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testIndexPutAlias() { RestIndexPutAliasAction action = new RestIndexPutAliasAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testIndicesAliases() { RestIndicesAliasesAction action = new RestIndicesAliasesAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testOpenIndex() { RestOpenIndexAction action = new RestOpenIndexAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testPutMapping() { @@ -393,42 +338,36 @@ public void testPutMapping() { () -> action.prepareRequest(getRestRequestWithBodyWithBothParams(), client) ); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testShrinkIndex() { RestResizeHandler.RestShrinkIndexAction action = new RestResizeHandler.RestShrinkIndexAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testSplitIndex() { RestResizeHandler.RestSplitIndexAction action = new RestResizeHandler.RestSplitIndexAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testCloneIndex() { RestResizeHandler.RestCloneIndexAction action = new RestResizeHandler.RestCloneIndexAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testRolloverIndex() { RestRolloverIndexAction action = new RestRolloverIndexAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testUpdateSettings() { RestUpdateSettingsAction action = new RestUpdateSettingsAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testDeleteDanglingIndex() { @@ -439,7 +378,6 @@ public void testDeleteDanglingIndex() { RestDeleteDanglingIndexAction action = new RestDeleteDanglingIndexAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(request, client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testImportDanglingIndex() { @@ -450,70 +388,60 @@ public void testImportDanglingIndex() { RestImportDanglingIndexAction action = new RestImportDanglingIndexAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(request, client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testDeleteComponentTemplate() { RestDeleteComponentTemplateAction action = new RestDeleteComponentTemplateAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testDeleteComposableIndexTemplate() { RestDeleteComposableIndexTemplateAction action = new RestDeleteComposableIndexTemplateAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testDeleteIndexTemplate() { RestDeleteIndexTemplateAction action = new RestDeleteIndexTemplateAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testGetComponentTemplate() { RestGetComponentTemplateAction action = new RestGetComponentTemplateAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testGetComposableIndexTemplate() { RestGetComposableIndexTemplateAction action = new RestGetComposableIndexTemplateAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testGetIndexTemplate() { RestGetIndexTemplateAction action = new RestGetIndexTemplateAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testPutComponentTemplate() { RestPutComponentTemplateAction action = new RestPutComponentTemplateAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testPutComposableIndexTemplate() { RestPutComposableIndexTemplateAction action = new RestPutComposableIndexTemplateAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testPutIndexTemplate() { RestPutIndexTemplateAction action = new RestPutIndexTemplateAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testSimulateIndexTemplate() { @@ -524,21 +452,18 @@ public void testSimulateIndexTemplate() { RestSimulateIndexTemplateAction action = new RestSimulateIndexTemplateAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(request, client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testSimulateTemplate() { RestSimulateTemplateAction action = new RestSimulateTemplateAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testCleanupRepository() { RestCleanupRepositoryAction action = new RestCleanupRepositoryAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testCloneSnapshot() { @@ -548,28 +473,24 @@ public void testCloneSnapshot() { () -> action.prepareRequest(getRestRequestWithBodyWithBothParams(), client) ); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testCreateSnapshot() { RestCreateSnapshotAction action = new RestCreateSnapshotAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testDeleteRepository() { RestDeleteRepositoryAction action = new RestDeleteRepositoryAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testDeleteSnapshot() { RestDeleteSnapshotAction action = new RestDeleteSnapshotAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testGetRepositories() { @@ -577,14 +498,12 @@ public void testGetRepositories() { RestGetRepositoriesAction action = new RestGetRepositoriesAction(filter); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testGetSnapshots() { RestGetSnapshotsAction action = new RestGetSnapshotsAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testPutRepository() { @@ -594,28 +513,24 @@ public void testPutRepository() { () -> action.prepareRequest(getRestRequestWithBodyWithBothParams(), client) ); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testRestoreSnapshot() { RestRestoreSnapshotAction action = new RestRestoreSnapshotAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testSnapshotsStatus() { RestSnapshotsStatusAction action = new RestSnapshotsStatusAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testVerifyRepository() { RestVerifyRepositoryAction action = new RestVerifyRepositoryAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testDeletePipeline() { @@ -626,14 +541,12 @@ public void testDeletePipeline() { RestDeletePipelineAction action = new RestDeletePipelineAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(request, client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testGetPipeline() { RestGetPipelineAction action = new RestGetPipelineAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testPutPipeline() { @@ -644,21 +557,18 @@ public void testPutPipeline() { RestPutPipelineAction action = new RestPutPipelineAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(request, client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testDeleteStoredScript() { RestDeleteStoredScriptAction action = new RestDeleteStoredScriptAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testGetStoredScript() { RestGetStoredScriptAction action = new RestGetStoredScriptAction(); Exception e = assertThrows(OpenSearchParseException.class, () -> action.prepareRequest(getRestRequestWithBothParams(), client)); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE); } public void testPutStoredScript() { @@ -668,7 +578,7 @@ public void testPutStoredScript() { () -> action.prepareRequest(getRestRequestWithBodyWithBothParams(), client) ); assertThat(e.getMessage(), containsString(DUPLICATE_PARAMETER_ERROR_MESSAGE)); - assertWarnings(MASTER_TIMEOUT_DEPRECATED_MESSAGE, "empty templates should no longer be used"); + assertWarnings("empty templates should no longer be used"); } private MasterNodeRequest getMasterNodeRequest() { From 91aa312c785c9d77c89db5bee4a0df3cbcf344d7 Mon Sep 17 00:00:00 2001 From: Tianli Feng Date: Fri, 15 Apr 2022 17:19:15 -0700 Subject: [PATCH 066/514] Revert "Make High-Level-Rest-Client tests allow deprecation warning temporarily, during deprecation of request parameter 'master_timeout' (#2702)" (#2930) This reverts commit 6a2a33d1872850b04562164c39621698cb99d7b8. * Sets the High-Level-Rest-Client tests back to treating warning header as a failure. Signed-off-by: Tianli Feng --- .../java/org/opensearch/test/rest/OpenSearchRestTestCase.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/framework/src/main/java/org/opensearch/test/rest/OpenSearchRestTestCase.java b/test/framework/src/main/java/org/opensearch/test/rest/OpenSearchRestTestCase.java index f976b3619102a..9624a9d3d0554 100644 --- a/test/framework/src/main/java/org/opensearch/test/rest/OpenSearchRestTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/rest/OpenSearchRestTestCase.java @@ -824,8 +824,7 @@ protected String getProtocol() { protected RestClient buildClient(Settings settings, HttpHost[] hosts) throws IOException { RestClientBuilder builder = RestClient.builder(hosts); configureClient(builder, settings); - // TODO: set the method argument to 'true' after PR https://github.com/opensearch-project/OpenSearch/pull/2683 merged. - builder.setStrictDeprecationMode(false); + builder.setStrictDeprecationMode(true); return builder.build(); } From e714b8b43af7ccef2ef42a52dd81d80502cba51c Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Fri, 15 Apr 2022 17:48:48 -0700 Subject: [PATCH 067/514] [Backport 2.x] Add type mapping removal bwc tests for indexing, searching, snapshots (#2921) * Add type mapping removal bwc tests for indexing, searching, snapshots (#2901) Signed-off-by: Kunal Kotwani (cherry picked from commit 437289254a14288c81fb79be8fd7defac9ceb61b) * Update version for 2.x branch Signed-off-by: Kunal Kotwani * Limiting rolling upgrade checks to test upgrades from Co-authored-by: Kunal Kotwani --- qa/rolling-upgrade/build.gradle | 2 + .../upgrades/AbstractRollingTestCase.java | 4 + .../upgrades/MappingTypeRemovalIT.java | 309 ++++++++++++++++++ .../test/rest/OpenSearchRestTestCase.java | 7 + 4 files changed, 322 insertions(+) create mode 100644 qa/rolling-upgrade/src/test/java/org/opensearch/upgrades/MappingTypeRemovalIT.java diff --git a/qa/rolling-upgrade/build.gradle b/qa/rolling-upgrade/build.gradle index 3dff452be855f..68a9dcafbdc47 100644 --- a/qa/rolling-upgrade/build.gradle +++ b/qa/rolling-upgrade/build.gradle @@ -74,6 +74,7 @@ for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) { } systemProperty 'tests.upgrade_from_version', bwcVersionStr systemProperty 'tests.rest.suite', 'old_cluster' + systemProperty 'tests.repo_location', "${buildDir}/cluster/shared/repo/${baseName}/test" nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}") nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}") } @@ -110,6 +111,7 @@ for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) { testClusters."${baseName}".nextNodeToNextVersion() } useCluster testClusters."${baseName}" + systemProperty 'tests.repo_location', "${buildDir}/cluster/shared/repo/${baseName}/test" systemProperty 'tests.rest.suite', 'upgraded_cluster' systemProperty 'tests.upgrade_from_version', bwcVersionStr diff --git a/qa/rolling-upgrade/src/test/java/org/opensearch/upgrades/AbstractRollingTestCase.java b/qa/rolling-upgrade/src/test/java/org/opensearch/upgrades/AbstractRollingTestCase.java index 27766e4086b91..ee1c1fd888438 100644 --- a/qa/rolling-upgrade/src/test/java/org/opensearch/upgrades/AbstractRollingTestCase.java +++ b/qa/rolling-upgrade/src/test/java/org/opensearch/upgrades/AbstractRollingTestCase.java @@ -56,6 +56,7 @@ public static ClusterType parse(String value) { } protected static final ClusterType CLUSTER_TYPE = ClusterType.parse(System.getProperty("tests.rest.suite")); + protected static final String REPOSITORY_LOCATION = System.getProperty("tests.repo_location"); protected static final Version UPGRADE_FROM_VERSION = Version.fromString(System.getProperty("tests.upgrade_from_version")); protected static final boolean firstMixedRound = Boolean.parseBoolean(System.getProperty("tests.first_round", "false")); @@ -74,6 +75,9 @@ protected boolean preserveTemplatesUponCompletion() { return true; } + @Override + protected final boolean preserveSnapshotsUponCompletion() { return true; } + @Override protected final Settings restClientSettings() { return Settings.builder().put(super.restClientSettings()) diff --git a/qa/rolling-upgrade/src/test/java/org/opensearch/upgrades/MappingTypeRemovalIT.java b/qa/rolling-upgrade/src/test/java/org/opensearch/upgrades/MappingTypeRemovalIT.java new file mode 100644 index 0000000000000..39e1b36ff8d58 --- /dev/null +++ b/qa/rolling-upgrade/src/test/java/org/opensearch/upgrades/MappingTypeRemovalIT.java @@ -0,0 +1,309 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.upgrades; + +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.methods.HttpPut; +import org.apache.http.util.EntityUtils; +import org.opensearch.Version; +import org.opensearch.client.Request; +import org.opensearch.client.RequestOptions; +import org.opensearch.client.Response; +import org.opensearch.cluster.metadata.IndexMetadata; +import org.opensearch.common.Strings; +import org.opensearch.common.settings.Settings; +import org.opensearch.rest.RestStatus; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.regex.Pattern; + +import static org.opensearch.rest.action.search.RestSearchAction.TOTAL_HITS_AS_INT_PARAM; + +/** + * Tests to ensure indices, snapshots, templates created using type mapping before {@link Version#V_2_0_0} + * survive the rolling upgrade to {@link Version#V_2_0_0}. The tests include indexing, re-indexing, + * snapshot and restore, template based index creation for type mapped indices to ensure they are accessible + * and searchable in {@link Version#V_2_0_0}. + */ +public class MappingTypeRemovalIT extends AbstractRollingTestCase { + + public void testTypeRemovalIndexing() throws IOException { + final String indexName = "test_index_with_mapping"; + final String indexWithoutTypeName = "test_index_without_mapping"; + final String templateIndexName = "template_test_index"; + final String templateName = "test_template"; + final String indexNamePattern = "template_test*"; + + final String mapping = "\"properties\":{\"f1\":{\"type\":\"keyword\"},\"f2\":{\"type\":\"keyword\"}}"; + final String typeMapping = "\"_doc\":{" + mapping +"}"; + + switch (CLUSTER_TYPE) { + case OLD: + if (UPGRADE_FROM_VERSION.before(Version.V_2_0_0)) { + Settings.Builder settings = Settings.builder() + .put(IndexMetadata.INDEX_NUMBER_OF_SHARDS_SETTING.getKey(), 1) + .put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 0); + createIndexWithDocMappings(indexName, settings.build(), typeMapping); + assertIndexMapping(indexName, mapping); + + createTemplate(templateName, indexNamePattern, typeMapping); + createIndex(templateIndexName, settings.build()); + assertIndexMapping(templateIndexName, mapping); + bulk(indexName, CLUSTER_TYPE.name(), 1); + bulk(templateIndexName, CLUSTER_TYPE.name(), 1); + + createIndex(indexWithoutTypeName, settings.build()); + bulk(indexWithoutTypeName, CLUSTER_TYPE.name(), 1); + } + break; + case MIXED: + waitForClusterGreenStatus(); + if (UPGRADE_FROM_VERSION.before(Version.V_2_0_0)) { + assertCount(indexName, 1, 1); + assertCount(templateIndexName, 1, 1); + assertCount(indexWithoutTypeName, 1, 1); + } + break; + case UPGRADED: + if (UPGRADE_FROM_VERSION.before(Version.V_2_0_0)) { + // Assert documents created with mapping prior to OS 2.0 are accessible. + assertCount(indexName, 1, 1); + bulk(indexName, CLUSTER_TYPE.name(), 1); + // Assert the newly ingested documents are accessible + assertCount(indexName, 2, 1); + + // Assert documents created with mapping on index with template prior to OS 2.0 are accessible. + assertCount(templateIndexName, 1, 1); + bulk(templateIndexName, CLUSTER_TYPE.name(), 1); + // Assert the newly ingested documents with template are accessible + assertCount(templateIndexName, 2, 1); + + // Assert documents created prior to OS 2.0 are accessible. + assertCount(indexWithoutTypeName, 1, 1); + // Test ingestion of new documents created using < OS2.0 + bulk(indexWithoutTypeName, CLUSTER_TYPE.name(), 1); + assertCount(indexWithoutTypeName, 2, 1); + } + break; + default: + throw new UnsupportedOperationException("Unknown cluster type [" + CLUSTER_TYPE + "]"); + } + } + + public void testTypeRemovalReindexing() throws IOException { + final String indexName = "test_reindex_with_mapping"; + final String reindexName = "test_reindex_with_mapping_v2"; + + final String originalMapping = "\"properties\":{\"f1\":{\"type\":\"keyword\"},\"f2\":{\"type\":\"keyword\"}}"; + final String originalTypeMapping = "\"_doc\":{" + originalMapping +"}"; + + final String newMapping = "\"properties\":{\"f1\":{\"type\":\"text\"},\"f2\":{\"type\":\"text\"}}"; + final String newTypeMapping = "\"_doc\":{" + newMapping +"}"; + + switch (CLUSTER_TYPE) { + case OLD: + if (UPGRADE_FROM_VERSION.before(Version.V_2_0_0)) { + Settings.Builder settings = Settings.builder() + .put(IndexMetadata.INDEX_NUMBER_OF_SHARDS_SETTING.getKey(), 1) + .put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 0); + createIndexWithDocMappings(indexName, settings.build(), originalTypeMapping); + assertIndexMapping(indexName, originalMapping); + + createIndexWithDocMappings(reindexName, settings.build(), newTypeMapping); + assertIndexMapping(reindexName, newMapping); + bulk(indexName, CLUSTER_TYPE.name(), 1); + } + break; + case MIXED: + waitForClusterGreenStatus(); + if (UPGRADE_FROM_VERSION.before(Version.V_2_0_0)) { + assertCount(indexName, 1, 1); + } + break; + case UPGRADED: + if (UPGRADE_FROM_VERSION.before(Version.V_2_0_0)) { + // Assert documents created with mapping prior to OS 2.0 are accessible. + assertCount(indexName, 1, 1); + bulk(indexName, CLUSTER_TYPE.name(), 1); + // Assert the newly ingested documents are accessible + assertCount(indexName, 2, 1); + + reindex(indexName, reindexName); + assertCount(reindexName, 2, 1); + assertIndexMapping(reindexName, newMapping); + } + break; + default: + throw new UnsupportedOperationException("Unknown cluster type [" + CLUSTER_TYPE + "]"); + } + } + + public void testTypeRemovalSnapshots() throws IOException { + final String indexName = "test_snapshot_index"; + final String repositoryName = "test_repository"; + final String snapshotName = "force_preserve_test_snapshot"; + + final String mapping = "\"properties\":{\"f1\":{\"type\":\"keyword\"},\"f2\":{\"type\":\"keyword\"}}"; + final String typeMapping = "\"_doc\":{" + mapping +"}"; + + switch (CLUSTER_TYPE) { + case OLD: + if (UPGRADE_FROM_VERSION.before(Version.V_2_0_0)) { + Settings.Builder settings = Settings.builder() + .put(IndexMetadata.INDEX_NUMBER_OF_SHARDS_SETTING.getKey(), 1) + .put(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.getKey(), 0); + createIndexWithDocMappings(indexName, settings.build(), typeMapping); + assertIndexMapping(indexName, mapping); + bulk(indexName, CLUSTER_TYPE.name(), 1); + + registerRepository(repositoryName,"fs", true, Settings.builder() + .put("location", REPOSITORY_LOCATION) + .build()); + createSnapshotIfNotExists(repositoryName, snapshotName, true, indexName); + deleteIndex(indexName); + } + break; + case MIXED: + waitForClusterGreenStatus(); + break; + case UPGRADED: + if (UPGRADE_FROM_VERSION.before(Version.V_2_0_0)) { + registerRepository(repositoryName,"fs", true, Settings.builder() + .put("location", REPOSITORY_LOCATION) + .build()); + assertFalse(indexExists(indexName));; + restoreSnapshot(repositoryName, snapshotName, true); + assertCount(indexName, 1, 1); + } + break; + default: + throw new UnsupportedOperationException("Unknown cluster type [" + CLUSTER_TYPE + "]"); + } + } + + private void bulk(String index, String valueSuffix, int count) throws IOException { + StringBuilder b = new StringBuilder(); + for (int i = 0; i < count; i++) { + b.append("{\"index\": {\"_index\": \"").append(index).append("\"}}\n"); + b.append("{\"f1\": \"v").append(i).append(valueSuffix).append("\", \"f2\": ").append(i).append("}\n"); + } + Request bulk = new Request(HttpPost.METHOD_NAME, "/_bulk"); + bulk.addParameter("refresh", "true"); + bulk.setJsonEntity(b.toString()); + client().performRequest(bulk); + } + + private void createIndexWithDocMappings(String index, Settings settings, String mapping) throws IOException { + Request createIndexWithMappingsRequest = new Request(HttpPut.METHOD_NAME, "/" + index); + String entity = "{\"settings\": " + Strings.toString(settings); + if (mapping != null) { + entity += ",\"mappings\" : {" + mapping + "}"; + } + entity += "}"; + createIndexWithMappingsRequest.addParameter("include_type_name", "true"); + createIndexWithMappingsRequest.setJsonEntity(entity); + useIgnoreTypesRemovalWarningsHandler(createIndexWithMappingsRequest); + client().performRequest(createIndexWithMappingsRequest); + } + + private void createTemplate(String templateName, String indexPattern, String mapping) throws IOException { + Request templateRequest = new Request(HttpPut.METHOD_NAME, "/_template/" + templateName); + String entity = "{\"index_patterns\": \"" + indexPattern + "\""; + if (mapping != null) { + entity += ",\"mappings\" : {" + mapping + "}"; + } + entity += "}"; + templateRequest.addParameter("include_type_name", "true"); + templateRequest.setJsonEntity(entity); + useIgnoreTypesRemovalWarningsHandler(templateRequest); + client().performRequest(templateRequest); + } + + private void reindex(String originalIndex, String newIndex) throws IOException { + Request reIndexRequest = new Request(HttpPost.METHOD_NAME, "/_reindex/"); + String entity = "{ \"source\": { \"index\": \"" + originalIndex + "\" }, \"dest\": { \"index\": \"" + newIndex + "\" } }"; + reIndexRequest.setJsonEntity(entity); + reIndexRequest.addParameter("refresh", "true"); + client().performRequest(reIndexRequest); + } + + private void assertIndexMapping(String index, String mappings) throws IOException { + Request testIndexMappingRequest = new Request(HttpGet.METHOD_NAME, "/" + index + "/_mapping"); + Response testIndexMappingResponse = client().performRequest(testIndexMappingRequest); + assertEquals("{\""+index+"\":{\"mappings\":{"+mappings+"}}}", + EntityUtils.toString(testIndexMappingResponse.getEntity(), StandardCharsets.UTF_8)); + } + + private void assertCount(String index, int count, Integer totalShards) throws IOException { + Request searchTestIndexRequest = new Request(HttpPost.METHOD_NAME, "/" + index + "/_search"); + searchTestIndexRequest.addParameter(TOTAL_HITS_AS_INT_PARAM, "true"); + if (totalShards != null) { + searchTestIndexRequest.addParameter("filter_path", "hits.total,_shards"); + } else { + searchTestIndexRequest.addParameter("filter_path", "hits.total"); + } + + Response searchTestIndexResponse = client().performRequest(searchTestIndexRequest); + String expectedResponse; + if (totalShards != null) { + expectedResponse = "{\"_shards\":{\"total\":" + totalShards + ",\"successful\":" + totalShards + ",\"skipped\":0,\"failed\":0},\"hits\":{\"total\":" + count + "}}"; + } else { + expectedResponse = "{\"hits\":{\"total\":" + count + "}}"; + } + assertEquals(expectedResponse, + EntityUtils.toString(searchTestIndexResponse.getEntity(), StandardCharsets.UTF_8)); + } + + private final Pattern TYPE_REMOVAL_WARNING = Pattern.compile( + "^\\[types removal\\] (.+) include_type_name (.+) is deprecated\\. The parameter will be removed in the next major version\\.$" + ); + + private void useIgnoreTypesRemovalWarningsHandler(Request request) { + RequestOptions.Builder options = request.getOptions().toBuilder(); + options.setWarningsHandler(warnings -> { + if (warnings.size() > 0) { + boolean matches = warnings.stream() + .anyMatch( + message -> TYPE_REMOVAL_WARNING.matcher(message).matches() + ); + return matches == false; + } else { + return false; + } + }); + request.setOptions(options); + } + + private void createSnapshotIfNotExists(String repository, String snapshot, boolean waitForCompletion, String indexName) throws IOException { + final Request getSnapshotsRequest = new Request(HttpGet.METHOD_NAME, "_cat/snapshots/" + repository); + final Response getSnapshotsResponse = client().performRequest(getSnapshotsRequest); + if (!EntityUtils.toString(getSnapshotsResponse.getEntity(), StandardCharsets.UTF_8).contains(snapshot)) { + final Request request = new Request(HttpPut.METHOD_NAME, "_snapshot/" + repository + '/' + snapshot); + request.addParameter("wait_for_completion", Boolean.toString(waitForCompletion)); + if (indexName != null) { + String entity = "{\"indices\" : \"" + indexName + "\"}"; + request.setJsonEntity(entity); + } + + final Response response = client().performRequest(request); + assertEquals( + "Failed to create snapshot [" + snapshot + "] in repository [" + repository + "]: " + response, + response.getStatusLine().getStatusCode(), RestStatus.OK.getStatus() + ); + } + } + + private void waitForClusterGreenStatus() throws IOException { + Request waitForGreen = new Request(HttpGet.METHOD_NAME, "/_cluster/health"); + waitForGreen.addParameter("wait_for_nodes", "3"); + client().performRequest(waitForGreen); + } +} diff --git a/test/framework/src/main/java/org/opensearch/test/rest/OpenSearchRestTestCase.java b/test/framework/src/main/java/org/opensearch/test/rest/OpenSearchRestTestCase.java index 9624a9d3d0554..a25dd31e69098 100644 --- a/test/framework/src/main/java/org/opensearch/test/rest/OpenSearchRestTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/rest/OpenSearchRestTestCase.java @@ -652,6 +652,13 @@ protected static void wipeDataStreams() throws IOException { for (Object snapshot : snapshots) { Map snapshotInfo = (Map) snapshot; String name = (String) snapshotInfo.get("snapshot"); + // Parallel test jobs create an issue with preserveSnapshotsUponCompletion set within subclasses. + // Since the snapshots are shared within the cluster, another parallel run may delete all + // snapshots in the repository. + // For now we hack to prevent deletion of snapshots prefixed with "force_preserve" + if (Version.CURRENT.onOrBefore(Version.V_2_1_0) && name.startsWith("force_preserve")) { + continue; + } if (SnapshotState.valueOf((String) snapshotInfo.get("state")).completed() == false) { inProgressSnapshots.computeIfAbsent(repoName, key -> new ArrayList<>()).add(snapshotInfo); } From b349851006e1d391178fdc86cb75a0f0dcc658df Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Sat, 16 Apr 2022 08:25:44 -0700 Subject: [PATCH 068/514] Fixing Scaled float field mapper to respect ignoreMalformed setting (#2918) (#2932) --- .../org/opensearch/index/mapper/ScaledFloatFieldMapper.java | 3 ++- .../opensearch/index/mapper/ScaledFloatFieldMapperTests.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/mapper-extras/src/main/java/org/opensearch/index/mapper/ScaledFloatFieldMapper.java b/modules/mapper-extras/src/main/java/org/opensearch/index/mapper/ScaledFloatFieldMapper.java index 78a9e389eb63f..73ce1cf96d7d0 100644 --- a/modules/mapper-extras/src/main/java/org/opensearch/index/mapper/ScaledFloatFieldMapper.java +++ b/modules/mapper-extras/src/main/java/org/opensearch/index/mapper/ScaledFloatFieldMapper.java @@ -32,6 +32,7 @@ package org.opensearch.index.mapper; +import com.fasterxml.jackson.core.JsonParseException; import org.apache.lucene.document.Field; import org.apache.lucene.index.DocValues; import org.apache.lucene.index.LeafReaderContext; @@ -392,7 +393,7 @@ protected void parseCreateField(ParseContext context) throws IOException { } else { try { numericValue = parse(parser, coerce.value()); - } catch (IllegalArgumentException e) { + } catch (IllegalArgumentException | JsonParseException e) { if (ignoreMalformed.value()) { return; } else { diff --git a/modules/mapper-extras/src/test/java/org/opensearch/index/mapper/ScaledFloatFieldMapperTests.java b/modules/mapper-extras/src/test/java/org/opensearch/index/mapper/ScaledFloatFieldMapperTests.java index 3de322b286183..e19f9dd7988e1 100644 --- a/modules/mapper-extras/src/test/java/org/opensearch/index/mapper/ScaledFloatFieldMapperTests.java +++ b/modules/mapper-extras/src/test/java/org/opensearch/index/mapper/ScaledFloatFieldMapperTests.java @@ -229,6 +229,7 @@ public void testCoerce() throws Exception { public void testIgnoreMalformed() throws Exception { doTestIgnoreMalformed("a", "For input string: \"a\""); + doTestIgnoreMalformed(true, "Current token (VALUE_TRUE) not numeric"); List values = Arrays.asList("NaN", "Infinity", "-Infinity"); for (String value : values) { @@ -236,7 +237,7 @@ public void testIgnoreMalformed() throws Exception { } } - private void doTestIgnoreMalformed(String value, String exceptionMessageContains) throws Exception { + private void doTestIgnoreMalformed(Object value, String exceptionMessageContains) throws Exception { DocumentMapper mapper = createDocumentMapper(fieldMapping(this::minimalMapping)); ThrowingRunnable runnable = () -> mapper.parse( new SourceToParse( From 98af7e0cc5c030c7026a3579725530e3e3104105 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 18 Apr 2022 11:28:26 -0700 Subject: [PATCH 069/514] Adding asm to version file and upgrading (#2933) (#2951) Signed-off-by: Vacha Shah (cherry picked from commit fc378c7256bc1e46f4c1cbee1ac6360624e1e574) Co-authored-by: Vacha Shah --- buildSrc/version.properties | 1 + modules/lang-expression/build.gradle | 6 +++--- .../lang-expression/licenses/asm-9.2.jar.sha1 | 1 - .../lang-expression/licenses/asm-9.3.jar.sha1 | 1 + .../licenses/asm-commons-9.2.jar.sha1 | 1 - .../licenses/asm-commons-9.3.jar.sha1 | 1 + .../licenses/asm-tree-9.2.jar.sha1 | 1 - .../licenses/asm-tree-9.3.jar.sha1 | 1 + modules/lang-painless/build.gradle | 20 +++++++++---------- .../lang-painless/licenses/asm-9.2.jar.sha1 | 1 - .../lang-painless/licenses/asm-9.3.jar.sha1 | 1 + .../licenses/asm-analysis-9.2.jar.sha1 | 1 - .../licenses/asm-analysis-9.3.jar.sha1 | 1 + .../licenses/asm-commons-9.2.jar.sha1 | 1 - .../licenses/asm-commons-9.3.jar.sha1 | 1 + .../licenses/asm-tree-9.2.jar.sha1 | 1 - .../licenses/asm-tree-9.3.jar.sha1 | 1 + .../licenses/asm-util-9.2.jar.sha1 | 1 - .../licenses/asm-util-9.3.jar.sha1 | 1 + test/logger-usage/build.gradle | 6 +++--- 20 files changed, 25 insertions(+), 24 deletions(-) delete mode 100644 modules/lang-expression/licenses/asm-9.2.jar.sha1 create mode 100644 modules/lang-expression/licenses/asm-9.3.jar.sha1 delete mode 100644 modules/lang-expression/licenses/asm-commons-9.2.jar.sha1 create mode 100644 modules/lang-expression/licenses/asm-commons-9.3.jar.sha1 delete mode 100644 modules/lang-expression/licenses/asm-tree-9.2.jar.sha1 create mode 100644 modules/lang-expression/licenses/asm-tree-9.3.jar.sha1 delete mode 100644 modules/lang-painless/licenses/asm-9.2.jar.sha1 create mode 100644 modules/lang-painless/licenses/asm-9.3.jar.sha1 delete mode 100644 modules/lang-painless/licenses/asm-analysis-9.2.jar.sha1 create mode 100644 modules/lang-painless/licenses/asm-analysis-9.3.jar.sha1 delete mode 100644 modules/lang-painless/licenses/asm-commons-9.2.jar.sha1 create mode 100644 modules/lang-painless/licenses/asm-commons-9.3.jar.sha1 delete mode 100644 modules/lang-painless/licenses/asm-tree-9.2.jar.sha1 create mode 100644 modules/lang-painless/licenses/asm-tree-9.3.jar.sha1 delete mode 100644 modules/lang-painless/licenses/asm-util-9.2.jar.sha1 create mode 100644 modules/lang-painless/licenses/asm-util-9.3.jar.sha1 diff --git a/buildSrc/version.properties b/buildSrc/version.properties index 3d6c4faddea53..09d7b195836ae 100644 --- a/buildSrc/version.properties +++ b/buildSrc/version.properties @@ -16,6 +16,7 @@ icu4j = 70.1 supercsv = 2.4.0 log4j = 2.17.1 slf4j = 1.6.2 +asm = 9.3 # when updating the JNA version, also update the version in buildSrc/build.gradle jna = 5.5.0 diff --git a/modules/lang-expression/build.gradle b/modules/lang-expression/build.gradle index 9d7b0e2f0979c..203c332069c5f 100644 --- a/modules/lang-expression/build.gradle +++ b/modules/lang-expression/build.gradle @@ -38,9 +38,9 @@ opensearchplugin { dependencies { api "org.apache.lucene:lucene-expressions:${versions.lucene}" api 'org.antlr:antlr4-runtime:4.9.3' - api 'org.ow2.asm:asm:9.2' - api 'org.ow2.asm:asm-commons:9.2' - api 'org.ow2.asm:asm-tree:9.2' + api "org.ow2.asm:asm:${versions.asm}" + api "org.ow2.asm:asm-commons:${versions.asm}" + api "org.ow2.asm:asm-tree:${versions.asm}" } restResources { restApi { diff --git a/modules/lang-expression/licenses/asm-9.2.jar.sha1 b/modules/lang-expression/licenses/asm-9.2.jar.sha1 deleted file mode 100644 index 28f456d3cbcb2..0000000000000 --- a/modules/lang-expression/licenses/asm-9.2.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -81a03f76019c67362299c40e0ba13405f5467bff \ No newline at end of file diff --git a/modules/lang-expression/licenses/asm-9.3.jar.sha1 b/modules/lang-expression/licenses/asm-9.3.jar.sha1 new file mode 100644 index 0000000000000..71d3966a6f6f9 --- /dev/null +++ b/modules/lang-expression/licenses/asm-9.3.jar.sha1 @@ -0,0 +1 @@ +8e6300ef51c1d801a7ed62d07cd221aca3a90640 \ No newline at end of file diff --git a/modules/lang-expression/licenses/asm-commons-9.2.jar.sha1 b/modules/lang-expression/licenses/asm-commons-9.2.jar.sha1 deleted file mode 100644 index 7beb3d29afe86..0000000000000 --- a/modules/lang-expression/licenses/asm-commons-9.2.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -f4d7f0fc9054386f2893b602454d48e07d4fbead \ No newline at end of file diff --git a/modules/lang-expression/licenses/asm-commons-9.3.jar.sha1 b/modules/lang-expression/licenses/asm-commons-9.3.jar.sha1 new file mode 100644 index 0000000000000..fd7cd4943a57c --- /dev/null +++ b/modules/lang-expression/licenses/asm-commons-9.3.jar.sha1 @@ -0,0 +1 @@ +1f2a432d1212f5c352ae607d7b61dcae20c20af5 \ No newline at end of file diff --git a/modules/lang-expression/licenses/asm-tree-9.2.jar.sha1 b/modules/lang-expression/licenses/asm-tree-9.2.jar.sha1 deleted file mode 100644 index 7b486521ecef3..0000000000000 --- a/modules/lang-expression/licenses/asm-tree-9.2.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -d96c99a30f5e1a19b0e609dbb19a44d8518ac01e \ No newline at end of file diff --git a/modules/lang-expression/licenses/asm-tree-9.3.jar.sha1 b/modules/lang-expression/licenses/asm-tree-9.3.jar.sha1 new file mode 100644 index 0000000000000..238f0006424d3 --- /dev/null +++ b/modules/lang-expression/licenses/asm-tree-9.3.jar.sha1 @@ -0,0 +1 @@ +78d2ecd61318b5a58cd04fb237636c0e86b77d97 \ No newline at end of file diff --git a/modules/lang-painless/build.gradle b/modules/lang-painless/build.gradle index ffbb3e60eb5ab..8e1280b937364 100644 --- a/modules/lang-painless/build.gradle +++ b/modules/lang-painless/build.gradle @@ -49,11 +49,11 @@ testClusters.all { dependencies { api 'org.antlr:antlr4-runtime:4.9.3' - api 'org.ow2.asm:asm-util:9.2' - api 'org.ow2.asm:asm-tree:9.2' - api 'org.ow2.asm:asm-commons:9.2' - api 'org.ow2.asm:asm-analysis:9.2' - api 'org.ow2.asm:asm:9.2' + api "org.ow2.asm:asm-util:${versions.asm}" + api "org.ow2.asm:asm-tree:${versions.asm}" + api "org.ow2.asm:asm-commons:${versions.asm}" + api "org.ow2.asm:asm-analysis:${versions.asm}" + api "org.ow2.asm:asm:${versions.asm}" api project('spi') } @@ -69,11 +69,11 @@ shadowJar { classifier = null relocate 'org.objectweb', 'org.opensearch.repackage.org.objectweb' dependencies { - include(dependency('org.ow2.asm:asm:9.2')) - include(dependency('org.ow2.asm:asm-util:9.2')) - include(dependency('org.ow2.asm:asm-tree:9.2')) - include(dependency('org.ow2.asm:asm-commons:9.2')) - include(dependency('org.ow2.asm:asm-analysis:9.2')) + include(dependency("org.ow2.asm:asm:${versions.asm}")) + include(dependency("org.ow2.asm:asm-util:${versions.asm}")) + include(dependency("org.ow2.asm:asm-tree:${versions.asm}")) + include(dependency("org.ow2.asm:asm-commons:${versions.asm}")) + include(dependency("org.ow2.asm:asm-analysis:${versions.asm}")) } } diff --git a/modules/lang-painless/licenses/asm-9.2.jar.sha1 b/modules/lang-painless/licenses/asm-9.2.jar.sha1 deleted file mode 100644 index 28f456d3cbcb2..0000000000000 --- a/modules/lang-painless/licenses/asm-9.2.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -81a03f76019c67362299c40e0ba13405f5467bff \ No newline at end of file diff --git a/modules/lang-painless/licenses/asm-9.3.jar.sha1 b/modules/lang-painless/licenses/asm-9.3.jar.sha1 new file mode 100644 index 0000000000000..71d3966a6f6f9 --- /dev/null +++ b/modules/lang-painless/licenses/asm-9.3.jar.sha1 @@ -0,0 +1 @@ +8e6300ef51c1d801a7ed62d07cd221aca3a90640 \ No newline at end of file diff --git a/modules/lang-painless/licenses/asm-analysis-9.2.jar.sha1 b/modules/lang-painless/licenses/asm-analysis-9.2.jar.sha1 deleted file mode 100644 index b93483a24da5d..0000000000000 --- a/modules/lang-painless/licenses/asm-analysis-9.2.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -7487dd756daf96cab9986e44b9d7bcb796a61c10 \ No newline at end of file diff --git a/modules/lang-painless/licenses/asm-analysis-9.3.jar.sha1 b/modules/lang-painless/licenses/asm-analysis-9.3.jar.sha1 new file mode 100644 index 0000000000000..f5a04d0196823 --- /dev/null +++ b/modules/lang-painless/licenses/asm-analysis-9.3.jar.sha1 @@ -0,0 +1 @@ +4b071f211b37c38e0e9f5998550197c8593f6ad8 \ No newline at end of file diff --git a/modules/lang-painless/licenses/asm-commons-9.2.jar.sha1 b/modules/lang-painless/licenses/asm-commons-9.2.jar.sha1 deleted file mode 100644 index 7beb3d29afe86..0000000000000 --- a/modules/lang-painless/licenses/asm-commons-9.2.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -f4d7f0fc9054386f2893b602454d48e07d4fbead \ No newline at end of file diff --git a/modules/lang-painless/licenses/asm-commons-9.3.jar.sha1 b/modules/lang-painless/licenses/asm-commons-9.3.jar.sha1 new file mode 100644 index 0000000000000..fd7cd4943a57c --- /dev/null +++ b/modules/lang-painless/licenses/asm-commons-9.3.jar.sha1 @@ -0,0 +1 @@ +1f2a432d1212f5c352ae607d7b61dcae20c20af5 \ No newline at end of file diff --git a/modules/lang-painless/licenses/asm-tree-9.2.jar.sha1 b/modules/lang-painless/licenses/asm-tree-9.2.jar.sha1 deleted file mode 100644 index 7b486521ecef3..0000000000000 --- a/modules/lang-painless/licenses/asm-tree-9.2.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -d96c99a30f5e1a19b0e609dbb19a44d8518ac01e \ No newline at end of file diff --git a/modules/lang-painless/licenses/asm-tree-9.3.jar.sha1 b/modules/lang-painless/licenses/asm-tree-9.3.jar.sha1 new file mode 100644 index 0000000000000..238f0006424d3 --- /dev/null +++ b/modules/lang-painless/licenses/asm-tree-9.3.jar.sha1 @@ -0,0 +1 @@ +78d2ecd61318b5a58cd04fb237636c0e86b77d97 \ No newline at end of file diff --git a/modules/lang-painless/licenses/asm-util-9.2.jar.sha1 b/modules/lang-painless/licenses/asm-util-9.2.jar.sha1 deleted file mode 100644 index 5cb89aa115f30..0000000000000 --- a/modules/lang-painless/licenses/asm-util-9.2.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -fbc178fc5ba3dab50fd7e8a5317b8b647c8e8946 \ No newline at end of file diff --git a/modules/lang-painless/licenses/asm-util-9.3.jar.sha1 b/modules/lang-painless/licenses/asm-util-9.3.jar.sha1 new file mode 100644 index 0000000000000..8859c317794ba --- /dev/null +++ b/modules/lang-painless/licenses/asm-util-9.3.jar.sha1 @@ -0,0 +1 @@ +9595bc05510d0bd4b610188b77333fe4851a1975 \ No newline at end of file diff --git a/test/logger-usage/build.gradle b/test/logger-usage/build.gradle index 3154e556a87cf..e81cdef04df1f 100644 --- a/test/logger-usage/build.gradle +++ b/test/logger-usage/build.gradle @@ -31,9 +31,9 @@ apply plugin: 'opensearch.java' dependencies { - api 'org.ow2.asm:asm:9.2' - api 'org.ow2.asm:asm-tree:9.2' - api 'org.ow2.asm:asm-analysis:9.3' + api "org.ow2.asm:asm:${versions.asm}" + api "org.ow2.asm:asm-tree:${versions.asm}" + api "org.ow2.asm:asm-analysis:${versions.asm}" api "org.apache.logging.log4j:log4j-api:${versions.log4j}" testImplementation project(":test:framework") } From 113194dc48ec2a0378f2e27036008e479ea9c3dc Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 18 Apr 2022 12:02:25 -0700 Subject: [PATCH 070/514] Bump jna from 5.10.0 to 5.11.0 in /buildSrc (#2946) (#2955) Bumps [jna](https://github.com/java-native-access/jna) from 5.10.0 to 5.11.0. - [Release notes](https://github.com/java-native-access/jna/releases) - [Changelog](https://github.com/java-native-access/jna/blob/master/CHANGES.md) - [Commits](https://github.com/java-native-access/jna/compare/5.10.0...5.11.0) --- updated-dependencies: - dependency-name: net.java.dev.jna:jna dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> (cherry picked from commit a36a1e395c2f535b4c78be1a14241b2e05a4a52c) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- buildSrc/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 1cb78fd832602..1c148f14a996a 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -110,7 +110,7 @@ dependencies { api 'com.netflix.nebula:gradle-info-plugin:11.3.3' api 'org.apache.rat:apache-rat:0.13' api 'commons-io:commons-io:2.7' - api "net.java.dev.jna:jna:5.10.0" + api "net.java.dev.jna:jna:5.11.0" api 'gradle.plugin.com.github.johnrengelman:shadow:7.1.2' api 'de.thetaphi:forbiddenapis:3.3' api 'com.avast.gradle:gradle-docker-compose-plugin:0.14.12' From a4a7ae4f05f202942f7b08b7515c8d306d9e3497 Mon Sep 17 00:00:00 2001 From: Vacha Shah Date: Mon, 18 Apr 2022 12:07:03 -0700 Subject: [PATCH 071/514] Bump com.diffplug.spotless from 6.4.1 to 6.4.2 (#2827) (#2956) Bumps com.diffplug.spotless from 6.4.1 to 6.4.2. --- updated-dependencies: - dependency-name: com.diffplug.spotless dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> (cherry picked from commit c876f55294b5636e558e5735cf2f0c629bcda080) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index bfa435cb4812c..a41ad61de39a6 100644 --- a/build.gradle +++ b/build.gradle @@ -48,7 +48,7 @@ plugins { id 'lifecycle-base' id 'opensearch.docker-support' id 'opensearch.global-build-info' - id "com.diffplug.spotless" version "6.3.0" apply false + id "com.diffplug.spotless" version "6.4.2" apply false id "org.gradle.test-retry" version "1.3.1" apply false } From ca46645b53e341822ee2d3fe8fb5d27d47472406 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 18 Apr 2022 12:13:47 -0700 Subject: [PATCH 072/514] Bump hadoop-minicluster from 3.3.1 to 3.3.2 in /test/fixtures/hdfs-fixture (#2381) (#2957) * Bump hadoop-minicluster in /test/fixtures/hdfs-fixture Bumps hadoop-minicluster from 3.3.1 to 3.3.2. --- updated-dependencies: - dependency-name: org.apache.hadoop:hadoop-minicluster dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Fixing gradle check Signed-off-by: Vacha Shah Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Vacha Shah (cherry picked from commit 002e614ecf9357a2636aaf6a4db98cec8af33129) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- test/fixtures/hdfs-fixture/build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/fixtures/hdfs-fixture/build.gradle b/test/fixtures/hdfs-fixture/build.gradle index c56cc6d196b63..2ff444c03b123 100644 --- a/test/fixtures/hdfs-fixture/build.gradle +++ b/test/fixtures/hdfs-fixture/build.gradle @@ -33,7 +33,7 @@ apply plugin: 'opensearch.java' group = 'hdfs' dependencies { - api "org.apache.hadoop:hadoop-minicluster:3.3.1" + api "org.apache.hadoop:hadoop-minicluster:3.3.2" api "org.apache.commons:commons-compress:1.21" api "commons-codec:commons-codec:${versions.commonscodec}" api "org.apache.logging.log4j:log4j-core:${versions.log4j}" @@ -43,4 +43,5 @@ dependencies { api "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:${versions.jackson}" api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}" api 'net.minidev:json-smart:2.4.8' + api "org.mockito:mockito-core:${versions.mockito}" } From 36c7a57bc587485afb7fc5463eb0d33150a7d897 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 18 Apr 2022 12:20:42 -0700 Subject: [PATCH 073/514] Bump reactor-netty from 1.0.16 to 1.0.17 in /plugins/repository-azure (#2613) (#2958) * Bump reactor-netty from 1.0.16 to 1.0.17 in /plugins/repository-azure Bumps [reactor-netty](https://github.com/reactor/reactor-netty) from 1.0.16 to 1.0.17. - [Release notes](https://github.com/reactor/reactor-netty/releases) - [Commits](https://github.com/reactor/reactor-netty/compare/v1.0.16...v1.0.17) --- updated-dependencies: - dependency-name: io.projectreactor.netty:reactor-netty dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Updating SHAs Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] (cherry picked from commit fb5cebbb9b47b35944432d5e15210f0327d32111) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- plugins/repository-azure/build.gradle | 2 +- plugins/repository-azure/licenses/reactor-netty-1.0.16.jar.sha1 | 1 - plugins/repository-azure/licenses/reactor-netty-1.0.17.jar.sha1 | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 plugins/repository-azure/licenses/reactor-netty-1.0.16.jar.sha1 create mode 100644 plugins/repository-azure/licenses/reactor-netty-1.0.17.jar.sha1 diff --git a/plugins/repository-azure/build.gradle b/plugins/repository-azure/build.gradle index 2a293be15bc0d..578dcf4a209a1 100644 --- a/plugins/repository-azure/build.gradle +++ b/plugins/repository-azure/build.gradle @@ -57,7 +57,7 @@ dependencies { api 'com.azure:azure-storage-blob:12.15.0' api 'org.reactivestreams:reactive-streams:1.0.3' api 'io.projectreactor:reactor-core:3.4.15' - api 'io.projectreactor.netty:reactor-netty:1.0.16' + api 'io.projectreactor.netty:reactor-netty:1.0.17' api 'io.projectreactor.netty:reactor-netty-core:1.0.16' api 'io.projectreactor.netty:reactor-netty-http:1.0.16' api "org.slf4j:slf4j-api:${versions.slf4j}" diff --git a/plugins/repository-azure/licenses/reactor-netty-1.0.16.jar.sha1 b/plugins/repository-azure/licenses/reactor-netty-1.0.16.jar.sha1 deleted file mode 100644 index 582380e449a1d..0000000000000 --- a/plugins/repository-azure/licenses/reactor-netty-1.0.16.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -d90829f6127966b0c35c4a3e8e23ca9ed29cd8a5 \ No newline at end of file diff --git a/plugins/repository-azure/licenses/reactor-netty-1.0.17.jar.sha1 b/plugins/repository-azure/licenses/reactor-netty-1.0.17.jar.sha1 new file mode 100644 index 0000000000000..a1f6aa3686692 --- /dev/null +++ b/plugins/repository-azure/licenses/reactor-netty-1.0.17.jar.sha1 @@ -0,0 +1 @@ +7720beb4f58a4379e6294d62766d2e9e1bfaf646 \ No newline at end of file From b0d49e6e5d4d06dd8b49f319bddc967ee59f777d Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 18 Apr 2022 12:25:39 -0700 Subject: [PATCH 074/514] Bump guava from 30.1.1-jre to 31.1-jre in /plugins/repository-hdfs (#2948) (#2959) * Bump guava from 30.1.1-jre to 31.1-jre in /plugins/repository-hdfs Bumps [guava](https://github.com/google/guava) from 30.1.1-jre to 31.1-jre. - [Release notes](https://github.com/google/guava/releases) - [Commits](https://github.com/google/guava/commits) --- updated-dependencies: - dependency-name: com.google.guava:guava dependency-type: direct:production ... Signed-off-by: dependabot[bot] * Updating SHAs Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] (cherry picked from commit bb19f627f090b04cd60213e4b00ee38b31f6de63) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- plugins/repository-hdfs/build.gradle | 2 +- plugins/repository-hdfs/licenses/guava-30.1.1-jre.jar.sha1 | 1 - plugins/repository-hdfs/licenses/guava-31.1-jre.jar.sha1 | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 plugins/repository-hdfs/licenses/guava-30.1.1-jre.jar.sha1 create mode 100644 plugins/repository-hdfs/licenses/guava-31.1-jre.jar.sha1 diff --git a/plugins/repository-hdfs/build.gradle b/plugins/repository-hdfs/build.gradle index a028bd28cc842..d644df243ba95 100644 --- a/plugins/repository-hdfs/build.gradle +++ b/plugins/repository-hdfs/build.gradle @@ -66,7 +66,7 @@ dependencies { api 'org.apache.avro:avro:1.10.2' api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}" api 'com.google.code.gson:gson:2.9.0' - runtimeOnly 'com.google.guava:guava:30.1.1-jre' + runtimeOnly 'com.google.guava:guava:31.1-jre' api 'com.google.protobuf:protobuf-java:3.20.0' api "commons-logging:commons-logging:${versions.commonslogging}" api 'commons-cli:commons-cli:1.2' diff --git a/plugins/repository-hdfs/licenses/guava-30.1.1-jre.jar.sha1 b/plugins/repository-hdfs/licenses/guava-30.1.1-jre.jar.sha1 deleted file mode 100644 index 39e641fc7834f..0000000000000 --- a/plugins/repository-hdfs/licenses/guava-30.1.1-jre.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -87e0fd1df874ea3cbe577702fe6f17068b790fd8 \ No newline at end of file diff --git a/plugins/repository-hdfs/licenses/guava-31.1-jre.jar.sha1 b/plugins/repository-hdfs/licenses/guava-31.1-jre.jar.sha1 new file mode 100644 index 0000000000000..e57390ebe1299 --- /dev/null +++ b/plugins/repository-hdfs/licenses/guava-31.1-jre.jar.sha1 @@ -0,0 +1 @@ +60458f877d055d0c9114d9e1a2efb737b4bc282c \ No newline at end of file From fd263168254c733f9765007b8d0b7fa849fa7edd Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 18 Apr 2022 14:00:25 -0700 Subject: [PATCH 075/514] Bump grpc-context from 1.29.0 to 1.45.1 in /plugins/repository-gcs (#2944) (#2962) * Bump grpc-context from 1.29.0 to 1.45.1 in /plugins/repository-gcs Bumps [grpc-context](https://github.com/grpc/grpc-java) from 1.29.0 to 1.45.1. - [Release notes](https://github.com/grpc/grpc-java/releases) - [Commits](https://github.com/grpc/grpc-java/compare/v1.29.0...v1.45.1) --- updated-dependencies: - dependency-name: io.grpc:grpc-context dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Updating SHAs Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] (cherry picked from commit ca102ea209d142b73f5c037ff0624ab704e00c04) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- plugins/repository-gcs/build.gradle | 2 +- plugins/repository-gcs/licenses/grpc-context-1.29.0.jar.sha1 | 1 - plugins/repository-gcs/licenses/grpc-context-1.45.1.jar.sha1 | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 plugins/repository-gcs/licenses/grpc-context-1.29.0.jar.sha1 create mode 100644 plugins/repository-gcs/licenses/grpc-context-1.45.1.jar.sha1 diff --git a/plugins/repository-gcs/build.gradle b/plugins/repository-gcs/build.gradle index 0e1ed06879f91..241cd70eba071 100644 --- a/plugins/repository-gcs/build.gradle +++ b/plugins/repository-gcs/build.gradle @@ -75,7 +75,7 @@ dependencies { api 'com.google.http-client:google-http-client-jackson2:1.35.0' api 'com.google.http-client:google-http-client-gson:1.41.4' api 'com.google.api:gax-httpjson:0.62.0' - api 'io.grpc:grpc-context:1.29.0' + api 'io.grpc:grpc-context:1.45.1' api 'io.opencensus:opencensus-api:0.18.0' api 'io.opencensus:opencensus-contrib-http-util:0.18.0' api 'com.google.apis:google-api-services-storage:v1-rev20200814-1.30.10' diff --git a/plugins/repository-gcs/licenses/grpc-context-1.29.0.jar.sha1 b/plugins/repository-gcs/licenses/grpc-context-1.29.0.jar.sha1 deleted file mode 100644 index a549827edd283..0000000000000 --- a/plugins/repository-gcs/licenses/grpc-context-1.29.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -1d8a441110f86f8927543dc3007639080441ea3c \ No newline at end of file diff --git a/plugins/repository-gcs/licenses/grpc-context-1.45.1.jar.sha1 b/plugins/repository-gcs/licenses/grpc-context-1.45.1.jar.sha1 new file mode 100644 index 0000000000000..eb7e4fcd78e97 --- /dev/null +++ b/plugins/repository-gcs/licenses/grpc-context-1.45.1.jar.sha1 @@ -0,0 +1 @@ +485a08c019cc78914a477b1dfc7052820b8d822c \ No newline at end of file From a1c9a279c26a37450df8006e7f603d100cd21660 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 18 Apr 2022 14:00:34 -0700 Subject: [PATCH 076/514] Bump reactor-core from 3.4.15 to 3.4.17 in /plugins/repository-azure (#2947) (#2961) * Bump reactor-core from 3.4.15 to 3.4.17 in /plugins/repository-azure Bumps [reactor-core](https://github.com/reactor/reactor-core) from 3.4.15 to 3.4.17. - [Release notes](https://github.com/reactor/reactor-core/releases) - [Commits](https://github.com/reactor/reactor-core/compare/v3.4.15...v3.4.17) --- updated-dependencies: - dependency-name: io.projectreactor:reactor-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Updating SHAs Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] (cherry picked from commit ab026025d711ab6f4e807c0ad40cae3d9ee055ac) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- plugins/repository-azure/build.gradle | 2 +- plugins/repository-azure/licenses/reactor-core-3.4.15.jar.sha1 | 1 - plugins/repository-azure/licenses/reactor-core-3.4.17.jar.sha1 | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 plugins/repository-azure/licenses/reactor-core-3.4.15.jar.sha1 create mode 100644 plugins/repository-azure/licenses/reactor-core-3.4.17.jar.sha1 diff --git a/plugins/repository-azure/build.gradle b/plugins/repository-azure/build.gradle index 578dcf4a209a1..6e4cda952203d 100644 --- a/plugins/repository-azure/build.gradle +++ b/plugins/repository-azure/build.gradle @@ -56,7 +56,7 @@ dependencies { implementation project(':modules:transport-netty4') api 'com.azure:azure-storage-blob:12.15.0' api 'org.reactivestreams:reactive-streams:1.0.3' - api 'io.projectreactor:reactor-core:3.4.15' + api 'io.projectreactor:reactor-core:3.4.17' api 'io.projectreactor.netty:reactor-netty:1.0.17' api 'io.projectreactor.netty:reactor-netty-core:1.0.16' api 'io.projectreactor.netty:reactor-netty-http:1.0.16' diff --git a/plugins/repository-azure/licenses/reactor-core-3.4.15.jar.sha1 b/plugins/repository-azure/licenses/reactor-core-3.4.15.jar.sha1 deleted file mode 100644 index a89de48b20b51..0000000000000 --- a/plugins/repository-azure/licenses/reactor-core-3.4.15.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -28ccf513fe64709c8ded30ea3f387fc718db9626 \ No newline at end of file diff --git a/plugins/repository-azure/licenses/reactor-core-3.4.17.jar.sha1 b/plugins/repository-azure/licenses/reactor-core-3.4.17.jar.sha1 new file mode 100644 index 0000000000000..3803458775631 --- /dev/null +++ b/plugins/repository-azure/licenses/reactor-core-3.4.17.jar.sha1 @@ -0,0 +1 @@ +52176b50d2191bc32a8a235124e7aff7f291754b \ No newline at end of file From d160c44443d066b240c6316f1b1e2733ee2802ed Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 18 Apr 2022 14:01:11 -0700 Subject: [PATCH 077/514] Bump org.gradle.test-retry from 1.3.1 to 1.3.2 (#2940) (#2960) Bumps org.gradle.test-retry from 1.3.1 to 1.3.2. --- updated-dependencies: - dependency-name: org.gradle.test-retry dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> (cherry picked from commit eba19351786944f6d9b3285c257c1637d18e5867) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index a41ad61de39a6..7949872a85b86 100644 --- a/build.gradle +++ b/build.gradle @@ -49,7 +49,7 @@ plugins { id 'opensearch.docker-support' id 'opensearch.global-build-info' id "com.diffplug.spotless" version "6.4.2" apply false - id "org.gradle.test-retry" version "1.3.1" apply false + id "org.gradle.test-retry" version "1.3.2" apply false } apply from: 'gradle/build-complete.gradle' From 2147cd03248e211e2f744b947c679bf46e8b48ca Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 18 Apr 2022 14:59:46 -0700 Subject: [PATCH 078/514] Removed java11 source folders since JDK-11 is the baseline now (#2898) (#2952) Signed-off-by: Andriy Redko (cherry picked from commit d61d170332be07b809cc982f0a5dc5a3d6148d77) Co-authored-by: Andriy Redko --- .../org/opensearch/common/collect/List.java | 34 +-- .../org/opensearch/common/collect/Map.java | 102 +++------ .../org/opensearch/common/collect/Set.java | 36 +--- .../opensearch/core/internal/io/Streams.java | 9 +- .../org/opensearch/common/collect/List.java | 94 --------- .../org/opensearch/common/collect/Map.java | 194 ------------------ .../org/opensearch/common/collect/Set.java | 95 --------- .../opensearch/core/internal/io/Streams.java | 101 --------- .../org/opensearch/monitor/jvm/JvmPid.java | 23 +-- .../org/opensearch/monitor/jvm/JvmPid.java | 41 ---- 10 files changed, 55 insertions(+), 674 deletions(-) delete mode 100644 libs/core/src/main/java11/org/opensearch/common/collect/List.java delete mode 100644 libs/core/src/main/java11/org/opensearch/common/collect/Map.java delete mode 100644 libs/core/src/main/java11/org/opensearch/common/collect/Set.java delete mode 100644 libs/core/src/main/java11/org/opensearch/core/internal/io/Streams.java delete mode 100644 server/src/main/java11/org/opensearch/monitor/jvm/JvmPid.java diff --git a/libs/core/src/main/java/org/opensearch/common/collect/List.java b/libs/core/src/main/java/org/opensearch/common/collect/List.java index 96bdacc276323..56216d6bbafe2 100644 --- a/libs/core/src/main/java/org/opensearch/common/collect/List.java +++ b/libs/core/src/main/java/org/opensearch/common/collect/List.java @@ -32,48 +32,44 @@ package org.opensearch.common.collect; -import java.util.Arrays; import java.util.Collection; -import java.util.Collections; public class List { /** - * Returns an unmodifiable list containing zero elements. + * Delegates to the Java9 {@code List.of()} method. * * @param the {@code List}'s element type * @return an empty {@code List} */ public static java.util.List of() { - return Collections.emptyList(); + return java.util.List.of(); } /** - * Returns an unmodifiable list containing one element. + * Delegates to the Java9 {@code List.of()} method. * * @param the {@code List}'s element type * @param e1 the single element * @return a {@code List} containing the specified element */ public static java.util.List of(T e1) { - return Collections.singletonList(e1); + return java.util.List.of(e1); } /** - * Returns an unmodifiable list containing two elements. + * Delegates to the Java9 {@code List.of()} method. * * @param the {@code List}'s element type - * @param e1 the first element - * @param e2 the second element + * @param e1 the single element * @return a {@code List} containing the specified element */ - @SuppressWarnings("unchecked") public static java.util.List of(T e1, T e2) { - return List.of((T[]) new Object[] { e1, e2 }); + return java.util.List.of(e1, e2); } /** - * Returns an unmodifiable list containing an arbitrary number of elements. + * Delegates to the Java9 {@code List.of()} method. * * @param entries the elements to be contained in the list * @param the {@code List}'s element type @@ -82,25 +78,17 @@ public static java.util.List of(T e1, T e2) { @SafeVarargs @SuppressWarnings("varargs") public static java.util.List of(T... entries) { - switch (entries.length) { - case 0: - return List.of(); - case 1: - return List.of(entries[0]); - default: - return Collections.unmodifiableList(Arrays.asList(entries)); - } + return java.util.List.of(entries); } /** - * Returns an unmodifiable {@code List} containing the elements of the given {@code Collection} in iteration order. + * Delegates to the Java9 {@code List.copyOf()} method. * * @param the {@code List}'s element type * @param coll a {@code Collection} from which elements are drawn, must be non-null * @return a {@code List} containing the elements of the given {@code Collection} */ - @SuppressWarnings("unchecked") public static java.util.List copyOf(Collection coll) { - return (java.util.List) List.of(coll.toArray()); + return java.util.List.copyOf(coll); } } diff --git a/libs/core/src/main/java/org/opensearch/common/collect/Map.java b/libs/core/src/main/java/org/opensearch/common/collect/Map.java index 3b401ee0e1c1b..21de546869390 100644 --- a/libs/core/src/main/java/org/opensearch/common/collect/Map.java +++ b/libs/core/src/main/java/org/opensearch/common/collect/Map.java @@ -32,70 +32,66 @@ package org.opensearch.common.collect; -import java.util.AbstractMap; -import java.util.Collections; -import java.util.HashMap; - public class Map { /** - * Returns an unmodifiable map containing one mapping. + * Delegates to the Java9 {@code Map.of()} method. */ public static java.util.Map of() { - return Collections.emptyMap(); + return java.util.Map.of(); } /** - * Returns an unmodifiable map containing one mapping. + * Delegates to the Java9 {@code Map.of()} method. */ public static java.util.Map of(K k1, V v1) { - return Collections.singletonMap(k1, v1); + return java.util.Map.of(k1, v1); } /** - * Returns an unmodifiable map containing two mappings. + * Delegates to the Java9 {@code Map.of()} method. */ public static java.util.Map of(K k1, V v1, K k2, V v2) { - return mapN(k1, v1, k2, v2); + return java.util.Map.of(k1, v1, k2, v2); } /** - * Returns an unmodifiable map containing three mappings. + * Delegates to the Java9 {@code Map.of()} method. */ public static java.util.Map of(K k1, V v1, K k2, V v2, K k3, V v3) { - return mapN(k1, v1, k2, v2, k3, v3); + return java.util.Map.of(k1, v1, k2, v2, k3, v3); } /** - * Returns an unmodifiable map containing four mappings. + * Delegates to the Java9 {@code Map.of()} method. */ public static java.util.Map of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4) { - return mapN(k1, v1, k2, v2, k3, v3, k4, v4); + return java.util.Map.of(k1, v1, k2, v2, k3, v3, k4, v4); } /** - * Returns an unmodifiable map containing five mappings. + * Delegates to the Java9 {@code Map.of()} method. */ public static java.util.Map of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) { - return mapN(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5); + return java.util.Map.of(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5); } /** - * Returns an unmodifiable map containing six mappings. + * Delegates to the Java9 {@code Map.of()} method. */ public static java.util.Map of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6) { - return mapN(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, k6, v6); + return java.util.Map.of(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, k6, v6); } /** - * Returns an unmodifiable map containing seven mappings. + * Delegates to the Java9 {@code Map.of()} method. */ public static java.util.Map of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7) { - return mapN(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, k6, v6, k7, v7); + return java.util.Map.of(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, k6, v6, k7, v7); } /** - * Returns an unmodifiable map containing eight mappings. + * Delegates to the Java9 {@code Map.of()} method. */ public static java.util.Map of( K k1, @@ -115,11 +111,11 @@ public static java.util.Map of( K k8, V v8 ) { - return mapN(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, k6, v6, k7, v7, k8, v8); + return java.util.Map.of(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, k6, v6, k7, v7, k8, v8); } /** - * Returns an unmodifiable map containing nine mappings. + * Delegates to the Java9 {@code Map.of()} method. */ public static java.util.Map of( K k1, @@ -141,11 +137,11 @@ public static java.util.Map of( K k9, V v9 ) { - return mapN(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, k6, v6, k7, v7, k8, v8, k9, v9); + return java.util.Map.of(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, k6, v6, k7, v7, k8, v8, k9, v9); } /** - * Returns an unmodifiable map containing ten mappings. + * Delegates to the Java9 {@code Map.of()} method. */ public static java.util.Map of( K k1, @@ -169,68 +165,30 @@ public static java.util.Map of( K k10, V v10 ) { - return mapN(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, k6, v6, k7, v7, k8, v8, k9, v9, k10, v10); - } - - @SuppressWarnings("unchecked") - private static java.util.Map mapN(Object... objects) { - if (objects.length % 2 != 0) { - throw new IllegalStateException("Must provide an even number of arguments to Map::of method"); - } - switch (objects.length) { - case 0: - return Map.of(); - case 2: - return Map.of((K) objects[0], (V) objects[1]); - default: - HashMap map = new HashMap<>(); - for (int k = 0; k < objects.length / 2; k++) { - map.put((K) objects[k * 2], (V) objects[k * 2 + 1]); - } - return Collections.unmodifiableMap(map); - } + return java.util.Map.of(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, k6, v6, k7, v7, k8, v8, k9, v9, k10, v10); } /** - * Returns an unmodifiable map containing keys and values extracted from the given entries. - * - * @param the {@code Map}'s key type - * @param the {@code Map}'s value type - * @param entries {@code Map.Entry}s containing the keys and values from which the map is populated - * @return a {@code Map} containing the specified mappings + * Delegates to the Java9 {@code Map.ofEntries()} method. */ @SafeVarargs + @SuppressWarnings("varargs") public static java.util.Map ofEntries(java.util.Map.Entry... entries) { - if (entries.length == 0) { - return Collections.emptyMap(); - } else if (entries.length == 1) { - return Collections.singletonMap(entries[0].getKey(), entries[0].getValue()); - } else { - HashMap map = new HashMap<>(); - for (java.util.Map.Entry entry : entries) { - map.put(entry.getKey(), entry.getValue()); - } - return Collections.unmodifiableMap(map); - } + return java.util.Map.ofEntries(entries); } /** - * Returns an unmodifiable Map.Entry for the provided key and value. + * Delegates to the Java9 {@code Map.entry()} method. */ public static java.util.Map.Entry entry(K k, V v) { - return new AbstractMap.SimpleImmutableEntry<>(k, v); + return java.util.Map.entry(k, v); } /** - * Returns an unmodifiable {@code Map} containing the entries of the given {@code Map}. - * - * @param the {@code Map}'s key type - * @param the {@code Map}'s value type - * @param map a {@code Map} from which entries are drawn, must be non-null - * @return a {@code Map} containing the entries of the given {@code Map} + * Delegates to the Java10 {@code Map.copyOf()} method. */ - @SuppressWarnings({ "unchecked", "rawtypes" }) public static java.util.Map copyOf(java.util.Map map) { - return (java.util.Map) Map.ofEntries(map.entrySet().toArray(new java.util.Map.Entry[0])); + return java.util.Map.copyOf(map); } + } diff --git a/libs/core/src/main/java/org/opensearch/common/collect/Set.java b/libs/core/src/main/java/org/opensearch/common/collect/Set.java index 921408b88241f..0350023e4e894 100644 --- a/libs/core/src/main/java/org/opensearch/common/collect/Set.java +++ b/libs/core/src/main/java/org/opensearch/common/collect/Set.java @@ -32,49 +32,45 @@ package org.opensearch.common.collect; -import java.util.Arrays; import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; public class Set { /** - * Returns an unmodifiable set containing zero elements. + * Delegates to the Java9 {@code Set.of()} method. * * @param the {@code Set}'s element type * @return an empty {@code Set} */ public static java.util.Set of() { - return Collections.emptySet(); + return java.util.Set.of(); } /** - * Returns an unmodifiable set containing one element. + * Delegates to the Java9 {@code Set.of()} method. * * @param the {@code Set}'s element type * @param e1 the single element * @return a {@code Set} containing the specified element */ public static java.util.Set of(T e1) { - return Collections.singleton(e1); + return java.util.Set.of(e1); } /** - * Returns an unmodifiable set containing two elements. + * Delegates to the Java9 {@code Set.of()} method. * * @param the {@code Set}'s element type * @param e1 the first element * @param e2 the second element * @return a {@code Set} containing the specified element */ - @SuppressWarnings("unchecked") public static java.util.Set of(T e1, T e2) { - return Set.of((T[]) new Object[] { e1, e2 }); + return java.util.Set.of(e1, e2); } /** - * Returns an unmodifiable set containing an arbitrary number of elements. + * Delegates to the Java9 {@code Set.of()} method. * * @param entries the elements to be contained in the set * @param the {@code Set}'s element type @@ -83,27 +79,17 @@ public static java.util.Set of(T e1, T e2) { @SafeVarargs @SuppressWarnings("varargs") public static java.util.Set of(T... entries) { - switch (entries.length) { - case 0: - return Set.of(); - case 1: - return Set.of(entries[0]); - default: - return Collections.unmodifiableSet(new HashSet<>(Arrays.asList(entries))); - } + return java.util.Set.of(entries); } /** - * Returns an unmodifiable {@code Set} containing the elements of the given Collection. + * Delegates to the Java10 {@code Set.copyOf} method. * - * @param the {@code Set}'s element type + * @param the {@code Set}'s element type * @param coll a {@code Collection} from which elements are drawn, must be non-null * @return a {@code Set} containing the elements of the given {@code Collection} - * @throws NullPointerException if coll is null, or if it contains any nulls - * @since 10 */ - @SuppressWarnings("unchecked") public static java.util.Set copyOf(Collection coll) { - return (java.util.Set) Set.of(new HashSet<>(coll).toArray()); + return java.util.Set.copyOf(coll); } } diff --git a/libs/core/src/main/java/org/opensearch/core/internal/io/Streams.java b/libs/core/src/main/java/org/opensearch/core/internal/io/Streams.java index 1938e1bbf4dff..67765392b1d46 100644 --- a/libs/core/src/main/java/org/opensearch/core/internal/io/Streams.java +++ b/libs/core/src/main/java/org/opensearch/core/internal/io/Streams.java @@ -38,20 +38,15 @@ /** * Simple utility methods for file and stream copying. - * All copy methods use a block size of 4096 bytes, - * and close all affected streams when done. + * All copy methods close all affected streams when done. *

* Mainly for use within the framework, * but also useful for application code. */ -public class Streams { +public abstract class Streams { private static final ThreadLocal buffer = ThreadLocal.withInitial(() -> new byte[8 * 1024]); - private Streams() { - - } - /** * Copy the contents of the given InputStream to the given OutputStream. Optionally, closes both streams when done. * diff --git a/libs/core/src/main/java11/org/opensearch/common/collect/List.java b/libs/core/src/main/java11/org/opensearch/common/collect/List.java deleted file mode 100644 index 56216d6bbafe2..0000000000000 --- a/libs/core/src/main/java11/org/opensearch/common/collect/List.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.common.collect; - -import java.util.Collection; - -public class List { - - /** - * Delegates to the Java9 {@code List.of()} method. - * - * @param the {@code List}'s element type - * @return an empty {@code List} - */ - public static java.util.List of() { - return java.util.List.of(); - } - - /** - * Delegates to the Java9 {@code List.of()} method. - * - * @param the {@code List}'s element type - * @param e1 the single element - * @return a {@code List} containing the specified element - */ - public static java.util.List of(T e1) { - return java.util.List.of(e1); - } - - /** - * Delegates to the Java9 {@code List.of()} method. - * - * @param the {@code List}'s element type - * @param e1 the single element - * @return a {@code List} containing the specified element - */ - public static java.util.List of(T e1, T e2) { - return java.util.List.of(e1, e2); - } - - /** - * Delegates to the Java9 {@code List.of()} method. - * - * @param entries the elements to be contained in the list - * @param the {@code List}'s element type - * @return an unmodifiable list containing the specified elements. - */ - @SafeVarargs - @SuppressWarnings("varargs") - public static java.util.List of(T... entries) { - return java.util.List.of(entries); - } - - /** - * Delegates to the Java9 {@code List.copyOf()} method. - * - * @param the {@code List}'s element type - * @param coll a {@code Collection} from which elements are drawn, must be non-null - * @return a {@code List} containing the elements of the given {@code Collection} - */ - public static java.util.List copyOf(Collection coll) { - return java.util.List.copyOf(coll); - } -} diff --git a/libs/core/src/main/java11/org/opensearch/common/collect/Map.java b/libs/core/src/main/java11/org/opensearch/common/collect/Map.java deleted file mode 100644 index 21de546869390..0000000000000 --- a/libs/core/src/main/java11/org/opensearch/common/collect/Map.java +++ /dev/null @@ -1,194 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.common.collect; - -public class Map { - - /** - * Delegates to the Java9 {@code Map.of()} method. - */ - public static java.util.Map of() { - return java.util.Map.of(); - } - - /** - * Delegates to the Java9 {@code Map.of()} method. - */ - public static java.util.Map of(K k1, V v1) { - return java.util.Map.of(k1, v1); - } - - /** - * Delegates to the Java9 {@code Map.of()} method. - */ - public static java.util.Map of(K k1, V v1, K k2, V v2) { - return java.util.Map.of(k1, v1, k2, v2); - } - - /** - * Delegates to the Java9 {@code Map.of()} method. - */ - public static java.util.Map of(K k1, V v1, K k2, V v2, K k3, V v3) { - return java.util.Map.of(k1, v1, k2, v2, k3, v3); - } - - /** - * Delegates to the Java9 {@code Map.of()} method. - */ - public static java.util.Map of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4) { - return java.util.Map.of(k1, v1, k2, v2, k3, v3, k4, v4); - } - - /** - * Delegates to the Java9 {@code Map.of()} method. - */ - public static java.util.Map of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) { - return java.util.Map.of(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5); - } - - /** - * Delegates to the Java9 {@code Map.of()} method. - */ - public static java.util.Map of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6) { - return java.util.Map.of(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, k6, v6); - } - - /** - * Delegates to the Java9 {@code Map.of()} method. - */ - public static java.util.Map of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7) { - return java.util.Map.of(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, k6, v6, k7, v7); - } - - /** - * Delegates to the Java9 {@code Map.of()} method. - */ - public static java.util.Map of( - K k1, - V v1, - K k2, - V v2, - K k3, - V v3, - K k4, - V v4, - K k5, - V v5, - K k6, - V v6, - K k7, - V v7, - K k8, - V v8 - ) { - return java.util.Map.of(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, k6, v6, k7, v7, k8, v8); - } - - /** - * Delegates to the Java9 {@code Map.of()} method. - */ - public static java.util.Map of( - K k1, - V v1, - K k2, - V v2, - K k3, - V v3, - K k4, - V v4, - K k5, - V v5, - K k6, - V v6, - K k7, - V v7, - K k8, - V v8, - K k9, - V v9 - ) { - return java.util.Map.of(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, k6, v6, k7, v7, k8, v8, k9, v9); - } - - /** - * Delegates to the Java9 {@code Map.of()} method. - */ - public static java.util.Map of( - K k1, - V v1, - K k2, - V v2, - K k3, - V v3, - K k4, - V v4, - K k5, - V v5, - K k6, - V v6, - K k7, - V v7, - K k8, - V v8, - K k9, - V v9, - K k10, - V v10 - ) { - return java.util.Map.of(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, k6, v6, k7, v7, k8, v8, k9, v9, k10, v10); - } - - /** - * Delegates to the Java9 {@code Map.ofEntries()} method. - */ - @SafeVarargs - @SuppressWarnings("varargs") - public static java.util.Map ofEntries(java.util.Map.Entry... entries) { - return java.util.Map.ofEntries(entries); - } - - /** - * Delegates to the Java9 {@code Map.entry()} method. - */ - public static java.util.Map.Entry entry(K k, V v) { - return java.util.Map.entry(k, v); - } - - /** - * Delegates to the Java10 {@code Map.copyOf()} method. - */ - public static java.util.Map copyOf(java.util.Map map) { - return java.util.Map.copyOf(map); - } - -} diff --git a/libs/core/src/main/java11/org/opensearch/common/collect/Set.java b/libs/core/src/main/java11/org/opensearch/common/collect/Set.java deleted file mode 100644 index 0350023e4e894..0000000000000 --- a/libs/core/src/main/java11/org/opensearch/common/collect/Set.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.common.collect; - -import java.util.Collection; - -public class Set { - - /** - * Delegates to the Java9 {@code Set.of()} method. - * - * @param the {@code Set}'s element type - * @return an empty {@code Set} - */ - public static java.util.Set of() { - return java.util.Set.of(); - } - - /** - * Delegates to the Java9 {@code Set.of()} method. - * - * @param the {@code Set}'s element type - * @param e1 the single element - * @return a {@code Set} containing the specified element - */ - public static java.util.Set of(T e1) { - return java.util.Set.of(e1); - } - - /** - * Delegates to the Java9 {@code Set.of()} method. - * - * @param the {@code Set}'s element type - * @param e1 the first element - * @param e2 the second element - * @return a {@code Set} containing the specified element - */ - public static java.util.Set of(T e1, T e2) { - return java.util.Set.of(e1, e2); - } - - /** - * Delegates to the Java9 {@code Set.of()} method. - * - * @param entries the elements to be contained in the set - * @param the {@code Set}'s element type - * @return an unmodifiable set containing the specified elements. - */ - @SafeVarargs - @SuppressWarnings("varargs") - public static java.util.Set of(T... entries) { - return java.util.Set.of(entries); - } - - /** - * Delegates to the Java10 {@code Set.copyOf} method. - * - * @param the {@code Set}'s element type - * @param coll a {@code Collection} from which elements are drawn, must be non-null - * @return a {@code Set} containing the elements of the given {@code Collection} - */ - public static java.util.Set copyOf(Collection coll) { - return java.util.Set.copyOf(coll); - } -} diff --git a/libs/core/src/main/java11/org/opensearch/core/internal/io/Streams.java b/libs/core/src/main/java11/org/opensearch/core/internal/io/Streams.java deleted file mode 100644 index 67765392b1d46..0000000000000 --- a/libs/core/src/main/java11/org/opensearch/core/internal/io/Streams.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.core.internal.io; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -/** - * Simple utility methods for file and stream copying. - * All copy methods close all affected streams when done. - *

- * Mainly for use within the framework, - * but also useful for application code. - */ -public abstract class Streams { - - private static final ThreadLocal buffer = ThreadLocal.withInitial(() -> new byte[8 * 1024]); - - /** - * Copy the contents of the given InputStream to the given OutputStream. Optionally, closes both streams when done. - * - * @param in the stream to copy from - * @param out the stream to copy to - * @param close whether to close both streams after copying - * @param buffer buffer to use for copying - * @return the number of bytes copied - * @throws IOException in case of I/O errors - */ - public static long copy(final InputStream in, final OutputStream out, byte[] buffer, boolean close) throws IOException { - Exception err = null; - try { - long byteCount = 0; - int bytesRead; - while ((bytesRead = in.read(buffer)) != -1) { - out.write(buffer, 0, bytesRead); - byteCount += bytesRead; - } - out.flush(); - return byteCount; - } catch (IOException | RuntimeException e) { - err = e; - throw e; - } finally { - if (close) { - IOUtils.close(err, in, out); - } - } - } - - /** - * @see #copy(InputStream, OutputStream, byte[], boolean) - */ - public static long copy(final InputStream in, final OutputStream out, boolean close) throws IOException { - return copy(in, out, buffer.get(), close); - } - - /** - * @see #copy(InputStream, OutputStream, byte[], boolean) - */ - public static long copy(final InputStream in, final OutputStream out, byte[] buffer) throws IOException { - return copy(in, out, buffer, true); - } - - /** - * @see #copy(InputStream, OutputStream, byte[], boolean) - */ - public static long copy(final InputStream in, final OutputStream out) throws IOException { - return copy(in, out, buffer.get(), true); - } -} diff --git a/server/src/main/java/org/opensearch/monitor/jvm/JvmPid.java b/server/src/main/java/org/opensearch/monitor/jvm/JvmPid.java index bf9b5f6fe4f3f..9a2fbfbd27c68 100644 --- a/server/src/main/java/org/opensearch/monitor/jvm/JvmPid.java +++ b/server/src/main/java/org/opensearch/monitor/jvm/JvmPid.java @@ -32,31 +32,10 @@ package org.opensearch.monitor.jvm; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.message.ParameterizedMessage; - -import java.lang.management.ManagementFactory; - class JvmPid { - private static final long PID; - static long getPid() { - return PID; - } - - static { - PID = initializePid(); - } - - private static long initializePid() { - final String name = ManagementFactory.getRuntimeMXBean().getName(); - try { - return Long.parseLong(name.split("@")[0]); - } catch (final NumberFormatException e) { - LogManager.getLogger(JvmPid.class).debug(new ParameterizedMessage("failed parsing PID from [{}]", name), e); - return -1; - } + return ProcessHandle.current().pid(); } } diff --git a/server/src/main/java11/org/opensearch/monitor/jvm/JvmPid.java b/server/src/main/java11/org/opensearch/monitor/jvm/JvmPid.java deleted file mode 100644 index 9a2fbfbd27c68..0000000000000 --- a/server/src/main/java11/org/opensearch/monitor/jvm/JvmPid.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.monitor.jvm; - -class JvmPid { - - static long getPid() { - return ProcessHandle.current().pid(); - } - -} From 354157d6f3a0bcb396a28ecc1de85fcae0f6419b Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 18 Apr 2022 16:08:32 -0700 Subject: [PATCH 079/514] Bump google-oauth-client from 1.33.2 to 1.33.3 in /plugins/discovery-gce (#2943) (#2966) * Bump google-oauth-client from 1.33.2 to 1.33.3 in /plugins/discovery-gce Bumps [google-oauth-client](https://github.com/googleapis/google-oauth-java-client) from 1.33.2 to 1.33.3. - [Release notes](https://github.com/googleapis/google-oauth-java-client/releases) - [Changelog](https://github.com/googleapis/google-oauth-java-client/blob/main/CHANGELOG.md) - [Commits](https://github.com/googleapis/google-oauth-java-client/compare/v1.33.2...v1.33.3) --- updated-dependencies: - dependency-name: com.google.oauth-client:google-oauth-client dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Updating SHAs Signed-off-by: dependabot[bot] * Fixing precommit failures Signed-off-by: Vacha Shah Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] Co-authored-by: Vacha Shah (cherry picked from commit 25d81c5fd5f680da2ca3db1cbbda66b68078c2fb) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- plugins/discovery-gce/build.gradle | 14 +++++++++++--- .../licenses/google-oauth-client-1.33.2.jar.sha1 | 1 - .../licenses/google-oauth-client-1.33.3.jar.sha1 | 1 + 3 files changed, 12 insertions(+), 4 deletions(-) delete mode 100644 plugins/discovery-gce/licenses/google-oauth-client-1.33.2.jar.sha1 create mode 100644 plugins/discovery-gce/licenses/google-oauth-client-1.33.3.jar.sha1 diff --git a/plugins/discovery-gce/build.gradle b/plugins/discovery-gce/build.gradle index eb695f84b2bd0..beae0d84685a4 100644 --- a/plugins/discovery-gce/build.gradle +++ b/plugins/discovery-gce/build.gradle @@ -24,7 +24,7 @@ versions << [ dependencies { api "com.google.apis:google-api-services-compute:v1-rev160-${versions.google}" api "com.google.api-client:google-api-client:${versions.google}" - api "com.google.oauth-client:google-oauth-client:1.33.2" + api "com.google.oauth-client:google-oauth-client:1.33.3" api "com.google.http-client:google-http-client:${versions.google}" api "com.google.http-client:google-http-client-jackson2:${versions.google}" api 'com.google.code.findbugs:jsr305:3.0.2' @@ -58,13 +58,21 @@ test { thirdPartyAudit.ignoreMissingClasses( // classes are missing 'javax.jms.Message', - 'com.google.common.base.Splitter', - 'com.google.common.collect.Lists', 'javax.servlet.ServletContextEvent', 'javax.servlet.ServletContextListener', 'org.apache.avalon.framework.logger.Logger', 'org.apache.log.Hierarchy', 'org.apache.log.Logger', + 'com.google.api.client.json.gson.GsonFactory', + 'com.google.common.base.Preconditions', + 'com.google.common.base.Splitter', + 'com.google.common.cache.CacheBuilder', + 'com.google.common.cache.CacheLoader', + 'com.google.common.cache.LoadingCache', + 'com.google.common.collect.ImmutableMap', + 'com.google.common.collect.ImmutableMap$Builder', + 'com.google.common.collect.ImmutableSet', + 'com.google.common.collect.Lists', 'com.google.common.collect.Multiset', 'com.google.common.collect.SortedMultiset', 'com.google.common.collect.TreeMultiset', diff --git a/plugins/discovery-gce/licenses/google-oauth-client-1.33.2.jar.sha1 b/plugins/discovery-gce/licenses/google-oauth-client-1.33.2.jar.sha1 deleted file mode 100644 index 289e8e8261fd3..0000000000000 --- a/plugins/discovery-gce/licenses/google-oauth-client-1.33.2.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -2810fb515fe110295dc6867fc9f70c401b66daf3 \ No newline at end of file diff --git a/plugins/discovery-gce/licenses/google-oauth-client-1.33.3.jar.sha1 b/plugins/discovery-gce/licenses/google-oauth-client-1.33.3.jar.sha1 new file mode 100644 index 0000000000000..f2afaa1bc2dba --- /dev/null +++ b/plugins/discovery-gce/licenses/google-oauth-client-1.33.3.jar.sha1 @@ -0,0 +1 @@ +9d445a8649b0de731922b9a3ebf1552b5403611d \ No newline at end of file From 13116d2d38e59e6525a8b21d2f311a07eb44228d Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 19 Apr 2022 12:45:35 -0400 Subject: [PATCH 080/514] Use G1GC on JDK11+ (#2964) (#2973) Update default jvm settings to use G1GC by default for JDK11 and greater. Signed-off-by: Matt Weber (cherry picked from commit 8bfb082ee136aa65063d17ec1e41fb10ed759d1f) Co-authored-by: Matt Weber --- distribution/src/config/jvm.options | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/distribution/src/config/jvm.options b/distribution/src/config/jvm.options index a20baf1be0906..ef1035489c9fc 100644 --- a/distribution/src/config/jvm.options +++ b/distribution/src/config/jvm.options @@ -33,19 +33,19 @@ ################################################################ ## GC configuration -8-13:-XX:+UseConcMarkSweepGC -8-13:-XX:CMSInitiatingOccupancyFraction=75 -8-13:-XX:+UseCMSInitiatingOccupancyOnly +8-10:-XX:+UseConcMarkSweepGC +8-10:-XX:CMSInitiatingOccupancyFraction=75 +8-10:-XX:+UseCMSInitiatingOccupancyOnly ## G1GC Configuration # NOTE: G1 GC is only supported on JDK version 10 or later # to use G1GC, uncomment the next two lines and update the version on the # following three lines to your version of the JDK -# 10-13:-XX:-UseConcMarkSweepGC -# 10-13:-XX:-UseCMSInitiatingOccupancyOnly -14-:-XX:+UseG1GC -14-:-XX:G1ReservePercent=25 -14-:-XX:InitiatingHeapOccupancyPercent=30 +# 10:-XX:-UseConcMarkSweepGC +# 10:-XX:-UseCMSInitiatingOccupancyOnly +11-:-XX:+UseG1GC +11-:-XX:G1ReservePercent=25 +11-:-XX:InitiatingHeapOccupancyPercent=30 ## JVM temporary directory -Djava.io.tmpdir=${OPENSEARCH_TMPDIR} From 46260af409bb083d143843220f7d70e881d9fbae Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 19 Apr 2022 12:54:50 -0400 Subject: [PATCH 081/514] Add `positive_score_impact` support for `rank_features` (#2725) (#2968) Adds positive_score_impact support for rank_features field mapper. Signed-off-by: Yevhen Tienkaiev (cherry picked from commit d8c815c6be80d592cf22f4a1c5060c2ca1857c2a) Co-authored-by: Yevhen Tienkaiev --- .../index/mapper/RankFeaturesFieldMapper.java | 41 ++++++++++++++++--- .../mapper/RankFeaturesFieldMapperTests.java | 31 +++++++++++++- .../mapper/RankFeaturesFieldTypeTests.java | 2 +- .../test/rank_feature/10_basic.yml | 21 ++++++++++ .../test/rank_features/10_basic.yml | 40 ++++++++++++++++++ 5 files changed, 126 insertions(+), 9 deletions(-) diff --git a/modules/mapper-extras/src/main/java/org/opensearch/index/mapper/RankFeaturesFieldMapper.java b/modules/mapper-extras/src/main/java/org/opensearch/index/mapper/RankFeaturesFieldMapper.java index 43853eb40f432..21a0acd508a39 100644 --- a/modules/mapper-extras/src/main/java/org/opensearch/index/mapper/RankFeaturesFieldMapper.java +++ b/modules/mapper-extras/src/main/java/org/opensearch/index/mapper/RankFeaturesFieldMapper.java @@ -42,7 +42,6 @@ import org.opensearch.search.lookup.SearchLookup; import java.io.IOException; -import java.util.Collections; import java.util.List; import java.util.Map; import java.util.function.Supplier; @@ -55,8 +54,18 @@ public class RankFeaturesFieldMapper extends ParametrizedFieldMapper { public static final String CONTENT_TYPE = "rank_features"; + private static RankFeaturesFieldType ft(FieldMapper in) { + return ((RankFeaturesFieldMapper) in).fieldType(); + } + public static class Builder extends ParametrizedFieldMapper.Builder { + private final Parameter positiveScoreImpact = Parameter.boolParam( + "positive_score_impact", + false, + m -> ft(m).positiveScoreImpact, + true + ); private final Parameter> meta = Parameter.metaParam(); public Builder(String name) { @@ -66,16 +75,17 @@ public Builder(String name) { @Override protected List> getParameters() { - return Collections.singletonList(meta); + return List.of(meta, positiveScoreImpact); } @Override public RankFeaturesFieldMapper build(BuilderContext context) { return new RankFeaturesFieldMapper( name, - new RankFeaturesFieldType(buildFullName(context), meta.getValue()), + new RankFeaturesFieldType(buildFullName(context), meta.getValue(), positiveScoreImpact.getValue()), multiFieldsBuilder.build(this, context), - copyTo.build() + copyTo.build(), + positiveScoreImpact.getValue() ); } } @@ -84,9 +94,12 @@ public RankFeaturesFieldMapper build(BuilderContext context) { public static final class RankFeaturesFieldType extends MappedFieldType { - public RankFeaturesFieldType(String name, Map meta) { + private final boolean positiveScoreImpact; + + public RankFeaturesFieldType(String name, Map meta, boolean positiveScoreImpact) { super(name, false, false, false, TextSearchInfo.NONE, meta); setIndexAnalyzer(Lucene.KEYWORD_ANALYZER); + this.positiveScoreImpact = positiveScoreImpact; } @Override @@ -94,6 +107,10 @@ public String typeName() { return CONTENT_TYPE; } + public boolean positiveScoreImpact() { + return positiveScoreImpact; + } + @Override public Query existsQuery(QueryShardContext context) { throw new IllegalArgumentException("[rank_features] fields do not support [exists] queries"); @@ -115,9 +132,18 @@ public Query termQuery(Object value, QueryShardContext context) { } } - private RankFeaturesFieldMapper(String simpleName, MappedFieldType mappedFieldType, MultiFields multiFields, CopyTo copyTo) { + private final boolean positiveScoreImpact; + + private RankFeaturesFieldMapper( + String simpleName, + MappedFieldType mappedFieldType, + MultiFields multiFields, + CopyTo copyTo, + boolean positiveScoreImpact + ) { super(simpleName, mappedFieldType, multiFields, copyTo); assert fieldType.indexOptions().compareTo(IndexOptions.DOCS_AND_FREQS) <= 0; + this.positiveScoreImpact = positiveScoreImpact; } @Override @@ -164,6 +190,9 @@ public void parse(ParseContext context) throws IOException { + "] in the same document" ); } + if (positiveScoreImpact == false) { + value = 1 / value; + } context.doc().addWithKey(key, new FeatureField(name(), feature, value)); } else { throw new IllegalArgumentException( diff --git a/modules/mapper-extras/src/test/java/org/opensearch/index/mapper/RankFeaturesFieldMapperTests.java b/modules/mapper-extras/src/test/java/org/opensearch/index/mapper/RankFeaturesFieldMapperTests.java index 129ba6b126237..55d825d1b53bb 100644 --- a/modules/mapper-extras/src/test/java/org/opensearch/index/mapper/RankFeaturesFieldMapperTests.java +++ b/modules/mapper-extras/src/test/java/org/opensearch/index/mapper/RankFeaturesFieldMapperTests.java @@ -67,8 +67,8 @@ protected void minimalMapping(XContentBuilder b) throws IOException { } @Override - protected void registerParameters(ParameterChecker checker) { - // no parameters to configure + protected void registerParameters(ParameterChecker checker) throws IOException { + checker.registerConflictCheck("positive_score_impact", b -> b.field("positive_score_impact", false)); } @Override @@ -95,6 +95,33 @@ public void testDefaults() throws Exception { assertTrue(freq1 < freq2); } + public void testNegativeScoreImpact() throws Exception { + DocumentMapper mapper = createDocumentMapper( + fieldMapping(b -> b.field("type", "rank_features").field("positive_score_impact", false)) + ); + + ParsedDocument doc1 = mapper.parse(source(this::writeField)); + + IndexableField[] fields = doc1.rootDoc().getFields("field"); + assertEquals(2, fields.length); + assertThat(fields[0], Matchers.instanceOf(FeatureField.class)); + FeatureField featureField1 = null; + FeatureField featureField2 = null; + for (IndexableField field : fields) { + if (field.stringValue().equals("foo")) { + featureField1 = (FeatureField) field; + } else if (field.stringValue().equals("bar")) { + featureField2 = (FeatureField) field; + } else { + throw new UnsupportedOperationException(); + } + } + + int freq1 = RankFeatureFieldMapperTests.getFrequency(featureField1.tokenStream(null, null)); + int freq2 = RankFeatureFieldMapperTests.getFrequency(featureField2.tokenStream(null, null)); + assertTrue(freq1 > freq2); + } + public void testRejectMultiValuedFields() throws MapperParsingException, IOException { DocumentMapper mapper = createDocumentMapper(mapping(b -> { b.startObject("field").field("type", "rank_features").endObject(); diff --git a/modules/mapper-extras/src/test/java/org/opensearch/index/mapper/RankFeaturesFieldTypeTests.java b/modules/mapper-extras/src/test/java/org/opensearch/index/mapper/RankFeaturesFieldTypeTests.java index b8c653bc97ce7..8ece0d63f05ba 100644 --- a/modules/mapper-extras/src/test/java/org/opensearch/index/mapper/RankFeaturesFieldTypeTests.java +++ b/modules/mapper-extras/src/test/java/org/opensearch/index/mapper/RankFeaturesFieldTypeTests.java @@ -37,7 +37,7 @@ public class RankFeaturesFieldTypeTests extends FieldTypeTestCase { public void testIsNotAggregatable() { - MappedFieldType fieldType = new RankFeaturesFieldMapper.RankFeaturesFieldType("field", Collections.emptyMap()); + MappedFieldType fieldType = new RankFeaturesFieldMapper.RankFeaturesFieldType("field", Collections.emptyMap(), true); assertFalse(fieldType.isAggregatable()); } } diff --git a/modules/mapper-extras/src/yamlRestTest/resources/rest-api-spec/test/rank_feature/10_basic.yml b/modules/mapper-extras/src/yamlRestTest/resources/rest-api-spec/test/rank_feature/10_basic.yml index 6fea35eb21f4e..ac951263ca299 100644 --- a/modules/mapper-extras/src/yamlRestTest/resources/rest-api-spec/test/rank_feature/10_basic.yml +++ b/modules/mapper-extras/src/yamlRestTest/resources/rest-api-spec/test/rank_feature/10_basic.yml @@ -157,3 +157,24 @@ setup: - match: hits.hits.1._id: "1" + +--- +"Negative linear": + + - do: + search: + index: test + body: + query: + rank_feature: + field: url_length + linear: {} + + - match: + hits.total.value: 2 + + - match: + hits.hits.0._id: "2" + + - match: + hits.hits.1._id: "1" diff --git a/modules/mapper-extras/src/yamlRestTest/resources/rest-api-spec/test/rank_features/10_basic.yml b/modules/mapper-extras/src/yamlRestTest/resources/rest-api-spec/test/rank_features/10_basic.yml index d4d5d2a360406..2644b9e777f6a 100644 --- a/modules/mapper-extras/src/yamlRestTest/resources/rest-api-spec/test/rank_features/10_basic.yml +++ b/modules/mapper-extras/src/yamlRestTest/resources/rest-api-spec/test/rank_features/10_basic.yml @@ -9,6 +9,9 @@ setup: properties: tags: type: rank_features + negative_reviews: + type: rank_features + positive_score_impact: false - do: index: @@ -18,6 +21,9 @@ setup: tags: foo: 3 bar: 5 + negative_reviews: + 1star: 10 + 2star: 1 - do: index: @@ -27,6 +33,9 @@ setup: tags: bar: 6 quux: 10 + negative_reviews: + 1star: 1 + 2star: 10 - do: indices.refresh: {} @@ -97,3 +106,34 @@ setup: - match: hits.hits.1._id: "1" + +--- +"Linear negative impact": + + - do: + search: + index: test + body: + query: + rank_feature: + field: negative_reviews.1star + linear: {} + + - match: + hits.hits.0._id: "2" + - match: + hits.hits.1._id: "1" + + - do: + search: + index: test + body: + query: + rank_feature: + field: negative_reviews.2star + linear: {} + + - match: + hits.hits.0._id: "1" + - match: + hits.hits.1._id: "2" From af02c06cd163472ec9324f00afd1584d59f11003 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 19 Apr 2022 13:04:55 -0400 Subject: [PATCH 082/514] Adding workflow to create documentation related issues in documentation-website repo (#2929) (#2975) Signed-off-by: Vacha Shah (cherry picked from commit 8c9078d134d6d4e9ec0d14d41c3565fc45ae7e33) Co-authored-by: Vacha Shah --- .ci/documentation/issue.md | 11 +++++ .../workflows/create-documentation-issue.yml | 41 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 .ci/documentation/issue.md create mode 100644 .github/workflows/create-documentation-issue.yml diff --git a/.ci/documentation/issue.md b/.ci/documentation/issue.md new file mode 100644 index 0000000000000..c34905605b2f6 --- /dev/null +++ b/.ci/documentation/issue.md @@ -0,0 +1,11 @@ +**Is your feature request related to a problem?** +A new feature has been added. + +**What solution would you like?** +Document the usage of the new feature. + +**What alternatives have you considered?** +N/A + +**Do you have any additional context?** +See please diff --git a/.github/workflows/create-documentation-issue.yml b/.github/workflows/create-documentation-issue.yml new file mode 100644 index 0000000000000..c81f7355a0d22 --- /dev/null +++ b/.github/workflows/create-documentation-issue.yml @@ -0,0 +1,41 @@ +name: Create Documentation Issue +on: + pull_request: + types: + - labeled +env: + PR_NUMBER: ${{ github.event.number }} + +jobs: + create-issue: + if: ${{ github.event.label.name == 'needs-documentation' }} + runs-on: ubuntu-latest + name: Create Documentation Issue + steps: + - name: GitHub App token + id: github_app_token + uses: tibdex/github-app-token@v1.5.0 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.APP_PRIVATE_KEY }} + installation_id: 22958780 + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Edit the issue template + run: | + echo "https://github.com/opensearch-project/OpenSearch/pull/${{ env.PR_NUMBER }}." >> ./ci/documentation/issue.md + + - name: Create Issue From File + id: create-issue + uses: peter-evans/create-issue-from-file@v4 + with: + title: Add documentation related to new feature + content-filepath: ./ci/documentation/issue.md + labels: documentation + repository: opensearch-project/documentation-website + token: ${{ steps.github_app_token.outputs.token }} + + - name: Print Issue + run: echo Created related documentation issue ${{ steps.create-issue.outputs.issue-number }} From a73cc28139620384ecbafe9ba3542a197e6fc481 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 19 Apr 2022 13:34:18 -0400 Subject: [PATCH 083/514] Remove binary (class) files from the repository (#2969) (#2978) Signed-off-by: Andriy Redko (cherry picked from commit 896b97e54df4e192a15994a1076a9d1d04312f74) Co-authored-by: Andriy Redko --- .../missingdoclet/MissingDoclet.class | Bin 14156 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 doc-tools/missing-doclet/bin/main/org/opensearch/missingdoclet/MissingDoclet.class diff --git a/doc-tools/missing-doclet/bin/main/org/opensearch/missingdoclet/MissingDoclet.class b/doc-tools/missing-doclet/bin/main/org/opensearch/missingdoclet/MissingDoclet.class deleted file mode 100644 index 8729def18e4b3eda7184b1e3e49f1bf055d152db..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14156 zcmbta34B!5)j#KEd6UTlhOlT*aeyetJXqnwXLEAqD9eG+uHWi?weigVi&vE(nYJ4?|<%lZKq+q?oGXiS2dq0V|fYLW!QhZ13X7?aV_*tEX!q827@Wt!3yk0mi8wJ{VOvnnHFkALg_(-mTe{ZHS zRvL5x_&zff!%Vu6Rsr9kaJVrFW-hPH!cGQ}4ON#Iv>NA}{4pz*c&U+^gqGhVYBfVEL#m#T_Ss2VNw~*D5WcDt3e^Aipk71sfR$kQZT%$si2v_ z=o9KP*>0OjGijD=*K1OQu7XHn5l2-xDsH|bF%u{`St@GMY&uDnikTD_g&+dh8taJ; zhOMxx4~6A+n3N#MvnK+59!kZb(`V;MWvkQPP)dUYQw3dKmcg&vYtk;-4VuQRU7+bq zcZF=$HRzo{giOr=-cgBl4p3e|e~n51MgI+Z)6;A9^g;94EHcrw1`(h^y3VBQ>D^%3 z-cT~2L4i8G1a)T@rumvzCtL~|1BSGxuRS#2=)6e*&{|3#pqmW35r%8bDYfNt@ov%w z>1J3jki;<^!EH?KlR4%1&^s$Rdw^OWrjHnO3)8|ez&OaL%bjA{d z7O}#CP(K7}UOuLC7m*>@?RL7uppU^J7&`l|E(CX>=bLv$E<^5NHqWH|YQkfg^BC z+x%8ebUFu}GP1!-pP>f~`m88||AUKVyh#tz=R|)d!jV`AmIkcYYS0(p3ynLyJsuv6 zTF$1W^m%&Nq=UlHC6VNYSPU2p%c&kU>5vGBsRg7d-Y-s&bQ~5R;eB$>5tAOH$8EW9 zf!xQF8My}zT>;g6*%nErK*FQ6!=NYN)o4VfdrENZV3?7e zBgwAau~e^>ioly3>~Gg@*CZ7K?Dz{zCynNg)q{~}*h+Zl+f1jn`orDR0E-;EmaPIEM@%=_ zvmGcJJoFQw#J}50Etb`ODy#i$)FSSFWBA`)L}uP0czemDU(&Czpp{67Mn88Fs%6Zo zP^nDbvIdV$vT)bc?MWP$WqY z{TX7QyMx<=H(xdBuk^QU-h@N#>;mDMggj~v`@2d15WXoCz7bH<0Eyvy&7{|bcf66L zYxlhLhG?lbb99C6Sb6C!z(^;+3lrIClbI12O~>(J+#SJ_XoP9~Byc>&2?)n~QkX3< zP1a%!rCi9x1{ZdMwB^mzeC;CNYw1k(dDd!KTSm z1UEBbCR<~@RszO9ybh9$<&z$sh8__Ysrf?*%kRXZvfOl&%XkKq8TJx+XwBwn$4NDK z7Hr`7kPE`VCw!90Co>`s1My@u)B_~Wu54<`UeIBA8GMS#r;6<;MEKQT!gJYg@aZlk zZDpnXKa=MXEPi2UFbExTH!m=`g3o{+O2ymaS6hjuP!b!R=}2eR#D;M;F7dELTU#Nu zecF8iTKqViqjS01|44mz%L2+XiDgB(3W}ydCKYrQjy;`MlC##ALQQ*4WQk*5nI$ z6^wo;w!1x)>gg5dW8yX8s`F}YHn<7!%I>@BQt@~+S=Ss1A=XdAWK?K#%q_eIpaz27 zEjn*8{?G;wuSEdoh=5;*(*CW3DgUbAPH5Cf*z$+1o+uIGE{o)a8G(?7QX33Ap<&s%4A)(@N8~s|RT~ZNKt5^w zsk^M6!IXsbj?OKEO6Wu!z+FtSw-vTd0N?0Ma>PrA4FCWfu>oEO!_wG6g+8g<>*b62 z5`#A*9W&-Insprb*F>TaIFm2s%it;5IT`4+jFjiB>H=bmzIJ^$NUs{aWg^F}8{w|A z9sGO_nY@*Iuv^^W2#EW2E-mwsYYaNx4(i4qn*|nf10IHcSU#3-ZIt-au)?>A!<$NE zaW9-n7z3BTaTbW+Xy3}oe5y2SX5Wnsw zMG&h!dnR-=vyaTQBG1Zpwr;{0PqKHj(-5wSCmb`_90yS^n23(@9+U#t4-OunAq4KnwKK;{*B_fJn4e|s;#hu>%L zdma65AHadoN!Y=Fnf!kK0FDbY51EGlkptl9;Tpc1O#UDv5I1`4{3+8}*)WcolkFfl zu1*NlbX&N zcG2%KgFLm_`ZCJm7I|#@8<*X9-3QltI^ql>}8%S zft(o)2Hy`D^26Hf82N6Tuat-QvnD?vaZ5=k>6!wN@+1fcx><$mVgacI7`@Q@t{*A%Eb}w!8{LVqp z3kgAfnSTo!!;4BH7=dH%s_pDi6&vmD1~31fUorR(V1J>8?NB&Nxr0ppqt3f+v-Dja zGEDqulZxmmi4$Hm`L7ZN6t#4A20O)NKQ12m-_!RH<3ta6{cOP9ZzYqs`a^iRZ7>>b zcWaJt=D`%Q^ZdFbCFcT3{Dz6t3Gxx(>`TWdnZsAMF2t<2Og;Wdp-dgW=R@=5E|wqR3ZTh69srkWvL z#qGi74K^IJOf_4Yih|v1TO=!}PBsav%GVrIouY?#wloDhB|)f8Gu2#a^4U#D5w>>( z11$j!kKa`Dq;q;_OIL71Cm_u}@d8s-NN*`l(cRjVKE;`)S}5&P1#er@M>kXz)0_-z z1>#+UJ-urpRy5oqVX{GUVP2x4{;lCq#aT>?ZCS}HXrn`H_~)f+u{z68bs+e-%4GC3 zQ!P#lk^;;yiGu~&_wP~(HpcI0m54`L)Rhw!DYa_aIn~*Zk*51xcJGfel zw;@q0S7cd4l^RI4!V5}!gM$<6cWQ#n3+_Kr@I zPhBAkhD_C@nlbrGpK3Ij5QP|LaRRJyv zAcfa%$?K0K%_GP?-u##}2Zpm4HA9{Rkq7mXthyKV(yY3SpORIdidlHGf?tx`dR^j1 zU6;7()+O$#b&1y~*k=yD6`g`#yh+K_ee1+xqIEjjPA5Np=b_e#v5fNM>ccd@y7&-P zR3D);4^gdMEPfb$iq69CY@CB=ITg}MoS+HNG-Kc8v;?iDy#_6%WvH<{9>FXdlI41z zyD(3oZ}sDJ&gR3&In-do^G2va(WaWmsc|!^O(V3%uC9}6Te{jV)u2;-2&)umh~{X# ztOZV6fsu7IA2;Yra6P(;j%cW6+dDc?d8nQ`G)CUxKy0^k0$!H)5BRk)QeacAy7mxl zsII9!Oq()Tn5z4Z0vAt!Zcplc{0^n<(+f5>(q~&@%ixx0aLQ+K>aWnbC|A+fvY=e;U<3Qh%M8G@6tixi_W-K*V!fH9PEaKk8iWgx zE3xb#(Ny%|PSk<_I@E--tEwN>puS%L)DH=~w;`5B*YDET2g!-8H z0@(IjAlA33g1(ytT2&gfDh&{B3;@n2=#vg;9^yBt!ocmAlE)1;IN+%wS(WD!e<1@B?bL_=IYyr!p@)EedZfB$m>wCT z2b}UgDTfR1rG2^qpd1mLd{NVIb%usO4q!Y;PwuCM?)TIC=@j?-nf)}){r>6!^5oF` z@gZu^`xM0y)Hw5X096i6e>|2NFJ1!!=U-si+dU2S3K1{z59=7FXqt+Wg zqcFWh1GwfKq+dgFUZ!hsGkGoj32!j|Odq1Z&=BqzAECd2%a7C7fuJAYvhYQ;{|48B zzoQfMI&k|IF7p_Xs-KH9q~v)nDe)z|#aL@Oc5%6EJ(avc;TgsW=qQ`j_Smd;g3far z4BDf)?*zy@YD_7?^#*_Lf!>-6ZomyUwh-aH#bM56z`$=@o~$kV-7x)OADOjff5OLJ znvLGSNUx^E@dH#;_+UYXO|_=usbumrIIBLY|u!1Ngy_t?v+V3Gk7Y$F zsmxl4St6Ik_fiSe+b~yUSfdjXM|>Jh;kh)G7vT66bUL4j$C3-Fo~!VjubP^;me%uP zyoRfzEBP$yZey+&KLeeN{cZgJ37iP?*=mckRN zX_)^>U`W)^R5GUe-lRDO7ka!)rywJX+g1mQuVO7P#vH8~VFVB(43G0M?1wK{lM7DW zOS5pi4F|aqhrMWoTfsjM);z_*y>wH}F%AZ*7d^(X0riFDg(KX}R9`$q+slhxHCta) zUZkb>2yfB?T<;m83(7rqKL_iLMI(GUG%{aNUxJ*Kx{o^Oo{f>)cstO&0vFo7909r;aj$t5 z_W`M!>0*vTMvG`SE#`jo8ko0$V;qOY2gbCWx5p1)yb!8~ir)m7C&*8REt70;&;U%1 z@SaX3Iqi;E>)!KDVBP%FN~pk@hE0^@_W-nZC|H~;!eI-r1<}nQ=@sn|0oX`~6|NRm z*rmV}?~<=;6;$yJBYY#IgN_D3JTQz9-~Ot8j6Wp9J|e?zt1rY-cgj+CK}++!2dLI= zIL1RG{25`E^1|}sBmAHqTwYjRUOdbXITi6uY^v6Sg^5E{#9Kkx9`bP*RJEvrw?Ut5 zrL(vfRE>FFeLaNBBv>;+JGF9E1AeMZ*2! z-^mm$1<#5!j__Bq)@wTs!rqN%g*VWh{2n@l`jh;DEO|PXrp7Tx zo`54qeNBT`@GbaV1yn~1`P=**?A%Tz{9UNDVi@ zQSk{{K*cumL;V?e$ft#6sR)Z>2%UD=;Ie!}-=Ibr>_`v>V__xlnH&P&20*0kxHt@l z`3Hd<-{}GL5cT7~82_;G)Zlzygi;to%2KB^ol<N9>CkO2k9mL9BwndkY(bIr+MUfnn#ZFKeT7y zp;!2y{4a;ni0a;?4uhUAJ;VD3b@_ZA1Zel!6jIk<5HQc@9^}_HKTCxV;mrSj;)~w( z)d%@MaBz*_5EX8!KB&ao_04i?1*jD}6?$5_Ot*F%wIa9jRq1jEsv@a*-M(j}mR{c@ zwW&^@Dn-rXR^WZy?<;YqJt?(Pw{N=C%G?@UlKXu=r^fKX?k{w^PLi(llI2pH;r5*> zwV7`1bg4~uYxAWx#jTwowP|*3^CSG)L-25Ykj7J0C6Kz1s!`S;Dm@qF3Pe6FDA!Ps zI#G7f<#Z*=5JH3)$~dgwyHH+3@1q-0-bA<29VqXlPtksq2k0Ss1m&ZM0G~qnG<}1f zNBIK%h+ahbQ+UyTK=}&1<=0TY4)?8CRl+Pz=b0#H;my^2lnbCa&O*P}Xoz zWYGn?sAjF9s!vFmhEjeisZD;6;2QI#J2F3+A(^&Ob4PV#sy?q|ifmSdC9yLEv#Lkb zB4}d;>p4T6J*>`wFP(9k^#S0*ECJwlI$)NnSE4ywMMvbc_>?4_oaO7Wyd2nv_*c9t z7}F88l7VD5@nEmKK5J#4Eo1-_i7IEE%?_Al)fv-m6hca}TrGR0aMns?s!^@ZfzfRd z0u+(*tzvA0l$Nv28kC|Ez16NmkjY2b%UfB?d&eyAwiK!stfJH!CCc<{DpCO|P(jtH zy7X7K+N3VlUz^os>T>Qnvj09LD*8dz1X ecBrHpEG~hEXaB8p%67X{J5hSTe~rkUwEr(LO30D` From 524aae46b657a3ce32622209bdb049e249794096 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 19 Apr 2022 16:53:32 -0400 Subject: [PATCH 084/514] Add Gradle 7.4 Aggregated Test Reports (#2821) (#2983) Signed-off-by: Andriy Redko (cherry picked from commit ede26d945f06522947e1077c8d0b30c1537ae688) Co-authored-by: Andriy Redko --- build.gradle | 24 +++++++++++ gradle/code-coverage.gradle | 83 +++++++------------------------------ 2 files changed, 38 insertions(+), 69 deletions(-) diff --git a/build.gradle b/build.gradle index 7949872a85b86..ae2247bb865d1 100644 --- a/build.gradle +++ b/build.gradle @@ -50,6 +50,8 @@ plugins { id 'opensearch.global-build-info' id "com.diffplug.spotless" version "6.4.2" apply false id "org.gradle.test-retry" version "1.3.2" apply false + id "test-report-aggregation" + id 'jacoco-report-aggregation' } apply from: 'gradle/build-complete.gradle' @@ -385,6 +387,15 @@ gradle.projectsEvaluated { } } } + + dependencies { + subprojects.findAll { it.pluginManager.hasPlugin('java') }.forEach { + testReportAggregation it + } + subprojects.findAll { it.pluginManager.hasPlugin('jacoco') }.forEach { + jacocoAggregation it + } + } } // test retry configuration @@ -402,6 +413,7 @@ subprojects { // eclipse configuration allprojects { apply plugin: 'eclipse' + // Name all the non-root projects after their path so that paths get grouped together when imported into eclipse. if (path != ':') { eclipse.project.name = path @@ -558,3 +570,15 @@ subprojects { } } } + +reporting { + reports { + testAggregateTestReport(AggregateTestReport) { + testType = TestSuiteType.UNIT_TEST + } + } +} + +tasks.named(JavaBasePlugin.CHECK_TASK_NAME) { + dependsOn tasks.named('testAggregateTestReport', TestReport) +} diff --git a/gradle/code-coverage.gradle b/gradle/code-coverage.gradle index de041eae7b72d..61719282c1ca2 100644 --- a/gradle/code-coverage.gradle +++ b/gradle/code-coverage.gradle @@ -10,92 +10,37 @@ apply plugin: 'jacoco' repositories { mavenCentral() + gradlePluginPortal() } allprojects { plugins.withId('jacoco') { - // The default JaCoCo version in Gradle 6.6.1 is 0.8.5, but at least version 0.8.6 officially supports Java 14 - jacoco.toolVersion = '0.8.7' + jacoco.toolVersion = '0.8.8' } } -def codeCoverageReportTask = tasks.register("codeCoverageReport", JacocoReport) { - description = 'Generates aggregate report from all subprojects.' - executionData.setFrom fileTree(dir: '.', include: '**/build/jacoco/*.exec') - dependsOn subprojects.findAll(s -> s.tasks.findByName('check') != null).check -} - -tasks.register("codeCoverageReportForUnitTest", JacocoReport) { - description = 'Generates aggregate report from all subprojects for unit test.' - executionData.setFrom fileTree(dir: '.', include: '**/build/jacoco/test.exec') -} - -tasks.register("codeCoverageReportForIntegrationTest", JacocoReport) { - description = 'Generates aggregate report from all subprojects for integration test.' - // These kinds of tests are integration test, and the tests can be ran by Gradle tasks with the same name - def integrationTestExecPathList = ['**/build/jacoco/integTest.exec', - '**/build/jacoco/internalClusterTest.exec', - '**/build/jacoco/javaRestTest.exec', - '**/build/jacoco/yamlRestTest.exec' ] - executionData.setFrom fileTree(dir: '.', include: integrationTestExecPathList) -} - tasks.withType(JacocoReport).configureEach { group = JavaBasePlugin.VERIFICATION_GROUP - // Select projects with corresponding tests in order to run proper tests and select proper classes to generate the report - def projectsWithJavaPlugin = subprojects.findAll { it.pluginManager.hasPlugin('java') } - def projectsWithUnitTest = projectsWithJavaPlugin.findAll { it.tasks.findByName('test').enabled } - def projectsWithIntegTest = projectsWithJavaPlugin.findAll {it.tasks.findByName('integTest')} - def projectsWithAsyncIntegTest = projectsWithJavaPlugin.findAll {it.tasks.findByName('asyncIntegTest')} - def projectsWithInternalClusterTest = projectsWithJavaPlugin.findAll {it.tasks.findByName('internalClusterTest')} - def projectsWithPooledInternalClusterTest = projectsWithJavaPlugin.findAll {it.tasks.findByName('pooledInternalClusterTest')} - def projectsWithJavaRestTest = projectsWithJavaPlugin.findAll {it.tasks.findByName('javaRestTest')} - def projectsWithYamlRestTest = projectsWithJavaPlugin.findAll {it.tasks.findByName('yamlRestTest')} - def projectsWithIntegrationTest = projectsWithIntegTest + projectsWithAsyncIntegTest + projectsWithInternalClusterTest + projectsWithPooledInternalClusterTest + projectsWithJavaRestTest + projectsWithYamlRestTest - def projectsWithTest = projectsWithUnitTest + projectsWithIntegrationTest - - def selectedProjects - switch (name) { - case "codeCoverageReportForUnitTest": - dependsOn projectsWithUnitTest.test - selectedProjects = projectsWithUnitTest - break - case "codeCoverageReportForIntegrationTest": - dependsOn projectsWithIntegTest.integTest - dependsOn projectsWithAsyncIntegTest.asyncIntegTest - dependsOn projectsWithInternalClusterTest.internalClusterTest - dependsOn projectsWithPooledInternalClusterTest.pooledInternalClusterTest - dependsOn projectsWithJavaRestTest.javaRestTest - dependsOn projectsWithYamlRestTest.yamlRestTest - selectedProjects = projectsWithIntegrationTest - break - default: - dependsOn projectsWithUnitTest.test - dependsOn projectsWithIntegTest.integTest - dependsOn projectsWithAsyncIntegTest.asyncIntegTest - dependsOn projectsWithInternalClusterTest.internalClusterTest - dependsOn projectsWithPooledInternalClusterTest.pooledInternalClusterTest - dependsOn projectsWithJavaRestTest.javaRestTest - dependsOn projectsWithYamlRestTest.yamlRestTest - selectedProjects = projectsWithJavaPlugin - break - } - - sourceDirectories.setFrom files(selectedProjects.sourceSets.main.allSource.srcDirs) - classDirectories.setFrom files(selectedProjects.sourceSets.main.output) - reports { // Code coverage report in HTML and CSV formats are on demand, in case they take extra disk space. - xml.getRequired().set(System.getProperty('tests.coverage.report.xml', 'true').toBoolean()) - html.getRequired().set(System.getProperty('tests.coverage.report.html', 'false').toBoolean()) - csv.getRequired().set(System.getProperty('tests.coverage.report.csv', 'false').toBoolean()) + xml.required = System.getProperty('tests.coverage.report.xml', 'true').toBoolean() + html.required = System.getProperty('tests.coverage.report.html', 'false').toBoolean() + csv.required = System.getProperty('tests.coverage.report.csv', 'false').toBoolean() } } if (System.getProperty("tests.coverage")) { + reporting { + reports { + testCodeCoverageReport(JacocoCoverageReport) { + testType = TestSuiteType.UNIT_TEST + } + } + } + // Attach code coverage report task to Gradle check task project.getTasks().named(JavaBasePlugin.CHECK_TASK_NAME).configure { - dependsOn codeCoverageReportTask + dependsOn tasks.named('testCodeCoverageReport', JacocoReport) } } From e1c3d2e2d13704f1fabbde7758ba2a1ab053c21f Mon Sep 17 00:00:00 2001 From: Vacha Shah Date: Tue, 19 Apr 2022 17:50:53 -0700 Subject: [PATCH 085/514] Revert "Bump gradle-info-plugin from 7.1.3 to 11.3.3 in /buildSrc (#2831) (#2842)" (#2991) This reverts commit d5d00eab8d326d7878ba4d80de63a809cc8d1735. Signed-off-by: Vacha Shah --- buildSrc/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 1c148f14a996a..71789ed61cfd0 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -107,7 +107,7 @@ dependencies { api 'org.apache.ant:ant:1.10.12' api 'com.netflix.nebula:gradle-extra-configurations-plugin:7.0.0' api 'com.netflix.nebula:nebula-publishing-plugin:4.4.4' - api 'com.netflix.nebula:gradle-info-plugin:11.3.3' + api 'com.netflix.nebula:gradle-info-plugin:7.1.3' api 'org.apache.rat:apache-rat:0.13' api 'commons-io:commons-io:2.7' api "net.java.dev.jna:jna:5.11.0" From 44a79b786e773c3a1fcbb788318e62ae94d6aa27 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 17:23:07 -0400 Subject: [PATCH 086/514] [Remove] remaining AllFieldMapper references (#3007) (#3009) AllFieldMapper was deprecated in legacy 6x. The remaining references are removed, along with the field mapper and corresponding tests. Signed-off-by: Nicholas Walter Knize (cherry picked from commit 6915df94c3a322a4fb7b6808e1f63a743a3af6be) Co-authored-by: Nick Knize --- .../index/mapper/AllFieldMapper.java | 134 ------------------ .../indices/mapper/MapperRegistry.java | 10 +- .../index/mapper/AllFieldMapperTests.java | 63 -------- .../indices/IndicesModuleTests.java | 14 -- 4 files changed, 1 insertion(+), 220 deletions(-) delete mode 100644 server/src/main/java/org/opensearch/index/mapper/AllFieldMapper.java delete mode 100644 server/src/test/java/org/opensearch/index/mapper/AllFieldMapperTests.java diff --git a/server/src/main/java/org/opensearch/index/mapper/AllFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/AllFieldMapper.java deleted file mode 100644 index 634424d6f45a4..0000000000000 --- a/server/src/main/java/org/opensearch/index/mapper/AllFieldMapper.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.index.mapper; - -import org.apache.lucene.document.FieldType; -import org.apache.lucene.index.IndexOptions; -import org.apache.lucene.search.MatchNoDocsQuery; -import org.apache.lucene.search.Query; -import org.opensearch.common.Explicit; -import org.opensearch.index.query.QueryShardContext; -import org.opensearch.search.lookup.SearchLookup; - -import java.util.Collections; -import java.util.List; - -/** - * Noop mapper that ensures that mappings created in 6x that explicitly disable the _all field - * can be restored in this version. - * - * TODO: Remove in 8 - */ -public class AllFieldMapper extends MetadataFieldMapper { - public static final String NAME = "_all"; - public static final String CONTENT_TYPE = "_all"; - - public static class Defaults { - public static final FieldType FIELD_TYPE = new FieldType(); - - static { - FIELD_TYPE.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS); - FIELD_TYPE.setTokenized(true); - FIELD_TYPE.freeze(); - } - } - - private static AllFieldMapper toType(FieldMapper in) { - return (AllFieldMapper) in; - } - - public static class Builder extends MetadataFieldMapper.Builder { - - private final Parameter> enabled = updateableBoolParam("enabled", m -> toType(m).enabled, false); - - public Builder() { - super(NAME); - } - - @Override - protected List> getParameters() { - return Collections.singletonList(enabled); - } - - @Override - public AllFieldMapper build(BuilderContext context) { - if (enabled.getValue().value()) { - throw new IllegalArgumentException("[_all] is disabled in this version."); - } - return new AllFieldMapper(enabled.getValue()); - } - } - - public static final TypeParser PARSER = new ConfigurableTypeParser( - c -> new AllFieldMapper(new Explicit<>(false, false)), - c -> new Builder() - ); - - static final class AllFieldType extends StringFieldType { - AllFieldType() { - super(NAME, false, false, false, TextSearchInfo.NONE, Collections.emptyMap()); - } - - @Override - public ValueFetcher valueFetcher(QueryShardContext context, SearchLookup searchLookup, String format) { - throw new UnsupportedOperationException(); - } - - @Override - public String typeName() { - return CONTENT_TYPE; - } - - @Override - public Query existsQuery(QueryShardContext context) { - return new MatchNoDocsQuery(); - } - } - - private final Explicit enabled; - - private AllFieldMapper(Explicit enabled) { - super(new AllFieldType()); - this.enabled = enabled; - } - - @Override - protected String contentType() { - return CONTENT_TYPE; - } - - @Override - public ParametrizedFieldMapper.Builder getMergeBuilder() { - return new Builder().init(this); - } -} diff --git a/server/src/main/java/org/opensearch/indices/mapper/MapperRegistry.java b/server/src/main/java/org/opensearch/indices/mapper/MapperRegistry.java index d37f82c7a484f..f56b2f98f0f6e 100644 --- a/server/src/main/java/org/opensearch/indices/mapper/MapperRegistry.java +++ b/server/src/main/java/org/opensearch/indices/mapper/MapperRegistry.java @@ -32,9 +32,7 @@ package org.opensearch.indices.mapper; -import org.opensearch.LegacyESVersion; import org.opensearch.Version; -import org.opensearch.index.mapper.AllFieldMapper; import org.opensearch.index.mapper.Mapper; import org.opensearch.index.mapper.MetadataFieldMapper; import org.opensearch.plugins.MapperPlugin; @@ -52,7 +50,6 @@ public final class MapperRegistry { private final Map mapperParsers; private final Map metadataMapperParsers; - private final Map metadataMapperParsers6x; private final Function> fieldFilter; public MapperRegistry( @@ -62,11 +59,6 @@ public MapperRegistry( ) { this.mapperParsers = Collections.unmodifiableMap(new LinkedHashMap<>(mapperParsers)); this.metadataMapperParsers = Collections.unmodifiableMap(new LinkedHashMap<>(metadataMapperParsers)); - // add the _all field mapper for indices created in 6x - Map metadata6x = new LinkedHashMap<>(); - metadata6x.put(AllFieldMapper.NAME, AllFieldMapper.PARSER); - metadata6x.putAll(metadataMapperParsers); - this.metadataMapperParsers6x = Collections.unmodifiableMap(metadata6x); this.fieldFilter = fieldFilter; } @@ -83,7 +75,7 @@ public Map getMapperParsers() { * returned map uses the name of the field as a key. */ public Map getMetadataMapperParsers(Version indexCreatedVersion) { - return indexCreatedVersion.onOrAfter(LegacyESVersion.V_7_0_0) ? metadataMapperParsers : metadataMapperParsers6x; + return metadataMapperParsers; } /** diff --git a/server/src/test/java/org/opensearch/index/mapper/AllFieldMapperTests.java b/server/src/test/java/org/opensearch/index/mapper/AllFieldMapperTests.java deleted file mode 100644 index 625cfbb81f8bc..0000000000000 --- a/server/src/test/java/org/opensearch/index/mapper/AllFieldMapperTests.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.index.mapper; - -import org.opensearch.common.Strings; -import org.opensearch.common.compress.CompressedXContent; -import org.opensearch.common.settings.Settings; -import org.opensearch.common.xcontent.XContentFactory; -import org.opensearch.index.IndexService; -import org.opensearch.index.mapper.MapperService.MergeReason; -import org.opensearch.test.OpenSearchSingleNodeTestCase; - -public class AllFieldMapperTests extends OpenSearchSingleNodeTestCase { - - @Override - protected boolean forbidPrivateIndexSettings() { - return false; - } - - public void testUpdateDefaultSearchAnalyzer() throws Exception { - IndexService indexService = createIndex( - "test", - Settings.builder() - .put("index.analysis.analyzer.default_search.type", "custom") - .put("index.analysis.analyzer.default_search.tokenizer", "standard") - .build() - ); - String mapping = Strings.toString(XContentFactory.jsonBuilder().startObject().startObject("_doc").endObject().endObject()); - indexService.mapperService().merge("_doc", new CompressedXContent(mapping), MergeReason.MAPPING_UPDATE); - assertEquals(mapping, indexService.mapperService().documentMapper().mapping().toString()); - } - -} diff --git a/server/src/test/java/org/opensearch/indices/IndicesModuleTests.java b/server/src/test/java/org/opensearch/indices/IndicesModuleTests.java index ef78b24be4c08..c2298f60e4a2b 100644 --- a/server/src/test/java/org/opensearch/indices/IndicesModuleTests.java +++ b/server/src/test/java/org/opensearch/indices/IndicesModuleTests.java @@ -33,7 +33,6 @@ package org.opensearch.indices; import org.opensearch.Version; -import org.opensearch.index.mapper.AllFieldMapper; import org.opensearch.index.mapper.DataStreamFieldMapper; import org.opensearch.index.mapper.FieldNamesFieldMapper; import org.opensearch.index.mapper.IdFieldMapper; @@ -101,19 +100,6 @@ public Map getMetadataMappers() { SeqNoFieldMapper.NAME, FieldNamesFieldMapper.NAME }; - private static String[] EXPECTED_METADATA_FIELDS_6x = new String[] { - AllFieldMapper.NAME, - IgnoredFieldMapper.NAME, - IdFieldMapper.NAME, - RoutingFieldMapper.NAME, - IndexFieldMapper.NAME, - DataStreamFieldMapper.NAME, - SourceFieldMapper.NAME, - TypeFieldMapper.NAME, - VersionFieldMapper.NAME, - SeqNoFieldMapper.NAME, - FieldNamesFieldMapper.NAME }; - public void testBuiltinMappers() { IndicesModule module = new IndicesModule(Collections.emptyList()); { From 4422540ecff194015dc6d6e00648fc083c692920 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 18:01:47 -0400 Subject: [PATCH 087/514] Remove JavaVersion, use builtin Runtime.Version to deal with runtime versions (#3006) (#3013) Signed-off-by: Andriy Redko (cherry picked from commit 3b7e6547572b23eda7bb7313850d4a3cb049a9be) Co-authored-by: Andriy Redko --- .../org/opensearch/bootstrap/JarHell.java | 17 +- .../org/opensearch/bootstrap/JavaVersion.java | 146 ------------------ .../opensearch/bootstrap/JarHellTests.java | 11 +- .../core/internal/net/NetUtilsTests.java | 5 +- .../common/ssl/SslConfigurationLoader.java | 40 ++--- .../ingest/common/DateFormatTests.java | 9 -- .../org/opensearch/painless/ArrayTests.java | 7 +- .../netty4/SimpleNetty4TransportTests.java | 6 +- .../AzureDiscoveryClusterFormationTests.java | 12 +- .../ingest/attachment/TikaImpl.java | 9 -- ...eCloudStorageBlobStoreRepositoryTests.java | 18 --- ...CloudStorageBlobContainerRetriesTests.java | 17 -- .../repositories/hdfs/HdfsTests.java | 2 - .../nio/SimpleNioTransportTests.java | 6 +- .../aggregations/bucket/DateHistogramIT.java | 10 +- .../search/query/SearchQueryIT.java | 2 - .../org/opensearch/bootstrap/Bootstrap.java | 10 -- .../opensearch/bootstrap/BootstrapChecks.java | 57 ------- .../bootstrap/BootstrapChecksTests.java | 76 --------- .../bootstrap/JavaVersionTests.java | 87 ++++------- .../common/LocalTimeOffsetTests.java | 4 +- .../joda/JavaJodaTimeDuellingTests.java | 22 --- .../common/time/DateFormattersTests.java | 6 - .../common/time/JavaDateMathParserTests.java | 6 - .../index/mapper/DateFieldMapperTests.java | 3 - .../opensearch/monitor/jvm/JvmInfoTests.java | 4 +- .../plugins/IndexStorePluginTests.java | 42 ++--- .../plugins/PluginsServiceTests.java | 2 +- .../test/OpenSearchIntegTestCase.java | 4 +- .../opensearch/test/OpenSearchTestCase.java | 13 +- .../junit/listeners/ReproduceInfoPrinter.java | 3 +- .../opensearch/test/rest/yaml/Features.java | 4 +- 32 files changed, 92 insertions(+), 568 deletions(-) delete mode 100644 libs/core/src/main/java/org/opensearch/bootstrap/JavaVersion.java diff --git a/libs/core/src/main/java/org/opensearch/bootstrap/JarHell.java b/libs/core/src/main/java/org/opensearch/bootstrap/JarHell.java index 843a6b982d7ff..d945697b21c0b 100644 --- a/libs/core/src/main/java/org/opensearch/bootstrap/JarHell.java +++ b/libs/core/src/main/java/org/opensearch/bootstrap/JarHell.java @@ -36,6 +36,7 @@ import org.opensearch.common.io.PathUtils; import java.io.IOException; +import java.lang.Runtime.Version; import java.net.MalformedURLException; import java.net.URISyntaxException; import java.net.URL; @@ -250,7 +251,9 @@ private static void checkManifest(Manifest manifest, Path jar) { } public static void checkVersionFormat(String targetVersion) { - if (!JavaVersion.isValid(targetVersion)) { + try { + Version.parse(targetVersion); + } catch (final IllegalArgumentException ex) { throw new IllegalStateException( String.format( Locale.ROOT, @@ -267,16 +270,10 @@ public static void checkVersionFormat(String targetVersion) { * required by {@code resource} is compatible with the current installation. */ public static void checkJavaVersion(String resource, String targetVersion) { - JavaVersion version = JavaVersion.parse(targetVersion); - if (JavaVersion.current().compareTo(version) < 0) { + Version version = Version.parse(targetVersion); + if (Runtime.version().compareTo(version) < 0) { throw new IllegalStateException( - String.format( - Locale.ROOT, - "%s requires Java %s:, your system: %s", - resource, - targetVersion, - JavaVersion.current().toString() - ) + String.format(Locale.ROOT, "%s requires Java %s:, your system: %s", resource, targetVersion, Runtime.version().toString()) ); } } diff --git a/libs/core/src/main/java/org/opensearch/bootstrap/JavaVersion.java b/libs/core/src/main/java/org/opensearch/bootstrap/JavaVersion.java deleted file mode 100644 index 236563bf8bd89..0000000000000 --- a/libs/core/src/main/java/org/opensearch/bootstrap/JavaVersion.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.bootstrap; - -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - -public class JavaVersion implements Comparable { - - private final List version; - private final String prePart; - - public List getVersion() { - return version; - } - - private JavaVersion(List version, String prePart) { - this.prePart = prePart; - if (version.size() >= 2 && version.get(0) == 1 && version.get(1) == 8) { - // for Java 8 there is ambiguity since both 1.8 and 8 are supported, - // so we rewrite the former to the latter - version = new ArrayList<>(version.subList(1, version.size())); - } - this.version = Collections.unmodifiableList(version); - } - - /** - * Parses the Java version as it can be retrieved as the value of java.version or - * java.specification.version according to JEP 223. - * - * @param value The version String - */ - public static JavaVersion parse(String value) { - Objects.requireNonNull(value); - String prePart = null; - if (!isValid(value)) { - throw new IllegalArgumentException("Java version string [" + value + "] could not be parsed."); - } - List version = new ArrayList<>(); - String[] parts = value.split("-"); - String[] numericComponents; - if (parts.length == 1) { - numericComponents = value.split("\\."); - } else if (parts.length == 2) { - numericComponents = parts[0].split("\\."); - prePart = parts[1]; - } else { - throw new IllegalArgumentException("Java version string [" + value + "] could not be parsed."); - } - - for (String component : numericComponents) { - version.add(Integer.valueOf(component)); - } - return new JavaVersion(version, prePart); - } - - public static boolean isValid(String value) { - return value.matches("^0*[0-9]+(\\.[0-9]+)*(-[a-zA-Z0-9]+)?$"); - } - - private static final JavaVersion CURRENT = parse(System.getProperty("java.specification.version")); - - public static JavaVersion current() { - return CURRENT; - } - - @Override - public int compareTo(JavaVersion o) { - int len = Math.max(version.size(), o.version.size()); - for (int i = 0; i < len; i++) { - int d = (i < version.size() ? version.get(i) : 0); - int s = (i < o.version.size() ? o.version.get(i) : 0); - if (s < d) return 1; - if (s > d) return -1; - } - if (prePart != null && o.prePart == null) { - return -1; - } else if (prePart == null && o.prePart != null) { - return 1; - } else if (prePart != null && o.prePart != null) { - return comparePrePart(prePart, o.prePart); - } - return 0; - } - - private int comparePrePart(String prePart, String otherPrePart) { - if (prePart.matches("\\d+")) { - return otherPrePart.matches("\\d+") ? (new BigInteger(prePart)).compareTo(new BigInteger(otherPrePart)) : -1; - } else { - return otherPrePart.matches("\\d+") ? 1 : prePart.compareTo(otherPrePart); - } - } - - @Override - public boolean equals(Object o) { - if (o == null || o.getClass() != getClass()) { - return false; - } - return compareTo((JavaVersion) o) == 0; - } - - @Override - public int hashCode() { - return version.hashCode(); - } - - @Override - public String toString() { - final String versionString = version.stream().map(v -> Integer.toString(v)).collect(Collectors.joining(".")); - return prePart != null ? versionString + "-" + prePart : versionString; - } -} diff --git a/libs/core/src/test/java/org/opensearch/bootstrap/JarHellTests.java b/libs/core/src/test/java/org/opensearch/bootstrap/JarHellTests.java index d0e411ae8e3c2..57f5f393ce49f 100644 --- a/libs/core/src/test/java/org/opensearch/bootstrap/JarHellTests.java +++ b/libs/core/src/test/java/org/opensearch/bootstrap/JarHellTests.java @@ -37,6 +37,7 @@ import org.opensearch.test.OpenSearchTestCase; import java.io.IOException; +import java.lang.Runtime.Version; import java.net.URL; import java.nio.file.Files; import java.nio.file.Path; @@ -156,12 +157,12 @@ public void testXmlBeansLeniency() throws Exception { public void testRequiredJDKVersionTooOld() throws Exception { Path dir = createTempDir(); - List current = JavaVersion.current().getVersion(); + List current = Runtime.version().version(); List target = new ArrayList<>(current.size()); for (int i = 0; i < current.size(); i++) { target.add(current.get(i) + 1); } - JavaVersion targetVersion = JavaVersion.parse(Strings.collectionToDelimitedString(target, ".")); + Version targetVersion = Version.parse(Strings.collectionToDelimitedString(target, ".")); Manifest manifest = new Manifest(); Attributes attributes = manifest.getMainAttributes(); @@ -173,7 +174,7 @@ public void testRequiredJDKVersionTooOld() throws Exception { fail("did not get expected exception"); } catch (IllegalStateException e) { assertTrue(e.getMessage().contains("requires Java " + targetVersion.toString())); - assertTrue(e.getMessage().contains("your system: " + JavaVersion.current().toString())); + assertTrue(e.getMessage().contains("your system: " + Runtime.version().toString())); } } @@ -209,7 +210,7 @@ public void testRequiredJDKVersionIsOK() throws Exception { } public void testValidVersions() { - String[] versions = new String[] { "1.7", "1.7.0", "0.1.7", "1.7.0.80" }; + String[] versions = new String[] { "12-ea", "13.0.2.3-ea", "14-something", "11.0.2-21002", "11.0.14.1+1", "17.0.2+8" }; for (String version : versions) { try { JarHell.checkVersionFormat(version); @@ -220,7 +221,7 @@ public void testValidVersions() { } public void testInvalidVersions() { - String[] versions = new String[] { "", "1.7.0_80", "1.7." }; + String[] versions = new String[] { "", "1.7.0_80", "1.7.", "11.2+something-else" }; for (String version : versions) { try { JarHell.checkVersionFormat(version); diff --git a/libs/core/src/test/java/org/opensearch/core/internal/net/NetUtilsTests.java b/libs/core/src/test/java/org/opensearch/core/internal/net/NetUtilsTests.java index 91236b4f8fb84..448c39731def5 100644 --- a/libs/core/src/test/java/org/opensearch/core/internal/net/NetUtilsTests.java +++ b/libs/core/src/test/java/org/opensearch/core/internal/net/NetUtilsTests.java @@ -33,15 +33,16 @@ package org.opensearch.core.internal.net; import org.apache.lucene.util.Constants; -import org.opensearch.bootstrap.JavaVersion; import org.opensearch.core.internal.io.IOUtils; import org.opensearch.test.OpenSearchTestCase; +import java.lang.Runtime.Version; + public class NetUtilsTests extends OpenSearchTestCase { public void testExtendedSocketOptions() { assumeTrue("JDK possibly not supported", Constants.JVM_NAME.contains("HotSpot") || Constants.JVM_NAME.contains("OpenJDK")); - assumeTrue("JDK version not supported", JavaVersion.current().compareTo(JavaVersion.parse("11")) >= 0); + assumeTrue("JDK version not supported", Runtime.version().compareTo(Version.parse("11")) >= 0); assumeTrue("Platform possibly not supported", IOUtils.LINUX || IOUtils.MAC_OS_X); assertNotNull(NetUtils.getTcpKeepIdleSocketOptionOrNull()); assertNotNull(NetUtils.getTcpKeepIntervalSocketOptionOrNull()); diff --git a/libs/ssl-config/src/main/java/org/opensearch/common/ssl/SslConfigurationLoader.java b/libs/ssl-config/src/main/java/org/opensearch/common/ssl/SslConfigurationLoader.java index 6f2670d285e84..2cd9f4f31fc7f 100644 --- a/libs/ssl-config/src/main/java/org/opensearch/common/ssl/SslConfigurationLoader.java +++ b/libs/ssl-config/src/main/java/org/opensearch/common/ssl/SslConfigurationLoader.java @@ -32,8 +32,6 @@ package org.opensearch.common.ssl; -import org.opensearch.bootstrap.JavaVersion; - import javax.crypto.Cipher; import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.TrustManagerFactory; @@ -361,7 +359,6 @@ private List resolveListSetting(String key, Function parser, L private static List loadDefaultCiphers() { final boolean has256BitAES = has256BitAES(); - final boolean useGCM = JavaVersion.current().compareTo(JavaVersion.parse("11")) >= 0; final boolean tlsV13Supported = DEFAULT_PROTOCOLS.contains("TLSv1.3"); List ciphers = new ArrayList<>(); if (tlsV13Supported) { // TLSv1.3 cipher has PFS, AEAD, hardware support @@ -370,19 +367,18 @@ private static List loadDefaultCiphers() { } ciphers.add("TLS_AES_128_GCM_SHA256"); } - if (useGCM) { // PFS, AEAD, hardware support - if (has256BitAES) { - ciphers.addAll( - Arrays.asList( - "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", - "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", - "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", - "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" - ) - ); - } else { - ciphers.addAll(Arrays.asList("TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256")); - } + // use GCM: PFS, AEAD, hardware support + if (has256BitAES) { + ciphers.addAll( + Arrays.asList( + "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", + "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", + "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", + "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" + ) + ); + } else { + ciphers.addAll(Arrays.asList("TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256")); } // PFS, hardware support @@ -410,13 +406,11 @@ private static List loadDefaultCiphers() { ); } - // AEAD, hardware support - if (useGCM) { - if (has256BitAES) { - ciphers.addAll(Arrays.asList("TLS_RSA_WITH_AES_256_GCM_SHA384", "TLS_RSA_WITH_AES_128_GCM_SHA256")); - } else { - ciphers.add("TLS_RSA_WITH_AES_128_GCM_SHA256"); - } + // use GCM: AEAD, hardware support + if (has256BitAES) { + ciphers.addAll(Arrays.asList("TLS_RSA_WITH_AES_256_GCM_SHA384", "TLS_RSA_WITH_AES_128_GCM_SHA256")); + } else { + ciphers.add("TLS_RSA_WITH_AES_128_GCM_SHA256"); } // hardware support diff --git a/modules/ingest-common/src/test/java/org/opensearch/ingest/common/DateFormatTests.java b/modules/ingest-common/src/test/java/org/opensearch/ingest/common/DateFormatTests.java index 951b93deb6e8b..04900fe6f7496 100644 --- a/modules/ingest-common/src/test/java/org/opensearch/ingest/common/DateFormatTests.java +++ b/modules/ingest-common/src/test/java/org/opensearch/ingest/common/DateFormatTests.java @@ -32,7 +32,6 @@ package org.opensearch.ingest.common; -import org.opensearch.bootstrap.JavaVersion; import org.opensearch.common.time.DateFormatter; import org.opensearch.common.time.DateUtils; import org.opensearch.test.OpenSearchTestCase; @@ -96,10 +95,6 @@ public void testParseJavaDefaultYear() { } public void testParseWeekBased() { - assumeFalse( - "won't work in jdk8 " + "because SPI mechanism is not looking at classpath - needs ISOCalendarDataProvider in jre's ext/libs", - JavaVersion.current().equals(JavaVersion.parse("8")) - ); String format = randomFrom("YYYY-ww"); ZoneId timezone = DateUtils.of("Europe/Amsterdam"); Function javaFunction = DateFormat.Java.getFunction(format, timezone, Locale.ROOT); @@ -108,10 +103,6 @@ public void testParseWeekBased() { } public void testParseWeekBasedWithLocale() { - assumeFalse( - "won't work in jdk8 " + "because SPI mechanism is not looking at classpath - needs ISOCalendarDataProvider in jre's ext/libs", - JavaVersion.current().equals(JavaVersion.parse("8")) - ); String format = randomFrom("YYYY-ww"); ZoneId timezone = DateUtils.of("Europe/Amsterdam"); Function javaFunction = DateFormat.Java.getFunction(format, timezone, Locale.US); diff --git a/modules/lang-painless/src/test/java/org/opensearch/painless/ArrayTests.java b/modules/lang-painless/src/test/java/org/opensearch/painless/ArrayTests.java index 7563ab87fd5e6..0b83a4c558ef6 100644 --- a/modules/lang-painless/src/test/java/org/opensearch/painless/ArrayTests.java +++ b/modules/lang-painless/src/test/java/org/opensearch/painless/ArrayTests.java @@ -33,7 +33,6 @@ package org.opensearch.painless; import org.apache.lucene.util.Constants; -import org.opensearch.bootstrap.JavaVersion; import org.hamcrest.Matcher; import java.lang.invoke.MethodHandle; @@ -55,11 +54,7 @@ protected String valueCtorCall(String valueType, int size) { @Override protected Matcher outOfBoundsExceptionMessageMatcher(int index, int size) { - if (JavaVersion.current().compareTo(JavaVersion.parse("11")) < 0) { - return equalTo(Integer.toString(index)); - } else { - return equalTo("Index " + Integer.toString(index) + " out of bounds for length " + Integer.toString(size)); - } + return equalTo("Index " + Integer.toString(index) + " out of bounds for length " + Integer.toString(size)); } public void testArrayLengthHelper() throws Throwable { diff --git a/modules/transport-netty4/src/test/java/org/opensearch/transport/netty4/SimpleNetty4TransportTests.java b/modules/transport-netty4/src/test/java/org/opensearch/transport/netty4/SimpleNetty4TransportTests.java index b690ba9e35e35..848819ee5b840 100644 --- a/modules/transport-netty4/src/test/java/org/opensearch/transport/netty4/SimpleNetty4TransportTests.java +++ b/modules/transport-netty4/src/test/java/org/opensearch/transport/netty4/SimpleNetty4TransportTests.java @@ -34,7 +34,6 @@ import org.opensearch.Version; import org.opensearch.action.ActionListener; -import org.opensearch.bootstrap.JavaVersion; import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.common.io.stream.NamedWriteableRegistry; import org.opensearch.common.network.NetworkService; @@ -121,10 +120,7 @@ public void testConnectException() throws UnknownHostException { } public void testDefaultKeepAliveSettings() throws IOException { - assumeTrue( - "setting default keepalive options not supported on this platform", - (IOUtils.LINUX || IOUtils.MAC_OS_X) && JavaVersion.current().compareTo(JavaVersion.parse("11")) >= 0 - ); + assumeTrue("setting default keepalive options not supported on this platform", (IOUtils.LINUX || IOUtils.MAC_OS_X)); try ( MockTransportService serviceC = buildService("TS_C", Version.CURRENT, Settings.EMPTY); MockTransportService serviceD = buildService("TS_D", Version.CURRENT, Settings.EMPTY) diff --git a/plugins/discovery-azure-classic/src/internalClusterTest/java/org/opensearch/discovery/azure/classic/AzureDiscoveryClusterFormationTests.java b/plugins/discovery-azure-classic/src/internalClusterTest/java/org/opensearch/discovery/azure/classic/AzureDiscoveryClusterFormationTests.java index c4f533fd2ee36..570aa98cd9f55 100644 --- a/plugins/discovery-azure-classic/src/internalClusterTest/java/org/opensearch/discovery/azure/classic/AzureDiscoveryClusterFormationTests.java +++ b/plugins/discovery-azure-classic/src/internalClusterTest/java/org/opensearch/discovery/azure/classic/AzureDiscoveryClusterFormationTests.java @@ -38,7 +38,6 @@ import com.sun.net.httpserver.HttpsConfigurator; import com.sun.net.httpserver.HttpsServer; import org.apache.logging.log4j.LogManager; -import org.opensearch.bootstrap.JavaVersion; import org.opensearch.cloud.azure.classic.management.AzureComputeService; import org.opensearch.common.SuppressForbidden; import org.opensearch.common.io.FileSystemUtils; @@ -67,6 +66,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.io.StringWriter; +import java.lang.Runtime.Version; import java.net.InetAddress; import java.net.InetSocketAddress; import java.nio.charset.StandardCharsets; @@ -295,15 +295,13 @@ private static SSLContext getSSLContext() throws Exception { * 12.0.1 so we pin to TLSv1.2 when running on an earlier JDK */ private static String getProtocol() { - if (JavaVersion.current().compareTo(JavaVersion.parse("11")) < 0) { - return "TLS"; - } else if (JavaVersion.current().compareTo(JavaVersion.parse("12")) < 0) { + if (Runtime.version().compareTo(Version.parse("12")) < 0) { return "TLSv1.2"; } else { - JavaVersion full = AccessController.doPrivileged( - (PrivilegedAction) () -> JavaVersion.parse(System.getProperty("java.version")) + Version full = AccessController.doPrivileged( + (PrivilegedAction) () -> Version.parse(System.getProperty("java.version")) ); - if (full.compareTo(JavaVersion.parse("12.0.1")) < 0) { + if (full.compareTo(Version.parse("12.0.1")) < 0) { return "TLSv1.2"; } } diff --git a/plugins/ingest-attachment/src/main/java/org/opensearch/ingest/attachment/TikaImpl.java b/plugins/ingest-attachment/src/main/java/org/opensearch/ingest/attachment/TikaImpl.java index 2451eee8e984b..aad490924d311 100644 --- a/plugins/ingest-attachment/src/main/java/org/opensearch/ingest/attachment/TikaImpl.java +++ b/plugins/ingest-attachment/src/main/java/org/opensearch/ingest/attachment/TikaImpl.java @@ -42,7 +42,6 @@ import org.opensearch.SpecialPermission; import org.opensearch.bootstrap.FilePermissionUtils; import org.opensearch.bootstrap.JarHell; -import org.opensearch.bootstrap.JavaVersion; import org.opensearch.common.SuppressForbidden; import org.opensearch.common.io.PathUtils; @@ -181,14 +180,6 @@ static PermissionCollection getRestrictedPermissions() { perms.add(new RuntimePermission("accessClassInPackage.sun.java2d.cmm.kcms")); // xmlbeans, use by POI, needs to get the context classloader perms.add(new RuntimePermission("getClassLoader")); - // ZipFile needs accessDeclaredMembers on JDK 10; cf. https://bugs.openjdk.java.net/browse/JDK-8187485 - if (JavaVersion.current().compareTo(JavaVersion.parse("10")) >= 0) { - if (JavaVersion.current().compareTo(JavaVersion.parse("11")) < 0) { - // TODO remove this and from plugin-security.policy when JDK 11 is the only one we support - // this is needed pre 11, but it's fixed in 11 : https://bugs.openjdk.java.net/browse/JDK-8187485 - perms.add(new RuntimePermission("accessDeclaredMembers")); - } - } perms.setReadOnly(); return perms; } diff --git a/plugins/repository-gcs/src/internalClusterTest/java/org/opensearch/repositories/gcs/GoogleCloudStorageBlobStoreRepositoryTests.java b/plugins/repository-gcs/src/internalClusterTest/java/org/opensearch/repositories/gcs/GoogleCloudStorageBlobStoreRepositoryTests.java index 4bc59b6ae6553..274a416d57431 100644 --- a/plugins/repository-gcs/src/internalClusterTest/java/org/opensearch/repositories/gcs/GoogleCloudStorageBlobStoreRepositoryTests.java +++ b/plugins/repository-gcs/src/internalClusterTest/java/org/opensearch/repositories/gcs/GoogleCloudStorageBlobStoreRepositoryTests.java @@ -44,7 +44,6 @@ import org.apache.lucene.util.BytesRefBuilder; import org.opensearch.action.ActionRunnable; import org.opensearch.action.support.PlainActionFuture; -import org.opensearch.bootstrap.JavaVersion; import org.opensearch.cluster.metadata.RepositoryMetadata; import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.SuppressForbidden; @@ -67,7 +66,6 @@ import org.opensearch.repositories.blobstore.BlobStoreRepository; import org.opensearch.repositories.blobstore.OpenSearchMockAPIBasedRepositoryIntegTestCase; -import org.junit.BeforeClass; import org.threeten.bp.Duration; import java.io.IOException; @@ -88,22 +86,6 @@ @SuppressForbidden(reason = "this test uses a HttpServer to emulate a Google Cloud Storage endpoint") public class GoogleCloudStorageBlobStoreRepositoryTests extends OpenSearchMockAPIBasedRepositoryIntegTestCase { - - public static void assumeNotJava8() { - assumeFalse( - "This test is flaky on jdk8 - we suspect a JDK bug to trigger some assertion in the HttpServer implementation used " - + "to emulate the server side logic of Google Cloud Storage. See https://bugs.openjdk.java.net/browse/JDK-8180754, " - + "https://github.com/elastic/elasticsearch/pull/51933 and https://github.com/elastic/elasticsearch/issues/52906 " - + "for more background on this issue.", - JavaVersion.current().equals(JavaVersion.parse("8")) - ); - } - - @BeforeClass - public static void skipJava8() { - assumeNotJava8(); - } - @Override protected String repositoryType() { return GoogleCloudStorageRepository.TYPE; diff --git a/plugins/repository-gcs/src/test/java/org/opensearch/repositories/gcs/GoogleCloudStorageBlobContainerRetriesTests.java b/plugins/repository-gcs/src/test/java/org/opensearch/repositories/gcs/GoogleCloudStorageBlobContainerRetriesTests.java index 6a589126a9466..616a1ae9feb4f 100644 --- a/plugins/repository-gcs/src/test/java/org/opensearch/repositories/gcs/GoogleCloudStorageBlobContainerRetriesTests.java +++ b/plugins/repository-gcs/src/test/java/org/opensearch/repositories/gcs/GoogleCloudStorageBlobContainerRetriesTests.java @@ -39,7 +39,6 @@ import fixture.gcs.FakeOAuth2HttpHandler; import org.apache.http.HttpStatus; -import org.opensearch.bootstrap.JavaVersion; import org.opensearch.common.Nullable; import org.opensearch.common.Strings; import org.opensearch.common.SuppressForbidden; @@ -62,7 +61,6 @@ import org.opensearch.repositories.blobstore.OpenSearchMockAPIBasedRepositoryIntegTestCase; import org.opensearch.rest.RestStatus; import org.opensearch.rest.RestUtils; -import org.junit.BeforeClass; import org.threeten.bp.Duration; import java.io.IOException; @@ -107,21 +105,6 @@ private String httpServerUrl() { return "http://" + InetAddresses.toUriString(address.getAddress()) + ":" + address.getPort(); } - public static void assumeNotJava8() { - assumeFalse( - "This test is flaky on jdk8 - we suspect a JDK bug to trigger some assertion in the HttpServer implementation used " - + "to emulate the server side logic of Google Cloud Storage. See https://bugs.openjdk.java.net/browse/JDK-8180754, " - + "https://github.com/elastic/elasticsearch/pull/51933 and https://github.com/elastic/elasticsearch/issues/52906 " - + "for more background on this issue.", - JavaVersion.current().equals(JavaVersion.parse("8")) - ); - } - - @BeforeClass - public static void skipJava8() { - assumeNotJava8(); - } - @Override protected String downloadStorageEndpoint(String blob) { return "/download/storage/v1/b/bucket/o/" + blob; diff --git a/plugins/repository-hdfs/src/test/java/org/opensearch/repositories/hdfs/HdfsTests.java b/plugins/repository-hdfs/src/test/java/org/opensearch/repositories/hdfs/HdfsTests.java index 46d97f41b604f..d46d0b2092d2a 100644 --- a/plugins/repository-hdfs/src/test/java/org/opensearch/repositories/hdfs/HdfsTests.java +++ b/plugins/repository-hdfs/src/test/java/org/opensearch/repositories/hdfs/HdfsTests.java @@ -36,7 +36,6 @@ import org.opensearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse; import org.opensearch.action.support.master.AcknowledgedResponse; -import org.opensearch.bootstrap.JavaVersion; import org.opensearch.client.Client; import org.opensearch.cluster.ClusterState; import org.opensearch.common.settings.Settings; @@ -63,7 +62,6 @@ protected Collection> getPlugins() { } public void testSimpleWorkflow() { - assumeFalse("https://github.com/elastic/elasticsearch/issues/31498", JavaVersion.current().equals(JavaVersion.parse("11"))); Client client = client(); AcknowledgedResponse putRepositoryResponse = client.admin() diff --git a/plugins/transport-nio/src/test/java/org/opensearch/transport/nio/SimpleNioTransportTests.java b/plugins/transport-nio/src/test/java/org/opensearch/transport/nio/SimpleNioTransportTests.java index c8b9fa63383bf..230f89bbafe9f 100644 --- a/plugins/transport-nio/src/test/java/org/opensearch/transport/nio/SimpleNioTransportTests.java +++ b/plugins/transport-nio/src/test/java/org/opensearch/transport/nio/SimpleNioTransportTests.java @@ -34,7 +34,6 @@ import org.opensearch.Version; import org.opensearch.action.ActionListener; -import org.opensearch.bootstrap.JavaVersion; import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.common.io.stream.NamedWriteableRegistry; import org.opensearch.common.network.NetworkService; @@ -122,10 +121,7 @@ public void testConnectException() throws UnknownHostException { } public void testDefaultKeepAliveSettings() throws IOException { - assumeTrue( - "setting default keepalive options not supported on this platform", - (IOUtils.LINUX || IOUtils.MAC_OS_X) && JavaVersion.current().compareTo(JavaVersion.parse("11")) >= 0 - ); + assumeTrue("setting default keepalive options not supported on this platform", (IOUtils.LINUX || IOUtils.MAC_OS_X)); try ( MockTransportService serviceC = buildService("TS_C", Version.CURRENT, Settings.EMPTY); MockTransportService serviceD = buildService("TS_D", Version.CURRENT, Settings.EMPTY) diff --git a/server/src/internalClusterTest/java/org/opensearch/search/aggregations/bucket/DateHistogramIT.java b/server/src/internalClusterTest/java/org/opensearch/search/aggregations/bucket/DateHistogramIT.java index 782bcde39ce8d..617c5745c9bba 100644 --- a/server/src/internalClusterTest/java/org/opensearch/search/aggregations/bucket/DateHistogramIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/search/aggregations/bucket/DateHistogramIT.java @@ -35,7 +35,6 @@ import org.opensearch.action.index.IndexRequestBuilder; import org.opensearch.action.search.SearchPhaseExecutionException; import org.opensearch.action.search.SearchResponse; -import org.opensearch.bootstrap.JavaVersion; import org.opensearch.common.Strings; import org.opensearch.common.settings.Settings; import org.opensearch.common.time.DateFormatter; @@ -386,9 +385,6 @@ public void testSingleValued_timeZone_epoch() throws Exception { ZonedDateTime expectedKey = keyIterator.next(); String bucketKey = bucket.getKeyAsString(); String expectedBucketName = Long.toString(expectedKey.toInstant().toEpochMilli() / millisDivider); - if (JavaVersion.current().getVersion().get(0) == 8 && bucket.getKeyAsString().endsWith(".0")) { - expectedBucketName = expectedBucketName + ".0"; - } assertThat(bucketKey, equalTo(expectedBucketName)); assertThat(((ZonedDateTime) bucket.getKey()), equalTo(expectedKey)); assertThat(bucket.getDocCount(), equalTo(1L)); @@ -1509,11 +1505,7 @@ public void testRewriteTimeZone_EpochMillisFormat() throws InterruptedException, assertSearchResponse(response); Histogram histo = response.getAggregations().get("histo"); assertThat(histo.getBuckets().size(), equalTo(1)); - if (JavaVersion.current().getVersion().get(0) == 8 && histo.getBuckets().get(0).getKeyAsString().endsWith(".0")) { - assertThat(histo.getBuckets().get(0).getKeyAsString(), equalTo("1477954800000.0")); - } else { - assertThat(histo.getBuckets().get(0).getKeyAsString(), equalTo("1477954800000")); - } + assertThat(histo.getBuckets().get(0).getKeyAsString(), equalTo("1477954800000")); assertThat(histo.getBuckets().get(0).getDocCount(), equalTo(1L)); response = client().prepareSearch(index) diff --git a/server/src/internalClusterTest/java/org/opensearch/search/query/SearchQueryIT.java b/server/src/internalClusterTest/java/org/opensearch/search/query/SearchQueryIT.java index fed5561c1df64..c51043f02174d 100644 --- a/server/src/internalClusterTest/java/org/opensearch/search/query/SearchQueryIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/search/query/SearchQueryIT.java @@ -44,7 +44,6 @@ import org.opensearch.action.search.SearchPhaseExecutionException; import org.opensearch.action.search.SearchResponse; import org.opensearch.action.search.SearchType; -import org.opensearch.bootstrap.JavaVersion; import org.opensearch.common.document.DocumentField; import org.opensearch.common.lucene.search.SpanBooleanQueryRewriteWithMaxClause; import org.opensearch.common.regex.Regex; @@ -1860,7 +1859,6 @@ public void testRangeQueryWithTimeZone() throws Exception { * on "Configuring IDEs And Running Tests". */ public void testRangeQueryWithLocaleMapping() throws Exception { - assumeTrue("need java 9 for testing ", JavaVersion.current().compareTo(JavaVersion.parse("9")) >= 0); assert ("SPI,COMPAT".equals(System.getProperty("java.locale.providers"))) : "`-Djava.locale.providers=SPI,COMPAT` needs to be set"; assertAcked( diff --git a/server/src/main/java/org/opensearch/bootstrap/Bootstrap.java b/server/src/main/java/org/opensearch/bootstrap/Bootstrap.java index 30a883454ba8c..1b773b62ef77b 100644 --- a/server/src/main/java/org/opensearch/bootstrap/Bootstrap.java +++ b/server/src/main/java/org/opensearch/bootstrap/Bootstrap.java @@ -48,7 +48,6 @@ import org.opensearch.common.PidFile; import org.opensearch.common.SuppressForbidden; import org.opensearch.common.inject.CreationException; -import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.logging.LogConfigurator; import org.opensearch.common.logging.Loggers; import org.opensearch.common.network.IfConfig; @@ -78,7 +77,6 @@ import java.security.NoSuchAlgorithmException; import java.util.Collections; import java.util.List; -import java.util.Locale; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -374,14 +372,6 @@ static void init(final boolean foreground, final Path pidFile, final boolean qui } catch (IOException e) { throw new BootstrapException(e); } - if (JavaVersion.current().compareTo(JavaVersion.parse("11")) < 0) { - final String message = String.format( - Locale.ROOT, - "future versions of OpenSearch will require Java 11; " + "your Java version from [%s] does not meet this requirement", - System.getProperty("java.home") - ); - DeprecationLogger.getLogger(Bootstrap.class).deprecate("java_version_11_required", message); - } if (environment.pidFile() != null) { try { PidFile.create(environment.pidFile(), true); diff --git a/server/src/main/java/org/opensearch/bootstrap/BootstrapChecks.java b/server/src/main/java/org/opensearch/bootstrap/BootstrapChecks.java index 79019a73c69e3..6b75f2306431c 100644 --- a/server/src/main/java/org/opensearch/bootstrap/BootstrapChecks.java +++ b/server/src/main/java/org/opensearch/bootstrap/BootstrapChecks.java @@ -59,8 +59,6 @@ import java.util.List; import java.util.Locale; import java.util.function.Predicate; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -224,7 +222,6 @@ static List checks() { checks.add(new OnErrorCheck()); checks.add(new OnOutOfMemoryErrorCheck()); checks.add(new EarlyAccessCheck()); - checks.add(new G1GCCheck()); checks.add(new AllPermissionCheck()); checks.add(new DiscoveryConfiguredCheck()); return Collections.unmodifiableList(checks); @@ -683,60 +680,6 @@ String javaVersion() { } - /** - * Bootstrap check for versions of HotSpot that are known to have issues that can lead to index corruption when G1GC is enabled. - */ - static class G1GCCheck implements BootstrapCheck { - - @Override - public BootstrapCheckResult check(BootstrapContext context) { - if ("Oracle Corporation".equals(jvmVendor()) && isJava8() && isG1GCEnabled()) { - final String jvmVersion = jvmVersion(); - // HotSpot versions on Java 8 match this regular expression; note that this changes with Java 9 after JEP-223 - final Pattern pattern = Pattern.compile("(\\d+)\\.(\\d+)-b\\d+"); - final Matcher matcher = pattern.matcher(jvmVersion); - final boolean matches = matcher.matches(); - assert matches : jvmVersion; - final int major = Integer.parseInt(matcher.group(1)); - final int update = Integer.parseInt(matcher.group(2)); - // HotSpot versions for Java 8 have major version 25, the bad versions are all versions prior to update 40 - if (major == 25 && update < 40) { - final String message = String.format( - Locale.ROOT, - "JVM version [%s] can cause data corruption when used with G1GC; upgrade to at least Java 8u40", - jvmVersion - ); - return BootstrapCheckResult.failure(message); - } - } - return BootstrapCheckResult.success(); - } - - // visible for testing - String jvmVendor() { - return Constants.JVM_VENDOR; - } - - // visible for testing - boolean isG1GCEnabled() { - assert "Oracle Corporation".equals(jvmVendor()); - return JvmInfo.jvmInfo().useG1GC().equals("true"); - } - - // visible for testing - String jvmVersion() { - assert "Oracle Corporation".equals(jvmVendor()); - return Constants.JVM_VERSION; - } - - // visible for testing - boolean isJava8() { - assert "Oracle Corporation".equals(jvmVendor()); - return JavaVersion.current().equals(JavaVersion.parse("1.8")); - } - - } - static class AllPermissionCheck implements BootstrapCheck { @Override diff --git a/server/src/test/java/org/opensearch/bootstrap/BootstrapChecksTests.java b/server/src/test/java/org/opensearch/bootstrap/BootstrapChecksTests.java index c59ca1dd60dc7..88f2047ffaa0f 100644 --- a/server/src/test/java/org/opensearch/bootstrap/BootstrapChecksTests.java +++ b/server/src/test/java/org/opensearch/bootstrap/BootstrapChecksTests.java @@ -52,7 +52,6 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; -import java.util.Locale; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; @@ -654,81 +653,6 @@ String javaVersion() { } - public void testG1GCCheck() throws NodeValidationException { - final AtomicBoolean isG1GCEnabled = new AtomicBoolean(true); - final AtomicBoolean isJava8 = new AtomicBoolean(true); - final AtomicReference jvmVersion = new AtomicReference<>( - String.format(Locale.ROOT, "25.%d-b%d", randomIntBetween(0, 39), randomIntBetween(1, 128)) - ); - final BootstrapChecks.G1GCCheck g1GCCheck = new BootstrapChecks.G1GCCheck() { - - @Override - String jvmVendor() { - return "Oracle Corporation"; - } - - @Override - boolean isG1GCEnabled() { - return isG1GCEnabled.get(); - } - - @Override - String jvmVersion() { - return jvmVersion.get(); - } - - @Override - boolean isJava8() { - return isJava8.get(); - } - - }; - - final NodeValidationException e = expectThrows( - NodeValidationException.class, - () -> BootstrapChecks.check(emptyContext, true, Collections.singletonList(g1GCCheck)) - ); - assertThat( - e.getMessage(), - containsString( - "JVM version [" + jvmVersion.get() + "] can cause data corruption when used with G1GC; upgrade to at least Java 8u40" - ) - ); - - // if G1GC is disabled, nothing should happen - isG1GCEnabled.set(false); - BootstrapChecks.check(emptyContext, true, Collections.singletonList(g1GCCheck)); - - // if on or after update 40, nothing should happen independent of whether or not G1GC is enabled - isG1GCEnabled.set(randomBoolean()); - jvmVersion.set(String.format(Locale.ROOT, "25.%d-b%d", randomIntBetween(40, 112), randomIntBetween(1, 128))); - BootstrapChecks.check(emptyContext, true, Collections.singletonList(g1GCCheck)); - - final BootstrapChecks.G1GCCheck nonOracleCheck = new BootstrapChecks.G1GCCheck() { - - @Override - String jvmVendor() { - return randomAlphaOfLength(8); - } - - }; - - // if not on an Oracle JVM, nothing should happen - BootstrapChecks.check(emptyContext, true, Collections.singletonList(nonOracleCheck)); - - final BootstrapChecks.G1GCCheck nonJava8Check = new BootstrapChecks.G1GCCheck() { - - @Override - boolean isJava8() { - return false; - } - - }; - - // if not Java 8, nothing should happen - BootstrapChecks.check(emptyContext, true, Collections.singletonList(nonJava8Check)); - } - public void testAllPermissionCheck() throws NodeValidationException { final AtomicBoolean isAllPermissionGranted = new AtomicBoolean(true); final BootstrapChecks.AllPermissionCheck allPermissionCheck = new BootstrapChecks.AllPermissionCheck() { diff --git a/server/src/test/java/org/opensearch/bootstrap/JavaVersionTests.java b/server/src/test/java/org/opensearch/bootstrap/JavaVersionTests.java index 24d78e0986342..b651afd253d11 100644 --- a/server/src/test/java/org/opensearch/bootstrap/JavaVersionTests.java +++ b/server/src/test/java/org/opensearch/bootstrap/JavaVersionTests.java @@ -34,6 +34,7 @@ import org.opensearch.test.OpenSearchTestCase; +import java.lang.Runtime.Version; import java.util.List; import static org.hamcrest.CoreMatchers.equalTo; @@ -41,29 +42,22 @@ public class JavaVersionTests extends OpenSearchTestCase { public void testParse() { - JavaVersion javaVersion = JavaVersion.parse("1.7.0"); - List version = javaVersion.getVersion(); - assertThat(version.size(), is(3)); - assertThat(version.get(0), is(1)); - assertThat(version.get(1), is(7)); - assertThat(version.get(2), is(0)); - - JavaVersion javaVersionEarlyAccess = JavaVersion.parse("14.0.1-ea"); - List version14 = javaVersionEarlyAccess.getVersion(); + Version javaVersionEarlyAccess = Version.parse("14.0.1-ea"); + List version14 = javaVersionEarlyAccess.version(); assertThat(version14.size(), is(3)); assertThat(version14.get(0), is(14)); assertThat(version14.get(1), is(0)); assertThat(version14.get(2), is(1)); - JavaVersion javaVersionOtherPrePart = JavaVersion.parse("13.2.4-somethingElseHere"); - List version13 = javaVersionOtherPrePart.getVersion(); + Version javaVersionOtherPrePart = Version.parse("13.2.4-somethingElseHere"); + List version13 = javaVersionOtherPrePart.version(); assertThat(version13.size(), is(3)); assertThat(version13.get(0), is(13)); assertThat(version13.get(1), is(2)); assertThat(version13.get(2), is(4)); - JavaVersion javaVersionNumericPrePart = JavaVersion.parse("13.2.4-something124443"); - List version11 = javaVersionNumericPrePart.getVersion(); + Version javaVersionNumericPrePart = Version.parse("13.2.4-something124443"); + List version11 = javaVersionNumericPrePart.version(); assertThat(version11.size(), is(3)); assertThat(version11.get(0), is(13)); assertThat(version11.get(1), is(2)); @@ -71,51 +65,36 @@ public void testParse() { } public void testParseInvalidVersions() { - final IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> JavaVersion.parse("11.2-something-else")); - assertThat(e.getMessage(), equalTo("Java version string [11.2-something-else] could not be parsed.")); - final IllegalArgumentException e1 = expectThrows(IllegalArgumentException.class, () -> JavaVersion.parse("11.0.")); - assertThat(e1.getMessage(), equalTo("Java version string [11.0.] could not be parsed.")); - final IllegalArgumentException e2 = expectThrows(IllegalArgumentException.class, () -> JavaVersion.parse("11.a.3")); - assertThat(e2.getMessage(), equalTo("Java version string [11.a.3] could not be parsed.")); + final IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> Version.parse("11.2+something-else")); + assertThat(e.getMessage(), equalTo("Invalid version string: '11.2+something-else'")); + final IllegalArgumentException e1 = expectThrows(IllegalArgumentException.class, () -> Version.parse("11.0.")); + assertThat(e1.getMessage(), equalTo("Invalid version string: '11.0.'")); + final IllegalArgumentException e2 = expectThrows(IllegalArgumentException.class, () -> Version.parse("11.a.3")); + assertThat(e2.getMessage(), equalTo("Invalid version string: '11.a.3'")); } public void testToString() { - JavaVersion javaVersion170 = JavaVersion.parse("1.7.0"); - assertThat(javaVersion170.toString(), is("1.7.0")); - JavaVersion javaVersion9 = JavaVersion.parse("9"); + Version javaVersion9 = Version.parse("9"); assertThat(javaVersion9.toString(), is("9")); - JavaVersion javaVersion11 = JavaVersion.parse("11.0.1-something09random"); + Version javaVersion11 = Version.parse("11.0.1-something09random"); assertThat(javaVersion11.toString(), is("11.0.1-something09random")); - JavaVersion javaVersion12 = JavaVersion.parse("12.2-2019"); + Version javaVersion12 = Version.parse("12.2-2019"); assertThat(javaVersion12.toString(), is("12.2-2019")); - JavaVersion javaVersion13ea = JavaVersion.parse("13.1-ea"); + Version javaVersion13ea = Version.parse("13.1-ea"); assertThat(javaVersion13ea.toString(), is("13.1-ea")); } public void testCompare() { - JavaVersion onePointSix = JavaVersion.parse("1.6"); - JavaVersion onePointSeven = JavaVersion.parse("1.7"); - JavaVersion onePointSevenPointZero = JavaVersion.parse("1.7.0"); - JavaVersion onePointSevenPointOne = JavaVersion.parse("1.7.1"); - JavaVersion onePointSevenPointTwo = JavaVersion.parse("1.7.2"); - JavaVersion onePointSevenPointOnePointOne = JavaVersion.parse("1.7.1.1"); - JavaVersion onePointSevenPointTwoPointOne = JavaVersion.parse("1.7.2.1"); - JavaVersion thirteen = JavaVersion.parse("13"); - JavaVersion thirteenPointTwoPointOne = JavaVersion.parse("13.2.1"); - JavaVersion thirteenPointTwoPointOneTwoThousand = JavaVersion.parse("13.2.1-2000"); - JavaVersion thirteenPointTwoPointOneThreeThousand = JavaVersion.parse("13.2.1-3000"); - JavaVersion thirteenPointTwoPointOneA = JavaVersion.parse("13.2.1-aaa"); - JavaVersion thirteenPointTwoPointOneB = JavaVersion.parse("13.2.1-bbb"); - JavaVersion fourteen = JavaVersion.parse("14"); - JavaVersion fourteenPointTwoPointOne = JavaVersion.parse("14.2.1"); - JavaVersion fourteenPointTwoPointOneEarlyAccess = JavaVersion.parse("14.2.1-ea"); - - assertTrue(onePointSix.compareTo(onePointSeven) < 0); - assertTrue(onePointSeven.compareTo(onePointSix) > 0); - assertTrue(onePointSix.compareTo(onePointSix) == 0); - assertTrue(onePointSeven.compareTo(onePointSevenPointZero) == 0); - assertTrue(onePointSevenPointOnePointOne.compareTo(onePointSevenPointOne) > 0); - assertTrue(onePointSevenPointTwo.compareTo(onePointSevenPointTwoPointOne) < 0); + Version thirteen = Version.parse("13"); + Version thirteenPointTwoPointOne = Version.parse("13.2.1"); + Version thirteenPointTwoPointOneTwoThousand = Version.parse("13.2.1-2000"); + Version thirteenPointTwoPointOneThreeThousand = Version.parse("13.2.1-3000"); + Version thirteenPointTwoPointOneA = Version.parse("13.2.1-aaa"); + Version thirteenPointTwoPointOneB = Version.parse("13.2.1-bbb"); + Version fourteen = Version.parse("14"); + Version fourteenPointTwoPointOne = Version.parse("14.2.1"); + Version fourteenPointTwoPointOneEarlyAccess = Version.parse("14.2.1-ea"); + assertTrue(thirteen.compareTo(thirteenPointTwoPointOne) < 0); assertTrue(thirteen.compareTo(fourteen) < 0); assertTrue(thirteenPointTwoPointOneThreeThousand.compareTo(thirteenPointTwoPointOneTwoThousand) > 0); @@ -129,20 +108,16 @@ public void testCompare() { } public void testValidVersions() { - String[] versions = new String[] { "1.7", "1.7.0", "0.1.7", "1.7.0.80", "12-ea", "13.0.2.3-ea", "14-something", "11.0.2-21002" }; + String[] versions = new String[] { "12-ea", "13.0.2.3-ea", "14-something", "11.0.2-21002", "11.0.14.1+1", "17.0.2+8" }; for (String version : versions) { - assertTrue(JavaVersion.isValid(version)); + assertNotNull(Version.parse(version)); } } public void testInvalidVersions() { - String[] versions = new String[] { "", "1.7.0_80", "1.7.", "11.2-something-else" }; + String[] versions = new String[] { "", "1.7.0_80", "1.7.", "11.2+something-else" }; for (String version : versions) { - assertFalse(JavaVersion.isValid(version)); + assertThrows(IllegalArgumentException.class, () -> Version.parse(version)); } } - - public void testJava8Compat() { - assertEquals(JavaVersion.parse("1.8"), JavaVersion.parse("8")); - } } diff --git a/server/src/test/java/org/opensearch/common/LocalTimeOffsetTests.java b/server/src/test/java/org/opensearch/common/LocalTimeOffsetTests.java index 12810241e3904..b032e27397f2d 100644 --- a/server/src/test/java/org/opensearch/common/LocalTimeOffsetTests.java +++ b/server/src/test/java/org/opensearch/common/LocalTimeOffsetTests.java @@ -32,12 +32,12 @@ package org.opensearch.common; -import org.opensearch.bootstrap.JavaVersion; import org.opensearch.common.LocalTimeOffset.Gap; import org.opensearch.common.LocalTimeOffset.Overlap; import org.opensearch.common.time.DateFormatter; import org.opensearch.test.OpenSearchTestCase; +import java.lang.Runtime.Version; import java.time.Instant; import java.time.ZoneId; import java.time.ZoneOffset; @@ -278,7 +278,7 @@ public void testKnownMovesBackToPreviousDay() { assertKnownMovesBacktoPreviousDay("America/Moncton", "2005-10-29T03:01:00"); assertKnownMovesBacktoPreviousDay("America/St_Johns", "2010-11-07T02:31:00"); assertKnownMovesBacktoPreviousDay("Canada/Newfoundland", "2010-11-07T02:31:00"); - if (JavaVersion.current().compareTo(JavaVersion.parse("11")) > 0) { + if (Runtime.version().compareTo(Version.parse("11")) > 0) { // Added in java 12 assertKnownMovesBacktoPreviousDay("Pacific/Guam", "1969-01-25T13:01:00"); assertKnownMovesBacktoPreviousDay("Pacific/Saipan", "1969-01-25T13:01:00"); diff --git a/server/src/test/java/org/opensearch/common/joda/JavaJodaTimeDuellingTests.java b/server/src/test/java/org/opensearch/common/joda/JavaJodaTimeDuellingTests.java index 30fcf4bb32989..94ddfd7e7f100 100644 --- a/server/src/test/java/org/opensearch/common/joda/JavaJodaTimeDuellingTests.java +++ b/server/src/test/java/org/opensearch/common/joda/JavaJodaTimeDuellingTests.java @@ -33,7 +33,6 @@ package org.opensearch.common.joda; import org.opensearch.OpenSearchParseException; -import org.opensearch.bootstrap.JavaVersion; import org.opensearch.common.time.DateFormatter; import org.opensearch.common.time.DateFormatters; import org.opensearch.common.time.DateMathParser; @@ -43,7 +42,6 @@ import org.joda.time.DateTimeZone; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.ISODateTimeFormat; -import org.junit.BeforeClass; import java.time.ZoneId; import java.time.ZoneOffset; @@ -62,18 +60,6 @@ protected boolean enableWarningsCheck() { return false; } - @BeforeClass - public static void checkJvmProperties() { - boolean runtimeJdk8 = JavaVersion.current().getVersion().get(0) == 8; - assert (runtimeJdk8 && ("SPI,JRE".equals(System.getProperty("java.locale.providers")))) - || (false == runtimeJdk8 && ("SPI,COMPAT".equals(System.getProperty("java.locale.providers")))) - : "`-Djava.locale.providers` needs to be set"; - assumeFalse( - "won't work in jdk8 " + "because SPI mechanism is not looking at classpath - needs ISOCalendarDataProvider in jre's ext/libs", - runtimeJdk8 - ); - } - public void testTimezoneParsing() { /** this testcase won't work in joda. See comment in {@link #testPartialTimeParsing()} * assertSameDateAs("2016-11-30T+01", "strict_date_optional_time", "strict_date_optional_time"); @@ -906,14 +892,6 @@ private void assertSamePrinterOutput( String jodaTimeOut = jodaDateFormatter.formatJoda(jodaDate); assertThat(jodaDate.getMillis(), is(javaDate.toInstant().toEpochMilli())); - - if (JavaVersion.current().getVersion().get(0) == 8 - && javaTimeOut.endsWith(".0") - && (format.equals("epoch_second") || format.equals("epoch_millis"))) { - // java 8 has a bug in DateTimeFormatter usage when printing dates that rely on isSupportedBy for fields, which is - // what we use for epoch time. This change accounts for that bug. It should be removed when java 8 support is removed - jodaTimeOut += ".0"; - } String message = String.format( Locale.ROOT, "expected string representation to be equal for format [%s]: joda [%s], java [%s]", diff --git a/server/src/test/java/org/opensearch/common/time/DateFormattersTests.java b/server/src/test/java/org/opensearch/common/time/DateFormattersTests.java index 1e57f9fe88d9c..681daf1755890 100644 --- a/server/src/test/java/org/opensearch/common/time/DateFormattersTests.java +++ b/server/src/test/java/org/opensearch/common/time/DateFormattersTests.java @@ -32,7 +32,6 @@ package org.opensearch.common.time; -import org.opensearch.bootstrap.JavaVersion; import org.opensearch.common.joda.Joda; import org.opensearch.test.OpenSearchTestCase; @@ -56,11 +55,6 @@ public class DateFormattersTests extends OpenSearchTestCase { public void testWeekBasedDates() { - assumeFalse( - "won't work in jdk8 " + "because SPI mechanism is not looking at classpath - needs ISOCalendarDataProvider in jre's ext/libs", - JavaVersion.current().equals(JavaVersion.parse("8")) - ); - // as per WeekFields.ISO first week starts on Monday and has minimum 4 days DateFormatter dateFormatter = DateFormatters.forPattern("YYYY-ww"); diff --git a/server/src/test/java/org/opensearch/common/time/JavaDateMathParserTests.java b/server/src/test/java/org/opensearch/common/time/JavaDateMathParserTests.java index a26a3a298b360..504741f56efed 100644 --- a/server/src/test/java/org/opensearch/common/time/JavaDateMathParserTests.java +++ b/server/src/test/java/org/opensearch/common/time/JavaDateMathParserTests.java @@ -33,7 +33,6 @@ package org.opensearch.common.time; import org.opensearch.OpenSearchParseException; -import org.opensearch.bootstrap.JavaVersion; import org.opensearch.test.OpenSearchTestCase; import java.time.Instant; @@ -111,11 +110,6 @@ public void testOverridingLocaleOrZoneAndCompositeRoundUpParser() { } public void testWeekDates() { - assumeFalse( - "won't work in jdk8 " + "because SPI mechanism is not looking at classpath - needs ISOCalendarDataProvider in jre's ext/libs", - JavaVersion.current().equals(JavaVersion.parse("8")) - ); - DateFormatter formatter = DateFormatter.forPattern("YYYY-ww"); assertDateMathEquals(formatter.toDateMathParser(), "2016-01", "2016-01-04T23:59:59.999Z", 0, true, ZoneOffset.UTC); diff --git a/server/src/test/java/org/opensearch/index/mapper/DateFieldMapperTests.java b/server/src/test/java/org/opensearch/index/mapper/DateFieldMapperTests.java index cdc5c9567e581..918b86761fe86 100644 --- a/server/src/test/java/org/opensearch/index/mapper/DateFieldMapperTests.java +++ b/server/src/test/java/org/opensearch/index/mapper/DateFieldMapperTests.java @@ -34,7 +34,6 @@ import org.apache.lucene.index.DocValuesType; import org.apache.lucene.index.IndexableField; -import org.opensearch.bootstrap.JavaVersion; import org.opensearch.common.collect.List; import org.opensearch.common.time.DateFormatter; import org.opensearch.common.xcontent.XContentBuilder; @@ -186,8 +185,6 @@ public void testChangeFormat() throws IOException { } public void testChangeLocale() throws IOException { - assumeTrue("need java 9 for testing ", JavaVersion.current().compareTo(JavaVersion.parse("9")) >= 0); - DocumentMapper mapper = createDocumentMapper( fieldMapping(b -> b.field("type", "date").field("format", "E, d MMM yyyy HH:mm:ss Z").field("locale", "de")) ); diff --git a/server/src/test/java/org/opensearch/monitor/jvm/JvmInfoTests.java b/server/src/test/java/org/opensearch/monitor/jvm/JvmInfoTests.java index d86971adcc992..3d02a4797497e 100644 --- a/server/src/test/java/org/opensearch/monitor/jvm/JvmInfoTests.java +++ b/server/src/test/java/org/opensearch/monitor/jvm/JvmInfoTests.java @@ -33,7 +33,6 @@ package org.opensearch.monitor.jvm; import org.apache.lucene.util.Constants; -import org.opensearch.bootstrap.JavaVersion; import org.opensearch.test.OpenSearchTestCase; public class JvmInfoTests extends OpenSearchTestCase { @@ -53,14 +52,13 @@ private boolean isG1GCEnabled() { final String argline = System.getProperty("tests.jvm.argline"); final boolean g1GCEnabled = flagIsEnabled(argline, "UseG1GC"); // for JDK 9 the default collector when no collector is specified is G1 GC - final boolean versionIsAtLeastJava9 = JavaVersion.current().compareTo(JavaVersion.parse("9")) >= 0; final boolean noOtherCollectorSpecified = argline == null || (!flagIsEnabled(argline, "UseParNewGC") && !flagIsEnabled(argline, "UseParallelGC") && !flagIsEnabled(argline, "UseParallelOldGC") && !flagIsEnabled(argline, "UseSerialGC") && !flagIsEnabled(argline, "UseConcMarkSweepGC")); - return g1GCEnabled || (versionIsAtLeastJava9 && noOtherCollectorSpecified); + return g1GCEnabled || noOtherCollectorSpecified; } private boolean flagIsEnabled(String argline, String flag) { diff --git a/server/src/test/java/org/opensearch/plugins/IndexStorePluginTests.java b/server/src/test/java/org/opensearch/plugins/IndexStorePluginTests.java index 165e3aaf3f171..5fd76fc90568c 100644 --- a/server/src/test/java/org/opensearch/plugins/IndexStorePluginTests.java +++ b/server/src/test/java/org/opensearch/plugins/IndexStorePluginTests.java @@ -32,7 +32,6 @@ package org.opensearch.plugins; -import org.opensearch.bootstrap.JavaVersion; import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.cluster.routing.ShardRouting; import org.opensearch.common.settings.Settings; @@ -134,25 +133,16 @@ public void testDuplicateIndexStoreFactories() { IllegalStateException.class, () -> new MockNode(settings, Arrays.asList(BarStorePlugin.class, FooStorePlugin.class)) ); - if (JavaVersion.current().compareTo(JavaVersion.parse("9")) >= 0) { - assertThat( - e, - hasToString( - matches( - "java.lang.IllegalStateException: Duplicate key store \\(attempted merging values " - + "org.opensearch.index.store.FsDirectoryFactory@[\\w\\d]+ " - + "and org.opensearch.index.store.FsDirectoryFactory@[\\w\\d]+\\)" - ) - ) - ); - } else { - assertThat( - e, - hasToString( - matches("java.lang.IllegalStateException: Duplicate key org.opensearch.index.store.FsDirectoryFactory@[\\w\\d]+") + assertThat( + e, + hasToString( + matches( + "java.lang.IllegalStateException: Duplicate key store \\(attempted merging values " + + "org.opensearch.index.store.FsDirectoryFactory@[\\w\\d]+ " + + "and org.opensearch.index.store.FsDirectoryFactory@[\\w\\d]+\\)" ) - ); - } + ) + ); } public void testDuplicateIndexStoreRecoveryStateFactories() { @@ -161,18 +151,6 @@ public void testDuplicateIndexStoreRecoveryStateFactories() { IllegalStateException.class, () -> new MockNode(settings, Arrays.asList(FooCustomRecoveryStore.class, BarCustomRecoveryStore.class)) ); - if (JavaVersion.current().compareTo(JavaVersion.parse("9")) >= 0) { - assertThat(e.getMessage(), containsString("Duplicate key recovery-type")); - } else { - assertThat( - e, - hasToString( - matches( - "java.lang.IllegalStateException: Duplicate key " - + "org.opensearch.plugins.IndexStorePluginTests\\$RecoveryFactory@[\\w\\d]+" - ) - ) - ); - } + assertThat(e.getMessage(), containsString("Duplicate key recovery-type")); } } diff --git a/server/src/test/java/org/opensearch/plugins/PluginsServiceTests.java b/server/src/test/java/org/opensearch/plugins/PluginsServiceTests.java index e022e78e7424b..c7586777387b8 100644 --- a/server/src/test/java/org/opensearch/plugins/PluginsServiceTests.java +++ b/server/src/test/java/org/opensearch/plugins/PluginsServiceTests.java @@ -723,7 +723,7 @@ public void testIncompatibleJavaVersion() throws Exception { "desc", "1.0", Version.CURRENT, - "1000000.0", + "1000000", "FakePlugin", Collections.emptyList(), false diff --git a/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java b/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java index 1c09fb2ff8c04..8a3a5bcb5bb50 100644 --- a/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java @@ -70,7 +70,6 @@ import org.opensearch.action.search.SearchResponse; import org.opensearch.action.support.DefaultShardOperationFailedException; import org.opensearch.action.support.IndicesOptions; -import org.opensearch.bootstrap.JavaVersion; import org.opensearch.client.AdminClient; import org.opensearch.client.Client; import org.opensearch.client.ClusterAdminClient; @@ -166,6 +165,7 @@ import org.junit.BeforeClass; import java.io.IOException; +import java.lang.Runtime.Version; import java.lang.annotation.Annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Inherited; @@ -2403,7 +2403,7 @@ protected boolean willSufferDebian8MemoryProblem() { final boolean anyDebian8Nodes = response.getNodes() .stream() .anyMatch(ni -> ni.getInfo(OsInfo.class).getPrettyName().equals("Debian GNU/Linux 8 (jessie)")); - boolean java15Plus = JavaVersion.current().compareTo(JavaVersion.parse("15")) >= 0; + boolean java15Plus = Runtime.version().compareTo(Version.parse("15")) >= 0; return anyDebian8Nodes && java15Plus == false; } } diff --git a/test/framework/src/main/java/org/opensearch/test/OpenSearchTestCase.java b/test/framework/src/main/java/org/opensearch/test/OpenSearchTestCase.java index 96698036fca55..ecf0de521f36a 100644 --- a/test/framework/src/main/java/org/opensearch/test/OpenSearchTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/OpenSearchTestCase.java @@ -62,7 +62,6 @@ import org.apache.lucene.tests.util.TimeUnits; import org.opensearch.Version; import org.opensearch.bootstrap.BootstrapForTesting; -import org.opensearch.bootstrap.JavaVersion; import org.opensearch.client.Requests; import org.opensearch.cluster.ClusterModule; import org.opensearch.cluster.metadata.IndexMetadata; @@ -967,17 +966,7 @@ public static TimeZone randomTimeZone() { * generate a random TimeZone from the ones available in java.time */ public static ZoneId randomZone() { - // work around a JDK bug, where java 8 cannot parse the timezone GMT0 back into a temporal accessor - // see https://bugs.openjdk.java.net/browse/JDK-8138664 - if (JavaVersion.current().getVersion().get(0) == 8) { - ZoneId timeZone; - do { - timeZone = ZoneId.of(randomJodaAndJavaSupportedTimezone(JAVA_ZONE_IDS)); - } while (timeZone.equals(ZoneId.of("GMT0"))); - return timeZone; - } else { - return ZoneId.of(randomJodaAndJavaSupportedTimezone(JAVA_ZONE_IDS)); - } + return ZoneId.of(randomJodaAndJavaSupportedTimezone(JAVA_ZONE_IDS)); } /** diff --git a/test/framework/src/main/java/org/opensearch/test/junit/listeners/ReproduceInfoPrinter.java b/test/framework/src/main/java/org/opensearch/test/junit/listeners/ReproduceInfoPrinter.java index 3d5a906e50836..b2d0705b937e2 100644 --- a/test/framework/src/main/java/org/opensearch/test/junit/listeners/ReproduceInfoPrinter.java +++ b/test/framework/src/main/java/org/opensearch/test/junit/listeners/ReproduceInfoPrinter.java @@ -35,7 +35,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.lucene.util.Constants; -import org.opensearch.bootstrap.JavaVersion; import org.opensearch.common.Strings; import org.opensearch.common.SuppressForbidden; import org.opensearch.test.OpenSearchIntegTestCase; @@ -192,7 +191,7 @@ private ReproduceErrorMessageBuilder appendESProperties() { } appendOpt("tests.locale", Locale.getDefault().toLanguageTag()); appendOpt("tests.timezone", TimeZone.getDefault().getID()); - appendOpt("runtime.java", Integer.toString(JavaVersion.current().getVersion().get(0))); + appendOpt("runtime.java", Integer.toString(Runtime.version().version().get(0))); appendOpt(OpenSearchTestCase.FIPS_SYSPROP, System.getProperty(OpenSearchTestCase.FIPS_SYSPROP)); return this; } diff --git a/test/framework/src/main/java/org/opensearch/test/rest/yaml/Features.java b/test/framework/src/main/java/org/opensearch/test/rest/yaml/Features.java index 6e59e35dcb0b4..10fb1e52259a9 100644 --- a/test/framework/src/main/java/org/opensearch/test/rest/yaml/Features.java +++ b/test/framework/src/main/java/org/opensearch/test/rest/yaml/Features.java @@ -32,8 +32,6 @@ package org.opensearch.test.rest.yaml; -import org.opensearch.bootstrap.JavaVersion; - import java.util.Arrays; import java.util.List; @@ -86,7 +84,7 @@ public static boolean areAllSupported(List features) { } private static boolean isSupported(String feature) { - if (feature.equals(SPI_ON_CLASSPATH_SINCE_JDK_9) && JavaVersion.current().compareTo(JavaVersion.parse("9")) >= 0) { + if (feature.equals(SPI_ON_CLASSPATH_SINCE_JDK_9)) { return true; } return SUPPORTED.contains(feature); From 6567da638de776a217e4db09015e9a2546eb0b49 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 21 Apr 2022 09:09:02 -0500 Subject: [PATCH 088/514] [Type Removal] Remove TypeFieldMapper usage, remove support of `_type` in searches and from LeafFieldsLookup (#3016) (#3018) Removes TypeFieldMapper and _type support from searches Signed-off-by: Suraj Singh (cherry picked from commit dbdee30a376b2dcbb938790ad99959338bfa1c8e) --- .../PercolatorFieldMapperTests.java | 4 +- .../test/search/160_exists_query.yml | 13 --- .../document/DocumentActionsIT.java | 9 +- .../aggregations/metrics/TopHitsIT.java | 4 +- .../search/fields/SearchFieldsIT.java | 36 ------ .../index/mapper/DocumentMapper.java | 1 - .../index/mapper/MapperService.java | 5 - .../index/mapper/TypeFieldMapper.java | 15 +-- .../org/opensearch/indices/IndicesModule.java | 2 - .../search/lookup/LeafFieldsLookup.java | 24 +--- .../index/engine/InternalEngineTests.java | 2 +- .../opensearch/index/get/GetResultTests.java | 6 +- .../index/mapper/TypeFieldMapperTests.java | 106 ------------------ .../index/mapper/TypeFieldTypeTests.java | 66 ----------- .../index/query/TermQueryBuilderTests.java | 7 -- .../index/query/TermsQueryBuilderTests.java | 7 -- .../query/WildcardQueryBuilderTests.java | 7 -- .../indices/IndicesModuleTests.java | 2 - .../support/ValuesSourceConfigTests.java | 20 ---- .../fetch/subphase/FieldFetcherTests.java | 5 + 20 files changed, 21 insertions(+), 320 deletions(-) delete mode 100644 server/src/test/java/org/opensearch/index/mapper/TypeFieldMapperTests.java delete mode 100644 server/src/test/java/org/opensearch/index/mapper/TypeFieldTypeTests.java diff --git a/modules/percolator/src/test/java/org/opensearch/percolator/PercolatorFieldMapperTests.java b/modules/percolator/src/test/java/org/opensearch/percolator/PercolatorFieldMapperTests.java index ca6f3a78b27d7..fe9c486b68166 100644 --- a/modules/percolator/src/test/java/org/opensearch/percolator/PercolatorFieldMapperTests.java +++ b/modules/percolator/src/test/java/org/opensearch/percolator/PercolatorFieldMapperTests.java @@ -862,7 +862,7 @@ public void testUnsupportedQueries() { PercolatorFieldMapper.verifyQuery(rangeQuery1); PercolatorFieldMapper.verifyQuery(rangeQuery2); - HasChildQueryBuilder hasChildQuery = new HasChildQueryBuilder("_type", new MatchAllQueryBuilder(), ScoreMode.None); + HasChildQueryBuilder hasChildQuery = new HasChildQueryBuilder("parent", new MatchAllQueryBuilder(), ScoreMode.None); expectThrows(IllegalArgumentException.class, () -> PercolatorFieldMapper.verifyQuery(new BoolQueryBuilder().must(hasChildQuery))); expectThrows(IllegalArgumentException.class, () -> PercolatorFieldMapper.verifyQuery(new DisMaxQueryBuilder().add(hasChildQuery))); PercolatorFieldMapper.verifyQuery(new ConstantScoreQueryBuilder((rangeQuery1))); @@ -881,7 +881,7 @@ public void testUnsupportedQueries() { expectThrows(IllegalArgumentException.class, () -> PercolatorFieldMapper.verifyQuery(hasChildQuery)); expectThrows(IllegalArgumentException.class, () -> PercolatorFieldMapper.verifyQuery(new BoolQueryBuilder().must(hasChildQuery))); - HasParentQueryBuilder hasParentQuery = new HasParentQueryBuilder("_type", new MatchAllQueryBuilder(), false); + HasParentQueryBuilder hasParentQuery = new HasParentQueryBuilder("parent", new MatchAllQueryBuilder(), false); expectThrows(IllegalArgumentException.class, () -> PercolatorFieldMapper.verifyQuery(hasParentQuery)); expectThrows(IllegalArgumentException.class, () -> PercolatorFieldMapper.verifyQuery(new BoolQueryBuilder().must(hasParentQuery))); } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/search/160_exists_query.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/search/160_exists_query.yml index 201e456be2cdd..be97930d41eb9 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/search/160_exists_query.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/search/160_exists_query.yml @@ -561,19 +561,6 @@ setup: - match: {hits.total: 4} ---- -"Test exists query on _type field": - - do: - search: - rest_total_hits_as_int: true - index: test - body: - query: - exists: - field: _type - - - match: {hits.total: 4} - --- "Test exists query on _routing field": - do: diff --git a/server/src/internalClusterTest/java/org/opensearch/document/DocumentActionsIT.java b/server/src/internalClusterTest/java/org/opensearch/document/DocumentActionsIT.java index 1e40cc14bbb36..fa94d5c1c5024 100644 --- a/server/src/internalClusterTest/java/org/opensearch/document/DocumentActionsIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/document/DocumentActionsIT.java @@ -47,7 +47,6 @@ import org.opensearch.common.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; -import org.opensearch.index.mapper.MapperService; import org.opensearch.test.OpenSearchIntegTestCase; import org.opensearch.test.hamcrest.OpenSearchAssertions; @@ -58,7 +57,7 @@ import static org.opensearch.client.Requests.getRequest; import static org.opensearch.client.Requests.indexRequest; import static org.opensearch.client.Requests.refreshRequest; -import static org.opensearch.index.query.QueryBuilders.termQuery; +import static org.opensearch.index.query.QueryBuilders.matchAllQuery; import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertNoFailures; import static org.hamcrest.Matchers.equalTo; @@ -181,11 +180,7 @@ public void testIndexActions() throws Exception { // check count for (int i = 0; i < 5; i++) { // test successful - SearchResponse countResponse = client().prepareSearch("test") - .setSize(0) - .setQuery(termQuery("_type", MapperService.SINGLE_MAPPING_NAME)) - .execute() - .actionGet(); + SearchResponse countResponse = client().prepareSearch("test").setSize(0).setQuery(matchAllQuery()).execute().actionGet(); assertNoFailures(countResponse); assertThat(countResponse.getHits().getTotalHits().value, equalTo(2L)); assertThat(countResponse.getSuccessfulShards(), equalTo(numShards.numPrimaries)); diff --git a/server/src/internalClusterTest/java/org/opensearch/search/aggregations/metrics/TopHitsIT.java b/server/src/internalClusterTest/java/org/opensearch/search/aggregations/metrics/TopHitsIT.java index c3240c5eef7c5..4c5c42b773e93 100644 --- a/server/src/internalClusterTest/java/org/opensearch/search/aggregations/metrics/TopHitsIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/search/aggregations/metrics/TopHitsIT.java @@ -1386,7 +1386,7 @@ public void testWithRescore() { SearchResponse response = client().prepareSearch("idx") .addRescorer(new QueryRescorerBuilder(new MatchAllQueryBuilder().boost(3.0f))) .addAggregation( - terms("terms").field(TERMS_AGGS_FIELD).subAggregation(topHits("hits").sort(SortBuilders.fieldSort("_type"))) + terms("terms").field(TERMS_AGGS_FIELD).subAggregation(topHits("hits").sort(SortBuilders.fieldSort("_index"))) ) .get(); Terms terms = response.getAggregations().get("terms"); @@ -1403,7 +1403,7 @@ public void testWithRescore() { .addRescorer(new QueryRescorerBuilder(new MatchAllQueryBuilder().boost(3.0f))) .addAggregation( terms("terms").field(TERMS_AGGS_FIELD) - .subAggregation(topHits("hits").sort(SortBuilders.scoreSort()).sort(SortBuilders.fieldSort("_type"))) + .subAggregation(topHits("hits").sort(SortBuilders.scoreSort()).sort(SortBuilders.fieldSort("_index"))) ) .get(); Terms terms = response.getAggregations().get("terms"); diff --git a/server/src/internalClusterTest/java/org/opensearch/search/fields/SearchFieldsIT.java b/server/src/internalClusterTest/java/org/opensearch/search/fields/SearchFieldsIT.java index 25782f8dc18db..941f4982af9cc 100644 --- a/server/src/internalClusterTest/java/org/opensearch/search/fields/SearchFieldsIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/search/fields/SearchFieldsIT.java @@ -471,42 +471,6 @@ public void testIdBasedScriptFields() throws Exception { assertThat(fields, equalTo(singleton("id"))); assertThat(response.getHits().getAt(i).getFields().get("id").getValue(), equalTo(Integer.toString(i))); } - - response = client().prepareSearch() - .setQuery(matchAllQuery()) - .addSort("num1", SortOrder.ASC) - .setSize(numDocs) - .addScriptField("type", new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "_fields._type.value", Collections.emptyMap())) - .get(); - - assertNoFailures(response); - - assertThat(response.getHits().getTotalHits().value, equalTo((long) numDocs)); - for (int i = 0; i < numDocs; i++) { - assertThat(response.getHits().getAt(i).getId(), equalTo(Integer.toString(i))); - Set fields = new HashSet<>(response.getHits().getAt(i).getFields().keySet()); - assertThat(fields, equalTo(singleton("type"))); - assertThat(response.getHits().getAt(i).getFields().get("type").getValue(), equalTo(MapperService.SINGLE_MAPPING_NAME)); - } - - response = client().prepareSearch() - .setQuery(matchAllQuery()) - .addSort("num1", SortOrder.ASC) - .setSize(numDocs) - .addScriptField("id", new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "_fields._id.value", Collections.emptyMap())) - .addScriptField("type", new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "_fields._type.value", Collections.emptyMap())) - .get(); - - assertNoFailures(response); - - assertThat(response.getHits().getTotalHits().value, equalTo((long) numDocs)); - for (int i = 0; i < numDocs; i++) { - assertThat(response.getHits().getAt(i).getId(), equalTo(Integer.toString(i))); - Set fields = new HashSet<>(response.getHits().getAt(i).getFields().keySet()); - assertThat(fields, equalTo(newHashSet("type", "id"))); - assertThat(response.getHits().getAt(i).getFields().get("type").getValue(), equalTo(MapperService.SINGLE_MAPPING_NAME)); - assertThat(response.getHits().getAt(i).getFields().get("id").getValue(), equalTo(Integer.toString(i))); - } } public void testScriptFieldUsingSource() throws Exception { diff --git a/server/src/main/java/org/opensearch/index/mapper/DocumentMapper.java b/server/src/main/java/org/opensearch/index/mapper/DocumentMapper.java index 0ee0a3cb9a180..0bebfa024e185 100644 --- a/server/src/main/java/org/opensearch/index/mapper/DocumentMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/DocumentMapper.java @@ -161,7 +161,6 @@ public DocumentMapper(MapperService mapperService, Mapping mapping) { final Collection deleteTombstoneMetadataFields = Arrays.asList( VersionFieldMapper.NAME, IdFieldMapper.NAME, - TypeFieldMapper.NAME, SeqNoFieldMapper.NAME, SeqNoFieldMapper.PRIMARY_TERM_NAME, SeqNoFieldMapper.TOMBSTONE_NAME diff --git a/server/src/main/java/org/opensearch/index/mapper/MapperService.java b/server/src/main/java/org/opensearch/index/mapper/MapperService.java index a92647929ff08..819df4a6f396e 100644 --- a/server/src/main/java/org/opensearch/index/mapper/MapperService.java +++ b/server/src/main/java/org/opensearch/index/mapper/MapperService.java @@ -576,11 +576,6 @@ public DocumentMapperForType documentMapperWithAutoCreate() { * Given the full name of a field, returns its {@link MappedFieldType}. */ public MappedFieldType fieldType(String fullName) { - if (fullName.equals(TypeFieldMapper.NAME)) { - String type = mapper == null ? null : mapper.type(); - return new TypeFieldMapper.TypeFieldType(type); - } - return this.mapper == null ? null : this.mapper.fieldTypes().get(fullName); } diff --git a/server/src/main/java/org/opensearch/index/mapper/TypeFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/TypeFieldMapper.java index 9adb1430b3df0..8d3f1df677040 100644 --- a/server/src/main/java/org/opensearch/index/mapper/TypeFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/TypeFieldMapper.java @@ -41,7 +41,6 @@ import org.apache.lucene.search.Query; import org.apache.lucene.util.BytesRef; import org.opensearch.common.geo.ShapeRelation; -import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.regex.Regex; import org.opensearch.common.time.DateMathParser; import org.opensearch.index.fielddata.IndexFieldData; @@ -55,17 +54,9 @@ import java.util.Objects; import java.util.function.Supplier; +// Todo: Remove TypeFieldMapper once we have NestedFieldMapper implementation public class TypeFieldMapper extends MetadataFieldMapper { - private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(TypeFieldType.class); - - public static final String TYPES_DEPRECATION_MESSAGE = "[types removal] Using the _type field " - + "in queries and aggregations is deprecated, prefer to use a field instead."; - - public static void emitTypesDeprecationWarning() { - deprecationLogger.deprecate("query_with_types", TYPES_DEPRECATION_MESSAGE); - } - public static final String NAME = "_type"; public static final String CONTENT_TYPE = "_type"; @@ -101,7 +92,6 @@ public String typeName() { @Override public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName, Supplier searchLookup) { - emitTypesDeprecationWarning(); return new ConstantIndexFieldData.Builder(type, name(), CoreValuesSourceType.BYTES); } @@ -112,13 +102,11 @@ public ValueFetcher valueFetcher(QueryShardContext context, SearchLookup lookup, @Override public Query existsQuery(QueryShardContext context) { - emitTypesDeprecationWarning(); return new MatchAllDocsQuery(); } @Override protected boolean matches(String pattern, boolean caseInsensitive, QueryShardContext context) { - emitTypesDeprecationWarning(); if (type == null) { return false; } @@ -136,7 +124,6 @@ public Query rangeQuery( DateMathParser parser, QueryShardContext context ) { - emitTypesDeprecationWarning(); BytesRef lower = (BytesRef) lowerTerm; BytesRef upper = (BytesRef) upperTerm; if (includeLower) { diff --git a/server/src/main/java/org/opensearch/indices/IndicesModule.java b/server/src/main/java/org/opensearch/indices/IndicesModule.java index e685ea52aa5ca..9a7b91f020e36 100644 --- a/server/src/main/java/org/opensearch/indices/IndicesModule.java +++ b/server/src/main/java/org/opensearch/indices/IndicesModule.java @@ -64,7 +64,6 @@ import org.opensearch.index.mapper.SeqNoFieldMapper; import org.opensearch.index.mapper.SourceFieldMapper; import org.opensearch.index.mapper.TextFieldMapper; -import org.opensearch.index.mapper.TypeFieldMapper; import org.opensearch.index.mapper.VersionFieldMapper; import org.opensearch.index.seqno.RetentionLeaseBackgroundSyncAction; import org.opensearch.index.seqno.RetentionLeaseSyncAction; @@ -185,7 +184,6 @@ private static Map initBuiltInMetadataMa builtInMetadataMappers.put(IndexFieldMapper.NAME, IndexFieldMapper.PARSER); builtInMetadataMappers.put(DataStreamFieldMapper.NAME, DataStreamFieldMapper.PARSER); builtInMetadataMappers.put(SourceFieldMapper.NAME, SourceFieldMapper.PARSER); - builtInMetadataMappers.put(TypeFieldMapper.NAME, TypeFieldMapper.PARSER); builtInMetadataMappers.put(VersionFieldMapper.NAME, VersionFieldMapper.PARSER); builtInMetadataMappers.put(SeqNoFieldMapper.NAME, SeqNoFieldMapper.PARSER); // _field_names must be added last so that it has a chance to see all the other mappers diff --git a/server/src/main/java/org/opensearch/search/lookup/LeafFieldsLookup.java b/server/src/main/java/org/opensearch/search/lookup/LeafFieldsLookup.java index 14c5dade52c87..62b040dfdc8d7 100644 --- a/server/src/main/java/org/opensearch/search/lookup/LeafFieldsLookup.java +++ b/server/src/main/java/org/opensearch/search/lookup/LeafFieldsLookup.java @@ -34,10 +34,8 @@ import org.apache.lucene.index.LeafReader; import org.opensearch.OpenSearchParseException; import org.opensearch.index.fieldvisitor.SingleFieldsVisitor; -import org.opensearch.index.mapper.DocumentMapper; import org.opensearch.index.mapper.MappedFieldType; import org.opensearch.index.mapper.MapperService; -import org.opensearch.index.mapper.TypeFieldMapper; import java.io.IOException; import java.util.ArrayList; @@ -147,22 +145,12 @@ private FieldLookup loadFieldData(String name) { cachedFieldData.put(name, data); } if (data.fields() == null) { - List values; - if (TypeFieldMapper.NAME.equals(data.fieldType().name())) { - TypeFieldMapper.emitTypesDeprecationWarning(); - values = new ArrayList<>(1); - final DocumentMapper mapper = mapperService.documentMapper(); - if (mapper != null) { - values.add(mapper.type()); - } - } else { - values = new ArrayList(2); - SingleFieldsVisitor visitor = new SingleFieldsVisitor(data.fieldType(), values); - try { - reader.document(docId, visitor); - } catch (IOException e) { - throw new OpenSearchParseException("failed to load field [{}]", e, name); - } + List values = new ArrayList<>(2); + SingleFieldsVisitor visitor = new SingleFieldsVisitor(data.fieldType(), values); + try { + reader.document(docId, visitor); + } catch (IOException e) { + throw new OpenSearchParseException("failed to load field [{}]", e, name); } data.fields(singletonMap(data.fieldType().name(), values)); } diff --git a/server/src/test/java/org/opensearch/index/engine/InternalEngineTests.java b/server/src/test/java/org/opensearch/index/engine/InternalEngineTests.java index ec177f460d606..d8d7be154b6b2 100644 --- a/server/src/test/java/org/opensearch/index/engine/InternalEngineTests.java +++ b/server/src/test/java/org/opensearch/index/engine/InternalEngineTests.java @@ -381,7 +381,7 @@ public void testSegmentsWithMergeFlag() throws Exception { } public void testSegmentsWithIndexSort() throws Exception { - Sort indexSort = new Sort(new SortedSetSortField("_type", false)); + Sort indexSort = new Sort(new SortedSetSortField("field", false)); try ( Store store = createStore(); Engine engine = createEngine(defaultSettings, store, createTempDir(), NoMergePolicy.INSTANCE, null, null, null, indexSort, null) diff --git a/server/src/test/java/org/opensearch/index/get/GetResultTests.java b/server/src/test/java/org/opensearch/index/get/GetResultTests.java index 9519b83fa54b1..03621f83e8af2 100644 --- a/server/src/test/java/org/opensearch/index/get/GetResultTests.java +++ b/server/src/test/java/org/opensearch/index/get/GetResultTests.java @@ -46,7 +46,6 @@ import org.opensearch.index.mapper.IndexFieldMapper; import org.opensearch.index.mapper.SeqNoFieldMapper; import org.opensearch.index.mapper.SourceFieldMapper; -import org.opensearch.index.mapper.TypeFieldMapper; import org.opensearch.index.mapper.VersionFieldMapper; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.RandomObjects; @@ -372,9 +371,8 @@ public static Tuple, Map> rand Map fields = new HashMap<>(numFields); Map expectedFields = new HashMap<>(numFields); // As we are using this to construct a GetResult object that already contains - // index, type, id, version, seqNo, and source fields, we need to exclude them from random fields - Predicate excludeMetaFieldFilter = field -> field.equals(TypeFieldMapper.NAME) - || field.equals(IndexFieldMapper.NAME) + // index, id, version, seqNo, and source fields, we need to exclude them from random fields + Predicate excludeMetaFieldFilter = field -> field.equals(IndexFieldMapper.NAME) || field.equals(IdFieldMapper.NAME) || field.equals(VersionFieldMapper.NAME) || field.equals(SourceFieldMapper.NAME) diff --git a/server/src/test/java/org/opensearch/index/mapper/TypeFieldMapperTests.java b/server/src/test/java/org/opensearch/index/mapper/TypeFieldMapperTests.java deleted file mode 100644 index 89eee655ca9d4..0000000000000 --- a/server/src/test/java/org/opensearch/index/mapper/TypeFieldMapperTests.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.index.mapper; - -import org.apache.lucene.index.DirectoryReader; -import org.apache.lucene.index.IndexWriter; -import org.apache.lucene.index.IndexableField; -import org.apache.lucene.index.SortedSetDocValues; -import org.apache.lucene.store.Directory; -import org.apache.lucene.util.BytesRef; -import org.opensearch.common.bytes.BytesArray; -import org.opensearch.common.compress.CompressedXContent; -import org.opensearch.common.settings.Settings; -import org.opensearch.common.xcontent.XContentType; -import org.opensearch.index.IndexService; -import org.opensearch.index.fielddata.IndexFieldDataCache; -import org.opensearch.index.fielddata.IndexOrdinalsFieldData; -import org.opensearch.index.fielddata.LeafOrdinalsFieldData; -import org.opensearch.index.mapper.MapperService.MergeReason; -import org.opensearch.indices.breaker.NoneCircuitBreakerService; -import org.opensearch.plugins.Plugin; -import org.opensearch.test.OpenSearchSingleNodeTestCase; -import org.opensearch.test.InternalSettingsPlugin; - -import java.io.IOException; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.function.Function; - -public class TypeFieldMapperTests extends OpenSearchSingleNodeTestCase { - - @Override - protected Collection> getPlugins() { - return pluginList(InternalSettingsPlugin.class); - } - - public void testDocValuesSingleType() throws Exception { - testDocValues(this::createIndex); - assertWarnings("[types removal] Using the _type field in queries and aggregations is deprecated, prefer to use a field instead."); - } - - public static void testDocValues(Function createIndex) throws IOException { - MapperService mapperService = createIndex.apply("test").mapperService(); - DocumentMapper mapper = mapperService.merge("type", new CompressedXContent("{\"type\":{}}"), MergeReason.MAPPING_UPDATE); - ParsedDocument document = mapper.parse(new SourceToParse("index", "id", new BytesArray("{}"), XContentType.JSON)); - - Directory dir = newDirectory(); - IndexWriter w = new IndexWriter(dir, newIndexWriterConfig()); - w.addDocument(document.rootDoc()); - DirectoryReader r = DirectoryReader.open(w); - w.close(); - - MappedFieldType ft = mapperService.fieldType(TypeFieldMapper.NAME); - IndexOrdinalsFieldData fd = (IndexOrdinalsFieldData) ft.fielddataBuilder( - "test", - () -> { throw new UnsupportedOperationException(); } - ).build(new IndexFieldDataCache.None(), new NoneCircuitBreakerService()); - LeafOrdinalsFieldData afd = fd.load(r.leaves().get(0)); - SortedSetDocValues values = afd.getOrdinalsValues(); - assertTrue(values.advanceExact(0)); - assertEquals(0, values.nextOrd()); - assertEquals(SortedSetDocValues.NO_MORE_ORDS, values.nextOrd()); - assertEquals(new BytesRef("type"), values.lookupOrd(0)); - r.close(); - dir.close(); - } - - public void testDefaults() throws IOException { - Settings indexSettings = Settings.EMPTY; - MapperService mapperService = createIndex("test", indexSettings).mapperService(); - DocumentMapper mapper = mapperService.merge("type", new CompressedXContent("{\"type\":{}}"), MergeReason.MAPPING_UPDATE); - ParsedDocument document = mapper.parse(new SourceToParse("index", "id", new BytesArray("{}"), XContentType.JSON)); - assertEquals(Collections.emptyList(), Arrays.asList(document.rootDoc().getFields(TypeFieldMapper.NAME))); - } -} diff --git a/server/src/test/java/org/opensearch/index/mapper/TypeFieldTypeTests.java b/server/src/test/java/org/opensearch/index/mapper/TypeFieldTypeTests.java deleted file mode 100644 index 66377a16b90d4..0000000000000 --- a/server/src/test/java/org/opensearch/index/mapper/TypeFieldTypeTests.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.index.mapper; - -import org.apache.lucene.search.MatchAllDocsQuery; -import org.apache.lucene.search.MatchNoDocsQuery; -import org.apache.lucene.search.Query; -import org.opensearch.index.query.QueryShardContext; -import org.opensearch.test.OpenSearchTestCase; -import org.mockito.Mockito; - -import java.util.Arrays; - -public class TypeFieldTypeTests extends OpenSearchTestCase { - - public void testTermsQuery() { - QueryShardContext context = Mockito.mock(QueryShardContext.class); - - TypeFieldMapper.TypeFieldType ft = new TypeFieldMapper.TypeFieldType("_doc"); - Query query = ft.termQuery("my_type", context); - assertEquals(new MatchNoDocsQuery(), query); - - query = ft.termQuery("_doc", context); - assertEquals(new MatchAllDocsQuery(), query); - - query = ft.termsQuery(Arrays.asList("_doc", "type", "foo"), context); - assertEquals(new MatchAllDocsQuery(), query); - - query = ft.termsQuery(Arrays.asList("type", "foo"), context); - assertEquals(new MatchNoDocsQuery(), query); - - query = ft.termQueryCaseInsensitive("_DOC", context); - assertEquals(new MatchAllDocsQuery(), query); - - assertWarnings("[types removal] Using the _type field in queries and aggregations is deprecated, prefer to use a field instead."); - } -} diff --git a/server/src/test/java/org/opensearch/index/query/TermQueryBuilderTests.java b/server/src/test/java/org/opensearch/index/query/TermQueryBuilderTests.java index 9cac88a256a0a..cc877c7590c6a 100644 --- a/server/src/test/java/org/opensearch/index/query/TermQueryBuilderTests.java +++ b/server/src/test/java/org/opensearch/index/query/TermQueryBuilderTests.java @@ -41,7 +41,6 @@ import org.apache.lucene.search.TermQuery; import org.opensearch.common.ParsingException; import org.opensearch.index.mapper.MappedFieldType; -import org.opensearch.index.mapper.TypeFieldMapper; import java.io.IOException; @@ -198,12 +197,6 @@ public void testParseAndSerializeBigInteger() throws IOException { assertSerialization(parsedQuery); } - public void testTypeField() throws IOException { - TermQueryBuilder builder = QueryBuilders.termQuery("_type", "value1"); - builder.doToQuery(createShardContext()); - assertWarnings(TypeFieldMapper.TYPES_DEPRECATION_MESSAGE); - } - public void testRewriteIndexQueryToMatchNone() throws IOException { TermQueryBuilder query = QueryBuilders.termQuery("_index", "does_not_exist"); QueryShardContext queryShardContext = createShardContext(); diff --git a/server/src/test/java/org/opensearch/index/query/TermsQueryBuilderTests.java b/server/src/test/java/org/opensearch/index/query/TermsQueryBuilderTests.java index ea93d7a65b951..e9a285208f1a6 100644 --- a/server/src/test/java/org/opensearch/index/query/TermsQueryBuilderTests.java +++ b/server/src/test/java/org/opensearch/index/query/TermsQueryBuilderTests.java @@ -50,7 +50,6 @@ import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentParser; import org.opensearch.index.get.GetResult; -import org.opensearch.index.mapper.TypeFieldMapper; import org.opensearch.indices.TermsLookup; import org.opensearch.test.AbstractQueryTestCase; import org.hamcrest.CoreMatchers; @@ -351,12 +350,6 @@ public void testConversion() { assertEquals(Arrays.asList(5, 42d), TermsQueryBuilder.convertBack(TermsQueryBuilder.convert(list))); } - public void testTypeField() throws IOException { - TermsQueryBuilder builder = QueryBuilders.termsQuery("_type", "value1", "value2"); - builder.doToQuery(createShardContext()); - assertWarnings(TypeFieldMapper.TYPES_DEPRECATION_MESSAGE); - } - public void testRewriteIndexQueryToMatchNone() throws IOException { TermsQueryBuilder query = new TermsQueryBuilder("_index", "does_not_exist", "also_does_not_exist"); QueryShardContext queryShardContext = createShardContext(); diff --git a/server/src/test/java/org/opensearch/index/query/WildcardQueryBuilderTests.java b/server/src/test/java/org/opensearch/index/query/WildcardQueryBuilderTests.java index c8a4207f21c25..9e99b7667f3e0 100644 --- a/server/src/test/java/org/opensearch/index/query/WildcardQueryBuilderTests.java +++ b/server/src/test/java/org/opensearch/index/query/WildcardQueryBuilderTests.java @@ -36,7 +36,6 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.WildcardQuery; import org.opensearch.common.ParsingException; -import org.opensearch.index.mapper.TypeFieldMapper; import org.opensearch.test.AbstractQueryTestCase; import java.io.IOException; @@ -150,12 +149,6 @@ public void testParseFailsWithMultipleFields() throws IOException { assertEquals("[wildcard] query doesn't support multiple fields, found [user1] and [user2]", e.getMessage()); } - public void testTypeField() throws IOException { - WildcardQueryBuilder builder = QueryBuilders.wildcardQuery("_type", "doc*"); - builder.doToQuery(createShardContext()); - assertWarnings(TypeFieldMapper.TYPES_DEPRECATION_MESSAGE); - } - public void testRewriteIndexQueryToMatchNone() throws IOException { WildcardQueryBuilder query = new WildcardQueryBuilder("_index", "does_not_exist"); QueryShardContext queryShardContext = createShardContext(); diff --git a/server/src/test/java/org/opensearch/indices/IndicesModuleTests.java b/server/src/test/java/org/opensearch/indices/IndicesModuleTests.java index c2298f60e4a2b..8123f044798bd 100644 --- a/server/src/test/java/org/opensearch/indices/IndicesModuleTests.java +++ b/server/src/test/java/org/opensearch/indices/IndicesModuleTests.java @@ -45,7 +45,6 @@ import org.opensearch.index.mapper.SeqNoFieldMapper; import org.opensearch.index.mapper.SourceFieldMapper; import org.opensearch.index.mapper.TextFieldMapper; -import org.opensearch.index.mapper.TypeFieldMapper; import org.opensearch.index.mapper.VersionFieldMapper; import org.opensearch.indices.mapper.MapperRegistry; import org.opensearch.plugins.MapperPlugin; @@ -95,7 +94,6 @@ public Map getMetadataMappers() { IndexFieldMapper.NAME, DataStreamFieldMapper.NAME, SourceFieldMapper.NAME, - TypeFieldMapper.NAME, VersionFieldMapper.NAME, SeqNoFieldMapper.NAME, FieldNamesFieldMapper.NAME }; diff --git a/server/src/test/java/org/opensearch/search/aggregations/support/ValuesSourceConfigTests.java b/server/src/test/java/org/opensearch/search/aggregations/support/ValuesSourceConfigTests.java index f866d817a7c43..33d9a63f61a35 100644 --- a/server/src/test/java/org/opensearch/search/aggregations/support/ValuesSourceConfigTests.java +++ b/server/src/test/java/org/opensearch/search/aggregations/support/ValuesSourceConfigTests.java @@ -40,7 +40,6 @@ import org.opensearch.index.IndexService; import org.opensearch.index.engine.Engine; import org.opensearch.index.fielddata.SortedBinaryDocValues; -import org.opensearch.index.mapper.TypeFieldMapper; import org.opensearch.index.query.QueryShardContext; import org.opensearch.test.OpenSearchSingleNodeTestCase; @@ -310,25 +309,6 @@ public void testUnmappedBoolean() throws Exception { } } - public void testTypeFieldDeprecation() { - IndexService indexService = createIndex("index", Settings.EMPTY, "type"); - try (Engine.Searcher searcher = indexService.getShard(0).acquireSearcher("test")) { - QueryShardContext context = indexService.newQueryShardContext(0, searcher, () -> 42L, null); - - ValuesSourceConfig config = ValuesSourceConfig.resolve( - context, - null, - TypeFieldMapper.NAME, - null, - null, - null, - null, - CoreValuesSourceType.BYTES - ); - assertWarnings(TypeFieldMapper.TYPES_DEPRECATION_MESSAGE); - } - } - public void testFieldAlias() throws Exception { IndexService indexService = createIndex("index", Settings.EMPTY, "type", "field", "type=keyword", "alias", "type=alias,path=field"); client().prepareIndex("index").setId("1").setSource("field", "value").setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE).get(); diff --git a/server/src/test/java/org/opensearch/search/fetch/subphase/FieldFetcherTests.java b/server/src/test/java/org/opensearch/search/fetch/subphase/FieldFetcherTests.java index 8147d1afb8c15..0aff1efff88ef 100644 --- a/server/src/test/java/org/opensearch/search/fetch/subphase/FieldFetcherTests.java +++ b/server/src/test/java/org/opensearch/search/fetch/subphase/FieldFetcherTests.java @@ -117,6 +117,11 @@ public void testMetadataFields() throws IOException { Map fields = fetchFields(mapperService, source, "_routing"); assertTrue(fields.isEmpty()); + + // The _type field was deprecated in 7.x and is not supported in 2.0. So the behavior + // should be the same as if the field didn't exist. + fields = fetchFields(mapperService, source, "_type"); + assertTrue(fields.isEmpty()); } public void testFetchAllFields() throws IOException { From 40edd54ab73f459d3694d52de72fa6e9dceee4b9 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 21 Apr 2022 10:13:59 -0700 Subject: [PATCH 089/514] Refactoring GatedAutoCloseable and moving RecoveryState.Timer (#2965) (#3014) * Refactoring GatedAutoCloseable to AutoCloseableRefCounted This is a part of the process of merging our feature branch - feature/segment-replication - back into main by re-PRing our changes from the feature branch. GatedAutoCloseable currently wraps a subclass of RefCounted. Segment replication adds another subclass, but this also wraps RefCounted. Both subclasses have the same shutdown hook - decRef. This change makes the superclass less generic to increase code convergence. The breakdown of the plan to merge segment-replication to main is detailed in #2355 Segment replication design proposal - #2229 Signed-off-by: Kartik Ganesh * Minor refactoring in RecoveryState This change makes two minor updates to RecoveryState - 1. The readRecoveryState API is removed because it can be replaced by an invocation of the constructor 2. The class members of the Timer inner class are changed to private, and accesses are only through the public APIs Signed-off-by: Kartik Ganesh * Update RecoveryTargetTests to test Timer subclasses deterministically This change removes the use of RandomBoolean in testing the Timer classes and creates a dedicated unit test for each. The common test logic is shared via a private method. Signed-off-by: Kartik Ganesh * Move the RecoveryState.Timer class to a top-level class This will eventually be reused across both replication use-cases - peer recovery and segment replication. Signed-off-by: Kartik Ganesh * Further update of timer tests in RecoveryTargetTests Removes a non-deterministic code path around stopping the timer, and avoids assertThat (deprecated) Signed-off-by: Kartik Ganesh * Rename to ReplicationTimer Signed-off-by: Kartik Ganesh * Remove RecoveryTargetTests assert on a running timer Trying to serialize and deserialize a running Timer instance, and then checking for equality leads to flaky test failures when the ser/deser takes time. Signed-off-by: Kartik Ganesh (cherry picked from commit c7c410a06311ea4b1ad61ca1a214ec89c898335a) Co-authored-by: Kartik Ganesh --- .../recovery/TransportRecoveryAction.java | 2 +- ...able.java => AutoCloseableRefCounted.java} | 15 +- .../common/concurrent/GatedCloseable.java | 2 +- .../recovery/PeerRecoveryTargetService.java | 7 +- .../recovery/RecoveriesCollection.java | 6 +- .../indices/recovery/RecoveryState.java | 96 ++----------- .../replication/common/ReplicationTimer.java | 97 +++++++++++++ ...java => AutoCloseableRefCountedTests.java} | 21 +-- .../indices/recovery/RecoveryTargetTests.java | 129 +++++++++--------- .../action/cat/RestRecoveryActionTests.java | 3 +- 10 files changed, 206 insertions(+), 172 deletions(-) rename server/src/main/java/org/opensearch/common/concurrent/{GatedAutoCloseable.java => AutoCloseableRefCounted.java} (57%) create mode 100644 server/src/main/java/org/opensearch/indices/replication/common/ReplicationTimer.java rename server/src/test/java/org/opensearch/common/concurrent/{GatedAutoCloseableTests.java => AutoCloseableRefCountedTests.java} (50%) diff --git a/server/src/main/java/org/opensearch/action/admin/indices/recovery/TransportRecoveryAction.java b/server/src/main/java/org/opensearch/action/admin/indices/recovery/TransportRecoveryAction.java index dd5ae31c01e56..7c3666e44f093 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/recovery/TransportRecoveryAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/recovery/TransportRecoveryAction.java @@ -87,7 +87,7 @@ public TransportRecoveryAction( @Override protected RecoveryState readShardResult(StreamInput in) throws IOException { - return RecoveryState.readRecoveryState(in); + return new RecoveryState(in); } @Override diff --git a/server/src/main/java/org/opensearch/common/concurrent/GatedAutoCloseable.java b/server/src/main/java/org/opensearch/common/concurrent/AutoCloseableRefCounted.java similarity index 57% rename from server/src/main/java/org/opensearch/common/concurrent/GatedAutoCloseable.java rename to server/src/main/java/org/opensearch/common/concurrent/AutoCloseableRefCounted.java index cb819c0320e91..795d352542881 100644 --- a/server/src/main/java/org/opensearch/common/concurrent/GatedAutoCloseable.java +++ b/server/src/main/java/org/opensearch/common/concurrent/AutoCloseableRefCounted.java @@ -13,20 +13,19 @@ package org.opensearch.common.concurrent; +import org.opensearch.common.util.concurrent.RefCounted; + /** - * Decorator class that wraps an object reference with a {@link Runnable} that is - * invoked when {@link #close()} is called. The internal {@link OneWayGate} instance ensures - * that this is invoked only once. See also {@link GatedCloseable} + * Adapter class that enables a {@link RefCounted} implementation to function like an {@link AutoCloseable}. + * The {@link #close()} API invokes {@link RefCounted#decRef()} and ensures idempotency using a {@link OneWayGate}. */ -public class GatedAutoCloseable implements AutoCloseable { +public class AutoCloseableRefCounted implements AutoCloseable { private final T ref; - private final Runnable onClose; private final OneWayGate gate; - public GatedAutoCloseable(T ref, Runnable onClose) { + public AutoCloseableRefCounted(T ref) { this.ref = ref; - this.onClose = onClose; gate = new OneWayGate(); } @@ -37,7 +36,7 @@ public T get() { @Override public void close() { if (gate.close()) { - onClose.run(); + ref.decRef(); } } } diff --git a/server/src/main/java/org/opensearch/common/concurrent/GatedCloseable.java b/server/src/main/java/org/opensearch/common/concurrent/GatedCloseable.java index d98e4cca8d561..467b5e4cfb3ea 100644 --- a/server/src/main/java/org/opensearch/common/concurrent/GatedCloseable.java +++ b/server/src/main/java/org/opensearch/common/concurrent/GatedCloseable.java @@ -21,7 +21,7 @@ /** * Decorator class that wraps an object reference with a {@link CheckedRunnable} that is * invoked when {@link #close()} is called. The internal {@link OneWayGate} instance ensures - * that this is invoked only once. See also {@link GatedAutoCloseable} + * that this is invoked only once. See also {@link AutoCloseableRefCounted} */ public class GatedCloseable implements Closeable { diff --git a/server/src/main/java/org/opensearch/indices/recovery/PeerRecoveryTargetService.java b/server/src/main/java/org/opensearch/indices/recovery/PeerRecoveryTargetService.java index d7c3421b1de93..9348988f8edcc 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/PeerRecoveryTargetService.java +++ b/server/src/main/java/org/opensearch/indices/recovery/PeerRecoveryTargetService.java @@ -70,6 +70,7 @@ import org.opensearch.index.translog.Translog; import org.opensearch.index.translog.TranslogCorruptedException; import org.opensearch.indices.recovery.RecoveriesCollection.RecoveryRef; +import org.opensearch.indices.replication.common.ReplicationTimer; import org.opensearch.tasks.Task; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.ConnectTransportException; @@ -215,7 +216,7 @@ private void doRecovery(final long recoveryId, final StartRecoveryRequest preExi final String actionName; final TransportRequest requestToSend; final StartRecoveryRequest startRequest; - final RecoveryState.Timer timer; + final ReplicationTimer timer; try (RecoveryRef recoveryRef = onGoingRecoveries.getRecovery(recoveryId)) { if (recoveryRef == null) { logger.trace("not running recovery with id [{}] - can not find it (probably finished)", recoveryId); @@ -622,9 +623,9 @@ private class RecoveryResponseHandler implements TransportResponseHandler { + public static class RecoveryRef extends AutoCloseableRefCounted { /** * Important: {@link RecoveryTarget#tryIncRef()} should * be *successfully* called on status before */ public RecoveryRef(RecoveryTarget status) { - super(status, status::decRef); + super(status); status.setLastAccessTime(); } } diff --git a/server/src/main/java/org/opensearch/indices/recovery/RecoveryState.java b/server/src/main/java/org/opensearch/indices/recovery/RecoveryState.java index d89d59e2f2c1b..9f57a0ebd4d0f 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RecoveryState.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RecoveryState.java @@ -50,6 +50,7 @@ import org.opensearch.index.shard.IndexShard; import org.opensearch.index.shard.ShardId; import org.opensearch.index.store.StoreStats; +import org.opensearch.indices.replication.common.ReplicationTimer; import java.io.IOException; import java.util.ArrayList; @@ -122,7 +123,7 @@ public static Stage fromId(byte id) { private final Index index; private final Translog translog; private final VerifyIndex verifyIndex; - private final Timer timer; + private final ReplicationTimer timer; private RecoverySource recoverySource; private ShardId shardId; @@ -149,12 +150,12 @@ public RecoveryState(ShardRouting shardRouting, DiscoveryNode targetNode, @Nulla this.index = index; translog = new Translog(); verifyIndex = new VerifyIndex(); - timer = new Timer(); + timer = new ReplicationTimer(); timer.start(); } public RecoveryState(StreamInput in) throws IOException { - timer = new Timer(in); + timer = new ReplicationTimer(in); stage = Stage.fromId(in.readByte()); shardId = new ShardId(in); recoverySource = RecoverySource.readFrom(in); @@ -256,7 +257,7 @@ public Translog getTranslog() { return translog; } - public Timer getTimer() { + public ReplicationTimer getTimer() { return timer; } @@ -280,10 +281,6 @@ public boolean getPrimary() { return primary; } - public static RecoveryState readRecoveryState(StreamInput in) throws IOException { - return new RecoveryState(in); - } - @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { @@ -291,9 +288,9 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.field(Fields.TYPE, recoverySource.getType()); builder.field(Fields.STAGE, stage.toString()); builder.field(Fields.PRIMARY, primary); - builder.timeField(Fields.START_TIME_IN_MILLIS, Fields.START_TIME, timer.startTime); - if (timer.stopTime > 0) { - builder.timeField(Fields.STOP_TIME_IN_MILLIS, Fields.STOP_TIME, timer.stopTime); + builder.timeField(Fields.START_TIME_IN_MILLIS, Fields.START_TIME, timer.startTime()); + if (timer.stopTime() > 0) { + builder.timeField(Fields.STOP_TIME_IN_MILLIS, Fields.STOP_TIME, timer.stopTime()); } builder.humanReadableField(Fields.TOTAL_TIME_IN_MILLIS, Fields.TOTAL_TIME, new TimeValue(timer.time())); @@ -375,78 +372,7 @@ static final class Fields { static final String TARGET_THROTTLE_TIME_IN_MILLIS = "target_throttle_time_in_millis"; } - public static class Timer implements Writeable { - protected long startTime = 0; - protected long startNanoTime = 0; - protected long time = -1; - protected long stopTime = 0; - - public Timer() {} - - public Timer(StreamInput in) throws IOException { - startTime = in.readVLong(); - startNanoTime = in.readVLong(); - stopTime = in.readVLong(); - time = in.readVLong(); - } - - @Override - public synchronized void writeTo(StreamOutput out) throws IOException { - out.writeVLong(startTime); - out.writeVLong(startNanoTime); - out.writeVLong(stopTime); - // write a snapshot of current time, which is not per se the time field - out.writeVLong(time()); - } - - public synchronized void start() { - assert startTime == 0 : "already started"; - startTime = System.currentTimeMillis(); - startNanoTime = System.nanoTime(); - } - - /** Returns start time in millis */ - public synchronized long startTime() { - return startTime; - } - - /** Returns elapsed time in millis, or 0 if timer was not started */ - public synchronized long time() { - if (startNanoTime == 0) { - return 0; - } - if (time >= 0) { - return time; - } - return Math.max(0, TimeValue.nsecToMSec(System.nanoTime() - startNanoTime)); - } - - /** Returns stop time in millis */ - public synchronized long stopTime() { - return stopTime; - } - - public synchronized void stop() { - assert stopTime == 0 : "already stopped"; - stopTime = Math.max(System.currentTimeMillis(), startTime); - time = TimeValue.nsecToMSec(System.nanoTime() - startNanoTime); - assert time >= 0; - } - - public synchronized void reset() { - startTime = 0; - startNanoTime = 0; - time = -1; - stopTime = 0; - } - - // for tests - public long getStartNanoTime() { - return startNanoTime; - } - } - - public static class VerifyIndex extends Timer implements ToXContentFragment, Writeable { + public static class VerifyIndex extends ReplicationTimer implements ToXContentFragment, Writeable { private volatile long checkIndexTime; public VerifyIndex() {} @@ -483,7 +409,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws } } - public static class Translog extends Timer implements ToXContentFragment, Writeable { + public static class Translog extends ReplicationTimer implements ToXContentFragment, Writeable { public static final int UNKNOWN = -1; private int recovered; @@ -819,7 +745,7 @@ public boolean isComplete() { } } - public static class Index extends Timer implements ToXContentFragment, Writeable { + public static class Index extends ReplicationTimer implements ToXContentFragment, Writeable { private final RecoveryFilesDetails fileDetails; public static final long UNKNOWN = -1L; diff --git a/server/src/main/java/org/opensearch/indices/replication/common/ReplicationTimer.java b/server/src/main/java/org/opensearch/indices/replication/common/ReplicationTimer.java new file mode 100644 index 0000000000000..976df28265d9a --- /dev/null +++ b/server/src/main/java/org/opensearch/indices/replication/common/ReplicationTimer.java @@ -0,0 +1,97 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.indices.replication.common; + +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.unit.TimeValue; + +import java.io.IOException; + +/** + * A serializable timer that is used to measure the time taken for + * file replication operations like recovery. + */ +public class ReplicationTimer implements Writeable { + private long startTime = 0; + private long startNanoTime = 0; + private long time = -1; + private long stopTime = 0; + + public ReplicationTimer() {} + + public ReplicationTimer(StreamInput in) throws IOException { + startTime = in.readVLong(); + startNanoTime = in.readVLong(); + stopTime = in.readVLong(); + time = in.readVLong(); + } + + @Override + public synchronized void writeTo(StreamOutput out) throws IOException { + out.writeVLong(startTime); + out.writeVLong(startNanoTime); + out.writeVLong(stopTime); + // write a snapshot of current time, which is not per se the time field + out.writeVLong(time()); + } + + public synchronized void start() { + assert startTime == 0 : "already started"; + startTime = System.currentTimeMillis(); + startNanoTime = System.nanoTime(); + } + + /** + * Returns start time in millis + */ + public synchronized long startTime() { + return startTime; + } + + /** + * Returns elapsed time in millis, or 0 if timer was not started + */ + public synchronized long time() { + if (startNanoTime == 0) { + return 0; + } + if (time >= 0) { + return time; + } + return Math.max(0, TimeValue.nsecToMSec(System.nanoTime() - startNanoTime)); + } + + /** + * Returns stop time in millis + */ + public synchronized long stopTime() { + return stopTime; + } + + public synchronized void stop() { + assert stopTime == 0 : "already stopped"; + stopTime = Math.max(System.currentTimeMillis(), startTime); + time = TimeValue.nsecToMSec(System.nanoTime() - startNanoTime); + assert time >= 0; + } + + public synchronized void reset() { + startTime = 0; + startNanoTime = 0; + time = -1; + stopTime = 0; + } + + // only used in tests + public long getStartNanoTime() { + return startNanoTime; + } +} diff --git a/server/src/test/java/org/opensearch/common/concurrent/GatedAutoCloseableTests.java b/server/src/test/java/org/opensearch/common/concurrent/AutoCloseableRefCountedTests.java similarity index 50% rename from server/src/test/java/org/opensearch/common/concurrent/GatedAutoCloseableTests.java rename to server/src/test/java/org/opensearch/common/concurrent/AutoCloseableRefCountedTests.java index 63058da8f163a..344368988f5ff 100644 --- a/server/src/test/java/org/opensearch/common/concurrent/GatedAutoCloseableTests.java +++ b/server/src/test/java/org/opensearch/common/concurrent/AutoCloseableRefCountedTests.java @@ -14,33 +14,36 @@ package org.opensearch.common.concurrent; import org.junit.Before; +import org.opensearch.common.util.concurrent.RefCounted; import org.opensearch.test.OpenSearchTestCase; -import java.util.concurrent.atomic.AtomicInteger; +import static org.mockito.Mockito.atMostOnce; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; -public class GatedAutoCloseableTests extends OpenSearchTestCase { +public class AutoCloseableRefCountedTests extends OpenSearchTestCase { - private AtomicInteger testRef; - private GatedAutoCloseable testObject; + private RefCounted mockRefCounted; + private AutoCloseableRefCounted testObject; @Before public void setup() { - testRef = new AtomicInteger(0); - testObject = new GatedAutoCloseable<>(testRef, testRef::incrementAndGet); + mockRefCounted = mock(RefCounted.class); + testObject = new AutoCloseableRefCounted<>(mockRefCounted); } public void testGet() { - assertEquals(0, testObject.get().get()); + assertEquals(mockRefCounted, testObject.get()); } public void testClose() { testObject.close(); - assertEquals(1, testObject.get().get()); + verify(mockRefCounted, atMostOnce()).decRef(); } public void testIdempotent() { testObject.close(); testObject.close(); - assertEquals(1, testObject.get().get()); + verify(mockRefCounted, atMostOnce()).decRef(); } } diff --git a/server/src/test/java/org/opensearch/indices/recovery/RecoveryTargetTests.java b/server/src/test/java/org/opensearch/indices/recovery/RecoveryTargetTests.java index 5d0d9bca8b3fb..dd4b17fbac5de 100644 --- a/server/src/test/java/org/opensearch/indices/recovery/RecoveryTargetTests.java +++ b/server/src/test/java/org/opensearch/indices/recovery/RecoveryTargetTests.java @@ -44,9 +44,9 @@ import org.opensearch.indices.recovery.RecoveryState.FileDetail; import org.opensearch.indices.recovery.RecoveryState.Index; import org.opensearch.indices.recovery.RecoveryState.Stage; -import org.opensearch.indices.recovery.RecoveryState.Timer; import org.opensearch.indices.recovery.RecoveryState.Translog; import org.opensearch.indices.recovery.RecoveryState.VerifyIndex; +import org.opensearch.indices.replication.common.ReplicationTimer; import org.opensearch.test.OpenSearchTestCase; import java.io.IOException; @@ -63,9 +63,7 @@ import static org.hamcrest.Matchers.closeTo; import static org.hamcrest.Matchers.either; import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.greaterThanOrEqualTo; -import static org.hamcrest.Matchers.lessThan; import static org.hamcrest.Matchers.lessThanOrEqualTo; import static org.hamcrest.Matchers.startsWith; @@ -124,72 +122,81 @@ public void run() { } } - public void testTimers() throws Throwable { - final Timer timer; - Streamer streamer; + public void testTimer() throws Throwable { AtomicBoolean stop = new AtomicBoolean(); - if (randomBoolean()) { - timer = new Timer(); - streamer = new Streamer(stop, timer) { - @Override - Timer createObj(StreamInput in) throws IOException { - return new Timer(in); - } - }; - } else if (randomBoolean()) { - timer = new Index(); - streamer = new Streamer(stop, timer) { - @Override - Timer createObj(StreamInput in) throws IOException { - return new Index(in); - } - }; - } else if (randomBoolean()) { - timer = new VerifyIndex(); - streamer = new Streamer(stop, timer) { - @Override - Timer createObj(StreamInput in) throws IOException { - return new VerifyIndex(in); - } - }; - } else { - timer = new Translog(); - streamer = new Streamer(stop, timer) { - @Override - Timer createObj(StreamInput in) throws IOException { - return new Translog(in); - } - }; - } + final ReplicationTimer timer = new ReplicationTimer(); + Streamer streamer = new Streamer<>(stop, timer) { + @Override + ReplicationTimer createObj(StreamInput in) throws IOException { + return new ReplicationTimer(in); + } + }; + doTimerTest(timer, streamer); + } + + public void testIndexTimer() throws Throwable { + AtomicBoolean stop = new AtomicBoolean(); + Index index = new Index(); + Streamer streamer = new Streamer<>(stop, index) { + @Override + Index createObj(StreamInput in) throws IOException { + return new Index(in); + } + }; + doTimerTest(index, streamer); + } + public void testVerifyIndexTimer() throws Throwable { + AtomicBoolean stop = new AtomicBoolean(); + VerifyIndex verifyIndex = new VerifyIndex(); + Streamer streamer = new Streamer<>(stop, verifyIndex) { + @Override + VerifyIndex createObj(StreamInput in) throws IOException { + return new VerifyIndex(in); + } + }; + doTimerTest(verifyIndex, streamer); + } + + public void testTranslogTimer() throws Throwable { + AtomicBoolean stop = new AtomicBoolean(); + Translog translog = new Translog(); + Streamer streamer = new Streamer<>(stop, translog) { + @Override + Translog createObj(StreamInput in) throws IOException { + return new Translog(in); + } + }; + doTimerTest(translog, streamer); + } + + private void doTimerTest(ReplicationTimer timer, Streamer streamer) throws Exception { timer.start(); - assertThat(timer.startTime(), greaterThan(0L)); - assertThat(timer.stopTime(), equalTo(0L)); - Timer lastRead = streamer.serializeDeserialize(); + assertTrue(timer.startTime() > 0); + assertEquals(0, timer.stopTime()); + ReplicationTimer lastRead = streamer.serializeDeserialize(); final long time = lastRead.time(); - assertThat(time, lessThanOrEqualTo(timer.time())); - assertBusy(() -> assertThat("timer timer should progress compared to captured one ", time, lessThan(timer.time()))); - assertThat("captured time shouldn't change", lastRead.time(), equalTo(time)); + assertBusy(() -> assertTrue("timer timer should progress compared to captured one ", time < timer.time())); + assertEquals("captured time shouldn't change", time, lastRead.time()); - if (randomBoolean()) { - timer.stop(); - assertThat(timer.stopTime(), greaterThanOrEqualTo(timer.startTime())); - assertThat(timer.time(), greaterThan(0L)); - lastRead = streamer.serializeDeserialize(); - assertThat(lastRead.startTime(), equalTo(timer.startTime())); - assertThat(lastRead.time(), equalTo(timer.time())); - assertThat(lastRead.stopTime(), equalTo(timer.stopTime())); - } + timer.stop(); + assertTrue(timer.stopTime() >= timer.startTime()); + assertTrue(timer.time() > 0); + // validate captured time + lastRead = streamer.serializeDeserialize(); + assertEquals(timer.startTime(), lastRead.startTime()); + assertEquals(timer.time(), lastRead.time()); + assertEquals(timer.stopTime(), lastRead.stopTime()); timer.reset(); - assertThat(timer.startTime(), equalTo(0L)); - assertThat(timer.time(), equalTo(0L)); - assertThat(timer.stopTime(), equalTo(0L)); + assertEquals(0, timer.startTime()); + assertEquals(0, timer.time()); + assertEquals(0, timer.stopTime()); + // validate captured time lastRead = streamer.serializeDeserialize(); - assertThat(lastRead.startTime(), equalTo(0L)); - assertThat(lastRead.time(), equalTo(0L)); - assertThat(lastRead.stopTime(), equalTo(0L)); - + assertEquals(0, lastRead.startTime()); + assertEquals(0, lastRead.time()); + assertEquals(0, lastRead.stopTime()); } public void testIndex() throws Throwable { diff --git a/server/src/test/java/org/opensearch/rest/action/cat/RestRecoveryActionTests.java b/server/src/test/java/org/opensearch/rest/action/cat/RestRecoveryActionTests.java index 7966d2961c29a..e7eb9cbf24015 100644 --- a/server/src/test/java/org/opensearch/rest/action/cat/RestRecoveryActionTests.java +++ b/server/src/test/java/org/opensearch/rest/action/cat/RestRecoveryActionTests.java @@ -45,6 +45,7 @@ import org.opensearch.index.Index; import org.opensearch.index.shard.ShardId; import org.opensearch.indices.recovery.RecoveryState; +import org.opensearch.indices.replication.common.ReplicationTimer; import org.opensearch.test.OpenSearchTestCase; import java.util.ArrayList; @@ -72,7 +73,7 @@ public void testRestRecoveryAction() { for (int i = 0; i < successfulShards; i++) { final RecoveryState state = mock(RecoveryState.class); when(state.getShardId()).thenReturn(new ShardId(new Index("index", "_na_"), i)); - final RecoveryState.Timer timer = mock(RecoveryState.Timer.class); + final ReplicationTimer timer = mock(ReplicationTimer.class); final long startTime = randomLongBetween(0, new Date().getTime()); when(timer.startTime()).thenReturn(startTime); final long time = randomLongBetween(1000000, 10 * 1000000); From 24949937989b39e0aac122221851fd90b4cc8da1 Mon Sep 17 00:00:00 2001 From: Owais Kazi Date: Thu, 21 Apr 2022 14:22:57 -0700 Subject: [PATCH 090/514] Removed binary file from linelint (#3028) Signed-off-by: Owais Kazi --- .gitignore | 3 +++ .linelint.yml | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e2cb6d8d37a82..8ea328ce2f1e9 100644 --- a/.gitignore +++ b/.gitignore @@ -56,3 +56,6 @@ testfixtures_shared/ # These are generated from .ci/jobs.t .ci/jobs/ + +# build files generated +doc-tools/missing-doclet/bin/ diff --git a/.linelint.yml b/.linelint.yml index 7b7bc162eef28..6240c8b3d7a96 100644 --- a/.linelint.yml +++ b/.linelint.yml @@ -12,7 +12,6 @@ ignore: - 'buildSrc/src/testKit/opensearch.build/NOTICE' - 'server/licenses/apache-log4j-extras-DEPENDENCIES' # Empty files - - 'doc-tools/missing-doclet/bin/main/org/opensearch/missingdoclet/MissingDoclet.class' - 'buildSrc/src/integTest/resources/org/opensearch/gradle/internal/fake_git/remote/build.gradle' - 'buildSrc/src/integTest/resources/org/opensearch/gradle/internal/fake_git/remote/distribution/archives/oss-darwin-tar/build.gradle' - 'buildSrc/src/integTest/resources/org/opensearch/gradle/internal/fake_git/remote/distribution/bwc/bugfix/build.gradle' From c7656f1de4a552c6bad9ebda66d4b23ae3b93149 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 21 Apr 2022 17:24:29 -0400 Subject: [PATCH 091/514] Add new multi_term aggregation (#2687) (#3022) Adds a new multi_term aggregation. The current implementation focuses on adding new type aggregates. Performance (latency) is suboptimal in this iteration, mainly because of brute force encoding/decoding a list of values into bucket keys. A performance improvement change will be made as a follow on. Signed-off-by: Peng Huo (cherry picked from commit 03fbca3f500d8541b4b32c1456997a8493ebe4f5) Co-authored-by: Peng Huo --- .../client/RestHighLevelClient.java | 3 + .../search.aggregation/370_multi_terms.yml | 620 ++++++++++++ .../aggregations/bucket/MultiTermsIT.java | 167 ++++ .../bucket/terms/BaseStringTermsTestCase.java | 256 +++++ .../bucket/terms/StringTermsIT.java | 239 +---- .../org/opensearch/search/SearchModule.java | 9 + .../aggregations/AggregationBuilders.java | 8 + .../bucket/terms/InternalMultiTerms.java | 440 +++++++++ .../bucket/terms/InternalTerms.java | 59 +- .../terms/MultiTermsAggregationBuilder.java | 443 +++++++++ .../terms/MultiTermsAggregationFactory.java | 163 ++++ .../bucket/terms/MultiTermsAggregator.java | 438 +++++++++ .../bucket/terms/ParsedMultiTerms.java | 77 ++ .../bucket/terms/ParsedTerms.java | 7 +- .../BaseMultiValuesSourceFieldConfig.java | 216 +++++ .../support/MultiTermsValuesSourceConfig.java | 203 ++++ .../support/MultiValuesSourceFieldConfig.java | 160 +-- .../aggregations/AggregationsTests.java | 2 + .../bucket/terms/InternalMultiTermsTests.java | 116 +++ .../MultiTermsAggregationBuilderTests.java | 182 ++++ .../terms/MultiTermsAggregatorTests.java | 909 ++++++++++++++++++ .../MultiTermsValuesSourceConfigTests.java | 65 ++ .../test/InternalAggregationTestCase.java | 3 + 23 files changed, 4378 insertions(+), 407 deletions(-) create mode 100644 rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/370_multi_terms.yml create mode 100644 server/src/internalClusterTest/java/org/opensearch/search/aggregations/bucket/MultiTermsIT.java create mode 100644 server/src/internalClusterTest/java/org/opensearch/search/aggregations/bucket/terms/BaseStringTermsTestCase.java create mode 100644 server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalMultiTerms.java create mode 100644 server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregationBuilder.java create mode 100644 server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregationFactory.java create mode 100644 server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregator.java create mode 100644 server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedMultiTerms.java create mode 100644 server/src/main/java/org/opensearch/search/aggregations/support/BaseMultiValuesSourceFieldConfig.java create mode 100644 server/src/main/java/org/opensearch/search/aggregations/support/MultiTermsValuesSourceConfig.java create mode 100644 server/src/test/java/org/opensearch/search/aggregations/bucket/terms/InternalMultiTermsTests.java create mode 100644 server/src/test/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregationBuilderTests.java create mode 100644 server/src/test/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregatorTests.java create mode 100644 server/src/test/java/org/opensearch/search/aggregations/support/MultiTermsValuesSourceConfigTests.java diff --git a/client/rest-high-level/src/main/java/org/opensearch/client/RestHighLevelClient.java b/client/rest-high-level/src/main/java/org/opensearch/client/RestHighLevelClient.java index 3eebb361fd9c4..e69ca149d697d 100644 --- a/client/rest-high-level/src/main/java/org/opensearch/client/RestHighLevelClient.java +++ b/client/rest-high-level/src/main/java/org/opensearch/client/RestHighLevelClient.java @@ -139,7 +139,9 @@ import org.opensearch.search.aggregations.bucket.sampler.InternalSampler; import org.opensearch.search.aggregations.bucket.sampler.ParsedSampler; import org.opensearch.search.aggregations.bucket.terms.LongRareTerms; +import org.opensearch.search.aggregations.bucket.terms.MultiTermsAggregationBuilder; import org.opensearch.search.aggregations.bucket.terms.ParsedLongRareTerms; +import org.opensearch.search.aggregations.bucket.terms.ParsedMultiTerms; import org.opensearch.search.aggregations.bucket.terms.ParsedSignificantLongTerms; import org.opensearch.search.aggregations.bucket.terms.ParsedSignificantStringTerms; import org.opensearch.search.aggregations.bucket.terms.ParsedStringRareTerms; @@ -2140,6 +2142,7 @@ static List getDefaultNamedXContents() { map.put(IpRangeAggregationBuilder.NAME, (p, c) -> ParsedBinaryRange.fromXContent(p, (String) c)); map.put(TopHitsAggregationBuilder.NAME, (p, c) -> ParsedTopHits.fromXContent(p, (String) c)); map.put(CompositeAggregationBuilder.NAME, (p, c) -> ParsedComposite.fromXContent(p, (String) c)); + map.put(MultiTermsAggregationBuilder.NAME, (p, c) -> ParsedMultiTerms.fromXContent(p, (String) c)); List entries = map.entrySet() .stream() .map(entry -> new NamedXContentRegistry.Entry(Aggregation.class, new ParseField(entry.getKey()), entry.getValue())) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/370_multi_terms.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/370_multi_terms.yml new file mode 100644 index 0000000000000..a0e4762ea9b53 --- /dev/null +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/370_multi_terms.yml @@ -0,0 +1,620 @@ +setup: + - do: + indices.create: + index: test_1 + body: + settings: + number_of_shards: 1 + number_of_replicas: 0 + mappings: + properties: + str: + type: keyword + ip: + type: ip + boolean: + type: boolean + integer: + type: long + double: + type: double + number: + type: long + date: + type: date + + - do: + indices.create: + index: test_2 + body: + settings: + number_of_shards: 2 + number_of_replicas: 0 + mappings: + properties: + str: + type: keyword + integer: + type: long + boolean: + type: boolean + + - do: + cluster.health: + wait_for_status: green + +--- +"Basic test": + - skip: + version: "- 2.9.99" + reason: multi_terms aggregation is introduced in 3.0.0 + + - do: + bulk: + index: test_1 + refresh: true + body: + - '{"index": {}}' + - '{"str": "a", "integer": 1}' + - '{"index": {}}' + - '{"str": "a", "integer": 2}' + - '{"index": {}}' + - '{"str": "b", "integer": 1}' + - '{"index": {}}' + - '{"str": "b", "integer": 2}' + - '{"index": {}}' + - '{"str": "a", "integer": 1}' + - '{"index": {}}' + - '{"str": "b", "integer": 1}' + + - do: + search: + index: test_1 + size: 0 + body: + aggs: + m_terms: + multi_terms: + terms: + - field: str + - field: integer + + - length: { aggregations.m_terms.buckets: 4 } + - match: { aggregations.m_terms.buckets.0.key: ["a", 1] } + - match: { aggregations.m_terms.buckets.0.key_as_string: "a|1" } + - match: { aggregations.m_terms.buckets.0.doc_count: 2 } + - match: { aggregations.m_terms.buckets.1.key: ["b", 1] } + - match: { aggregations.m_terms.buckets.1.key_as_string: "b|1" } + - match: { aggregations.m_terms.buckets.1.doc_count: 2 } + - match: { aggregations.m_terms.buckets.2.key: ["a", 2] } + - match: { aggregations.m_terms.buckets.2.key_as_string: "a|2" } + - match: { aggregations.m_terms.buckets.2.doc_count: 1 } + - match: { aggregations.m_terms.buckets.3.key: ["b", 2] } + - match: { aggregations.m_terms.buckets.3.key_as_string: "b|2" } + - match: { aggregations.m_terms.buckets.3.doc_count: 1 } + +--- +"IP test": + - skip: + version: "- 2.9.99" + reason: multi_terms aggregation is introduced in 3.0.0 + + - do: + bulk: + index: test_1 + refresh: true + body: + - '{"index": {}}' + - '{"str": "a", "ip": "::1"}' + - '{"index": {}}' + - '{"str": "a", "ip": "127.0.0.1"}' + - '{"index": {}}' + - '{"str": "b", "ip": "::1"}' + - '{"index": {}}' + - '{"str": "b", "ip": "127.0.0.1"}' + - '{"index": {}}' + - '{"str": "a", "ip": "127.0.0.1"}' + - '{"index": {}}' + - '{"str": "b", "ip": "::1"}' + + - do: + search: + index: test_1 + size: 0 + body: + aggs: + m_terms: + multi_terms: + terms: + - field: str + - field: ip + + - length: { aggregations.m_terms.buckets: 4 } + - match: { aggregations.m_terms.buckets.0.key: ["a", "127.0.0.1"] } + - match: { aggregations.m_terms.buckets.0.key_as_string: "a|127.0.0.1" } + - match: { aggregations.m_terms.buckets.0.doc_count: 2 } + - match: { aggregations.m_terms.buckets.1.key: ["b", "::1"] } + - match: { aggregations.m_terms.buckets.1.key_as_string: "b|::1" } + - match: { aggregations.m_terms.buckets.1.doc_count: 2 } + - match: { aggregations.m_terms.buckets.2.key: ["a", "::1"] } + - match: { aggregations.m_terms.buckets.2.key_as_string: "a|::1" } + - match: { aggregations.m_terms.buckets.2.doc_count: 1 } + - match: { aggregations.m_terms.buckets.3.key: ["b", "127.0.0.1"] } + - match: { aggregations.m_terms.buckets.3.key_as_string: "b|127.0.0.1" } + - match: { aggregations.m_terms.buckets.3.doc_count: 1 } + +--- +"Boolean test": + - skip: + version: "- 2.9.99" + reason: multi_terms aggregation is introduced in 3.0.0 + + - do: + bulk: + index: test_1 + refresh: true + body: + - '{"index": {}}' + - '{"str": "a", "boolean": true}' + - '{"index": {}}' + - '{"str": "a", "boolean": false}' + - '{"index": {}}' + - '{"str": "b", "boolean": false}' + - '{"index": {}}' + - '{"str": "b", "boolean": true}' + - '{"index": {}}' + - '{"str": "a", "boolean": true}' + - '{"index": {}}' + - '{"str": "b", "boolean": false}' + + - do: + search: + index: test_1 + size: 0 + body: + aggs: + m_terms: + multi_terms: + terms: + - field: str + - field: boolean + + - length: { aggregations.m_terms.buckets: 4 } + - match: { aggregations.m_terms.buckets.0.key: ["a", true] } + - match: { aggregations.m_terms.buckets.0.key_as_string: "a|true" } + - match: { aggregations.m_terms.buckets.0.doc_count: 2 } + - match: { aggregations.m_terms.buckets.1.key: ["b", false] } + - match: { aggregations.m_terms.buckets.1.key_as_string: "b|false" } + - match: { aggregations.m_terms.buckets.1.doc_count: 2 } + - match: { aggregations.m_terms.buckets.2.key: ["a", false] } + - match: { aggregations.m_terms.buckets.2.key_as_string: "a|false" } + - match: { aggregations.m_terms.buckets.2.doc_count: 1 } + - match: { aggregations.m_terms.buckets.3.key: ["b", true] } + - match: { aggregations.m_terms.buckets.3.key_as_string: "b|true" } + - match: { aggregations.m_terms.buckets.3.doc_count: 1 } + +--- +"Double test": + - skip: + version: "- 2.9.99" + reason: multi_terms aggregation is introduced in 3.0.0 + + - do: + bulk: + index: test_1 + refresh: true + body: + - '{"index": {}}' + - '{"str": "a", "double": 1234.5}' + - '{"index": {}}' + - '{"str": "a", "double": 5678.5}' + - '{"index": {}}' + - '{"str": "b", "double": 1234.5}' + - '{"index": {}}' + - '{"str": "a", "double": 1234.5}' + + - do: + search: + index: test_1 + size: 0 + body: + aggs: + m_terms: + multi_terms: + terms: + - field: str + - field: double + + - length: { aggregations.m_terms.buckets: 3 } + - match: { aggregations.m_terms.buckets.0.key: ["a", 1234.5] } + - match: { aggregations.m_terms.buckets.0.key_as_string: "a|1234.5" } + - match: { aggregations.m_terms.buckets.0.doc_count: 2 } + - match: { aggregations.m_terms.buckets.1.key: ["a", 5678.5] } + - match: { aggregations.m_terms.buckets.1.key_as_string: "a|5678.5" } + - match: { aggregations.m_terms.buckets.1.doc_count: 1 } + - match: { aggregations.m_terms.buckets.2.key: ["b", 1234.5] } + - match: { aggregations.m_terms.buckets.2.key_as_string: "b|1234.5" } + - match: { aggregations.m_terms.buckets.2.doc_count: 1 } + +--- +"Date test": + - skip: + version: "- 2.9.99" + reason: multi_terms aggregation is introduced in 3.0.0 + + - do: + bulk: + index: test_1 + refresh: true + body: + - '{"index": {}}' + - '{"str": "a", "date": "2022-03-23"}' + - '{"index": {}}' + - '{"str": "a", "date": "2022-03-25"}' + - '{"index": {}}' + - '{"str": "b", "date": "2022-03-23"}' + - '{"index": {}}' + - '{"str": "a", "date": "2022-03-23"}' + + - do: + search: + index: test_1 + size: 0 + body: + aggs: + m_terms: + multi_terms: + terms: + - field: str + - field: date + + - length: { aggregations.m_terms.buckets: 3 } + - match: { aggregations.m_terms.buckets.0.key: ["a", "2022-03-23T00:00:00.000Z"] } + - match: { aggregations.m_terms.buckets.0.key_as_string: "a|2022-03-23T00:00:00.000Z" } + - match: { aggregations.m_terms.buckets.0.doc_count: 2 } + - match: { aggregations.m_terms.buckets.1.key: ["a", "2022-03-25T00:00:00.000Z"] } + - match: { aggregations.m_terms.buckets.1.key_as_string: "a|2022-03-25T00:00:00.000Z" } + - match: { aggregations.m_terms.buckets.1.doc_count: 1 } + - match: { aggregations.m_terms.buckets.2.key: ["b", "2022-03-23T00:00:00.000Z"] } + - match: { aggregations.m_terms.buckets.2.key_as_string: "b|2022-03-23T00:00:00.000Z" } + - match: { aggregations.m_terms.buckets.2.doc_count: 1 } + +--- +"Unmapped keywords": + - skip: + version: "- 2.9.99" + reason: multi_terms aggregation is introduced in 3.0.0 + + - do: + bulk: + index: test_1 + refresh: true + body: + - '{"index": {}}' + - '{"str": "a", "integer": 1}' + - '{"index": {}}' + - '{"str": "a", "integer": 2}' + - '{"index": {}}' + - '{"str": "b", "integer": 1}' + + - do: + search: + index: test_1 + size: 0 + body: + aggs: + m_terms: + multi_terms: + terms: + - field: str + - field: unmapped_string + value_type: string + missing: abc + + - length: { aggregations.m_terms.buckets: 2 } + - match: { aggregations.m_terms.buckets.0.key: ["a", "abc"] } + - match: { aggregations.m_terms.buckets.0.key_as_string: "a|abc" } + - match: { aggregations.m_terms.buckets.0.doc_count: 2 } + - match: { aggregations.m_terms.buckets.1.key: ["b", "abc"] } + - match: { aggregations.m_terms.buckets.1.key_as_string: "b|abc" } + - match: { aggregations.m_terms.buckets.1.doc_count: 1 } + +--- +"Null value": + - skip: + version: "- 2.9.99" + reason: multi_terms aggregation is introduced in 3.0.0 + + - do: + bulk: + index: test_1 + refresh: true + body: + - '{"index": {}}' + - '{"str": "a", "integer": null}' + - '{"index": {}}' + - '{"str": "a", "integer": 2}' + - '{"index": {}}' + - '{"str": null, "integer": 1}' + + - do: + search: + index: test_1 + size: 0 + body: + aggs: + m_terms: + multi_terms: + terms: + - field: str + - field: integer + + - length: { aggregations.m_terms.buckets: 1 } + - match: { aggregations.m_terms.buckets.0.key: ["a", 2] } + - match: { aggregations.m_terms.buckets.0.key_as_string: "a|2" } + - match: { aggregations.m_terms.buckets.0.doc_count: 1 } + +--- +"multiple multi_terms bucket": + - skip: + version: "- 2.9.99" + reason: multi_terms aggregation is introduced in 3.0.0 + + - do: + bulk: + index: test_1 + refresh: true + body: + - '{"index": {}}' + - '{"str": "a", "integer": 1, "double": 1234.5, "boolean": true}' + - '{"index": {}}' + - '{"str": "a", "integer": 1, "double": 5678.9, "boolean": false}' + - '{"index": {}}' + - '{"str": "a", "integer": 1, "double": 1234.5, "boolean": true}' + - '{"index": {}}' + - '{"str": "b", "integer": 1, "double": 1234.5, "boolean": true}' + + - do: + search: + index: test_1 + size: 0 + body: + aggs: + m_terms: + multi_terms: + terms: + - field: str + - field: integer + aggs: + n_terms: + multi_terms: + terms: + - field: double + - field: boolean + + - length: { aggregations.m_terms.buckets: 2 } + - match: { aggregations.m_terms.buckets.0.key: ["a", 1] } + - match: { aggregations.m_terms.buckets.0.key_as_string: "a|1" } + - match: { aggregations.m_terms.buckets.0.doc_count: 3 } + - match: { aggregations.m_terms.buckets.0.n_terms.buckets.0.key: [1234.5, true] } + - match: { aggregations.m_terms.buckets.0.n_terms.buckets.0.key_as_string: "1234.5|true" } + - match: { aggregations.m_terms.buckets.0.n_terms.buckets.0.doc_count: 2 } + - match: { aggregations.m_terms.buckets.0.n_terms.buckets.1.key: [5678.9, false] } + - match: { aggregations.m_terms.buckets.0.n_terms.buckets.1.key_as_string: "5678.9|false" } + - match: { aggregations.m_terms.buckets.0.n_terms.buckets.1.doc_count: 1 } + - match: { aggregations.m_terms.buckets.1.key: ["b", 1] } + - match: { aggregations.m_terms.buckets.1.key_as_string: "b|1" } + - match: { aggregations.m_terms.buckets.1.doc_count: 1 } + +--- +"ordered by metrics": + - skip: + version: "- 3.0.0" + reason: multi_terms aggregation is introduced in 3.0.0 + + - do: + bulk: + index: test_1 + refresh: true + body: + - '{"index": {}}' + - '{"str": "a", "double": 1234.5, "integer": 1}' + - '{"index": {}}' + - '{"str": "b", "double": 5678.9, "integer": 2}' + - '{"index": {}}' + - '{"str": "b", "double": 5678.9, "integer": 2}' + - '{"index": {}}' + - '{"str": "a", "double": 1234.5, "integer": 1}' + + - do: + search: + index: test_1 + size: 0 + body: + aggs: + m_terms: + multi_terms: + terms: + - field: str + - field: double + order: + the_int_sum: desc + aggs: + the_int_sum: + sum: + field: integer + + - length: { aggregations.m_terms.buckets: 2 } + - match: { aggregations.m_terms.buckets.0.key: ["b", 5678.9] } + - match: { aggregations.m_terms.buckets.0.key_as_string: "b|5678.9" } + - match: { aggregations.m_terms.buckets.0.the_int_sum.value: 4.0 } + - match: { aggregations.m_terms.buckets.0.doc_count: 2 } + - match: { aggregations.m_terms.buckets.1.key: ["a", 1234.5] } + - match: { aggregations.m_terms.buckets.1.key_as_string: "a|1234.5" } + - match: { aggregations.m_terms.buckets.1.the_int_sum.value: 2.0 } + - match: { aggregations.m_terms.buckets.1.doc_count: 2 } + +--- +"top 1 ordered by metrics ": + - skip: + version: "- 2.9.99" + reason: multi_terms aggregation is introduced in 3.0.0 + + - do: + bulk: + index: test_1 + refresh: true + body: + - '{"index": {}}' + - '{"str": "a", "double": 1234.5, "integer": 1}' + - '{"index": {}}' + - '{"str": "b", "double": 5678.9, "integer": 2}' + - '{"index": {}}' + - '{"str": "b", "double": 5678.9, "integer": 2}' + - '{"index": {}}' + - '{"str": "a", "double": 1234.5, "integer": 1}' + + - do: + search: + index: test_1 + size: 0 + body: + aggs: + m_terms: + multi_terms: + terms: + - field: str + - field: double + order: + the_int_sum: desc + size: 1 + aggs: + the_int_sum: + sum: + field: integer + + - length: { aggregations.m_terms.buckets: 1 } + - match: { aggregations.m_terms.buckets.0.key: ["b", 5678.9] } + - match: { aggregations.m_terms.buckets.0.key_as_string: "b|5678.9" } + - match: { aggregations.m_terms.buckets.0.the_int_sum.value: 4.0 } + - match: { aggregations.m_terms.buckets.0.doc_count: 2 } + +--- +"min_doc_count": + - skip: + version: "- 2.9.99" + reason: multi_terms aggregation is introduced in 3.0.0 + + - do: + bulk: + index: test_1 + refresh: true + body: + - '{"index": {}}' + - '{"str": "a", "integer": 1}' + - '{"index": {}}' + - '{"str": "a", "integer": 1}' + - '{"index": {}}' + - '{"str": "b", "integer": 1}' + - '{"index": {}}' + - '{"str": "c", "integer": 1}' + + - do: + search: + index: test_1 + body: + size: 0 + query: + simple_query_string: + fields: [str] + query: a b + minimum_should_match: 1 + aggs: + m_terms: + multi_terms: + terms: + - field: str + - field: integer + min_doc_count: 2 + + - length: { aggregations.m_terms.buckets: 1 } + - match: { aggregations.m_terms.buckets.0.key: ["a", 1] } + - match: { aggregations.m_terms.buckets.0.key_as_string: "a|1" } + - match: { aggregations.m_terms.buckets.0.doc_count: 2 } + + - do: + search: + index: test_1 + body: + size: 0 + query: + simple_query_string: + fields: [str] + query: a b + minimum_should_match: 1 + aggs: + m_terms: + multi_terms: + terms: + - field: str + - field: integer + min_doc_count: 0 + + - length: { aggregations.m_terms.buckets: 3 } + - match: { aggregations.m_terms.buckets.0.key: ["a", 1] } + - match: { aggregations.m_terms.buckets.0.key_as_string: "a|1" } + - match: { aggregations.m_terms.buckets.0.doc_count: 2 } + - match: { aggregations.m_terms.buckets.1.key: ["b", 1] } + - match: { aggregations.m_terms.buckets.1.key_as_string: "b|1" } + - match: { aggregations.m_terms.buckets.1.doc_count: 1 } + - match: { aggregations.m_terms.buckets.2.key: ["c", 1] } + - match: { aggregations.m_terms.buckets.2.key_as_string: "c|1" } + - match: { aggregations.m_terms.buckets.2.doc_count: 0 } + +--- +"sum_other_doc_count": + - skip: + version: "- 2.9.99" + reason: multi_terms aggregation is introduced in 3.0.0 + + - do: + bulk: + index: test_2 + refresh: true + body: + - '{"index": {"routing": "s1"}}' + - '{"str": "a", "integer": 1}' + - '{"index": {"routing": "s1"}}' + - '{"str": "a", "integer": 1}' + - '{"index": {"routing": "s1"}}' + - '{"str": "a", "integer": 1}' + - '{"index": {"routing": "s1"}}' + - '{"str": "a", "integer": 1}' + - '{"index": {"routing": "s2"}}' + - '{"str": "b", "integer": 1}' + - '{"index": {"routing": "s2"}}' + - '{"str": "b", "integer": 1}' + - '{"index": {"routing": "s2"}}' + - '{"str": "b", "integer": 1}' + - '{"index": {"routing": "s2"}}' + - '{"str": "a", "integer": 1}' + + - do: + search: + index: test_2 + size: 0 + body: + aggs: + m_terms: + multi_terms: + size: 1 + shard_size: 1 + terms: + - field: str + - field: integer + + - length: { aggregations.m_terms.buckets: 1 } + - match: { aggregations.m_terms.sum_other_doc_count: 4 } + - match: { aggregations.m_terms.buckets.0.key: ["a", 1] } + - match: { aggregations.m_terms.buckets.0.key_as_string: "a|1" } + - match: { aggregations.m_terms.buckets.0.doc_count: 4 } diff --git a/server/src/internalClusterTest/java/org/opensearch/search/aggregations/bucket/MultiTermsIT.java b/server/src/internalClusterTest/java/org/opensearch/search/aggregations/bucket/MultiTermsIT.java new file mode 100644 index 0000000000000..7d7f80c8ac758 --- /dev/null +++ b/server/src/internalClusterTest/java/org/opensearch/search/aggregations/bucket/MultiTermsIT.java @@ -0,0 +1,167 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.search.aggregations.bucket; + +import org.opensearch.action.search.SearchResponse; +import org.opensearch.script.Script; +import org.opensearch.script.ScriptType; +import org.opensearch.search.aggregations.bucket.terms.BaseStringTermsTestCase; +import org.opensearch.search.aggregations.bucket.terms.StringTermsIT; +import org.opensearch.search.aggregations.bucket.terms.Terms; +import org.opensearch.search.aggregations.support.MultiTermsValuesSourceConfig; +import org.opensearch.search.aggregations.support.ValueType; +import org.opensearch.test.OpenSearchIntegTestCase; + +import java.util.Collections; + +import static java.util.Arrays.asList; +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.core.IsNull.notNullValue; +import static org.opensearch.search.aggregations.AggregationBuilders.multiTerms; +import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertSearchResponse; + +/** + * Extend {@link BaseStringTermsTestCase}. + */ +@OpenSearchIntegTestCase.SuiteScopeTestCase +public class MultiTermsIT extends BaseStringTermsTestCase { + + // the main purpose of this test is to make sure we're not allocating 2GB of memory per shard + public void testSizeIsZero() { + final int minDocCount = randomInt(1); + IllegalArgumentException exception = expectThrows( + IllegalArgumentException.class, + () -> client().prepareSearch("high_card_idx") + .addAggregation( + multiTerms("mterms").terms( + asList( + new MultiTermsValuesSourceConfig.Builder().setFieldName(SINGLE_VALUED_FIELD_NAME).build(), + new MultiTermsValuesSourceConfig.Builder().setFieldName(MULTI_VALUED_FIELD_NAME).build() + ) + ).minDocCount(minDocCount).size(0) + ) + .get() + ); + assertThat(exception.getMessage(), containsString("[size] must be greater than 0. Found [0] in [mterms]")); + } + + public void testSingleValuedFieldWithValueScript() throws Exception { + SearchResponse response = client().prepareSearch("idx") + .addAggregation( + multiTerms("mterms").terms( + asList( + new MultiTermsValuesSourceConfig.Builder().setFieldName("i").build(), + new MultiTermsValuesSourceConfig.Builder().setFieldName(SINGLE_VALUED_FIELD_NAME) + .setScript( + new Script( + ScriptType.INLINE, + StringTermsIT.CustomScriptPlugin.NAME, + "'foo_' + _value", + Collections.emptyMap() + ) + ) + .build() + ) + ) + ) + .get(); + + assertSearchResponse(response); + + Terms terms = response.getAggregations().get("mterms"); + assertThat(terms, notNullValue()); + assertThat(terms.getName(), equalTo("mterms")); + assertThat(terms.getBuckets().size(), equalTo(5)); + + for (int i = 0; i < 5; i++) { + Terms.Bucket bucket = terms.getBucketByKey(i + "|foo_val" + i); + assertThat(bucket, notNullValue()); + assertThat(key(bucket), equalTo(i + "|foo_val" + i)); + assertThat(bucket.getDocCount(), equalTo(1L)); + } + } + + public void testSingleValuedFieldWithScript() throws Exception { + SearchResponse response = client().prepareSearch("idx") + .addAggregation( + multiTerms("mterms").terms( + asList( + new MultiTermsValuesSourceConfig.Builder().setFieldName("i").build(), + new MultiTermsValuesSourceConfig.Builder().setScript( + new Script( + ScriptType.INLINE, + StringTermsIT.CustomScriptPlugin.NAME, + "doc['" + SINGLE_VALUED_FIELD_NAME + "'].value", + Collections.emptyMap() + ) + ).setUserValueTypeHint(ValueType.STRING).build() + ) + ) + ) + .get(); + + assertSearchResponse(response); + + Terms terms = response.getAggregations().get("mterms"); + assertThat(terms, notNullValue()); + assertThat(terms.getName(), equalTo("mterms")); + assertThat(terms.getBuckets().size(), equalTo(5)); + + for (int i = 0; i < 5; i++) { + Terms.Bucket bucket = terms.getBucketByKey(i + "|val" + i); + assertThat(bucket, notNullValue()); + assertThat(key(bucket), equalTo(i + "|val" + i)); + assertThat(bucket.getDocCount(), equalTo(1L)); + } + } + + public void testMultiValuedFieldWithValueScript() throws Exception { + SearchResponse response = client().prepareSearch("idx") + .addAggregation( + multiTerms("mterms").terms( + asList( + new MultiTermsValuesSourceConfig.Builder().setFieldName("tag").build(), + new MultiTermsValuesSourceConfig.Builder().setFieldName(MULTI_VALUED_FIELD_NAME) + .setScript( + new Script( + ScriptType.INLINE, + StringTermsIT.CustomScriptPlugin.NAME, + "_value.substring(0,3)", + Collections.emptyMap() + ) + ) + .build() + ) + ) + ) + .get(); + + assertSearchResponse(response); + + Terms terms = response.getAggregations().get("mterms"); + assertThat(terms, notNullValue()); + assertThat(terms.getName(), equalTo("mterms")); + assertThat(terms.getBuckets().size(), equalTo(2)); + + Terms.Bucket bucket = terms.getBucketByKey("more|val"); + assertThat(bucket, notNullValue()); + assertThat(key(bucket), equalTo("more|val")); + assertThat(bucket.getDocCount(), equalTo(3L)); + + bucket = terms.getBucketByKey("less|val"); + assertThat(bucket, notNullValue()); + assertThat(key(bucket), equalTo("less|val")); + assertThat(bucket.getDocCount(), equalTo(2L)); + } + + private MultiTermsValuesSourceConfig field(String name) { + return new MultiTermsValuesSourceConfig.Builder().setFieldName(name).build(); + } +} diff --git a/server/src/internalClusterTest/java/org/opensearch/search/aggregations/bucket/terms/BaseStringTermsTestCase.java b/server/src/internalClusterTest/java/org/opensearch/search/aggregations/bucket/terms/BaseStringTermsTestCase.java new file mode 100644 index 0000000000000..7775618ba5b13 --- /dev/null +++ b/server/src/internalClusterTest/java/org/opensearch/search/aggregations/bucket/terms/BaseStringTermsTestCase.java @@ -0,0 +1,256 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.search.aggregations.bucket.terms; + +import org.junit.After; +import org.junit.Before; +import org.opensearch.action.index.IndexRequestBuilder; +import org.opensearch.common.Strings; +import org.opensearch.index.fielddata.ScriptDocValues; +import org.opensearch.plugins.Plugin; +import org.opensearch.search.aggregations.AggregationTestScriptsPlugin; +import org.opensearch.search.aggregations.bucket.AbstractTermsTestCase; +import org.opensearch.test.OpenSearchIntegTestCase; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Function; + +import static org.opensearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertAcked; + +@OpenSearchIntegTestCase.SuiteScopeTestCase +public class BaseStringTermsTestCase extends AbstractTermsTestCase { + + protected static final String SINGLE_VALUED_FIELD_NAME = "s_value"; + protected static final String MULTI_VALUED_FIELD_NAME = "s_values"; + protected static Map> expectedMultiSortBuckets; + + @Override + protected Collection> nodePlugins() { + return Collections.singleton(CustomScriptPlugin.class); + } + + @Before + public void randomizeOptimizations() { + TermsAggregatorFactory.COLLECT_SEGMENT_ORDS = randomBoolean(); + TermsAggregatorFactory.REMAP_GLOBAL_ORDS = randomBoolean(); + } + + @After + public void resetOptimizations() { + TermsAggregatorFactory.COLLECT_SEGMENT_ORDS = null; + TermsAggregatorFactory.REMAP_GLOBAL_ORDS = null; + } + + public static class CustomScriptPlugin extends AggregationTestScriptsPlugin { + + @Override + protected Map, Object>> pluginScripts() { + Map, Object>> scripts = super.pluginScripts(); + + scripts.put("'foo_' + _value", vars -> "foo_" + (String) vars.get("_value")); + scripts.put("_value.substring(0,3)", vars -> ((String) vars.get("_value")).substring(0, 3)); + + scripts.put("doc['" + MULTI_VALUED_FIELD_NAME + "']", vars -> { + Map doc = (Map) vars.get("doc"); + return doc.get(MULTI_VALUED_FIELD_NAME); + }); + + scripts.put("doc['" + SINGLE_VALUED_FIELD_NAME + "'].value", vars -> { + Map doc = (Map) vars.get("doc"); + ScriptDocValues.Strings value = (ScriptDocValues.Strings) doc.get(SINGLE_VALUED_FIELD_NAME); + return value.getValue(); + }); + + scripts.put("42", vars -> 42); + + return scripts; + } + + @Override + protected Map, Object>> nonDeterministicPluginScripts() { + Map, Object>> scripts = new HashMap<>(); + + scripts.put("Math.random()", vars -> randomDouble()); + + return scripts; + } + } + + @Override + public void setupSuiteScopeCluster() throws Exception { + assertAcked( + client().admin() + .indices() + .prepareCreate("idx") + .setMapping(SINGLE_VALUED_FIELD_NAME, "type=keyword", MULTI_VALUED_FIELD_NAME, "type=keyword", "tag", "type=keyword") + .get() + ); + List builders = new ArrayList<>(); + for (int i = 0; i < 5; i++) { + builders.add( + client().prepareIndex("idx") + .setSource( + jsonBuilder().startObject() + .field(SINGLE_VALUED_FIELD_NAME, "val" + i) + .field("i", i) + .field("constant", 1) + .field("tag", i < 5 / 2 + 1 ? "more" : "less") + .startArray(MULTI_VALUED_FIELD_NAME) + .value("val" + i) + .value("val" + (i + 1)) + .endArray() + .endObject() + ) + ); + } + + getMultiSortDocs(builders); + + assertAcked( + client().admin() + .indices() + .prepareCreate("high_card_idx") + .setMapping(SINGLE_VALUED_FIELD_NAME, "type=keyword", MULTI_VALUED_FIELD_NAME, "type=keyword", "tag", "type=keyword") + .get() + ); + for (int i = 0; i < 100; i++) { + builders.add( + client().prepareIndex("high_card_idx") + .setSource( + jsonBuilder().startObject() + .field(SINGLE_VALUED_FIELD_NAME, "val" + Strings.padStart(i + "", 3, '0')) + .startArray(MULTI_VALUED_FIELD_NAME) + .value("val" + Strings.padStart(i + "", 3, '0')) + .value("val" + Strings.padStart((i + 1) + "", 3, '0')) + .endArray() + .endObject() + ) + ); + } + prepareCreate("empty_bucket_idx").setMapping(SINGLE_VALUED_FIELD_NAME, "type=integer").get(); + + for (int i = 0; i < 2; i++) { + builders.add( + client().prepareIndex("empty_bucket_idx") + .setId("" + i) + .setSource(jsonBuilder().startObject().field(SINGLE_VALUED_FIELD_NAME, i * 2).endObject()) + ); + } + indexRandom(true, builders); + createIndex("idx_unmapped"); + ensureSearchable(); + } + + private void getMultiSortDocs(List builders) throws IOException { + expectedMultiSortBuckets = new HashMap<>(); + Map bucketProps = new HashMap<>(); + bucketProps.put("_term", "val1"); + bucketProps.put("_count", 3L); + bucketProps.put("avg_l", 1d); + bucketProps.put("sum_d", 6d); + expectedMultiSortBuckets.put((String) bucketProps.get("_term"), bucketProps); + bucketProps = new HashMap<>(); + bucketProps.put("_term", "val2"); + bucketProps.put("_count", 3L); + bucketProps.put("avg_l", 2d); + bucketProps.put("sum_d", 6d); + expectedMultiSortBuckets.put((String) bucketProps.get("_term"), bucketProps); + bucketProps = new HashMap<>(); + bucketProps.put("_term", "val3"); + bucketProps.put("_count", 2L); + bucketProps.put("avg_l", 3d); + bucketProps.put("sum_d", 3d); + expectedMultiSortBuckets.put((String) bucketProps.get("_term"), bucketProps); + bucketProps = new HashMap<>(); + bucketProps.put("_term", "val4"); + bucketProps.put("_count", 2L); + bucketProps.put("avg_l", 3d); + bucketProps.put("sum_d", 4d); + expectedMultiSortBuckets.put((String) bucketProps.get("_term"), bucketProps); + bucketProps = new HashMap<>(); + bucketProps.put("_term", "val5"); + bucketProps.put("_count", 2L); + bucketProps.put("avg_l", 5d); + bucketProps.put("sum_d", 3d); + expectedMultiSortBuckets.put((String) bucketProps.get("_term"), bucketProps); + bucketProps = new HashMap<>(); + bucketProps.put("_term", "val6"); + bucketProps.put("_count", 1L); + bucketProps.put("avg_l", 5d); + bucketProps.put("sum_d", 1d); + expectedMultiSortBuckets.put((String) bucketProps.get("_term"), bucketProps); + bucketProps = new HashMap<>(); + bucketProps.put("_term", "val7"); + bucketProps.put("_count", 1L); + bucketProps.put("avg_l", 5d); + bucketProps.put("sum_d", 1d); + expectedMultiSortBuckets.put((String) bucketProps.get("_term"), bucketProps); + + assertAcked( + client().admin() + .indices() + .prepareCreate("sort_idx") + .setMapping(SINGLE_VALUED_FIELD_NAME, "type=keyword", MULTI_VALUED_FIELD_NAME, "type=keyword", "tag", "type=keyword") + .get() + ); + for (int i = 1; i <= 3; i++) { + builders.add( + client().prepareIndex("sort_idx") + .setSource(jsonBuilder().startObject().field(SINGLE_VALUED_FIELD_NAME, "val1").field("l", 1).field("d", i).endObject()) + ); + builders.add( + client().prepareIndex("sort_idx") + .setSource(jsonBuilder().startObject().field(SINGLE_VALUED_FIELD_NAME, "val2").field("l", 2).field("d", i).endObject()) + ); + } + builders.add( + client().prepareIndex("sort_idx") + .setSource(jsonBuilder().startObject().field(SINGLE_VALUED_FIELD_NAME, "val3").field("l", 3).field("d", 1).endObject()) + ); + builders.add( + client().prepareIndex("sort_idx") + .setSource(jsonBuilder().startObject().field(SINGLE_VALUED_FIELD_NAME, "val3").field("l", 3).field("d", 2).endObject()) + ); + builders.add( + client().prepareIndex("sort_idx") + .setSource(jsonBuilder().startObject().field(SINGLE_VALUED_FIELD_NAME, "val4").field("l", 3).field("d", 1).endObject()) + ); + builders.add( + client().prepareIndex("sort_idx") + .setSource(jsonBuilder().startObject().field(SINGLE_VALUED_FIELD_NAME, "val4").field("l", 3).field("d", 3).endObject()) + ); + builders.add( + client().prepareIndex("sort_idx") + .setSource(jsonBuilder().startObject().field(SINGLE_VALUED_FIELD_NAME, "val5").field("l", 5).field("d", 1).endObject()) + ); + builders.add( + client().prepareIndex("sort_idx") + .setSource(jsonBuilder().startObject().field(SINGLE_VALUED_FIELD_NAME, "val5").field("l", 5).field("d", 2).endObject()) + ); + builders.add( + client().prepareIndex("sort_idx") + .setSource(jsonBuilder().startObject().field(SINGLE_VALUED_FIELD_NAME, "val6").field("l", 5).field("d", 1).endObject()) + ); + builders.add( + client().prepareIndex("sort_idx") + .setSource(jsonBuilder().startObject().field(SINGLE_VALUED_FIELD_NAME, "val7").field("l", 5).field("d", 1).endObject()) + ); + } + + protected String key(Terms.Bucket bucket) { + return bucket.getKeyAsString(); + } +} diff --git a/server/src/internalClusterTest/java/org/opensearch/search/aggregations/bucket/terms/StringTermsIT.java b/server/src/internalClusterTest/java/org/opensearch/search/aggregations/bucket/terms/StringTermsIT.java index 3190bcb72fcbb..64f81cdcdec98 100644 --- a/server/src/internalClusterTest/java/org/opensearch/search/aggregations/bucket/terms/StringTermsIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/search/aggregations/bucket/terms/StringTermsIT.java @@ -32,25 +32,19 @@ package org.opensearch.search.aggregations.bucket.terms; import org.opensearch.OpenSearchException; -import org.opensearch.action.index.IndexRequestBuilder; import org.opensearch.action.search.SearchPhaseExecutionException; import org.opensearch.action.search.SearchResponse; -import org.opensearch.common.Strings; import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.XContentParseException; import org.opensearch.common.xcontent.XContentParser; import org.opensearch.common.xcontent.json.JsonXContent; -import org.opensearch.index.fielddata.ScriptDocValues; import org.opensearch.index.mapper.IndexFieldMapper; import org.opensearch.index.query.QueryBuilders; -import org.opensearch.plugins.Plugin; import org.opensearch.script.Script; import org.opensearch.script.ScriptType; import org.opensearch.search.aggregations.AggregationExecutionException; -import org.opensearch.search.aggregations.AggregationTestScriptsPlugin; import org.opensearch.search.aggregations.Aggregator.SubAggCollectionMode; import org.opensearch.search.aggregations.BucketOrder; -import org.opensearch.search.aggregations.bucket.AbstractTermsTestCase; import org.opensearch.search.aggregations.bucket.filter.Filter; import org.opensearch.search.aggregations.bucket.terms.Terms.Bucket; import org.opensearch.search.aggregations.metrics.Avg; @@ -60,23 +54,13 @@ import org.opensearch.search.aggregations.support.ValueType; import org.opensearch.search.builder.SearchSourceBuilder; import org.opensearch.test.OpenSearchIntegTestCase; -import org.junit.After; -import org.junit.Before; -import java.io.IOException; -import java.util.ArrayList; import java.util.Arrays; -import java.util.Collection; import java.util.Collections; -import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; -import java.util.List; -import java.util.Map; import java.util.Set; -import java.util.function.Function; -import static org.opensearch.common.xcontent.XContentFactory.jsonBuilder; import static org.opensearch.index.query.QueryBuilders.termQuery; import static org.opensearch.search.aggregations.AggregationBuilders.avg; import static org.opensearch.search.aggregations.AggregationBuilders.extendedStats; @@ -93,228 +77,7 @@ import static org.hamcrest.core.IsNull.notNullValue; @OpenSearchIntegTestCase.SuiteScopeTestCase -public class StringTermsIT extends AbstractTermsTestCase { - - private static final String SINGLE_VALUED_FIELD_NAME = "s_value"; - private static final String MULTI_VALUED_FIELD_NAME = "s_values"; - private static Map> expectedMultiSortBuckets; - - @Override - protected Collection> nodePlugins() { - return Collections.singleton(CustomScriptPlugin.class); - } - - @Before - public void randomizeOptimizations() { - TermsAggregatorFactory.COLLECT_SEGMENT_ORDS = randomBoolean(); - TermsAggregatorFactory.REMAP_GLOBAL_ORDS = randomBoolean(); - } - - @After - public void resetOptimizations() { - TermsAggregatorFactory.COLLECT_SEGMENT_ORDS = null; - TermsAggregatorFactory.REMAP_GLOBAL_ORDS = null; - } - - public static class CustomScriptPlugin extends AggregationTestScriptsPlugin { - - @Override - protected Map, Object>> pluginScripts() { - Map, Object>> scripts = super.pluginScripts(); - - scripts.put("'foo_' + _value", vars -> "foo_" + (String) vars.get("_value")); - scripts.put("_value.substring(0,3)", vars -> ((String) vars.get("_value")).substring(0, 3)); - - scripts.put("doc['" + MULTI_VALUED_FIELD_NAME + "']", vars -> { - Map doc = (Map) vars.get("doc"); - return doc.get(MULTI_VALUED_FIELD_NAME); - }); - - scripts.put("doc['" + SINGLE_VALUED_FIELD_NAME + "'].value", vars -> { - Map doc = (Map) vars.get("doc"); - ScriptDocValues.Strings value = (ScriptDocValues.Strings) doc.get(SINGLE_VALUED_FIELD_NAME); - return value.getValue(); - }); - - scripts.put("42", vars -> 42); - - return scripts; - } - - @Override - protected Map, Object>> nonDeterministicPluginScripts() { - Map, Object>> scripts = new HashMap<>(); - - scripts.put("Math.random()", vars -> StringTermsIT.randomDouble()); - - return scripts; - } - } - - @Override - public void setupSuiteScopeCluster() throws Exception { - assertAcked( - client().admin() - .indices() - .prepareCreate("idx") - .setMapping(SINGLE_VALUED_FIELD_NAME, "type=keyword", MULTI_VALUED_FIELD_NAME, "type=keyword", "tag", "type=keyword") - .get() - ); - List builders = new ArrayList<>(); - for (int i = 0; i < 5; i++) { - builders.add( - client().prepareIndex("idx") - .setSource( - jsonBuilder().startObject() - .field(SINGLE_VALUED_FIELD_NAME, "val" + i) - .field("i", i) - .field("constant", 1) - .field("tag", i < 5 / 2 + 1 ? "more" : "less") - .startArray(MULTI_VALUED_FIELD_NAME) - .value("val" + i) - .value("val" + (i + 1)) - .endArray() - .endObject() - ) - ); - } - - getMultiSortDocs(builders); - - assertAcked( - client().admin() - .indices() - .prepareCreate("high_card_idx") - .setMapping(SINGLE_VALUED_FIELD_NAME, "type=keyword", MULTI_VALUED_FIELD_NAME, "type=keyword", "tag", "type=keyword") - .get() - ); - for (int i = 0; i < 100; i++) { - builders.add( - client().prepareIndex("high_card_idx") - .setSource( - jsonBuilder().startObject() - .field(SINGLE_VALUED_FIELD_NAME, "val" + Strings.padStart(i + "", 3, '0')) - .startArray(MULTI_VALUED_FIELD_NAME) - .value("val" + Strings.padStart(i + "", 3, '0')) - .value("val" + Strings.padStart((i + 1) + "", 3, '0')) - .endArray() - .endObject() - ) - ); - } - prepareCreate("empty_bucket_idx").setMapping(SINGLE_VALUED_FIELD_NAME, "type=integer").get(); - - for (int i = 0; i < 2; i++) { - builders.add( - client().prepareIndex("empty_bucket_idx") - .setId("" + i) - .setSource(jsonBuilder().startObject().field(SINGLE_VALUED_FIELD_NAME, i * 2).endObject()) - ); - } - indexRandom(true, builders); - createIndex("idx_unmapped"); - ensureSearchable(); - } - - private void getMultiSortDocs(List builders) throws IOException { - expectedMultiSortBuckets = new HashMap<>(); - Map bucketProps = new HashMap<>(); - bucketProps.put("_term", "val1"); - bucketProps.put("_count", 3L); - bucketProps.put("avg_l", 1d); - bucketProps.put("sum_d", 6d); - expectedMultiSortBuckets.put((String) bucketProps.get("_term"), bucketProps); - bucketProps = new HashMap<>(); - bucketProps.put("_term", "val2"); - bucketProps.put("_count", 3L); - bucketProps.put("avg_l", 2d); - bucketProps.put("sum_d", 6d); - expectedMultiSortBuckets.put((String) bucketProps.get("_term"), bucketProps); - bucketProps = new HashMap<>(); - bucketProps.put("_term", "val3"); - bucketProps.put("_count", 2L); - bucketProps.put("avg_l", 3d); - bucketProps.put("sum_d", 3d); - expectedMultiSortBuckets.put((String) bucketProps.get("_term"), bucketProps); - bucketProps = new HashMap<>(); - bucketProps.put("_term", "val4"); - bucketProps.put("_count", 2L); - bucketProps.put("avg_l", 3d); - bucketProps.put("sum_d", 4d); - expectedMultiSortBuckets.put((String) bucketProps.get("_term"), bucketProps); - bucketProps = new HashMap<>(); - bucketProps.put("_term", "val5"); - bucketProps.put("_count", 2L); - bucketProps.put("avg_l", 5d); - bucketProps.put("sum_d", 3d); - expectedMultiSortBuckets.put((String) bucketProps.get("_term"), bucketProps); - bucketProps = new HashMap<>(); - bucketProps.put("_term", "val6"); - bucketProps.put("_count", 1L); - bucketProps.put("avg_l", 5d); - bucketProps.put("sum_d", 1d); - expectedMultiSortBuckets.put((String) bucketProps.get("_term"), bucketProps); - bucketProps = new HashMap<>(); - bucketProps.put("_term", "val7"); - bucketProps.put("_count", 1L); - bucketProps.put("avg_l", 5d); - bucketProps.put("sum_d", 1d); - expectedMultiSortBuckets.put((String) bucketProps.get("_term"), bucketProps); - - assertAcked( - client().admin() - .indices() - .prepareCreate("sort_idx") - .setMapping(SINGLE_VALUED_FIELD_NAME, "type=keyword", MULTI_VALUED_FIELD_NAME, "type=keyword", "tag", "type=keyword") - .get() - ); - for (int i = 1; i <= 3; i++) { - builders.add( - client().prepareIndex("sort_idx") - .setSource(jsonBuilder().startObject().field(SINGLE_VALUED_FIELD_NAME, "val1").field("l", 1).field("d", i).endObject()) - ); - builders.add( - client().prepareIndex("sort_idx") - .setSource(jsonBuilder().startObject().field(SINGLE_VALUED_FIELD_NAME, "val2").field("l", 2).field("d", i).endObject()) - ); - } - builders.add( - client().prepareIndex("sort_idx") - .setSource(jsonBuilder().startObject().field(SINGLE_VALUED_FIELD_NAME, "val3").field("l", 3).field("d", 1).endObject()) - ); - builders.add( - client().prepareIndex("sort_idx") - .setSource(jsonBuilder().startObject().field(SINGLE_VALUED_FIELD_NAME, "val3").field("l", 3).field("d", 2).endObject()) - ); - builders.add( - client().prepareIndex("sort_idx") - .setSource(jsonBuilder().startObject().field(SINGLE_VALUED_FIELD_NAME, "val4").field("l", 3).field("d", 1).endObject()) - ); - builders.add( - client().prepareIndex("sort_idx") - .setSource(jsonBuilder().startObject().field(SINGLE_VALUED_FIELD_NAME, "val4").field("l", 3).field("d", 3).endObject()) - ); - builders.add( - client().prepareIndex("sort_idx") - .setSource(jsonBuilder().startObject().field(SINGLE_VALUED_FIELD_NAME, "val5").field("l", 5).field("d", 1).endObject()) - ); - builders.add( - client().prepareIndex("sort_idx") - .setSource(jsonBuilder().startObject().field(SINGLE_VALUED_FIELD_NAME, "val5").field("l", 5).field("d", 2).endObject()) - ); - builders.add( - client().prepareIndex("sort_idx") - .setSource(jsonBuilder().startObject().field(SINGLE_VALUED_FIELD_NAME, "val6").field("l", 5).field("d", 1).endObject()) - ); - builders.add( - client().prepareIndex("sort_idx") - .setSource(jsonBuilder().startObject().field(SINGLE_VALUED_FIELD_NAME, "val7").field("l", 5).field("d", 1).endObject()) - ); - } - - private String key(Terms.Bucket bucket) { - return bucket.getKeyAsString(); - } +public class StringTermsIT extends BaseStringTermsTestCase { // the main purpose of this test is to make sure we're not allocating 2GB of memory per shard public void testSizeIsZero() { diff --git a/server/src/main/java/org/opensearch/search/SearchModule.java b/server/src/main/java/org/opensearch/search/SearchModule.java index dc5309b50abb8..bf0cc646d271e 100644 --- a/server/src/main/java/org/opensearch/search/SearchModule.java +++ b/server/src/main/java/org/opensearch/search/SearchModule.java @@ -159,8 +159,11 @@ import org.opensearch.search.aggregations.bucket.sampler.SamplerAggregationBuilder; import org.opensearch.search.aggregations.bucket.sampler.UnmappedSampler; import org.opensearch.search.aggregations.bucket.terms.DoubleTerms; +import org.opensearch.search.aggregations.bucket.terms.InternalMultiTerms; import org.opensearch.search.aggregations.bucket.terms.LongRareTerms; import org.opensearch.search.aggregations.bucket.terms.LongTerms; +import org.opensearch.search.aggregations.bucket.terms.MultiTermsAggregationBuilder; +import org.opensearch.search.aggregations.bucket.terms.MultiTermsAggregationFactory; import org.opensearch.search.aggregations.bucket.terms.RareTermsAggregationBuilder; import org.opensearch.search.aggregations.bucket.terms.SignificantLongTerms; import org.opensearch.search.aggregations.bucket.terms.SignificantStringTerms; @@ -687,6 +690,12 @@ private ValuesSourceRegistry registerAggregations(List plugins) { .setAggregatorRegistrar(CompositeAggregationBuilder::registerAggregators), builder ); + registerAggregation( + new AggregationSpec(MultiTermsAggregationBuilder.NAME, MultiTermsAggregationBuilder::new, MultiTermsAggregationBuilder.PARSER) + .addResultReader(InternalMultiTerms::new) + .setAggregatorRegistrar(MultiTermsAggregationFactory::registerAggregators), + builder + ); registerFromPlugin(plugins, SearchPlugin::getAggregations, (agg) -> this.registerAggregation(agg, builder)); // after aggs have been registered, see if there are any new VSTypes that need to be linked to core fields diff --git a/server/src/main/java/org/opensearch/search/aggregations/AggregationBuilders.java b/server/src/main/java/org/opensearch/search/aggregations/AggregationBuilders.java index 99a1107675edf..69a9fd92ac459 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/AggregationBuilders.java +++ b/server/src/main/java/org/opensearch/search/aggregations/AggregationBuilders.java @@ -66,6 +66,7 @@ import org.opensearch.search.aggregations.bucket.sampler.DiversifiedAggregationBuilder; import org.opensearch.search.aggregations.bucket.sampler.Sampler; import org.opensearch.search.aggregations.bucket.sampler.SamplerAggregationBuilder; +import org.opensearch.search.aggregations.bucket.terms.MultiTermsAggregationBuilder; import org.opensearch.search.aggregations.bucket.terms.SignificantTerms; import org.opensearch.search.aggregations.bucket.terms.SignificantTermsAggregationBuilder; import org.opensearch.search.aggregations.bucket.terms.SignificantTextAggregationBuilder; @@ -388,4 +389,11 @@ public static ScriptedMetricAggregationBuilder scriptedMetric(String name) { public static CompositeAggregationBuilder composite(String name, List> sources) { return new CompositeAggregationBuilder(name, sources); } + + /** + * Create a new {@link MultiTermsAggregationBuilder} aggregation with the given name. + */ + public static MultiTermsAggregationBuilder multiTerms(String name) { + return new MultiTermsAggregationBuilder(name); + } } diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalMultiTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalMultiTerms.java new file mode 100644 index 0000000000000..fd1758d3ea8ba --- /dev/null +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalMultiTerms.java @@ -0,0 +1,440 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.search.aggregations.bucket.terms; + +import org.apache.lucene.util.BytesRef; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.search.DocValueFormat; +import org.opensearch.search.aggregations.AggregationExecutionException; +import org.opensearch.search.aggregations.Aggregations; +import org.opensearch.search.aggregations.BucketOrder; +import org.opensearch.search.aggregations.InternalAggregations; +import org.opensearch.search.aggregations.KeyComparable; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * Result of the {@link MultiTermsAggregator}. + */ +public class InternalMultiTerms extends InternalTerms { + /** + * Internal Multi Terms Bucket. + */ + public static class Bucket extends InternalTerms.AbstractInternalBucket implements KeyComparable { + + protected long bucketOrd; + /** + * list of terms values. + */ + protected List termValues; + protected long docCount; + protected InternalAggregations aggregations; + protected boolean showDocCountError; + protected long docCountError; + /** + * A list of term's {@link DocValueFormat}. + */ + protected final List termFormats; + + private static final String PIPE = "|"; + + /** + * Create default {@link Bucket}. + */ + public static Bucket EMPTY(boolean showTermDocCountError, List formats) { + return new Bucket(null, 0, null, showTermDocCountError, 0, formats); + } + + public Bucket( + List values, + long docCount, + InternalAggregations aggregations, + boolean showDocCountError, + long docCountError, + List formats + ) { + this.termValues = values; + this.docCount = docCount; + this.aggregations = aggregations; + this.showDocCountError = showDocCountError; + this.docCountError = docCountError; + this.termFormats = formats; + } + + public Bucket(StreamInput in, List formats, boolean showDocCountError) throws IOException { + this.termValues = in.readList(StreamInput::readGenericValue); + this.docCount = in.readVLong(); + this.aggregations = InternalAggregations.readFrom(in); + this.showDocCountError = showDocCountError; + this.docCountError = -1; + if (showDocCountError) { + this.docCountError = in.readLong(); + } + this.termFormats = formats; + } + + @Override + public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { + builder.startObject(); + builder.field(CommonFields.KEY.getPreferredName(), getKey()); + builder.field(CommonFields.KEY_AS_STRING.getPreferredName(), getKeyAsString()); + builder.field(CommonFields.DOC_COUNT.getPreferredName(), getDocCount()); + if (showDocCountError) { + builder.field(DOC_COUNT_ERROR_UPPER_BOUND_FIELD_NAME.getPreferredName(), getDocCountError()); + } + aggregations.toXContentInternal(builder, params); + builder.endObject(); + return builder; + } + + @Override + public void writeTo(StreamOutput out) throws IOException { + out.writeCollection(termValues, StreamOutput::writeGenericValue); + out.writeVLong(docCount); + aggregations.writeTo(out); + if (showDocCountError) { + out.writeLong(docCountError); + } + } + + @Override + public List getKey() { + List keys = new ArrayList<>(termValues.size()); + for (int i = 0; i < termValues.size(); i++) { + keys.add(formatObject(termValues.get(i), termFormats.get(i))); + } + return keys; + } + + @Override + public String getKeyAsString() { + return getKey().stream().map(Object::toString).collect(Collectors.joining(PIPE)); + } + + @Override + public long getDocCount() { + return docCount; + } + + @Override + public Aggregations getAggregations() { + return aggregations; + } + + @Override + void setDocCountError(long docCountError) { + this.docCountError = docCountError; + } + + @Override + public void setDocCountError(Function updater) { + this.docCountError = updater.apply(this.docCountError); + } + + @Override + public boolean showDocCountError() { + return showDocCountError; + } + + @Override + public Number getKeyAsNumber() { + throw new IllegalArgumentException("getKeyAsNumber is not supported by [" + MultiTermsAggregationBuilder.NAME + "]"); + } + + @Override + public long getDocCountError() { + if (!showDocCountError) { + throw new IllegalStateException("show_terms_doc_count_error is false"); + } + return docCountError; + } + + @Override + public boolean equals(Object obj) { + if (obj == null || getClass() != obj.getClass()) { + return false; + } + Bucket other = (Bucket) obj; + if (showDocCountError && docCountError != other.docCountError) { + return false; + } + return termValues.equals(other.termValues) + && docCount == other.docCount + && aggregations.equals(other.aggregations) + && showDocCountError == other.showDocCountError; + } + + @Override + public int hashCode() { + return Objects.hash(termValues, docCount, aggregations, showDocCountError, showDocCountError ? docCountError : 0); + } + + @Override + public int compareKey(Bucket other) { + return new BucketComparator().compare(this.termValues, other.termValues); + } + + /** + * Visible for testing. + */ + protected static class BucketComparator implements Comparator> { + @SuppressWarnings({ "unchecked" }) + @Override + public int compare(List thisObjects, List thatObjects) { + if (thisObjects.size() != thatObjects.size()) { + throw new AggregationExecutionException( + "[" + MultiTermsAggregationBuilder.NAME + "] aggregations failed due to terms" + " size is different" + ); + } + for (int i = 0; i < thisObjects.size(); i++) { + final Object thisObject = thisObjects.get(i); + final Object thatObject = thatObjects.get(i); + int ret = ((Comparable) thisObject).compareTo(thatObject); + if (ret != 0) { + return ret; + } + } + return 0; + } + } + } + + private final int shardSize; + private final boolean showTermDocCountError; + private final long otherDocCount; + private final List termFormats; + private final List buckets; + private Map bucketMap; + + private long docCountError; + + public InternalMultiTerms( + String name, + BucketOrder reduceOrder, + BucketOrder order, + int requiredSize, + long minDocCount, + Map metadata, + int shardSize, + boolean showTermDocCountError, + long otherDocCount, + long docCountError, + List formats, + List buckets + ) { + super(name, reduceOrder, order, requiredSize, minDocCount, metadata); + this.shardSize = shardSize; + this.showTermDocCountError = showTermDocCountError; + this.otherDocCount = otherDocCount; + this.termFormats = formats; + this.buckets = buckets; + this.docCountError = docCountError; + } + + public InternalMultiTerms(StreamInput in) throws IOException { + super(in); + this.docCountError = in.readZLong(); + this.termFormats = in.readList(stream -> stream.readNamedWriteable(DocValueFormat.class)); + this.shardSize = readSize(in); + this.showTermDocCountError = in.readBoolean(); + this.otherDocCount = in.readVLong(); + this.buckets = in.readList(steam -> new Bucket(steam, termFormats, showTermDocCountError)); + } + + @Override + public String getWriteableName() { + return MultiTermsAggregationBuilder.NAME; + } + + @Override + public XContentBuilder doXContentBody(XContentBuilder builder, Params params) throws IOException { + return doXContentCommon(builder, params, docCountError, otherDocCount, buckets); + } + + @Override + public InternalMultiTerms create(List buckets) { + return new InternalMultiTerms( + name, + reduceOrder, + order, + requiredSize, + minDocCount, + metadata, + shardSize, + showTermDocCountError, + otherDocCount, + docCountError, + termFormats, + buckets + ); + } + + @Override + public Bucket createBucket(InternalAggregations aggregations, Bucket prototype) { + return new Bucket( + prototype.termValues, + prototype.docCount, + aggregations, + prototype.showDocCountError, + prototype.docCountError, + prototype.termFormats + ); + } + + @Override + protected void writeTermTypeInfoTo(StreamOutput out) throws IOException { + out.writeZLong(docCountError); + out.writeCollection(termFormats, StreamOutput::writeNamedWriteable); + writeSize(shardSize, out); + out.writeBoolean(showTermDocCountError); + out.writeVLong(otherDocCount); + out.writeList(buckets); + } + + @Override + public List getBuckets() { + return buckets; + } + + @Override + public Bucket getBucketByKey(String term) { + if (bucketMap == null) { + bucketMap = buckets.stream().collect(Collectors.toMap(InternalMultiTerms.Bucket::getKeyAsString, Function.identity())); + } + return bucketMap.get(term); + } + + @Override + public long getDocCountError() { + return docCountError; + } + + @Override + public long getSumOfOtherDocCounts() { + return otherDocCount; + } + + @Override + protected void setDocCountError(long docCountError) { + this.docCountError = docCountError; + } + + @Override + protected int getShardSize() { + return shardSize; + } + + @Override + protected InternalMultiTerms create( + String name, + List buckets, + BucketOrder reduceOrder, + long docCountError, + long otherDocCount + ) { + return new InternalMultiTerms( + name, + reduceOrder, + order, + requiredSize, + minDocCount, + metadata, + shardSize, + showTermDocCountError, + otherDocCount, + docCountError, + termFormats, + buckets + ); + } + + @Override + protected Bucket[] createBucketsArray(int size) { + return new Bucket[size]; + } + + @Override + Bucket createBucket(long docCount, InternalAggregations aggs, long docCountError, Bucket prototype) { + return new Bucket( + prototype.termValues, + docCount, + aggs, + prototype.showDocCountError, + prototype.docCountError, + prototype.termFormats + ); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) return true; + if (obj == null || getClass() != obj.getClass()) return false; + if (super.equals(obj) == false) return false; + InternalMultiTerms that = (InternalMultiTerms) obj; + + if (showTermDocCountError && docCountError != that.docCountError) { + return false; + } + return Objects.equals(buckets, that.buckets) + && Objects.equals(otherDocCount, that.otherDocCount) + && Objects.equals(showTermDocCountError, that.showTermDocCountError) + && Objects.equals(shardSize, that.shardSize) + && Objects.equals(docCountError, that.docCountError); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), buckets, otherDocCount, showTermDocCountError, shardSize); + } + + /** + * Copy from InternalComposite + * + * Format obj using the provided {@link DocValueFormat}. + * If the format is equals to {@link DocValueFormat#RAW}, the object is returned as is + * for numbers and a string for {@link BytesRef}s. + */ + static Object formatObject(Object obj, DocValueFormat format) { + if (obj == null) { + return null; + } + if (obj.getClass() == BytesRef.class) { + BytesRef value = (BytesRef) obj; + if (format == DocValueFormat.RAW) { + return value.utf8ToString(); + } else { + return format.format(value); + } + } else if (obj.getClass() == Long.class) { + long value = (long) obj; + if (format == DocValueFormat.RAW) { + return value; + } else { + return format.format(value); + } + } else if (obj.getClass() == Double.class) { + double value = (double) obj; + if (format == DocValueFormat.RAW) { + return value; + } else { + return format.format(value); + } + } + return obj; + } +} diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalTerms.java index be397bcbb2f2c..8fae5720a9082 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalTerms.java @@ -57,11 +57,12 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.function.Function; import static org.opensearch.search.aggregations.InternalOrder.isKeyAsc; import static org.opensearch.search.aggregations.InternalOrder.isKeyOrder; -public abstract class InternalTerms, B extends InternalTerms.Bucket> extends +public abstract class InternalTerms, B extends InternalTerms.AbstractInternalBucket> extends InternalMultiBucketAggregation implements Terms { @@ -69,10 +70,15 @@ public abstract class InternalTerms, B extends Int protected static final ParseField DOC_COUNT_ERROR_UPPER_BOUND_FIELD_NAME = new ParseField("doc_count_error_upper_bound"); protected static final ParseField SUM_OF_OTHER_DOC_COUNTS = new ParseField("sum_other_doc_count"); - public abstract static class Bucket> extends InternalMultiBucketAggregation.InternalBucket - implements - Terms.Bucket, - KeyComparable { + public abstract static class AbstractInternalBucket extends InternalMultiBucketAggregation.InternalBucket implements Terms.Bucket { + abstract void setDocCountError(long docCountError); + + abstract void setDocCountError(Function updater); + + abstract boolean showDocCountError(); + } + + public abstract static class Bucket> extends AbstractInternalBucket implements KeyComparable { /** * Reads a bucket. Should be a constructor reference. */ @@ -142,6 +148,21 @@ public long getDocCountError() { return docCountError; } + @Override + public void setDocCountError(long docCountError) { + this.docCountError = docCountError; + } + + @Override + public void setDocCountError(Function updater) { + this.docCountError = updater.apply(this.docCountError); + } + + @Override + public boolean showDocCountError() { + return showDocCountError; + } + @Override public Aggregations getAggregations() { return aggregations; @@ -274,7 +295,7 @@ private long getDocCountError(InternalTerms terms) { } else { // otherwise use the doc count of the last term in the // aggregation - return terms.getBuckets().stream().mapToLong(Bucket::getDocCount).min().getAsLong(); + return terms.getBuckets().stream().mapToLong(MultiBucketsAggregation.Bucket::getDocCount).min().getAsLong(); } } else { return -1; @@ -393,7 +414,7 @@ public InternalAggregation reduce(List aggregations, Reduce // for the existing error calculated in a previous reduce. // Note that if the error is unbounded (-1) this will be fixed // later in this method. - bucket.docCountError -= thisAggDocCountError; + bucket.setDocCountError(docCountError -> docCountError - thisAggDocCountError); } } @@ -419,11 +440,12 @@ public InternalAggregation reduce(List aggregations, Reduce final BucketPriorityQueue ordered = new BucketPriorityQueue<>(size, order.comparator()); for (B bucket : reducedBuckets) { if (sumDocCountError == -1) { - bucket.docCountError = -1; + bucket.setDocCountError(-1); } else { - bucket.docCountError += sumDocCountError; + final long finalSumDocCountError = sumDocCountError; + bucket.setDocCountError(docCountError -> docCountError + finalSumDocCountError); } - if (bucket.docCount >= minDocCount) { + if (bucket.getDocCount() >= minDocCount) { B removed = ordered.insertWithOverflow(bucket); if (removed != null) { otherDocCount += removed.getDocCount(); @@ -448,9 +470,10 @@ public InternalAggregation reduce(List aggregations, Reduce reduceContext.consumeBucketsAndMaybeBreak(1); list[i] = reducedBuckets.get(i); if (sumDocCountError == -1) { - list[i].docCountError = -1; + list[i].setDocCountError(-1); } else { - list[i].docCountError += sumDocCountError; + final long fSumDocCountError = sumDocCountError; + list[i].setDocCountError(docCountError -> docCountError + fSumDocCountError); } } } @@ -474,15 +497,15 @@ protected B reduceBucket(List buckets, ReduceContext context) { long docCountError = 0; List aggregationsList = new ArrayList<>(buckets.size()); for (B bucket : buckets) { - docCount += bucket.docCount; + docCount += bucket.getDocCount(); if (docCountError != -1) { - if (bucket.docCountError == -1) { + if (bucket.showDocCountError() == false || bucket.getDocCountError() == -1) { docCountError = -1; } else { - docCountError += bucket.docCountError; + docCountError += bucket.getDocCountError(); } } - aggregationsList.add(bucket.aggregations); + aggregationsList.add((InternalAggregations) bucket.getAggregations()); } InternalAggregations aggs = InternalAggregations.reduce(aggregationsList, context); return createBucket(docCount, aggs, docCountError, buckets.get(0)); @@ -524,12 +547,12 @@ protected static XContentBuilder doXContentCommon( Params params, long docCountError, long otherDocCount, - List buckets + List buckets ) throws IOException { builder.field(DOC_COUNT_ERROR_UPPER_BOUND_FIELD_NAME.getPreferredName(), docCountError); builder.field(SUM_OF_OTHER_DOC_COUNTS.getPreferredName(), otherDocCount); builder.startArray(CommonFields.BUCKETS.getPreferredName()); - for (Bucket bucket : buckets) { + for (AbstractInternalBucket bucket : buckets) { bucket.toXContent(builder, params); } builder.endArray(); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregationBuilder.java new file mode 100644 index 0000000000000..78be4f980bce5 --- /dev/null +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregationBuilder.java @@ -0,0 +1,443 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.search.aggregations.bucket.terms; + +import org.opensearch.common.ParseField; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.common.xcontent.LoggingDeprecationHandler; +import org.opensearch.common.xcontent.ObjectParser; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.index.query.QueryShardContext; +import org.opensearch.search.aggregations.AbstractAggregationBuilder; +import org.opensearch.search.aggregations.AggregationBuilder; +import org.opensearch.search.aggregations.Aggregator; +import org.opensearch.search.aggregations.AggregatorFactories; +import org.opensearch.search.aggregations.AggregatorFactory; +import org.opensearch.search.aggregations.BucketOrder; +import org.opensearch.search.aggregations.InternalOrder; +import org.opensearch.search.aggregations.support.MultiTermsValuesSourceConfig; +import org.opensearch.search.aggregations.support.ValuesSourceRegistry; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +import static org.opensearch.search.aggregations.bucket.terms.TermsAggregationBuilder.DEFAULT_BUCKET_COUNT_THRESHOLDS; + +/** + * Multi-terms aggregation supports collecting terms from multiple fields in the same document. + * + *

+ * For example, using the multi-terms aggregation to group by two fields region, host, calculate max cpu, and sort by max cpu. + *

+ *
+ *   GET test_000001/_search
+ *   {
+ *     "size": 0,
+ *     "aggs": {
+ *       "hot": {
+ *         "multi_terms": {
+ *           "terms": [{
+ *             "field": "region"
+ *           },{
+ *             "field": "host"
+ *           }],
+ *           "order": {"max-cpu": "desc"}
+ *         },
+ *         "aggs": {
+ *           "max-cpu": { "max": { "field": "cpu" } }
+ *         }
+ *       }
+ *     }
+ *   }
+ * 
+ * + *

+ * The aggregation result contains + * - key: a list of value extract from multiple fields in the same doc. + *

+ *
+ *   {
+ *     "hot": {
+ *       "doc_count_error_upper_bound": 0,
+ *       "sum_other_doc_count": 0,
+ *       "buckets": [
+ *         {
+ *           "key": [
+ *             "dub",
+ *             "h1"
+ *           ],
+ *           "key_as_string": "dub|h1",
+ *           "doc_count": 2,
+ *           "max-cpu": {
+ *             "value": 90.0
+ *           }
+ *         },
+ *         {
+ *           "key": [
+ *             "dub",
+ *             "h2"
+ *           ],
+ *           "key_as_string": "dub|h2",
+ *           "doc_count": 2,
+ *           "max-cpu": {
+ *             "value": 70.0
+ *           }
+ *         }
+ *       ]
+ *     }
+ *   }
+ * 
+ * + *

+ * Notes: The current implementation focuses on adding new type aggregates. Performance (latency) is not good,mainly because of + * simply encoding/decoding a list of values as bucket keys. + *

+ */ +public class MultiTermsAggregationBuilder extends AbstractAggregationBuilder { + public static final String NAME = "multi_terms"; + public static final ObjectParser PARSER = ObjectParser.fromBuilder( + NAME, + MultiTermsAggregationBuilder::new + ); + + public static final ParseField TERMS_FIELD = new ParseField("terms"); + public static final ParseField SHARD_SIZE_FIELD_NAME = new ParseField("shard_size"); + public static final ParseField MIN_DOC_COUNT_FIELD_NAME = new ParseField("min_doc_count"); + public static final ParseField SHARD_MIN_DOC_COUNT_FIELD_NAME = new ParseField("shard_min_doc_count"); + public static final ParseField REQUIRED_SIZE_FIELD_NAME = new ParseField("size"); + public static final ParseField SHOW_TERM_DOC_COUNT_ERROR = new ParseField("show_term_doc_count_error"); + public static final ParseField ORDER_FIELD = new ParseField("order"); + + @Override + public String getType() { + return NAME; + } + + static { + final ObjectParser parser = MultiTermsValuesSourceConfig.PARSER.apply( + true, + true, + true, + true + ); + PARSER.declareObjectArray(MultiTermsAggregationBuilder::terms, (p, c) -> parser.parse(p, null).build(), TERMS_FIELD); + + PARSER.declareBoolean(MultiTermsAggregationBuilder::showTermDocCountError, SHOW_TERM_DOC_COUNT_ERROR); + + PARSER.declareInt(MultiTermsAggregationBuilder::shardSize, SHARD_SIZE_FIELD_NAME); + + PARSER.declareLong(MultiTermsAggregationBuilder::minDocCount, MIN_DOC_COUNT_FIELD_NAME); + + PARSER.declareLong(MultiTermsAggregationBuilder::shardMinDocCount, SHARD_MIN_DOC_COUNT_FIELD_NAME); + + PARSER.declareInt(MultiTermsAggregationBuilder::size, REQUIRED_SIZE_FIELD_NAME); + + PARSER.declareObjectArray(MultiTermsAggregationBuilder::order, (p, c) -> InternalOrder.Parser.parseOrderParam(p), ORDER_FIELD); + + PARSER.declareField( + MultiTermsAggregationBuilder::collectMode, + (p, c) -> Aggregator.SubAggCollectionMode.parse(p.text(), LoggingDeprecationHandler.INSTANCE), + Aggregator.SubAggCollectionMode.KEY, + ObjectParser.ValueType.STRING + ); + } + + public static final ValuesSourceRegistry.RegistryKey REGISTRY_KEY = + new ValuesSourceRegistry.RegistryKey<>( + MultiTermsAggregationBuilder.NAME, + MultiTermsAggregationFactory.InternalValuesSourceSupplier.class + ); + + private List terms; + + private BucketOrder order = BucketOrder.compound(BucketOrder.count(false)); // automatically adds tie-breaker key asc order + private Aggregator.SubAggCollectionMode collectMode = null; + private TermsAggregator.BucketCountThresholds bucketCountThresholds = new TermsAggregator.BucketCountThresholds( + DEFAULT_BUCKET_COUNT_THRESHOLDS + ); + private boolean showTermDocCountError = false; + + public MultiTermsAggregationBuilder(String name) { + super(name); + } + + protected MultiTermsAggregationBuilder( + MultiTermsAggregationBuilder clone, + AggregatorFactories.Builder factoriesBuilder, + Map metadata + ) { + super(clone, factoriesBuilder, metadata); + this.terms = new ArrayList<>(clone.terms); + this.order = clone.order; + this.collectMode = clone.collectMode; + this.bucketCountThresholds = new TermsAggregator.BucketCountThresholds(clone.bucketCountThresholds); + this.showTermDocCountError = clone.showTermDocCountError; + } + + @Override + protected AggregationBuilder shallowCopy(AggregatorFactories.Builder factoriesBuilder, Map metadata) { + return new MultiTermsAggregationBuilder(this, factoriesBuilder, metadata); + } + + /** + * Read from a stream. + */ + public MultiTermsAggregationBuilder(StreamInput in) throws IOException { + super(in); + terms = in.readList(MultiTermsValuesSourceConfig::new); + bucketCountThresholds = new TermsAggregator.BucketCountThresholds(in); + collectMode = in.readOptionalWriteable(Aggregator.SubAggCollectionMode::readFromStream); + order = InternalOrder.Streams.readOrder(in); + showTermDocCountError = in.readBoolean(); + } + + @Override + protected void doWriteTo(StreamOutput out) throws IOException { + out.writeList(terms); + bucketCountThresholds.writeTo(out); + out.writeOptionalWriteable(collectMode); + order.writeTo(out); + out.writeBoolean(showTermDocCountError); + } + + @Override + protected AggregatorFactory doBuild( + QueryShardContext queryShardContext, + AggregatorFactory parent, + AggregatorFactories.Builder subfactoriesBuilder + ) throws IOException { + return new MultiTermsAggregationFactory( + name, + queryShardContext, + parent, + subfactoriesBuilder, + metadata, + terms, + order, + collectMode, + bucketCountThresholds, + showTermDocCountError + ); + } + + @Override + protected XContentBuilder internalXContent(XContentBuilder builder, Params params) throws IOException { + builder.startObject(); + if (terms != null) { + builder.field(TERMS_FIELD.getPreferredName(), terms); + } + bucketCountThresholds.toXContent(builder, params); + builder.field(SHOW_TERM_DOC_COUNT_ERROR.getPreferredName(), showTermDocCountError); + builder.field(ORDER_FIELD.getPreferredName()); + order.toXContent(builder, params); + if (collectMode != null) { + builder.field(Aggregator.SubAggCollectionMode.KEY.getPreferredName(), collectMode.parseField().getPreferredName()); + } + builder.endObject(); + return builder; + } + + /** + * Set the terms. + */ + public MultiTermsAggregationBuilder terms(List terms) { + if (terms == null) { + throw new IllegalArgumentException("[terms] must not be null. Found null terms in [" + name + "]"); + } + if (terms.size() < 2) { + throw new IllegalArgumentException( + "multi term aggregation must has at least 2 terms. Found [" + + terms.size() + + "] in" + + " [" + + name + + "]" + + (terms.size() == 1 ? " Use terms aggregation for single term aggregation" : "") + ); + } + this.terms = terms; + return this; + } + + /** + * Sets the size - indicating how many term buckets should be returned + * (defaults to 10) + */ + public MultiTermsAggregationBuilder size(int size) { + if (size <= 0) { + throw new IllegalArgumentException("[size] must be greater than 0. Found [" + size + "] in [" + name + "]"); + } + bucketCountThresholds.setRequiredSize(size); + return this; + } + + /** + * Returns the number of term buckets currently configured + */ + public int size() { + return bucketCountThresholds.getRequiredSize(); + } + + /** + * Sets the shard_size - indicating the number of term buckets each shard + * will return to the coordinating node (the node that coordinates the + * search execution). The higher the shard size is, the more accurate the + * results are. + */ + public MultiTermsAggregationBuilder shardSize(int shardSize) { + if (shardSize <= 0) { + throw new IllegalArgumentException("[shardSize] must be greater than 0. Found [" + shardSize + "] in [" + name + "]"); + } + bucketCountThresholds.setShardSize(shardSize); + return this; + } + + /** + * Returns the number of term buckets per shard that are currently configured + */ + public int shardSize() { + return bucketCountThresholds.getShardSize(); + } + + /** + * Set the minimum document count terms should have in order to appear in + * the response. + */ + public MultiTermsAggregationBuilder minDocCount(long minDocCount) { + if (minDocCount < 0) { + throw new IllegalArgumentException( + "[minDocCount] must be greater than or equal to 0. Found [" + minDocCount + "] in [" + name + "]" + ); + } + bucketCountThresholds.setMinDocCount(minDocCount); + return this; + } + + /** + * Returns the minimum document count required per term + */ + public long minDocCount() { + return bucketCountThresholds.getMinDocCount(); + } + + /** + * Set the minimum document count terms should have on the shard in order to + * appear in the response. + */ + public MultiTermsAggregationBuilder shardMinDocCount(long shardMinDocCount) { + if (shardMinDocCount < 0) { + throw new IllegalArgumentException( + "[shardMinDocCount] must be greater than or equal to 0. Found [" + shardMinDocCount + "] in [" + name + "]" + ); + } + bucketCountThresholds.setShardMinDocCount(shardMinDocCount); + return this; + } + + /** + * Returns the minimum document count required per term, per shard + */ + public long shardMinDocCount() { + return bucketCountThresholds.getShardMinDocCount(); + } + + /** Set a new order on this builder and return the builder so that calls + * can be chained. A tie-breaker may be added to avoid non-deterministic ordering. */ + public MultiTermsAggregationBuilder order(BucketOrder order) { + if (order == null) { + throw new IllegalArgumentException("[order] must not be null: [" + name + "]"); + } + if (order instanceof InternalOrder.CompoundOrder || InternalOrder.isKeyOrder(order)) { + this.order = order; // if order already contains a tie-breaker we are good to go + } else { // otherwise add a tie-breaker by using a compound order + this.order = BucketOrder.compound(order); + } + return this; + } + + /** + * Sets the order in which the buckets will be returned. A tie-breaker may be added to avoid non-deterministic + * ordering. + */ + public MultiTermsAggregationBuilder order(List orders) { + if (orders == null) { + throw new IllegalArgumentException("[orders] must not be null: [" + name + "]"); + } + // if the list only contains one order use that to avoid inconsistent xcontent + order(orders.size() > 1 ? BucketOrder.compound(orders) : orders.get(0)); + return this; + } + + /** + * Gets the order in which the buckets will be returned. + */ + public BucketOrder order() { + return order; + } + + /** + * Expert: set the collection mode. + */ + public MultiTermsAggregationBuilder collectMode(Aggregator.SubAggCollectionMode collectMode) { + if (collectMode == null) { + throw new IllegalArgumentException("[collectMode] must not be null: [" + name + "]"); + } + this.collectMode = collectMode; + return this; + } + + /** + * Expert: get the collection mode. + */ + public Aggregator.SubAggCollectionMode collectMode() { + return collectMode; + } + + /** + * Get whether doc count error will be return for individual terms + */ + public boolean showTermDocCountError() { + return showTermDocCountError; + } + + /** + * Set whether doc count error will be return for individual terms + */ + public MultiTermsAggregationBuilder showTermDocCountError(boolean showTermDocCountError) { + this.showTermDocCountError = showTermDocCountError; + return this; + } + + @Override + public BucketCardinality bucketCardinality() { + return BucketCardinality.MANY; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), bucketCountThresholds, collectMode, order, showTermDocCountError); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) return true; + if (obj == null || getClass() != obj.getClass()) return false; + if (super.equals(obj) == false) return false; + MultiTermsAggregationBuilder other = (MultiTermsAggregationBuilder) obj; + return Objects.equals(terms, other.terms) + && Objects.equals(bucketCountThresholds, other.bucketCountThresholds) + && Objects.equals(collectMode, other.collectMode) + && Objects.equals(order, other.order) + && Objects.equals(showTermDocCountError, other.showTermDocCountError); + } +} diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregationFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregationFactory.java new file mode 100644 index 0000000000000..d5600bc030bf2 --- /dev/null +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregationFactory.java @@ -0,0 +1,163 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.search.aggregations.bucket.terms; + +import org.opensearch.common.collect.Tuple; +import org.opensearch.index.query.QueryShardContext; +import org.opensearch.search.DocValueFormat; +import org.opensearch.search.aggregations.Aggregator; +import org.opensearch.search.aggregations.AggregatorFactories; +import org.opensearch.search.aggregations.AggregatorFactory; +import org.opensearch.search.aggregations.BucketOrder; +import org.opensearch.search.aggregations.CardinalityUpperBound; +import org.opensearch.search.aggregations.InternalOrder; +import org.opensearch.search.aggregations.bucket.BucketUtils; +import org.opensearch.search.aggregations.support.CoreValuesSourceType; +import org.opensearch.search.aggregations.support.MultiTermsValuesSourceConfig; +import org.opensearch.search.aggregations.support.ValuesSource; +import org.opensearch.search.aggregations.support.ValuesSourceConfig; +import org.opensearch.search.aggregations.support.ValuesSourceRegistry; +import org.opensearch.search.internal.SearchContext; + +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import static org.opensearch.search.aggregations.bucket.terms.MultiTermsAggregationBuilder.REGISTRY_KEY; + +/** + * Factory of {@link MultiTermsAggregator}. + */ +public class MultiTermsAggregationFactory extends AggregatorFactory { + + private final List> configs; + private final List formats; + /** + * Fields inherent from Terms Aggregation Factory. + */ + private final BucketOrder order; + private final Aggregator.SubAggCollectionMode collectMode; + private final TermsAggregator.BucketCountThresholds bucketCountThresholds; + private final boolean showTermDocCountError; + + public static void registerAggregators(ValuesSourceRegistry.Builder builder) { + builder.register( + REGISTRY_KEY, + org.opensearch.common.collect.List.of(CoreValuesSourceType.BYTES, CoreValuesSourceType.IP), + config -> { + final IncludeExclude.StringFilter filter = config.v2() == null + ? null + : config.v2().convertToStringFilter(config.v1().format()); + return MultiTermsAggregator.InternalValuesSourceFactory.bytesValuesSource(config.v1().getValuesSource(), filter); + }, + true + ); + + builder.register( + REGISTRY_KEY, + org.opensearch.common.collect.List.of(CoreValuesSourceType.NUMERIC, CoreValuesSourceType.BOOLEAN, CoreValuesSourceType.DATE), + config -> { + ValuesSourceConfig valuesSourceConfig = config.v1(); + IncludeExclude includeExclude = config.v2(); + ValuesSource.Numeric valuesSource = ((ValuesSource.Numeric) valuesSourceConfig.getValuesSource()); + IncludeExclude.LongFilter longFilter = null; + if (valuesSource.isFloatingPoint()) { + if (includeExclude != null) { + longFilter = includeExclude.convertToDoubleFilter(); + } + return MultiTermsAggregator.InternalValuesSourceFactory.doubleValueSource(valuesSource, longFilter); + } else { + if (includeExclude != null) { + longFilter = includeExclude.convertToLongFilter(valuesSourceConfig.format()); + } + return MultiTermsAggregator.InternalValuesSourceFactory.longValuesSource(valuesSource, longFilter); + } + }, + true + ); + + builder.registerUsage(MultiTermsAggregationBuilder.NAME); + } + + public MultiTermsAggregationFactory( + String name, + QueryShardContext queryShardContext, + AggregatorFactory parent, + AggregatorFactories.Builder subFactoriesBuilder, + Map metadata, + List multiTermConfigs, + BucketOrder order, + Aggregator.SubAggCollectionMode collectMode, + TermsAggregator.BucketCountThresholds bucketCountThresholds, + boolean showTermDocCountError + ) throws IOException { + super(name, queryShardContext, parent, subFactoriesBuilder, metadata); + this.configs = multiTermConfigs.stream() + .map( + c -> new Tuple( + ValuesSourceConfig.resolveUnregistered( + queryShardContext, + c.getUserValueTypeHint(), + c.getFieldName(), + c.getScript(), + c.getMissing(), + c.getTimeZone(), + c.getFormat(), + CoreValuesSourceType.BYTES + ), + c.getIncludeExclude() + ) + ) + .collect(Collectors.toList()); + this.formats = this.configs.stream().map(c -> c.v1().format()).collect(Collectors.toList()); + this.order = order; + this.collectMode = collectMode; + this.bucketCountThresholds = bucketCountThresholds; + this.showTermDocCountError = showTermDocCountError; + } + + @Override + protected Aggregator createInternal( + SearchContext searchContext, + Aggregator parent, + CardinalityUpperBound cardinality, + Map metadata + ) throws IOException { + TermsAggregator.BucketCountThresholds bucketCountThresholds = new TermsAggregator.BucketCountThresholds(this.bucketCountThresholds); + if (InternalOrder.isKeyOrder(order) == false + && bucketCountThresholds.getShardSize() == TermsAggregationBuilder.DEFAULT_BUCKET_COUNT_THRESHOLDS.getShardSize()) { + // The user has not made a shardSize selection. Use default + // heuristic to avoid any wrong-ranking caused by distributed + // counting + bucketCountThresholds.setShardSize(BucketUtils.suggestShardSideQueueSize(bucketCountThresholds.getRequiredSize())); + } + bucketCountThresholds.ensureValidity(); + return new MultiTermsAggregator( + name, + factories, + showTermDocCountError, + configs.stream() + .map(config -> queryShardContext.getValuesSourceRegistry().getAggregator(REGISTRY_KEY, config.v1()).build(config)) + .collect(Collectors.toList()), + configs.stream().map(c -> c.v1().format()).collect(Collectors.toList()), + order, + collectMode, + bucketCountThresholds, + searchContext, + parent, + cardinality, + metadata + ); + } + + public interface InternalValuesSourceSupplier { + MultiTermsAggregator.InternalValuesSource build(Tuple config); + } +} diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregator.java new file mode 100644 index 0000000000000..36bf710f74398 --- /dev/null +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregator.java @@ -0,0 +1,438 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.search.aggregations.bucket.terms; + +import org.apache.lucene.index.LeafReaderContext; +import org.apache.lucene.index.SortedNumericDocValues; +import org.apache.lucene.util.BytesRef; +import org.apache.lucene.util.BytesRefBuilder; +import org.apache.lucene.util.NumericUtils; +import org.apache.lucene.util.PriorityQueue; +import org.opensearch.ExceptionsHelper; +import org.opensearch.common.CheckedSupplier; +import org.opensearch.common.bytes.BytesArray; +import org.opensearch.common.io.stream.BytesStreamOutput; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.common.lease.Releasables; +import org.opensearch.index.fielddata.SortedBinaryDocValues; +import org.opensearch.index.fielddata.SortedNumericDoubleValues; +import org.opensearch.search.DocValueFormat; +import org.opensearch.search.aggregations.Aggregator; +import org.opensearch.search.aggregations.AggregatorFactories; +import org.opensearch.search.aggregations.BucketOrder; +import org.opensearch.search.aggregations.CardinalityUpperBound; +import org.opensearch.search.aggregations.InternalAggregation; +import org.opensearch.search.aggregations.InternalOrder; +import org.opensearch.search.aggregations.LeafBucketCollector; +import org.opensearch.search.aggregations.bucket.DeferableBucketAggregator; +import org.opensearch.search.aggregations.support.AggregationPath; +import org.opensearch.search.aggregations.support.ValuesSource; +import org.opensearch.search.internal.SearchContext; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import static org.opensearch.search.aggregations.InternalOrder.isKeyOrder; +import static org.opensearch.search.aggregations.bucket.terms.TermsAggregator.descendsFromNestedAggregator; + +/** + * An aggregator that aggregate with multi_terms. + */ +public class MultiTermsAggregator extends DeferableBucketAggregator { + + private final BytesKeyedBucketOrds bucketOrds; + private final MultiTermsValuesSource multiTermsValue; + private final boolean showTermDocCountError; + private final List formats; + private final TermsAggregator.BucketCountThresholds bucketCountThresholds; + private final BucketOrder order; + private final Comparator partiallyBuiltBucketComparator; + private final SubAggCollectionMode collectMode; + private final Set aggsUsedForSorting = new HashSet<>(); + + public MultiTermsAggregator( + String name, + AggregatorFactories factories, + boolean showTermDocCountError, + List internalValuesSources, + List formats, + BucketOrder order, + SubAggCollectionMode collectMode, + TermsAggregator.BucketCountThresholds bucketCountThresholds, + SearchContext context, + Aggregator parent, + CardinalityUpperBound cardinality, + Map metadata + ) throws IOException { + super(name, factories, context, parent, metadata); + this.bucketOrds = BytesKeyedBucketOrds.build(context.bigArrays(), cardinality); + this.multiTermsValue = new MultiTermsValuesSource(internalValuesSources); + this.showTermDocCountError = showTermDocCountError; + this.formats = formats; + this.bucketCountThresholds = bucketCountThresholds; + this.order = order; + this.partiallyBuiltBucketComparator = order == null ? null : order.partiallyBuiltBucketComparator(b -> b.bucketOrd, this); + // Todo, copy from TermsAggregator. need to remove duplicate code. + if (subAggsNeedScore() && descendsFromNestedAggregator(parent)) { + /** + * Force the execution to depth_first because we need to access the score of + * nested documents in a sub-aggregation and we are not able to generate this score + * while replaying deferred documents. + */ + this.collectMode = SubAggCollectionMode.DEPTH_FIRST; + } else { + this.collectMode = collectMode; + } + // Don't defer any child agg if we are dependent on it for pruning results + if (order instanceof InternalOrder.Aggregation) { + AggregationPath path = ((InternalOrder.Aggregation) order).path(); + aggsUsedForSorting.add(path.resolveTopmostAggregator(this)); + } else if (order instanceof InternalOrder.CompoundOrder) { + InternalOrder.CompoundOrder compoundOrder = (InternalOrder.CompoundOrder) order; + for (BucketOrder orderElement : compoundOrder.orderElements()) { + if (orderElement instanceof InternalOrder.Aggregation) { + AggregationPath path = ((InternalOrder.Aggregation) orderElement).path(); + aggsUsedForSorting.add(path.resolveTopmostAggregator(this)); + } + } + } + } + + @Override + public InternalAggregation[] buildAggregations(long[] owningBucketOrds) throws IOException { + InternalMultiTerms.Bucket[][] topBucketsPerOrd = new InternalMultiTerms.Bucket[owningBucketOrds.length][]; + long[] otherDocCounts = new long[owningBucketOrds.length]; + for (int ordIdx = 0; ordIdx < owningBucketOrds.length; ordIdx++) { + collectZeroDocEntriesIfNeeded(owningBucketOrds[ordIdx]); + long bucketsInOrd = bucketOrds.bucketsInOrd(owningBucketOrds[ordIdx]); + + int size = (int) Math.min(bucketsInOrd, bucketCountThresholds.getShardSize()); + PriorityQueue ordered = new BucketPriorityQueue<>(size, partiallyBuiltBucketComparator); + InternalMultiTerms.Bucket spare = null; + BytesRef dest = null; + BytesKeyedBucketOrds.BucketOrdsEnum ordsEnum = bucketOrds.ordsEnum(owningBucketOrds[ordIdx]); + CheckedSupplier emptyBucketBuilder = () -> InternalMultiTerms.Bucket.EMPTY( + showTermDocCountError, + formats + ); + while (ordsEnum.next()) { + long docCount = bucketDocCount(ordsEnum.ord()); + otherDocCounts[ordIdx] += docCount; + if (docCount < bucketCountThresholds.getShardMinDocCount()) { + continue; + } + if (spare == null) { + spare = emptyBucketBuilder.get(); + dest = new BytesRef(); + } + + ordsEnum.readValue(dest); + + spare.termValues = decode(dest); + spare.docCount = docCount; + spare.bucketOrd = ordsEnum.ord(); + spare = ordered.insertWithOverflow(spare); + } + + // Get the top buckets + InternalMultiTerms.Bucket[] bucketsForOrd = new InternalMultiTerms.Bucket[ordered.size()]; + topBucketsPerOrd[ordIdx] = bucketsForOrd; + for (int b = ordered.size() - 1; b >= 0; --b) { + topBucketsPerOrd[ordIdx][b] = ordered.pop(); + otherDocCounts[ordIdx] -= topBucketsPerOrd[ordIdx][b].getDocCount(); + } + } + + buildSubAggsForAllBuckets(topBucketsPerOrd, b -> b.bucketOrd, (b, aggs) -> b.aggregations = aggs); + + InternalAggregation[] result = new InternalAggregation[owningBucketOrds.length]; + for (int ordIdx = 0; ordIdx < owningBucketOrds.length; ordIdx++) { + result[ordIdx] = buildResult(owningBucketOrds[ordIdx], otherDocCounts[ordIdx], topBucketsPerOrd[ordIdx]); + } + return result; + } + + InternalMultiTerms buildResult(long owningBucketOrd, long otherDocCount, InternalMultiTerms.Bucket[] topBuckets) { + BucketOrder reduceOrder; + if (isKeyOrder(order) == false) { + reduceOrder = InternalOrder.key(true); + Arrays.sort(topBuckets, reduceOrder.comparator()); + } else { + reduceOrder = order; + } + return new InternalMultiTerms( + name, + reduceOrder, + order, + bucketCountThresholds.getRequiredSize(), + bucketCountThresholds.getMinDocCount(), + metadata(), + bucketCountThresholds.getShardSize(), + showTermDocCountError, + otherDocCount, + 0, + formats, + org.opensearch.common.collect.List.of(topBuckets) + ); + } + + @Override + public InternalAggregation buildEmptyAggregation() { + return null; + } + + @Override + protected LeafBucketCollector getLeafCollector(LeafReaderContext ctx, LeafBucketCollector sub) throws IOException { + MultiTermsValuesSourceCollector collector = multiTermsValue.getValues(ctx); + return new LeafBucketCollector() { + @Override + public void collect(int doc, long owningBucketOrd) throws IOException { + for (List value : collector.apply(doc)) { + long bucketOrd = bucketOrds.add(owningBucketOrd, encode(value)); + if (bucketOrd < 0) { + bucketOrd = -1 - bucketOrd; + collectExistingBucket(sub, doc, bucketOrd); + } else { + collectBucket(sub, doc, bucketOrd); + } + } + } + }; + } + + @Override + protected void doClose() { + Releasables.close(bucketOrds); + } + + private static BytesRef encode(List values) { + try (BytesStreamOutput output = new BytesStreamOutput()) { + output.writeCollection(values, StreamOutput::writeGenericValue); + return output.bytes().toBytesRef(); + } catch (IOException e) { + throw ExceptionsHelper.convertToRuntime(e); + } + } + + private static List decode(BytesRef bytesRef) { + try (StreamInput input = new BytesArray(bytesRef).streamInput()) { + return input.readList(StreamInput::readGenericValue); + } catch (IOException e) { + throw ExceptionsHelper.convertToRuntime(e); + } + } + + private boolean subAggsNeedScore() { + for (Aggregator subAgg : subAggregators) { + if (subAgg.scoreMode().needsScores()) { + return true; + } + } + return false; + } + + @Override + protected boolean shouldDefer(Aggregator aggregator) { + return collectMode == Aggregator.SubAggCollectionMode.BREADTH_FIRST && !aggsUsedForSorting.contains(aggregator); + } + + private void collectZeroDocEntriesIfNeeded(long owningBucketOrd) throws IOException { + if (bucketCountThresholds.getMinDocCount() != 0) { + return; + } + if (InternalOrder.isCountDesc(order) && bucketOrds.bucketsInOrd(owningBucketOrd) >= bucketCountThresholds.getRequiredSize()) { + return; + } + // we need to fill-in the blanks + for (LeafReaderContext ctx : context.searcher().getTopReaderContext().leaves()) { + MultiTermsValuesSourceCollector collector = multiTermsValue.getValues(ctx); + // brute force + for (int docId = 0; docId < ctx.reader().maxDoc(); ++docId) { + for (List value : collector.apply(docId)) { + bucketOrds.add(owningBucketOrd, encode(value)); + } + } + } + } + + /** + * A multi_terms collector which collect values on each doc, + */ + @FunctionalInterface + interface MultiTermsValuesSourceCollector { + /** + * Collect a list values of multi_terms on each doc. + * Each terms could have multi_values, so the result is the cartesian product of each term's values. + */ + List> apply(int doc) throws IOException; + } + + @FunctionalInterface + interface InternalValuesSource { + /** + * Create {@link InternalValuesSourceCollector} from existing {@link LeafReaderContext}. + */ + InternalValuesSourceCollector apply(LeafReaderContext ctx) throws IOException; + } + + /** + * A terms collector which collect values on each doc, + */ + @FunctionalInterface + interface InternalValuesSourceCollector { + /** + * Collect a list values of a term on specific doc. + */ + List apply(int doc) throws IOException; + } + + /** + * Multi_Term ValuesSource, it is a collection of {@link InternalValuesSource} + */ + static class MultiTermsValuesSource { + private final List valuesSources; + + public MultiTermsValuesSource(List valuesSources) { + this.valuesSources = valuesSources; + } + + public MultiTermsValuesSourceCollector getValues(LeafReaderContext ctx) throws IOException { + List collectors = new ArrayList<>(); + for (InternalValuesSource valuesSource : valuesSources) { + collectors.add(valuesSource.apply(ctx)); + } + return new MultiTermsValuesSourceCollector() { + @Override + public List> apply(int doc) throws IOException { + List, IOException>> collectedValues = new ArrayList<>(); + for (InternalValuesSourceCollector collector : collectors) { + collectedValues.add(() -> collector.apply(doc)); + } + List> result = new ArrayList<>(); + apply(0, collectedValues, new ArrayList<>(), result); + return result; + } + + /** + * DFS traverse each term's values and add cartesian product to results lists. + */ + private void apply( + int index, + List, IOException>> collectedValues, + List current, + List> results + ) throws IOException { + if (index == collectedValues.size()) { + results.add(org.opensearch.common.collect.List.copyOf(current)); + } else if (null != collectedValues.get(index)) { + for (Object value : collectedValues.get(index).get()) { + current.add(value); + apply(index + 1, collectedValues, current, results); + current.remove(current.size() - 1); + } + } + } + }; + } + } + + /** + * Factory for construct {@link InternalValuesSource}. + */ + static class InternalValuesSourceFactory { + static InternalValuesSource bytesValuesSource(ValuesSource valuesSource, IncludeExclude.StringFilter includeExclude) { + return ctx -> { + SortedBinaryDocValues values = valuesSource.bytesValues(ctx); + return doc -> { + BytesRefBuilder previous = new BytesRefBuilder(); + + if (false == values.advanceExact(doc)) { + return Collections.emptyList(); + } + int valuesCount = values.docValueCount(); + List termValues = new ArrayList<>(valuesCount); + + // SortedBinaryDocValues don't guarantee uniqueness so we + // need to take care of dups + previous.clear(); + for (int i = 0; i < valuesCount; ++i) { + BytesRef bytes = values.nextValue(); + if (includeExclude != null && false == includeExclude.accept(bytes)) { + continue; + } + if (i > 0 && previous.get().equals(bytes)) { + continue; + } + previous.copyBytes(bytes); + termValues.add(BytesRef.deepCopyOf(bytes)); + } + return termValues; + }; + }; + } + + static InternalValuesSource longValuesSource(ValuesSource.Numeric valuesSource, IncludeExclude.LongFilter longFilter) { + return ctx -> { + SortedNumericDocValues values = valuesSource.longValues(ctx); + return doc -> { + if (values.advanceExact(doc)) { + int valuesCount = values.docValueCount(); + + long previous = Long.MAX_VALUE; + List termValues = new ArrayList<>(valuesCount); + for (int i = 0; i < valuesCount; ++i) { + long val = values.nextValue(); + if (previous != val || i == 0) { + if (longFilter == null || longFilter.accept(val)) { + termValues.add(val); + } + previous = val; + } + } + return termValues; + } + return Collections.emptyList(); + }; + }; + } + + static InternalValuesSource doubleValueSource(ValuesSource.Numeric valuesSource, IncludeExclude.LongFilter longFilter) { + return ctx -> { + SortedNumericDoubleValues values = valuesSource.doubleValues(ctx); + return doc -> { + if (values.advanceExact(doc)) { + int valuesCount = values.docValueCount(); + + double previous = Double.MAX_VALUE; + List termValues = new ArrayList<>(valuesCount); + for (int i = 0; i < valuesCount; ++i) { + double val = values.nextValue(); + if (previous != val || i == 0) { + if (longFilter == null || longFilter.accept(NumericUtils.doubleToSortableLong(val))) { + termValues.add(val); + } + previous = val; + } + } + return termValues; + } + return Collections.emptyList(); + }; + }; + } + } +} diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedMultiTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedMultiTerms.java new file mode 100644 index 0000000000000..8686d329fa3b2 --- /dev/null +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedMultiTerms.java @@ -0,0 +1,77 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.search.aggregations.bucket.terms; + +import org.opensearch.common.xcontent.ObjectParser; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentParser; + +import java.io.IOException; +import java.util.List; + +public class ParsedMultiTerms extends ParsedTerms { + @Override + public String getType() { + return MultiTermsAggregationBuilder.NAME; + } + + private static final ObjectParser PARSER = new ObjectParser<>( + ParsedMultiTerms.class.getSimpleName(), + true, + ParsedMultiTerms::new + ); + static { + declareParsedTermsFields(PARSER, ParsedBucket::fromXContent); + } + + public static ParsedMultiTerms fromXContent(XContentParser parser, String name) throws IOException { + ParsedMultiTerms aggregation = PARSER.parse(parser, null); + aggregation.setName(name); + return aggregation; + } + + public static class ParsedBucket extends ParsedTerms.ParsedBucket { + + private List key; + + @Override + public List getKey() { + return key; + } + + @Override + public String getKeyAsString() { + String keyAsString = super.getKeyAsString(); + if (keyAsString != null) { + return keyAsString; + } + if (key != null) { + return key.toString(); + } + return null; + } + + public Number getKeyAsNumber() { + throw new UnsupportedOperationException("not implemented"); + } + + @Override + protected XContentBuilder keyToXContent(XContentBuilder builder) throws IOException { + builder.field(CommonFields.KEY.getPreferredName(), key); + if (super.getKeyAsString() != null) { + builder.field(CommonFields.KEY_AS_STRING.getPreferredName(), getKeyAsString()); + } + return builder; + } + + static ParsedBucket fromXContent(XContentParser parser) throws IOException { + return parseTermsBucketXContent(parser, ParsedBucket::new, (p, bucket) -> { bucket.key = p.list(); }); + } + } +} diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedTerms.java index ce5f56c898fa6..054ea7d827053 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedTerms.java @@ -139,13 +139,16 @@ static B parseTermsBucketXContent( XContentParser.Token token; String currentFieldName = parser.currentName(); while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) { + // field value could be list, e.g. multi_terms aggregation. + if ((token.isValue() || token == XContentParser.Token.START_ARRAY) + && CommonFields.KEY.getPreferredName().equals(currentFieldName)) { + keyConsumer.accept(parser, bucket); + } if (token == XContentParser.Token.FIELD_NAME) { currentFieldName = parser.currentName(); } else if (token.isValue()) { if (CommonFields.KEY_AS_STRING.getPreferredName().equals(currentFieldName)) { bucket.setKeyAsString(parser.text()); - } else if (CommonFields.KEY.getPreferredName().equals(currentFieldName)) { - keyConsumer.accept(parser, bucket); } else if (CommonFields.DOC_COUNT.getPreferredName().equals(currentFieldName)) { bucket.setDocCount(parser.longValue()); } else if (DOC_COUNT_ERROR_UPPER_BOUND_FIELD_NAME.getPreferredName().equals(currentFieldName)) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/BaseMultiValuesSourceFieldConfig.java b/server/src/main/java/org/opensearch/search/aggregations/support/BaseMultiValuesSourceFieldConfig.java new file mode 100644 index 0000000000000..c75ab861439d3 --- /dev/null +++ b/server/src/main/java/org/opensearch/search/aggregations/support/BaseMultiValuesSourceFieldConfig.java @@ -0,0 +1,216 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.search.aggregations.support; + +import org.opensearch.LegacyESVersion; +import org.opensearch.common.ParseField; +import org.opensearch.common.Strings; +import org.opensearch.common.TriConsumer; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.time.DateUtils; +import org.opensearch.common.xcontent.ObjectParser; +import org.opensearch.common.xcontent.ToXContentObject; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.script.Script; + +import java.io.IOException; +import java.time.ZoneId; +import java.time.ZoneOffset; +import java.util.Objects; + +/** + * A configuration that tells aggregation how to retrieve data from index + * in order to run a specific aggregation. + */ +public abstract class BaseMultiValuesSourceFieldConfig implements Writeable, ToXContentObject { + private final String fieldName; + private final Object missing; + private final Script script; + private final ZoneId timeZone; + + static TriConsumer< + ObjectParser>, Void>, + Boolean, + Boolean> PARSER = (parser, scriptable, timezoneAware) -> { + parser.declareString(Builder::setFieldName, ParseField.CommonFields.FIELD); + parser.declareField( + Builder::setMissing, + XContentParser::objectText, + ParseField.CommonFields.MISSING, + ObjectParser.ValueType.VALUE + ); + + if (scriptable) { + parser.declareField( + Builder::setScript, + (p, context) -> Script.parse(p), + Script.SCRIPT_PARSE_FIELD, + ObjectParser.ValueType.OBJECT_OR_STRING + ); + } + + if (timezoneAware) { + parser.declareField(Builder::setTimeZone, p -> { + if (p.currentToken() == XContentParser.Token.VALUE_STRING) { + return ZoneId.of(p.text()); + } else { + return ZoneOffset.ofHours(p.intValue()); + } + }, ParseField.CommonFields.TIME_ZONE, ObjectParser.ValueType.LONG); + } + }; + + public BaseMultiValuesSourceFieldConfig(String fieldName, Object missing, Script script, ZoneId timeZone) { + this.fieldName = fieldName; + this.missing = missing; + this.script = script; + this.timeZone = timeZone; + } + + public BaseMultiValuesSourceFieldConfig(StreamInput in) throws IOException { + if (in.getVersion().onOrAfter(LegacyESVersion.V_7_6_0)) { + this.fieldName = in.readOptionalString(); + } else { + this.fieldName = in.readString(); + } + this.missing = in.readGenericValue(); + this.script = in.readOptionalWriteable(Script::new); + if (in.getVersion().before(LegacyESVersion.V_7_0_0)) { + this.timeZone = DateUtils.dateTimeZoneToZoneId(in.readOptionalTimeZone()); + } else { + this.timeZone = in.readOptionalZoneId(); + } + } + + @Override + public void writeTo(StreamOutput out) throws IOException { + if (out.getVersion().onOrAfter(LegacyESVersion.V_7_6_0)) { + out.writeOptionalString(fieldName); + } else { + out.writeString(fieldName); + } + out.writeGenericValue(missing); + out.writeOptionalWriteable(script); + if (out.getVersion().before(LegacyESVersion.V_7_0_0)) { + out.writeOptionalTimeZone(DateUtils.zoneIdToDateTimeZone(timeZone)); + } else { + out.writeOptionalZoneId(timeZone); + } + doWriteTo(out); + } + + @Override + public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { + builder.startObject(); + if (missing != null) { + builder.field(ParseField.CommonFields.MISSING.getPreferredName(), missing); + } + if (script != null) { + builder.field(Script.SCRIPT_PARSE_FIELD.getPreferredName(), script); + } + if (fieldName != null) { + builder.field(ParseField.CommonFields.FIELD.getPreferredName(), fieldName); + } + if (timeZone != null) { + builder.field(ParseField.CommonFields.TIME_ZONE.getPreferredName(), timeZone.getId()); + } + doXContentBody(builder, params); + builder.endObject(); + return builder; + } + + public Object getMissing() { + return missing; + } + + public Script getScript() { + return script; + } + + public ZoneId getTimeZone() { + return timeZone; + } + + public String getFieldName() { + return fieldName; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + BaseMultiValuesSourceFieldConfig that = (BaseMultiValuesSourceFieldConfig) o; + return Objects.equals(fieldName, that.fieldName) + && Objects.equals(missing, that.missing) + && Objects.equals(script, that.script) + && Objects.equals(timeZone, that.timeZone); + } + + @Override + public int hashCode() { + return Objects.hash(fieldName, missing, script, timeZone); + } + + @Override + public String toString() { + return Strings.toString(this); + } + + abstract void doXContentBody(XContentBuilder builder, Params params) throws IOException; + + abstract void doWriteTo(StreamOutput out) throws IOException; + + public abstract static class Builder> { + String fieldName; + Object missing = null; + Script script = null; + ZoneId timeZone = null; + + public String getFieldName() { + return fieldName; + } + + public B setFieldName(String fieldName) { + this.fieldName = fieldName; + return (B) this; + } + + public Object getMissing() { + return missing; + } + + public B setMissing(Object missing) { + this.missing = missing; + return (B) this; + } + + public Script getScript() { + return script; + } + + public B setScript(Script script) { + this.script = script; + return (B) this; + } + + public ZoneId getTimeZone() { + return timeZone; + } + + public B setTimeZone(ZoneId timeZone) { + this.timeZone = timeZone; + return (B) this; + } + + abstract public C build(); + } +} diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/MultiTermsValuesSourceConfig.java b/server/src/main/java/org/opensearch/search/aggregations/support/MultiTermsValuesSourceConfig.java new file mode 100644 index 0000000000000..3bc7f444c610d --- /dev/null +++ b/server/src/main/java/org/opensearch/search/aggregations/support/MultiTermsValuesSourceConfig.java @@ -0,0 +1,203 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.search.aggregations.support; + +import org.opensearch.common.ParseField; +import org.opensearch.common.Strings; +import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.common.xcontent.ObjectParser; +import org.opensearch.common.xcontent.XContentBuilder; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.script.Script; +import org.opensearch.search.aggregations.AggregationBuilder; +import org.opensearch.search.aggregations.bucket.terms.IncludeExclude; + +import java.io.IOException; +import java.time.ZoneId; +import java.util.Objects; + +/** + * A configuration that used by multi_terms aggregations. + */ +public class MultiTermsValuesSourceConfig extends BaseMultiValuesSourceFieldConfig { + private final ValueType userValueTypeHint; + private final String format; + private final IncludeExclude includeExclude; + + private static final String NAME = "field_config"; + public static final ParseField FILTER = new ParseField("filter"); + + public interface ParserSupplier { + ObjectParser apply( + Boolean scriptable, + Boolean timezoneAware, + Boolean valueTypeHinted, + Boolean formatted + ); + } + + public static final MultiTermsValuesSourceConfig.ParserSupplier PARSER = (scriptable, timezoneAware, valueTypeHinted, formatted) -> { + + ObjectParser parser = new ObjectParser<>( + MultiTermsValuesSourceConfig.NAME, + MultiTermsValuesSourceConfig.Builder::new + ); + + BaseMultiValuesSourceFieldConfig.PARSER.apply(parser, scriptable, timezoneAware); + + if (valueTypeHinted) { + parser.declareField( + MultiTermsValuesSourceConfig.Builder::setUserValueTypeHint, + p -> ValueType.lenientParse(p.text()), + ValueType.VALUE_TYPE, + ObjectParser.ValueType.STRING + ); + } + + if (formatted) { + parser.declareField( + MultiTermsValuesSourceConfig.Builder::setFormat, + XContentParser::text, + ParseField.CommonFields.FORMAT, + ObjectParser.ValueType.STRING + ); + } + + parser.declareField( + (b, v) -> b.setIncludeExclude(IncludeExclude.merge(b.getIncludeExclude(), v)), + IncludeExclude::parseExclude, + IncludeExclude.EXCLUDE_FIELD, + ObjectParser.ValueType.STRING_ARRAY + ); + + return parser; + }; + + protected MultiTermsValuesSourceConfig( + String fieldName, + Object missing, + Script script, + ZoneId timeZone, + ValueType userValueTypeHint, + String format, + IncludeExclude includeExclude + ) { + super(fieldName, missing, script, timeZone); + this.userValueTypeHint = userValueTypeHint; + this.format = format; + this.includeExclude = includeExclude; + } + + public MultiTermsValuesSourceConfig(StreamInput in) throws IOException { + super(in); + this.userValueTypeHint = in.readOptionalWriteable(ValueType::readFromStream); + this.format = in.readOptionalString(); + this.includeExclude = in.readOptionalWriteable(IncludeExclude::new); + } + + public ValueType getUserValueTypeHint() { + return userValueTypeHint; + } + + public String getFormat() { + return format; + } + + /** + * Get terms to include and exclude from the aggregation results + */ + public IncludeExclude getIncludeExclude() { + return includeExclude; + } + + @Override + public void doWriteTo(StreamOutput out) throws IOException { + out.writeOptionalWriteable(userValueTypeHint); + out.writeOptionalString(format); + out.writeOptionalWriteable(includeExclude); + } + + @Override + public void doXContentBody(XContentBuilder builder, Params params) throws IOException { + if (userValueTypeHint != null) { + builder.field(AggregationBuilder.CommonFields.VALUE_TYPE.getPreferredName(), userValueTypeHint.getPreferredName()); + } + if (format != null) { + builder.field(AggregationBuilder.CommonFields.FORMAT.getPreferredName(), format); + } + if (includeExclude != null) { + includeExclude.toXContent(builder, params); + } + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + if (super.equals(o) == false) return false; + + MultiTermsValuesSourceConfig that = (MultiTermsValuesSourceConfig) o; + return Objects.equals(userValueTypeHint, that.userValueTypeHint) + && Objects.equals(format, that.format) + && Objects.equals(includeExclude, that.includeExclude); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), userValueTypeHint, format, includeExclude); + } + + public static class Builder extends BaseMultiValuesSourceFieldConfig.Builder { + private ValueType userValueTypeHint = null; + private String format; + private IncludeExclude includeExclude = null; + + public IncludeExclude getIncludeExclude() { + return includeExclude; + } + + public Builder setIncludeExclude(IncludeExclude includeExclude) { + this.includeExclude = includeExclude; + return this; + } + + public ValueType getUserValueTypeHint() { + return userValueTypeHint; + } + + public Builder setUserValueTypeHint(ValueType userValueTypeHint) { + this.userValueTypeHint = userValueTypeHint; + return this; + } + + public String getFormat() { + return format; + } + + public Builder setFormat(String format) { + this.format = format; + return this; + } + + public MultiTermsValuesSourceConfig build() { + if (Strings.isNullOrEmpty(fieldName) && script == null) { + throw new IllegalArgumentException( + "[" + + ParseField.CommonFields.FIELD.getPreferredName() + + "] and [" + + Script.SCRIPT_PARSE_FIELD.getPreferredName() + + "] cannot both be null. " + + "Please specify one or the other." + ); + } + return new MultiTermsValuesSourceConfig(fieldName, missing, script, timeZone, userValueTypeHint, format, includeExclude); + } + } +} diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSourceFieldConfig.java b/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSourceFieldConfig.java index 54450763148c8..ea9bbe8019276 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSourceFieldConfig.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSourceFieldConfig.java @@ -38,26 +38,17 @@ import org.opensearch.common.TriFunction; import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; -import org.opensearch.common.time.DateUtils; import org.opensearch.common.xcontent.ObjectParser; -import org.opensearch.common.xcontent.ToXContentObject; import org.opensearch.common.xcontent.XContentBuilder; -import org.opensearch.common.xcontent.XContentParser; import org.opensearch.index.query.AbstractQueryBuilder; import org.opensearch.index.query.QueryBuilder; import org.opensearch.script.Script; import java.io.IOException; import java.time.ZoneId; -import java.time.ZoneOffset; import java.util.Objects; -public class MultiValuesSourceFieldConfig implements Writeable, ToXContentObject { - private final String fieldName; - private final Object missing; - private final Script script; - private final ZoneId timeZone; +public class MultiValuesSourceFieldConfig extends BaseMultiValuesSourceFieldConfig { private final QueryBuilder filter; private static final String NAME = "field_config"; @@ -73,32 +64,7 @@ public class MultiValuesSourceFieldConfig implements Writeable, ToXContentObject MultiValuesSourceFieldConfig.Builder::new ); - parser.declareString(MultiValuesSourceFieldConfig.Builder::setFieldName, ParseField.CommonFields.FIELD); - parser.declareField( - MultiValuesSourceFieldConfig.Builder::setMissing, - XContentParser::objectText, - ParseField.CommonFields.MISSING, - ObjectParser.ValueType.VALUE - ); - - if (scriptable) { - parser.declareField( - MultiValuesSourceFieldConfig.Builder::setScript, - (p, context) -> Script.parse(p), - Script.SCRIPT_PARSE_FIELD, - ObjectParser.ValueType.OBJECT_OR_STRING - ); - } - - if (timezoneAware) { - parser.declareField(MultiValuesSourceFieldConfig.Builder::setTimeZone, p -> { - if (p.currentToken() == XContentParser.Token.VALUE_STRING) { - return ZoneId.of(p.text()); - } else { - return ZoneOffset.ofHours(p.intValue()); - } - }, ParseField.CommonFields.TIME_ZONE, ObjectParser.ValueType.LONG); - } + BaseMultiValuesSourceFieldConfig.PARSER.apply(parser, scriptable, timezoneAware); if (filtered) { parser.declareField( @@ -112,26 +78,12 @@ public class MultiValuesSourceFieldConfig implements Writeable, ToXContentObject }; protected MultiValuesSourceFieldConfig(String fieldName, Object missing, Script script, ZoneId timeZone, QueryBuilder filter) { - this.fieldName = fieldName; - this.missing = missing; - this.script = script; - this.timeZone = timeZone; + super(fieldName, missing, script, timeZone); this.filter = filter; } public MultiValuesSourceFieldConfig(StreamInput in) throws IOException { - if (in.getVersion().onOrAfter(LegacyESVersion.V_7_6_0)) { - this.fieldName = in.readOptionalString(); - } else { - this.fieldName = in.readString(); - } - this.missing = in.readGenericValue(); - this.script = in.readOptionalWriteable(Script::new); - if (in.getVersion().before(LegacyESVersion.V_7_0_0)) { - this.timeZone = DateUtils.dateTimeZoneToZoneId(in.readOptionalTimeZone()); - } else { - this.timeZone = in.readOptionalZoneId(); - } + super(in); if (in.getVersion().onOrAfter(LegacyESVersion.V_7_8_0)) { this.filter = in.readOptionalNamedWriteable(QueryBuilder.class); } else { @@ -139,133 +91,43 @@ public MultiValuesSourceFieldConfig(StreamInput in) throws IOException { } } - public Object getMissing() { - return missing; - } - - public Script getScript() { - return script; - } - - public ZoneId getTimeZone() { - return timeZone; - } - - public String getFieldName() { - return fieldName; - } - public QueryBuilder getFilter() { return filter; } @Override - public void writeTo(StreamOutput out) throws IOException { - if (out.getVersion().onOrAfter(LegacyESVersion.V_7_6_0)) { - out.writeOptionalString(fieldName); - } else { - out.writeString(fieldName); - } - out.writeGenericValue(missing); - out.writeOptionalWriteable(script); - if (out.getVersion().before(LegacyESVersion.V_7_0_0)) { - out.writeOptionalTimeZone(DateUtils.zoneIdToDateTimeZone(timeZone)); - } else { - out.writeOptionalZoneId(timeZone); - } + public void doWriteTo(StreamOutput out) throws IOException { if (out.getVersion().onOrAfter(LegacyESVersion.V_7_8_0)) { out.writeOptionalNamedWriteable(filter); } } @Override - public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { - builder.startObject(); - if (missing != null) { - builder.field(ParseField.CommonFields.MISSING.getPreferredName(), missing); - } - if (script != null) { - builder.field(Script.SCRIPT_PARSE_FIELD.getPreferredName(), script); - } - if (fieldName != null) { - builder.field(ParseField.CommonFields.FIELD.getPreferredName(), fieldName); - } - if (timeZone != null) { - builder.field(ParseField.CommonFields.TIME_ZONE.getPreferredName(), timeZone.getId()); - } + public void doXContentBody(XContentBuilder builder, Params params) throws IOException { if (filter != null) { builder.field(FILTER.getPreferredName()); filter.toXContent(builder, params); } - builder.endObject(); - return builder; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; + if (super.equals(o) == false) return false; + MultiValuesSourceFieldConfig that = (MultiValuesSourceFieldConfig) o; - return Objects.equals(fieldName, that.fieldName) - && Objects.equals(missing, that.missing) - && Objects.equals(script, that.script) - && Objects.equals(timeZone, that.timeZone) - && Objects.equals(filter, that.filter); + return Objects.equals(filter, that.filter); } @Override public int hashCode() { - return Objects.hash(fieldName, missing, script, timeZone, filter); + return Objects.hash(super.hashCode(), filter); } - @Override - public String toString() { - return Strings.toString(this); - } - - public static class Builder { - private String fieldName; - private Object missing = null; - private Script script = null; - private ZoneId timeZone = null; + public static class Builder extends BaseMultiValuesSourceFieldConfig.Builder { private QueryBuilder filter = null; - public String getFieldName() { - return fieldName; - } - - public Builder setFieldName(String fieldName) { - this.fieldName = fieldName; - return this; - } - - public Object getMissing() { - return missing; - } - - public Builder setMissing(Object missing) { - this.missing = missing; - return this; - } - - public Script getScript() { - return script; - } - - public Builder setScript(Script script) { - this.script = script; - return this; - } - - public ZoneId getTimeZone() { - return timeZone; - } - - public Builder setTimeZone(ZoneId timeZone) { - this.timeZone = timeZone; - return this; - } - public Builder setFilter(QueryBuilder filter) { this.filter = filter; return this; diff --git a/server/src/test/java/org/opensearch/search/aggregations/AggregationsTests.java b/server/src/test/java/org/opensearch/search/aggregations/AggregationsTests.java index fe029d22a45b2..421865013a28c 100644 --- a/server/src/test/java/org/opensearch/search/aggregations/AggregationsTests.java +++ b/server/src/test/java/org/opensearch/search/aggregations/AggregationsTests.java @@ -64,6 +64,7 @@ import org.opensearch.search.aggregations.bucket.range.InternalRangeTests; import org.opensearch.search.aggregations.bucket.sampler.InternalSamplerTests; import org.opensearch.search.aggregations.bucket.terms.DoubleTermsTests; +import org.opensearch.search.aggregations.bucket.terms.InternalMultiTermsTests; import org.opensearch.search.aggregations.bucket.terms.LongRareTermsTests; import org.opensearch.search.aggregations.bucket.terms.LongTermsTests; import org.opensearch.search.aggregations.bucket.terms.SignificantLongTermsTests; @@ -172,6 +173,7 @@ private static List> getAggsTests() { aggsTests.add(new InternalTopHitsTests()); aggsTests.add(new InternalCompositeTests()); aggsTests.add(new InternalMedianAbsoluteDeviationTests()); + aggsTests.add(new InternalMultiTermsTests()); return Collections.unmodifiableList(aggsTests); } diff --git a/server/src/test/java/org/opensearch/search/aggregations/bucket/terms/InternalMultiTermsTests.java b/server/src/test/java/org/opensearch/search/aggregations/bucket/terms/InternalMultiTermsTests.java new file mode 100644 index 0000000000000..2657f2bdd5138 --- /dev/null +++ b/server/src/test/java/org/opensearch/search/aggregations/bucket/terms/InternalMultiTermsTests.java @@ -0,0 +1,116 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.search.aggregations.bucket.terms; + +import org.apache.lucene.document.InetAddressPoint; +import org.apache.lucene.util.BytesRef; +import org.opensearch.search.DocValueFormat; +import org.opensearch.search.aggregations.BucketOrder; +import org.opensearch.search.aggregations.InternalAggregations; +import org.opensearch.search.aggregations.ParsedMultiBucketAggregation; +import org.opensearch.search.aggregations.support.CoreValuesSourceType; +import org.opensearch.search.aggregations.support.ValuesSourceType; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import static java.util.Arrays.asList; + +public class InternalMultiTermsTests extends InternalTermsTestCase { + + /** + * terms count and type should consistent across entire test. + */ + private final List types = getSupportedValuesSourceTypes(); + + @Override + protected InternalTerms createTestInstance( + String name, + Map metadata, + InternalAggregations aggregations, + boolean showTermDocCountError, + long docCountError + ) { + BucketOrder order = BucketOrder.count(false); + long minDocCount = 1; + int requiredSize = 3; + int shardSize = requiredSize + 2; + long otherDocCount = 0; + + final int numBuckets = randomNumberOfBuckets(); + + List buckets = new ArrayList<>(); + List formats = types.stream().map(type -> type.getFormatter(null, null)).collect(Collectors.toList()); + + for (int i = 0; i < numBuckets; i++) { + buckets.add( + new InternalMultiTerms.Bucket( + types.stream().map(this::value).collect(Collectors.toList()), + minDocCount, + aggregations, + showTermDocCountError, + docCountError, + formats + ) + ); + } + BucketOrder reduceOrder = rarely() ? order : BucketOrder.key(true); + // mimic per-shard bucket sort operation, which is required by bucket reduce phase. + Collections.sort(buckets, reduceOrder.comparator()); + return new InternalMultiTerms( + name, + reduceOrder, + order, + requiredSize, + minDocCount, + metadata, + shardSize, + showTermDocCountError, + otherDocCount, + docCountError, + formats, + buckets + ); + } + + @Override + protected Class implementationClass() { + return ParsedMultiTerms.class; + } + + private static List getSupportedValuesSourceTypes() { + return Collections.unmodifiableList( + asList( + CoreValuesSourceType.NUMERIC, + CoreValuesSourceType.BYTES, + CoreValuesSourceType.IP, + CoreValuesSourceType.DATE, + CoreValuesSourceType.BOOLEAN + ) + ); + } + + private Object value(ValuesSourceType type) { + if (CoreValuesSourceType.NUMERIC.equals(type)) { + return randomInt(); + } else if (CoreValuesSourceType.DATE.equals(type)) { + return randomNonNegativeLong(); + } else if (CoreValuesSourceType.BOOLEAN.equals(type)) { + return randomBoolean(); + } else if (CoreValuesSourceType.BYTES.equals(type)) { + return new BytesRef(randomAlphaOfLength(10)); + } else if (CoreValuesSourceType.IP.equals(type)) { + return new BytesRef(InetAddressPoint.encode(randomIp(randomBoolean()))); + } + throw new IllegalArgumentException("unexpected type [" + type.typeName() + "]"); + } +} diff --git a/server/src/test/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregationBuilderTests.java b/server/src/test/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregationBuilderTests.java new file mode 100644 index 0000000000000..505fb7382ab3b --- /dev/null +++ b/server/src/test/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregationBuilderTests.java @@ -0,0 +1,182 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.search.aggregations.bucket.terms; + +import org.opensearch.search.DocValueFormat; +import org.opensearch.search.aggregations.Aggregator; +import org.opensearch.search.aggregations.BaseAggregationTestCase; +import org.opensearch.search.aggregations.BucketOrder; +import org.opensearch.search.aggregations.support.MultiTermsValuesSourceConfig; +import org.opensearch.search.aggregations.support.ValueType; + +import java.time.ZoneId; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.function.Supplier; + +public class MultiTermsAggregationBuilderTests extends BaseAggregationTestCase { + + @Override + protected MultiTermsAggregationBuilder createTestAggregatorBuilder() { + String name = randomAlphaOfLengthBetween(3, 20); + MultiTermsAggregationBuilder factory = new MultiTermsAggregationBuilder(name); + + int termsCount = randomIntBetween(2, 10); + List fieldConfigs = new ArrayList<>(); + for (int i = 0; i < termsCount; i++) { + fieldConfigs.add(randomFieldConfig()); + } + factory.terms(fieldConfigs); + + if (randomBoolean()) { + factory.size(randomIntBetween(1, Integer.MAX_VALUE)); + } + if (randomBoolean()) { + factory.shardSize(randomIntBetween(1, Integer.MAX_VALUE)); + } + if (randomBoolean()) { + int minDocCount = randomInt(4); + switch (minDocCount) { + case 0: + break; + case 1: + case 2: + case 3: + case 4: + minDocCount = randomIntBetween(0, Integer.MAX_VALUE); + break; + default: + fail(); + } + factory.minDocCount(minDocCount); + } + if (randomBoolean()) { + int shardMinDocCount = randomInt(4); + switch (shardMinDocCount) { + case 0: + break; + case 1: + case 2: + case 3: + case 4: + shardMinDocCount = randomIntBetween(0, Integer.MAX_VALUE); + break; + default: + fail(); + } + factory.shardMinDocCount(shardMinDocCount); + } + if (randomBoolean()) { + factory.collectMode(randomFrom(Aggregator.SubAggCollectionMode.values())); + } + if (randomBoolean()) { + List order = randomOrder(); + if (order.size() == 1 && randomBoolean()) { + factory.order(order.get(0)); + } else { + factory.order(order); + } + } + if (randomBoolean()) { + factory.showTermDocCountError(randomBoolean()); + } + return factory; + } + + public void testInvalidTermsParams() { + IllegalArgumentException exception = expectThrows( + IllegalArgumentException.class, + () -> { new MultiTermsAggregationBuilder("_name").terms(Collections.singletonList(randomFieldConfig())); } + ); + assertEquals( + "multi term aggregation must has at least 2 terms. Found [1] in [_name] Use terms aggregation for single term aggregation", + exception.getMessage() + ); + + exception = expectThrows( + IllegalArgumentException.class, + () -> { new MultiTermsAggregationBuilder("_name").terms(Collections.emptyList()); } + ); + assertEquals("multi term aggregation must has at least 2 terms. Found [0] in [_name]", exception.getMessage()); + + exception = expectThrows(IllegalArgumentException.class, () -> { new MultiTermsAggregationBuilder("_name").terms(null); }); + assertEquals("[terms] must not be null. Found null terms in [_name]", exception.getMessage()); + } + + private List randomOrder() { + List orders = new ArrayList<>(); + switch (randomInt(4)) { + case 0: + orders.add(BucketOrder.key(randomBoolean())); + break; + case 1: + orders.add(BucketOrder.count(randomBoolean())); + break; + case 2: + orders.add(BucketOrder.aggregation(randomAlphaOfLengthBetween(3, 20), randomBoolean())); + break; + case 3: + orders.add(BucketOrder.aggregation(randomAlphaOfLengthBetween(3, 20), randomAlphaOfLengthBetween(3, 20), randomBoolean())); + break; + case 4: + int numOrders = randomIntBetween(1, 3); + for (int i = 0; i < numOrders; i++) { + orders.addAll(randomOrder()); + } + break; + default: + fail(); + } + return orders; + } + + protected static MultiTermsValuesSourceConfig randomFieldConfig() { + String field = randomAlphaOfLength(10); + Object missing = randomBoolean() ? randomAlphaOfLength(10) : null; + ZoneId timeZone = randomBoolean() ? randomZone() : null; + ValueType userValueTypeHint = randomBoolean() + ? randomFrom(ValueType.STRING, ValueType.LONG, ValueType.DOUBLE, ValueType.DATE, ValueType.IP) + : null; + String format = randomBoolean() ? randomNumericDocValueFormat().toString() : null; + return randomFieldOrScript( + new MultiTermsValuesSourceConfig.Builder().setMissing(missing) + .setTimeZone(timeZone) + .setUserValueTypeHint(userValueTypeHint) + .setFormat(format), + field + ).build(); + } + + protected static MultiTermsValuesSourceConfig.Builder randomFieldOrScript(MultiTermsValuesSourceConfig.Builder builder, String field) { + int choice = randomInt(1); + switch (choice) { + case 0: + builder.setFieldName(field); + break; + case 1: + builder.setScript(mockScript("doc[" + field + "] + 1")); + break; + default: + throw new AssertionError("Unknown random operation [" + choice + "]"); + } + return builder; + } + + /** + * @return a random {@link DocValueFormat} that can be used in aggregations which + * compute numbers. + */ + protected static DocValueFormat randomNumericDocValueFormat() { + final List> formats = new ArrayList<>(3); + formats.add(() -> DocValueFormat.RAW); + formats.add(() -> new DocValueFormat.Decimal(randomFrom("###.##", "###,###.##"))); + return randomFrom(formats).get(); + } +} diff --git a/server/src/test/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregatorTests.java b/server/src/test/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregatorTests.java new file mode 100644 index 0000000000000..f3922a65ff264 --- /dev/null +++ b/server/src/test/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregatorTests.java @@ -0,0 +1,909 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.search.aggregations.bucket.terms; + +import org.apache.lucene.document.DoubleDocValuesField; +import org.apache.lucene.document.Field; +import org.apache.lucene.document.FloatDocValuesField; +import org.apache.lucene.document.InetAddressPoint; +import org.apache.lucene.document.NumericDocValuesField; +import org.apache.lucene.document.SortedDocValuesField; +import org.apache.lucene.document.SortedNumericDocValuesField; +import org.apache.lucene.document.SortedSetDocValuesField; +import org.apache.lucene.document.StringField; +import org.apache.lucene.tests.index.RandomIndexWriter; +import org.apache.lucene.index.Term; +import org.apache.lucene.search.MatchAllDocsQuery; +import org.apache.lucene.search.Query; +import org.apache.lucene.search.TermQuery; +import org.apache.lucene.util.BytesRef; +import org.hamcrest.MatcherAssert; +import org.opensearch.common.CheckedConsumer; +import org.opensearch.common.network.InetAddresses; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.time.DateFormatter; +import org.opensearch.index.mapper.BooleanFieldMapper; +import org.opensearch.index.mapper.DateFieldMapper; +import org.opensearch.index.mapper.GeoPointFieldMapper; +import org.opensearch.index.mapper.IpFieldMapper; +import org.opensearch.index.mapper.KeywordFieldMapper; +import org.opensearch.index.mapper.MappedFieldType; +import org.opensearch.index.mapper.NumberFieldMapper; +import org.opensearch.script.MockScriptEngine; +import org.opensearch.script.Script; +import org.opensearch.script.ScriptEngine; +import org.opensearch.script.ScriptModule; +import org.opensearch.script.ScriptService; +import org.opensearch.script.ScriptType; +import org.opensearch.search.aggregations.AggregationBuilder; +import org.opensearch.search.aggregations.AggregatorTestCase; +import org.opensearch.search.aggregations.BucketOrder; +import org.opensearch.search.aggregations.metrics.InternalMax; +import org.opensearch.search.aggregations.metrics.MaxAggregationBuilder; +import org.opensearch.search.aggregations.support.CoreValuesSourceType; +import org.opensearch.search.aggregations.support.MultiTermsValuesSourceConfig; +import org.opensearch.search.aggregations.support.ValueType; +import org.opensearch.search.aggregations.support.ValuesSourceType; +import org.opensearch.search.lookup.LeafDocLookup; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Consumer; +import java.util.function.Function; + +import static java.util.Arrays.asList; +import static java.util.Collections.emptyMap; +import static java.util.Collections.singletonList; +import static java.util.Collections.singletonMap; +import static java.util.stream.Collectors.toList; +import static org.hamcrest.Matchers.closeTo; +import static org.hamcrest.Matchers.contains; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.hasSize; + +public class MultiTermsAggregatorTests extends AggregatorTestCase { + private static final String FIELD_NAME = "field"; + private static final String VALUE_SCRIPT_NAME = "value_script"; + private static final String FIELD_SCRIPT_NAME = "field_script"; + + private static final String AGG_NAME = "_name"; + + private static final String INT_FIELD = "int"; + private static final String LONG_FIELD = "long"; + private static final String FLOAT_FIELD = "float"; + private static final String DOUBLE_FIELD = "double"; + private static final String KEYWORD_FIELD = "keyword"; + private static final String DATE_FIELD = "date"; + private static final String IP_FIELD = "ip"; + private static final String GEO_POINT_FIELD = "geopoint"; + private static final String BOOL_FIELD = "bool"; + private static final String UNRELATED_KEYWORD_FIELD = "unrelated"; + + private static final Map mappedFieldTypeMap = new HashMap() { + { + put(INT_FIELD, new NumberFieldMapper.NumberFieldType(INT_FIELD, NumberFieldMapper.NumberType.INTEGER)); + put(LONG_FIELD, new NumberFieldMapper.NumberFieldType(LONG_FIELD, NumberFieldMapper.NumberType.LONG)); + put(FLOAT_FIELD, new NumberFieldMapper.NumberFieldType(FLOAT_FIELD, NumberFieldMapper.NumberType.FLOAT)); + put(DOUBLE_FIELD, new NumberFieldMapper.NumberFieldType(DOUBLE_FIELD, NumberFieldMapper.NumberType.DOUBLE)); + put(DATE_FIELD, dateFieldType(DATE_FIELD)); + put(KEYWORD_FIELD, new KeywordFieldMapper.KeywordFieldType(KEYWORD_FIELD)); + put(IP_FIELD, new IpFieldMapper.IpFieldType(IP_FIELD)); + put(FIELD_NAME, new NumberFieldMapper.NumberFieldType(FIELD_NAME, NumberFieldMapper.NumberType.INTEGER)); + put(UNRELATED_KEYWORD_FIELD, new KeywordFieldMapper.KeywordFieldType(UNRELATED_KEYWORD_FIELD)); + put(GEO_POINT_FIELD, new GeoPointFieldMapper.GeoPointFieldType(GEO_POINT_FIELD)); + put(BOOL_FIELD, new BooleanFieldMapper.BooleanFieldType(BOOL_FIELD)); + } + }; + + private static final Consumer NONE_DECORATOR = null; + + @Override + protected List getSupportedValuesSourceTypes() { + return Collections.unmodifiableList( + asList( + CoreValuesSourceType.NUMERIC, + CoreValuesSourceType.BYTES, + CoreValuesSourceType.IP, + CoreValuesSourceType.DATE, + CoreValuesSourceType.BOOLEAN + ) + ); + } + + @Override + protected AggregationBuilder createAggBuilderForTypeTest(MappedFieldType fieldType, String fieldName) { + return createTestAggregatorBuilder(asList(term(fieldName), term(fieldName))); + } + + @Override + protected ScriptService getMockScriptService() { + final Map, Object>> scripts = org.opensearch.common.collect.Map.of( + VALUE_SCRIPT_NAME, + vars -> ((Number) vars.get("_value")).doubleValue() + 1, + FIELD_SCRIPT_NAME, + vars -> { + final String fieldName = (String) vars.get(FIELD_NAME); + final LeafDocLookup lookup = (LeafDocLookup) vars.get("doc"); + return lookup.get(fieldName).stream().map(value -> ((Number) value).longValue() + 1).collect(toList()); + } + ); + final MockScriptEngine engine = new MockScriptEngine(MockScriptEngine.NAME, scripts, emptyMap()); + final Map engines = singletonMap(engine.getType(), engine); + return new ScriptService(Settings.EMPTY, engines, ScriptModule.CORE_CONTEXTS); + } + + public void testNumbers() throws IOException { + testAggregation( + new MatchAllDocsQuery(), + fieldConfigs(asList(INT_FIELD, LONG_FIELD, FLOAT_FIELD, DOUBLE_FIELD)), + NONE_DECORATOR, + iw -> { + iw.addDocument( + asList( + new NumericDocValuesField(INT_FIELD, 1), + new SortedNumericDocValuesField(LONG_FIELD, 1L), + new FloatDocValuesField(FLOAT_FIELD, 1.0f), + new DoubleDocValuesField(DOUBLE_FIELD, 1.0d) + ) + ); + iw.addDocument( + asList( + new NumericDocValuesField(INT_FIELD, 1), + new SortedNumericDocValuesField(LONG_FIELD, 1L), + new FloatDocValuesField(FLOAT_FIELD, 1.0f), + new DoubleDocValuesField(DOUBLE_FIELD, 1.0d) + ) + ); + iw.addDocument( + asList( + new NumericDocValuesField(INT_FIELD, 2), + new SortedNumericDocValuesField(LONG_FIELD, 2L), + new FloatDocValuesField(FLOAT_FIELD, 2.0f), + new DoubleDocValuesField(DOUBLE_FIELD, 2.0d) + ) + ); + iw.addDocument( + asList( + new NumericDocValuesField(INT_FIELD, 2), + new SortedNumericDocValuesField(LONG_FIELD, 2L), + new FloatDocValuesField(FLOAT_FIELD, 3.0f), + new DoubleDocValuesField(DOUBLE_FIELD, 3.0d) + ) + ); + iw.addDocument( + asList( + new NumericDocValuesField(INT_FIELD, 2), + new SortedNumericDocValuesField(LONG_FIELD, 2L), + new FloatDocValuesField(FLOAT_FIELD, 3.0f), + new DoubleDocValuesField(DOUBLE_FIELD, 3.0d) + ) + ); + }, + h -> { + MatcherAssert.assertThat(h.getBuckets(), hasSize(3)); + MatcherAssert.assertThat(h.getBuckets().get(0).getKey(), contains(equalTo(1L), equalTo(1L), equalTo(1.0), equalTo(1.0))); + MatcherAssert.assertThat(h.getBuckets().get(0).getDocCount(), equalTo(2L)); + MatcherAssert.assertThat(h.getBuckets().get(1).getKey(), contains(equalTo(2L), equalTo(2L), equalTo(3.0), equalTo(3.0))); + MatcherAssert.assertThat(h.getBuckets().get(1).getDocCount(), equalTo(2L)); + MatcherAssert.assertThat(h.getBuckets().get(2).getKey(), contains(equalTo(2L), equalTo(2L), equalTo(2.0), equalTo(2.0))); + MatcherAssert.assertThat(h.getBuckets().get(2).getDocCount(), equalTo(1L)); + } + ); + } + + public void testMixNumberAndKeywordWithFilter() throws IOException { + testAggregation( + new TermQuery(new Term(KEYWORD_FIELD, "a")), + fieldConfigs(asList(KEYWORD_FIELD, FLOAT_FIELD)), + NONE_DECORATOR, + iw -> { + iw.addDocument( + asList( + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")), + new StringField(KEYWORD_FIELD, "a", Field.Store.NO), + new FloatDocValuesField(FLOAT_FIELD, 2.0f) + ) + ); + iw.addDocument( + asList( + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")), + new StringField(KEYWORD_FIELD, "a", Field.Store.NO), + new FloatDocValuesField(FLOAT_FIELD, 1.0f) + ) + ); + iw.addDocument( + asList( + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")), + new StringField(KEYWORD_FIELD, "b", Field.Store.NO), + new FloatDocValuesField(FLOAT_FIELD, 1.0f) + ) + ); + iw.addDocument( + asList( + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")), + new StringField(KEYWORD_FIELD, "a", Field.Store.NO), + new FloatDocValuesField(FLOAT_FIELD, 2.0f) + ) + ); + }, + h -> { + MatcherAssert.assertThat(h.getBuckets(), hasSize(2)); + MatcherAssert.assertThat(h.getBuckets().get(0).getKey(), contains(equalTo("a"), equalTo(2.0))); + MatcherAssert.assertThat(h.getBuckets().get(0).getDocCount(), equalTo(2L)); + MatcherAssert.assertThat(h.getBuckets().get(1).getKey(), contains(equalTo("a"), equalTo(1.0))); + MatcherAssert.assertThat(h.getBuckets().get(1).getDocCount(), equalTo(1L)); + } + ); + } + + public void testMixNumberAndKeyword() throws IOException { + testAggregation(new MatchAllDocsQuery(), fieldConfigs(asList(KEYWORD_FIELD, INT_FIELD, FLOAT_FIELD)), NONE_DECORATOR, iw -> { + iw.addDocument( + asList( + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")), + new NumericDocValuesField(INT_FIELD, 1), + new FloatDocValuesField(FLOAT_FIELD, 1.0f) + ) + ); + iw.addDocument( + asList( + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")), + new NumericDocValuesField(INT_FIELD, 1), + new FloatDocValuesField(FLOAT_FIELD, 1.0f) + ) + ); + iw.addDocument( + asList( + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("b")), + new NumericDocValuesField(INT_FIELD, 1), + new FloatDocValuesField(FLOAT_FIELD, 2.0f) + ) + ); + iw.addDocument( + asList( + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("c")), + new NumericDocValuesField(INT_FIELD, 2), + new FloatDocValuesField(FLOAT_FIELD, 2.0f) + ) + ); + }, h -> { + MatcherAssert.assertThat(h.getBuckets(), hasSize(3)); + MatcherAssert.assertThat(h.getBuckets().get(0).getKey(), contains(equalTo("a"), equalTo(1L), equalTo(1.0))); + MatcherAssert.assertThat(h.getBuckets().get(0).getDocCount(), equalTo(2L)); + MatcherAssert.assertThat(h.getBuckets().get(1).getKey(), contains(equalTo("b"), equalTo(1L), equalTo(2.0))); + MatcherAssert.assertThat(h.getBuckets().get(1).getDocCount(), equalTo(1L)); + MatcherAssert.assertThat(h.getBuckets().get(2).getKey(), contains(equalTo("c"), equalTo(2L), equalTo(2.0))); + MatcherAssert.assertThat(h.getBuckets().get(2).getDocCount(), equalTo(1L)); + }); + } + + public void testMultiValuesField() throws IOException { + testAggregation(new MatchAllDocsQuery(), fieldConfigs(asList(KEYWORD_FIELD, INT_FIELD)), NONE_DECORATOR, iw -> { + iw.addDocument( + asList( + new SortedSetDocValuesField(KEYWORD_FIELD, new BytesRef("a")), + new SortedSetDocValuesField(KEYWORD_FIELD, new BytesRef("b")), + new SortedNumericDocValuesField(INT_FIELD, 1) + ) + ); + iw.addDocument( + asList( + new SortedSetDocValuesField(KEYWORD_FIELD, new BytesRef("a")), + new SortedNumericDocValuesField(INT_FIELD, 1), + new SortedNumericDocValuesField(INT_FIELD, 3) + ) + ); + }, h -> { + MatcherAssert.assertThat(h.getBuckets(), hasSize(3)); + MatcherAssert.assertThat(h.getBuckets().get(0).getKey(), contains(equalTo("a"), equalTo(1L))); + MatcherAssert.assertThat(h.getBuckets().get(0).getDocCount(), equalTo(2L)); + MatcherAssert.assertThat(h.getBuckets().get(1).getKey(), contains(equalTo("a"), equalTo(3L))); + MatcherAssert.assertThat(h.getBuckets().get(1).getDocCount(), equalTo(1L)); + MatcherAssert.assertThat(h.getBuckets().get(2).getKey(), contains(equalTo("b"), equalTo(1L))); + }); + + testAggregation(new MatchAllDocsQuery(), fieldConfigs(asList(KEYWORD_FIELD, INT_FIELD)), NONE_DECORATOR, iw -> { + iw.addDocument( + asList( + new SortedSetDocValuesField(KEYWORD_FIELD, new BytesRef("a")), + new SortedSetDocValuesField(KEYWORD_FIELD, new BytesRef("b")), + new SortedNumericDocValuesField(INT_FIELD, 1), + new SortedNumericDocValuesField(INT_FIELD, 2) + ) + ); + iw.addDocument( + asList( + new SortedSetDocValuesField(KEYWORD_FIELD, new BytesRef("a")), + new SortedSetDocValuesField(KEYWORD_FIELD, new BytesRef("c")), + new SortedNumericDocValuesField(INT_FIELD, 1), + new SortedNumericDocValuesField(INT_FIELD, 3) + ) + ); + }, h -> { + MatcherAssert.assertThat(h.getBuckets(), hasSize(7)); + MatcherAssert.assertThat(h.getBuckets().get(0).getKey(), contains(equalTo("a"), equalTo(1L))); + MatcherAssert.assertThat(h.getBuckets().get(0).getDocCount(), equalTo(2L)); + MatcherAssert.assertThat(h.getBuckets().get(1).getKey(), contains(equalTo("a"), equalTo(2L))); + MatcherAssert.assertThat(h.getBuckets().get(1).getDocCount(), equalTo(1L)); + MatcherAssert.assertThat(h.getBuckets().get(2).getKey(), contains(equalTo("a"), equalTo(3L))); + MatcherAssert.assertThat(h.getBuckets().get(2).getDocCount(), equalTo(1L)); + MatcherAssert.assertThat(h.getBuckets().get(3).getKey(), contains(equalTo("b"), equalTo(1L))); + MatcherAssert.assertThat(h.getBuckets().get(3).getDocCount(), equalTo(1L)); + MatcherAssert.assertThat(h.getBuckets().get(4).getKey(), contains(equalTo("b"), equalTo(2L))); + MatcherAssert.assertThat(h.getBuckets().get(4).getDocCount(), equalTo(1L)); + MatcherAssert.assertThat(h.getBuckets().get(5).getKey(), contains(equalTo("c"), equalTo(1L))); + MatcherAssert.assertThat(h.getBuckets().get(5).getDocCount(), equalTo(1L)); + MatcherAssert.assertThat(h.getBuckets().get(6).getKey(), contains(equalTo("c"), equalTo(3L))); + MatcherAssert.assertThat(h.getBuckets().get(6).getDocCount(), equalTo(1L)); + }); + } + + public void testScripts() throws IOException { + testAggregation( + new MatchAllDocsQuery(), + asList( + new MultiTermsValuesSourceConfig.Builder().setFieldName(KEYWORD_FIELD).build(), + new MultiTermsValuesSourceConfig.Builder().setScript( + new Script(ScriptType.INLINE, MockScriptEngine.NAME, FIELD_SCRIPT_NAME, singletonMap(FIELD_NAME, FIELD_NAME)) + ).setUserValueTypeHint(ValueType.LONG).build() + ), + null, + iw -> { + iw.addDocument( + asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")), new NumericDocValuesField(FIELD_NAME, 1)) + ); + iw.addDocument( + asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("b")), new NumericDocValuesField(FIELD_NAME, 2)) + ); + iw.addDocument( + asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("b")), new NumericDocValuesField(FIELD_NAME, 2)) + ); + iw.addDocument( + asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("c")), new NumericDocValuesField(FIELD_NAME, 3)) + ); + }, + h -> { + MatcherAssert.assertThat(h.getBuckets(), hasSize(3)); + MatcherAssert.assertThat(h.getBuckets().get(0).getKey(), contains(equalTo("b"), equalTo(3L))); + MatcherAssert.assertThat(h.getBuckets().get(0).getDocCount(), equalTo(2L)); + MatcherAssert.assertThat(h.getBuckets().get(1).getKey(), contains(equalTo("a"), equalTo(2L))); + MatcherAssert.assertThat(h.getBuckets().get(1).getDocCount(), equalTo(1L)); + MatcherAssert.assertThat(h.getBuckets().get(2).getKey(), contains(equalTo("c"), equalTo(4L))); + MatcherAssert.assertThat(h.getBuckets().get(2).getDocCount(), equalTo(1L)); + } + ); + } + + public void testScriptsWithoutValueTypeHint() throws IOException { + testAggregation( + new MatchAllDocsQuery(), + asList( + new MultiTermsValuesSourceConfig.Builder().setFieldName(KEYWORD_FIELD).build(), + new MultiTermsValuesSourceConfig.Builder().setScript( + new Script(ScriptType.INLINE, MockScriptEngine.NAME, FIELD_SCRIPT_NAME, singletonMap(FIELD_NAME, FIELD_NAME)) + ).build() + ), + null, + iw -> { + iw.addDocument( + asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")), new NumericDocValuesField(FIELD_NAME, 1)) + ); + iw.addDocument( + asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("b")), new NumericDocValuesField(FIELD_NAME, 2)) + ); + iw.addDocument( + asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("b")), new NumericDocValuesField(FIELD_NAME, 2)) + ); + iw.addDocument( + asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("c")), new NumericDocValuesField(FIELD_NAME, 3)) + ); + }, + h -> { + MatcherAssert.assertThat(h.getBuckets(), hasSize(3)); + MatcherAssert.assertThat(h.getBuckets().get(0).getKey(), contains(equalTo("b"), equalTo("3"))); + MatcherAssert.assertThat(h.getBuckets().get(0).getDocCount(), equalTo(2L)); + MatcherAssert.assertThat(h.getBuckets().get(1).getKey(), contains(equalTo("a"), equalTo("2"))); + MatcherAssert.assertThat(h.getBuckets().get(1).getDocCount(), equalTo(1L)); + MatcherAssert.assertThat(h.getBuckets().get(2).getKey(), contains(equalTo("c"), equalTo("4"))); + MatcherAssert.assertThat(h.getBuckets().get(2).getDocCount(), equalTo(1L)); + } + ); + } + + public void testValueScripts() throws IOException { + testAggregation( + new MatchAllDocsQuery(), + asList( + new MultiTermsValuesSourceConfig.Builder().setFieldName(KEYWORD_FIELD).build(), + new MultiTermsValuesSourceConfig.Builder().setFieldName(FIELD_NAME) + .setScript(new Script(ScriptType.INLINE, MockScriptEngine.NAME, VALUE_SCRIPT_NAME, emptyMap())) + .build() + ), + null, + iw -> { + iw.addDocument( + asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")), new NumericDocValuesField(FIELD_NAME, 1)) + ); + iw.addDocument( + asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("b")), new NumericDocValuesField(FIELD_NAME, 2)) + ); + iw.addDocument( + asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("b")), new NumericDocValuesField(FIELD_NAME, 2)) + ); + iw.addDocument( + asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("c")), new NumericDocValuesField(FIELD_NAME, 3)) + ); + }, + h -> { + MatcherAssert.assertThat(h.getBuckets(), hasSize(3)); + MatcherAssert.assertThat(h.getBuckets().get(0).getKey(), contains(equalTo("b"), equalTo(3.0))); + MatcherAssert.assertThat(h.getBuckets().get(0).getDocCount(), equalTo(2L)); + MatcherAssert.assertThat(h.getBuckets().get(1).getKey(), contains(equalTo("a"), equalTo(2.0))); + MatcherAssert.assertThat(h.getBuckets().get(1).getDocCount(), equalTo(1L)); + MatcherAssert.assertThat(h.getBuckets().get(2).getKey(), contains(equalTo("c"), equalTo(4.0))); + MatcherAssert.assertThat(h.getBuckets().get(2).getDocCount(), equalTo(1L)); + } + ); + } + + public void testOrderByMetrics() throws IOException { + testAggregation(new MatchAllDocsQuery(), fieldConfigs(asList(KEYWORD_FIELD, INT_FIELD)), b -> { + b.order(BucketOrder.aggregation("max", false)); + b.subAggregation(new MaxAggregationBuilder("max").field(FLOAT_FIELD)); + }, iw -> { + iw.addDocument( + asList( + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")), + new NumericDocValuesField(INT_FIELD, 1), + new FloatDocValuesField(FLOAT_FIELD, 1.0f) + ) + ); + iw.addDocument( + asList( + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("b")), + new NumericDocValuesField(INT_FIELD, 2), + new FloatDocValuesField(FLOAT_FIELD, 2.0f) + ) + ); + iw.addDocument( + asList( + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("c")), + new NumericDocValuesField(INT_FIELD, 3), + new FloatDocValuesField(FLOAT_FIELD, 3.0f) + ) + ); + iw.addDocument( + asList( + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")), + new NumericDocValuesField(INT_FIELD, 1), + new FloatDocValuesField(FLOAT_FIELD, 4.0f) + ) + ); + iw.addDocument( + asList( + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("b")), + new NumericDocValuesField(INT_FIELD, 2), + new FloatDocValuesField(FLOAT_FIELD, 3.0f) + ) + ); + iw.addDocument( + asList( + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("c")), + new NumericDocValuesField(INT_FIELD, 3), + new FloatDocValuesField(FLOAT_FIELD, 2.0f) + ) + ); + }, h -> { + MatcherAssert.assertThat(h.getBuckets(), hasSize(3)); + MatcherAssert.assertThat(h.getBuckets().get(0).getKey(), contains(equalTo("a"), equalTo(1L))); + MatcherAssert.assertThat(h.getBuckets().get(0).getDocCount(), equalTo(2L)); + MatcherAssert.assertThat(((InternalMax) (h.getBuckets().get(0).getAggregations().get("max"))).value(), closeTo(4.0f, 0.01)); + MatcherAssert.assertThat(h.getBuckets().get(1).getKey(), contains(equalTo("b"), equalTo(2L))); + MatcherAssert.assertThat(h.getBuckets().get(1).getDocCount(), equalTo(2L)); + MatcherAssert.assertThat(((InternalMax) (h.getBuckets().get(1).getAggregations().get("max"))).value(), closeTo(3.0f, 0.01)); + MatcherAssert.assertThat(h.getBuckets().get(2).getKey(), contains(equalTo("c"), equalTo(3L))); + MatcherAssert.assertThat(h.getBuckets().get(2).getDocCount(), equalTo(2L)); + MatcherAssert.assertThat(((InternalMax) (h.getBuckets().get(2).getAggregations().get("max"))).value(), closeTo(3.0f, 0.01)); + }); + } + + public void testNumberFieldFormat() throws IOException { + testAggregation( + new MatchAllDocsQuery(), + asList(term(KEYWORD_FIELD), new MultiTermsValuesSourceConfig.Builder().setFieldName(DOUBLE_FIELD).setFormat("00.00").build()), + null, + iw -> { + iw.addDocument( + asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")), new DoubleDocValuesField(DOUBLE_FIELD, 1.0d)) + ); + iw.addDocument( + asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("b")), new DoubleDocValuesField(DOUBLE_FIELD, 2.0d)) + ); + iw.addDocument( + asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")), new DoubleDocValuesField(DOUBLE_FIELD, 2.0d)) + ); + iw.addDocument( + asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")), new DoubleDocValuesField(DOUBLE_FIELD, 1.0d)) + ); + }, + h -> { + MatcherAssert.assertThat(h.getBuckets(), hasSize(3)); + MatcherAssert.assertThat(h.getBuckets().get(0).getKeyAsString(), equalTo("a|01.00")); + MatcherAssert.assertThat(h.getBuckets().get(0).getDocCount(), equalTo(2L)); + MatcherAssert.assertThat(h.getBuckets().get(1).getKeyAsString(), equalTo("a|02.00")); + MatcherAssert.assertThat(h.getBuckets().get(1).getDocCount(), equalTo(1L)); + MatcherAssert.assertThat(h.getBuckets().get(2).getKeyAsString(), equalTo("b|02.00")); + MatcherAssert.assertThat(h.getBuckets().get(2).getDocCount(), equalTo(1L)); + } + ); + } + + public void testDates() throws IOException { + testAggregation( + new MatchAllDocsQuery(), + asList(new MultiTermsValuesSourceConfig.Builder().setFieldName(DATE_FIELD).build(), term(KEYWORD_FIELD)), + null, + iw -> { + iw.addDocument( + asList( + new SortedNumericDocValuesField(DATE_FIELD, dateFieldType(DATE_FIELD).parse("2022-03-23")), + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")) + ) + ); + iw.addDocument( + asList( + new SortedNumericDocValuesField(DATE_FIELD, dateFieldType(DATE_FIELD).parse("2022-03-23")), + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("b")) + ) + ); + iw.addDocument( + asList( + new SortedNumericDocValuesField(DATE_FIELD, dateFieldType(DATE_FIELD).parse("2022-03-22")), + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")) + ) + ); + iw.addDocument( + asList( + new SortedNumericDocValuesField(DATE_FIELD, dateFieldType(DATE_FIELD).parse("2022-03-23")), + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")) + ) + ); + iw.addDocument( + asList( + new SortedNumericDocValuesField(DATE_FIELD, dateFieldType(DATE_FIELD).parse("2022-03-21")), + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("c")) + ) + ); + }, + h -> { + MatcherAssert.assertThat(h.getBuckets(), hasSize(4)); + MatcherAssert.assertThat(h.getBuckets().get(0).getKeyAsString(), equalTo("2022-03-23|a")); + MatcherAssert.assertThat(h.getBuckets().get(0).getDocCount(), equalTo(2L)); + MatcherAssert.assertThat(h.getBuckets().get(1).getKeyAsString(), equalTo("2022-03-21|c")); + MatcherAssert.assertThat(h.getBuckets().get(1).getDocCount(), equalTo(1L)); + MatcherAssert.assertThat(h.getBuckets().get(2).getKeyAsString(), equalTo("2022-03-22|a")); + MatcherAssert.assertThat(h.getBuckets().get(2).getDocCount(), equalTo(1L)); + MatcherAssert.assertThat(h.getBuckets().get(3).getKeyAsString(), equalTo("2022-03-23|b")); + MatcherAssert.assertThat(h.getBuckets().get(3).getDocCount(), equalTo(1L)); + } + ); + } + + public void testDatesFieldFormat() throws IOException { + testAggregation( + new MatchAllDocsQuery(), + asList( + new MultiTermsValuesSourceConfig.Builder().setFieldName(DATE_FIELD).setFormat("yyyy/MM/dd").build(), + term(KEYWORD_FIELD) + ), + null, + iw -> { + iw.addDocument( + asList( + new SortedNumericDocValuesField(DATE_FIELD, dateFieldType(DATE_FIELD).parse("2022-03-23")), + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")) + ) + ); + iw.addDocument( + asList( + new SortedNumericDocValuesField(DATE_FIELD, dateFieldType(DATE_FIELD).parse("2022-03-23")), + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("b")) + ) + ); + iw.addDocument( + asList( + new SortedNumericDocValuesField(DATE_FIELD, dateFieldType(DATE_FIELD).parse("2022-03-22")), + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")) + ) + ); + iw.addDocument( + asList( + new SortedNumericDocValuesField(DATE_FIELD, dateFieldType(DATE_FIELD).parse("2022-03-23")), + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")) + ) + ); + iw.addDocument( + asList( + new SortedNumericDocValuesField(DATE_FIELD, dateFieldType(DATE_FIELD).parse("2022-03-21")), + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("c")) + ) + ); + }, + h -> { + MatcherAssert.assertThat(h.getBuckets(), hasSize(4)); + MatcherAssert.assertThat(h.getBuckets().get(0).getKeyAsString(), equalTo("2022/03/23|a")); + MatcherAssert.assertThat(h.getBuckets().get(0).getDocCount(), equalTo(2L)); + MatcherAssert.assertThat(h.getBuckets().get(1).getKeyAsString(), equalTo("2022/03/21|c")); + MatcherAssert.assertThat(h.getBuckets().get(1).getDocCount(), equalTo(1L)); + MatcherAssert.assertThat(h.getBuckets().get(2).getKeyAsString(), equalTo("2022/03/22|a")); + MatcherAssert.assertThat(h.getBuckets().get(2).getDocCount(), equalTo(1L)); + MatcherAssert.assertThat(h.getBuckets().get(3).getKeyAsString(), equalTo("2022/03/23|b")); + MatcherAssert.assertThat(h.getBuckets().get(3).getDocCount(), equalTo(1L)); + } + ); + } + + public void testIpAndKeyword() throws IOException { + testAggregation(new MatchAllDocsQuery(), fieldConfigs(asList(KEYWORD_FIELD, IP_FIELD)), NONE_DECORATOR, iw -> { + iw.addDocument( + asList( + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")), + new SortedDocValuesField(IP_FIELD, new BytesRef(InetAddressPoint.encode(InetAddresses.forString("192.168.0.0")))) + ) + ); + iw.addDocument( + asList( + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("b")), + new SortedDocValuesField(IP_FIELD, new BytesRef(InetAddressPoint.encode(InetAddresses.forString("192.168.0.1")))) + ) + ); + iw.addDocument( + asList( + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("c")), + new SortedDocValuesField(IP_FIELD, new BytesRef(InetAddressPoint.encode(InetAddresses.forString("192.168.0.2")))) + ) + ); + iw.addDocument( + asList( + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")), + new SortedDocValuesField(IP_FIELD, new BytesRef(InetAddressPoint.encode(InetAddresses.forString("192.168.0.0")))) + ) + ); + }, h -> { + MatcherAssert.assertThat(h.getBuckets(), hasSize(3)); + MatcherAssert.assertThat(h.getBuckets().get(0).getKey(), contains(equalTo("a"), equalTo("192.168.0.0"))); + MatcherAssert.assertThat(h.getBuckets().get(0).getKeyAsString(), equalTo("a|192.168.0.0")); + MatcherAssert.assertThat(h.getBuckets().get(0).getDocCount(), equalTo(2L)); + MatcherAssert.assertThat(h.getBuckets().get(1).getKey(), contains(equalTo("b"), equalTo("192.168.0.1"))); + MatcherAssert.assertThat(h.getBuckets().get(1).getKeyAsString(), equalTo("b|192.168.0.1")); + MatcherAssert.assertThat(h.getBuckets().get(1).getDocCount(), equalTo(1L)); + MatcherAssert.assertThat(h.getBuckets().get(2).getKey(), contains(equalTo("c"), equalTo("192.168.0.2"))); + MatcherAssert.assertThat(h.getBuckets().get(2).getKeyAsString(), equalTo("c|192.168.0.2")); + MatcherAssert.assertThat(h.getBuckets().get(2).getDocCount(), equalTo(1L)); + }); + } + + public void testEmpty() throws IOException { + testAggregation(new MatchAllDocsQuery(), fieldConfigs(asList(KEYWORD_FIELD, INT_FIELD)), NONE_DECORATOR, iw -> {}, h -> { + MatcherAssert.assertThat(h.getName(), equalTo(AGG_NAME)); + MatcherAssert.assertThat(h.getBuckets(), hasSize(0)); + }); + } + + public void testNull() throws IOException { + testAggregation(new MatchAllDocsQuery(), fieldConfigs(asList(KEYWORD_FIELD, INT_FIELD, FLOAT_FIELD)), NONE_DECORATOR, iw -> { + iw.addDocument( + asList( + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")), + new NumericDocValuesField(INT_FIELD, 1), + new FloatDocValuesField(FLOAT_FIELD, 1.0f) + ) + ); + iw.addDocument( + asList( + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")), + new NumericDocValuesField(INT_FIELD, 1), + new FloatDocValuesField(FLOAT_FIELD, 1.0f) + ) + ); + iw.addDocument(asList(new NumericDocValuesField(INT_FIELD, 1), new FloatDocValuesField(FLOAT_FIELD, 2.0f))); + iw.addDocument(asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("c")), new FloatDocValuesField(FLOAT_FIELD, 2.0f))); + iw.addDocument(asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("d")), new NumericDocValuesField(INT_FIELD, 3))); + + }, h -> { + MatcherAssert.assertThat(h.getBuckets(), hasSize(1)); + MatcherAssert.assertThat(h.getBuckets().get(0).getKey(), contains(equalTo("a"), equalTo(1L), equalTo(1.0))); + MatcherAssert.assertThat(h.getBuckets().get(0).getDocCount(), equalTo(2L)); + }); + + } + + public void testMissing() throws IOException { + testAggregation( + new MatchAllDocsQuery(), + asList( + new MultiTermsValuesSourceConfig.Builder().setFieldName(KEYWORD_FIELD).setMissing("a").build(), + new MultiTermsValuesSourceConfig.Builder().setFieldName(INT_FIELD).setMissing(1).build(), + new MultiTermsValuesSourceConfig.Builder().setFieldName(FLOAT_FIELD).setMissing(2.0f).build() + ), + NONE_DECORATOR, + iw -> { + iw.addDocument( + asList( + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")), + new NumericDocValuesField(INT_FIELD, 1), + new FloatDocValuesField(FLOAT_FIELD, 2.0f) + ) + ); + iw.addDocument( + asList( + // missing KEYWORD_FIELD + new NumericDocValuesField(INT_FIELD, 1), + new FloatDocValuesField(FLOAT_FIELD, 1.0f) + ) + ); + iw.addDocument( + asList( + new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("b")), + // missing INT_FIELD + new FloatDocValuesField(FLOAT_FIELD, 2.0f) + ) + ); + iw.addDocument(asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("c")), new NumericDocValuesField(INT_FIELD, 2) + // missing FLOAT_FIELD + )); + iw.addDocument(singletonList(new SortedDocValuesField(UNRELATED_KEYWORD_FIELD, new BytesRef("unrelated")))); + }, + h -> { + MatcherAssert.assertThat(h.getBuckets(), hasSize(4)); + MatcherAssert.assertThat(h.getBuckets().get(0).getKey(), contains(equalTo("a"), equalTo(1L), equalTo(2.0))); + MatcherAssert.assertThat(h.getBuckets().get(0).getDocCount(), equalTo(2L)); + MatcherAssert.assertThat(h.getBuckets().get(1).getKey(), contains(equalTo("a"), equalTo(1L), equalTo(1.0))); + MatcherAssert.assertThat(h.getBuckets().get(1).getDocCount(), equalTo(1L)); + MatcherAssert.assertThat(h.getBuckets().get(2).getKey(), contains(equalTo("b"), equalTo(1L), equalTo(2.0))); + MatcherAssert.assertThat(h.getBuckets().get(2).getDocCount(), equalTo(1L)); + MatcherAssert.assertThat(h.getBuckets().get(3).getKey(), contains(equalTo("c"), equalTo(2L), equalTo(2.0))); + MatcherAssert.assertThat(h.getBuckets().get(3).getDocCount(), equalTo(1L)); + } + ); + } + + public void testMixKeywordAndBoolean() throws IOException { + testAggregation(new MatchAllDocsQuery(), fieldConfigs(asList(KEYWORD_FIELD, BOOL_FIELD)), NONE_DECORATOR, iw -> { + iw.addDocument(asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")), new NumericDocValuesField(BOOL_FIELD, 1))); + iw.addDocument(asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")), new NumericDocValuesField(BOOL_FIELD, 0))); + iw.addDocument(asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("b")), new NumericDocValuesField(BOOL_FIELD, 0))); + iw.addDocument(asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("b")), new NumericDocValuesField(BOOL_FIELD, 1))); + }, h -> { + MatcherAssert.assertThat(h.getBuckets(), hasSize(4)); + MatcherAssert.assertThat(h.getBuckets().get(0).getKey(), contains(equalTo("a"), equalTo(false))); + MatcherAssert.assertThat(h.getBuckets().get(0).getKeyAsString(), equalTo("a|false")); + MatcherAssert.assertThat(h.getBuckets().get(0).getDocCount(), equalTo(1L)); + MatcherAssert.assertThat(h.getBuckets().get(1).getKey(), contains(equalTo("a"), equalTo(true))); + MatcherAssert.assertThat(h.getBuckets().get(1).getKeyAsString(), equalTo("a|true")); + MatcherAssert.assertThat(h.getBuckets().get(1).getDocCount(), equalTo(1L)); + MatcherAssert.assertThat(h.getBuckets().get(2).getKey(), contains(equalTo("b"), equalTo(false))); + MatcherAssert.assertThat(h.getBuckets().get(2).getKeyAsString(), equalTo("b|false")); + MatcherAssert.assertThat(h.getBuckets().get(2).getDocCount(), equalTo(1L)); + MatcherAssert.assertThat(h.getBuckets().get(3).getKey(), contains(equalTo("b"), equalTo(true))); + MatcherAssert.assertThat(h.getBuckets().get(3).getKeyAsString(), equalTo("b|true")); + MatcherAssert.assertThat(h.getBuckets().get(3).getDocCount(), equalTo(1L)); + }); + } + + public void testGeoPointField() { + assertThrows( + IllegalArgumentException.class, + () -> testAggregation( + new MatchAllDocsQuery(), + asList(term(KEYWORD_FIELD), term(GEO_POINT_FIELD)), + NONE_DECORATOR, + iw -> {}, + f -> fail("should throw exception") + ) + ); + } + + public void testMinDocCount() throws IOException { + testAggregation(new MatchAllDocsQuery(), fieldConfigs(asList(KEYWORD_FIELD, INT_FIELD)), b -> b.minDocCount(2), iw -> { + iw.addDocument(asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")), new NumericDocValuesField(INT_FIELD, 1))); + iw.addDocument(asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")), new NumericDocValuesField(INT_FIELD, 1))); + iw.addDocument(asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")), new NumericDocValuesField(INT_FIELD, 2))); + iw.addDocument(asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("b")), new NumericDocValuesField(INT_FIELD, 1))); + iw.addDocument(asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("c")), new NumericDocValuesField(INT_FIELD, 2))); + }, h -> { + MatcherAssert.assertThat(h.getBuckets(), hasSize(1)); + MatcherAssert.assertThat(h.getBuckets().get(0).getKey(), contains(equalTo("a"), equalTo(1L))); + MatcherAssert.assertThat(h.getBuckets().get(0).getDocCount(), equalTo(2L)); + }); + } + + public void testIncludeExclude() throws IOException { + testAggregation( + new MatchAllDocsQuery(), + asList( + new MultiTermsValuesSourceConfig.Builder().setFieldName(KEYWORD_FIELD) + .setIncludeExclude(new IncludeExclude("a", null)) + .build(), + term(INT_FIELD) + ), + NONE_DECORATOR, + iw -> { + iw.addDocument(asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")), new NumericDocValuesField(INT_FIELD, 1))); + iw.addDocument(asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("a")), new NumericDocValuesField(INT_FIELD, 1))); + iw.addDocument(asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("b")), new NumericDocValuesField(INT_FIELD, 1))); + iw.addDocument(asList(new SortedDocValuesField(KEYWORD_FIELD, new BytesRef("c")), new NumericDocValuesField(INT_FIELD, 2))); + }, + h -> { + MatcherAssert.assertThat(h.getBuckets(), hasSize(1)); + MatcherAssert.assertThat(h.getBuckets().get(0).getKey(), contains(equalTo("a"), equalTo(1L))); + MatcherAssert.assertThat(h.getBuckets().get(0).getDocCount(), equalTo(2L)); + } + ); + } + + private void testAggregation( + Query query, + List terms, + Consumer decorator, + CheckedConsumer indexBuilder, + Consumer verify + ) throws IOException { + MultiTermsAggregationBuilder builder = createTestAggregatorBuilder(terms); + if (decorator != NONE_DECORATOR) { + decorator.accept(builder); + } + testCase(builder, query, indexBuilder, verify, mappedFieldTypeMap.values().toArray(new MappedFieldType[] {})); + } + + private MultiTermsValuesSourceConfig term(String field) { + return new MultiTermsValuesSourceConfig.Builder().setFieldName(field).build(); + } + + private MultiTermsAggregationBuilder createTestAggregatorBuilder(List termsConfig) { + MultiTermsAggregationBuilder factory = new MultiTermsAggregationBuilder(AGG_NAME); + factory.terms(termsConfig); + + if (randomBoolean()) { + factory.size(randomIntBetween(10, Integer.MAX_VALUE)); + } + if (randomBoolean()) { + factory.shardSize(randomIntBetween(10, Integer.MAX_VALUE)); + } + if (randomBoolean()) { + factory.showTermDocCountError(randomBoolean()); + } + return factory; + } + + private List fieldConfigs(List terms) { + List termConfigs = new ArrayList<>(); + for (String term : terms) { + termConfigs.add(term(term)); + } + return termConfigs; + } + + private static DateFieldMapper.DateFieldType dateFieldType(String name) { + return new DateFieldMapper.DateFieldType( + name, + true, + false, + true, + DateFormatter.forPattern("date"), + DateFieldMapper.Resolution.MILLISECONDS, + null, + Collections.emptyMap() + ); + } +} diff --git a/server/src/test/java/org/opensearch/search/aggregations/support/MultiTermsValuesSourceConfigTests.java b/server/src/test/java/org/opensearch/search/aggregations/support/MultiTermsValuesSourceConfigTests.java new file mode 100644 index 0000000000000..a142faa2048ea --- /dev/null +++ b/server/src/test/java/org/opensearch/search/aggregations/support/MultiTermsValuesSourceConfigTests.java @@ -0,0 +1,65 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.search.aggregations.support; + +import org.opensearch.common.io.stream.NamedWriteableRegistry; +import org.opensearch.common.io.stream.Writeable; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.xcontent.NamedXContentRegistry; +import org.opensearch.common.xcontent.XContentParser; +import org.opensearch.script.Script; +import org.opensearch.search.SearchModule; +import org.opensearch.test.AbstractSerializingTestCase; + +import java.io.IOException; +import java.time.ZoneId; +import java.util.Collections; + +import static org.hamcrest.Matchers.equalTo; + +public class MultiTermsValuesSourceConfigTests extends AbstractSerializingTestCase { + + @Override + protected MultiTermsValuesSourceConfig doParseInstance(XContentParser parser) throws IOException { + return MultiTermsValuesSourceConfig.PARSER.apply(true, true, true, true).apply(parser, null).build(); + } + + @Override + protected MultiTermsValuesSourceConfig createTestInstance() { + String field = randomAlphaOfLength(10); + Object missing = randomBoolean() ? randomAlphaOfLength(10) : null; + ZoneId timeZone = randomBoolean() ? randomZone() : null; + Script script = randomBoolean() ? new Script(randomAlphaOfLength(10)) : null; + return new MultiTermsValuesSourceConfig.Builder().setFieldName(field) + .setMissing(missing) + .setScript(script) + .setTimeZone(timeZone) + .build(); + } + + @Override + protected Writeable.Reader instanceReader() { + return MultiTermsValuesSourceConfig::new; + } + + public void testMissingFieldScript() { + IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> new MultiTermsValuesSourceConfig.Builder().build()); + assertThat(e.getMessage(), equalTo("[field] and [script] cannot both be null. Please specify one or the other.")); + } + + @Override + protected NamedWriteableRegistry getNamedWriteableRegistry() { + return new NamedWriteableRegistry(new SearchModule(Settings.EMPTY, Collections.emptyList()).getNamedWriteables()); + } + + @Override + protected NamedXContentRegistry xContentRegistry() { + return new NamedXContentRegistry(new SearchModule(Settings.EMPTY, Collections.emptyList()).getNamedXContents()); + } +} diff --git a/test/framework/src/main/java/org/opensearch/test/InternalAggregationTestCase.java b/test/framework/src/main/java/org/opensearch/test/InternalAggregationTestCase.java index 6be7abffb9ad6..f138de152a488 100644 --- a/test/framework/src/main/java/org/opensearch/test/InternalAggregationTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/InternalAggregationTestCase.java @@ -101,9 +101,11 @@ import org.opensearch.search.aggregations.bucket.terms.DoubleTerms; import org.opensearch.search.aggregations.bucket.terms.LongRareTerms; import org.opensearch.search.aggregations.bucket.terms.LongTerms; +import org.opensearch.search.aggregations.bucket.terms.MultiTermsAggregationBuilder; import org.opensearch.search.aggregations.bucket.terms.ParsedDoubleTerms; import org.opensearch.search.aggregations.bucket.terms.ParsedLongRareTerms; import org.opensearch.search.aggregations.bucket.terms.ParsedLongTerms; +import org.opensearch.search.aggregations.bucket.terms.ParsedMultiTerms; import org.opensearch.search.aggregations.bucket.terms.ParsedSignificantLongTerms; import org.opensearch.search.aggregations.bucket.terms.ParsedSignificantStringTerms; import org.opensearch.search.aggregations.bucket.terms.ParsedStringRareTerms; @@ -289,6 +291,7 @@ public ReduceContext forFinalReduction() { map.put(IpRangeAggregationBuilder.NAME, (p, c) -> ParsedBinaryRange.fromXContent(p, (String) c)); map.put(TopHitsAggregationBuilder.NAME, (p, c) -> ParsedTopHits.fromXContent(p, (String) c)); map.put(CompositeAggregationBuilder.NAME, (p, c) -> ParsedComposite.fromXContent(p, (String) c)); + map.put(MultiTermsAggregationBuilder.NAME, (p, c) -> ParsedMultiTerms.fromXContent(p, (String) c)); namedXContents = map.entrySet() .stream() From a330850b3152d1ce1bff65d38d4ab5d9ff60a73e Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 21 Apr 2022 17:33:34 -0400 Subject: [PATCH 092/514] Remove usages of MultiTermQuery.setRewriteMethodsetRewriteMethod (#2997) (#3017) Remove usages of MultiTermQuery.setRewriteMethod which is removed in latest versions of Lucene. Signed-off-by: ruanwenjun Signed-off-by: Nicholas Walter Knize (cherry picked from commit a34d11f15a2c0f14ac8ebda4d85da92000719b7f) Co-authored-by: Wenjun Ruan --- .../mapper/SearchAsYouTypeFieldMapper.java | 4 +- .../search/query/QueryPhaseTests.java | 12 ++--- .../lucene/search/AutomatonQueries.java | 48 +++++++++++++++---- .../index/mapper/StringFieldType.java | 44 ++++++++--------- .../index/mapper/TextFieldMapper.java | 5 +- .../index/query/RegexpQueryBuilder.java | 13 ++--- .../index/search/QueryStringQueryParser.java | 11 +++-- .../deps/lucene/VectorHighlighterTests.java | 2 +- .../search/query/QueryPhaseTests.java | 15 +++--- 9 files changed, 89 insertions(+), 65 deletions(-) diff --git a/modules/mapper-extras/src/main/java/org/opensearch/index/mapper/SearchAsYouTypeFieldMapper.java b/modules/mapper-extras/src/main/java/org/opensearch/index/mapper/SearchAsYouTypeFieldMapper.java index 7394993448bbf..68b887c4c4a43 100644 --- a/modules/mapper-extras/src/main/java/org/opensearch/index/mapper/SearchAsYouTypeFieldMapper.java +++ b/modules/mapper-extras/src/main/java/org/opensearch/index/mapper/SearchAsYouTypeFieldMapper.java @@ -60,6 +60,7 @@ import org.apache.lucene.util.automaton.Automaton; import org.apache.lucene.util.automaton.Operations; import org.opensearch.common.collect.Iterators; +import org.opensearch.common.lucene.search.AutomatonQueries; import org.opensearch.index.analysis.AnalyzerScope; import org.opensearch.index.analysis.IndexAnalyzers; import org.opensearch.index.analysis.NamedAnalyzer; @@ -431,8 +432,7 @@ public Query prefixQuery(String value, MultiTermQuery.RewriteMethod method, bool automata.add(Automata.makeAnyChar()); } Automaton automaton = Operations.concatenate(automata); - AutomatonQuery query = new AutomatonQuery(new Term(name(), value + "*"), automaton); - query.setRewriteMethod(method); + AutomatonQuery query = AutomatonQueries.createAutomatonQuery(new Term(name(), value + "*"), automaton, method); return new BooleanQuery.Builder().add(query, BooleanClause.Occur.SHOULD) .add(new TermQuery(new Term(parentField, value)), BooleanClause.Occur.SHOULD) .build(); diff --git a/sandbox/plugins/concurrent-search/src/test/java/org/opensearch/search/query/QueryPhaseTests.java b/sandbox/plugins/concurrent-search/src/test/java/org/opensearch/search/query/QueryPhaseTests.java index 83a0a63a6a5c8..74cd4754efe44 100644 --- a/sandbox/plugins/concurrent-search/src/test/java/org/opensearch/search/query/QueryPhaseTests.java +++ b/sandbox/plugins/concurrent-search/src/test/java/org/opensearch/search/query/QueryPhaseTests.java @@ -33,7 +33,6 @@ package org.opensearch.search.query; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; - import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field.Store; @@ -52,6 +51,8 @@ import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.NoMergePolicy; import org.apache.lucene.index.Term; +import org.apache.lucene.queries.spans.SpanNearQuery; +import org.apache.lucene.queries.spans.SpanTermQuery; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.search.BooleanQuery; @@ -82,8 +83,6 @@ import org.apache.lucene.search.grouping.CollapseTopFieldDocs; import org.apache.lucene.search.join.BitSetProducer; import org.apache.lucene.search.join.ScoreMode; -import org.apache.lucene.queries.spans.SpanNearQuery; -import org.apache.lucene.queries.spans.SpanTermQuery; import org.apache.lucene.store.Directory; import org.apache.lucene.tests.index.RandomIndexWriter; import org.apache.lucene.util.BytesRef; @@ -122,7 +121,6 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; -import static org.opensearch.search.query.TopDocsCollectorContext.hasInfMaxScore; import static org.hamcrest.Matchers.anyOf; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; @@ -130,8 +128,9 @@ import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.lessThanOrEqualTo; import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.when; +import static org.opensearch.search.query.TopDocsCollectorContext.hasInfMaxScore; public class QueryPhaseTests extends IndexShardTestCase { @@ -1114,8 +1113,7 @@ public void testCancellationDuringPreprocess() throws IOException { indexShard, newContextSearcher(reader, executor) ); - PrefixQuery prefixQuery = new PrefixQuery(new Term("foo", "a")); - prefixQuery.setRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_REWRITE); + PrefixQuery prefixQuery = new PrefixQuery(new Term("foo", "a"), MultiTermQuery.SCORING_BOOLEAN_REWRITE); context.parsedQuery(new ParsedQuery(prefixQuery)); SearchShardTask task = mock(SearchShardTask.class); when(task.isCancelled()).thenReturn(true); diff --git a/server/src/main/java/org/opensearch/common/lucene/search/AutomatonQueries.java b/server/src/main/java/org/opensearch/common/lucene/search/AutomatonQueries.java index 9755a99fecc08..12dec26090b48 100644 --- a/server/src/main/java/org/opensearch/common/lucene/search/AutomatonQueries.java +++ b/server/src/main/java/org/opensearch/common/lucene/search/AutomatonQueries.java @@ -34,6 +34,7 @@ import org.apache.lucene.index.Term; import org.apache.lucene.search.AutomatonQuery; +import org.apache.lucene.search.MultiTermQuery; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.automaton.Automata; import org.apache.lucene.util.automaton.Automaton; @@ -63,29 +64,58 @@ public static Automaton caseInsensitivePrefix(String s) { return a; } - /** Build an automaton query accepting all terms with the specified prefix, ASCII case insensitive. */ + /** + * Build an automaton query accepting all terms with the specified prefix, ASCII case insensitive. + */ public static AutomatonQuery caseInsensitivePrefixQuery(Term prefix) { - return new AutomatonQuery(prefix, caseInsensitivePrefix(prefix.text())); + return caseInsensitivePrefixQuery(prefix, MultiTermQuery.CONSTANT_SCORE_REWRITE); } - /** Build an automaton accepting all terms ASCII case insensitive. */ + /** + * Build an automaton query accepting all terms with the specified prefix, ASCII case insensitive. + */ + public static AutomatonQuery caseInsensitivePrefixQuery(Term prefix, MultiTermQuery.RewriteMethod method) { + return createAutomatonQuery(prefix, caseInsensitivePrefix(prefix.text()), method); + } + + /** + * Build an automaton accepting all terms ASCII case insensitive. + */ public static AutomatonQuery caseInsensitiveTermQuery(Term term) { BytesRef prefix = term.bytes(); return new AutomatonQuery(term, toCaseInsensitiveString(prefix, Integer.MAX_VALUE)); } - /** Build an automaton matching a wildcard pattern, ASCII case insensitive. */ - public static AutomatonQuery caseInsensitiveWildcardQuery(Term wildcardquery) { - return new AutomatonQuery(wildcardquery, toCaseInsensitiveWildcardAutomaton(wildcardquery, Integer.MAX_VALUE)); + /** + * Build an automaton matching a wildcard pattern, ASCII case insensitive, if the method is null, then will use {@link MultiTermQuery#CONSTANT_SCORE_REWRITE}. + */ + public static AutomatonQuery caseInsensitiveWildcardQuery(Term wildcardquery, MultiTermQuery.RewriteMethod method) { + return createAutomatonQuery(wildcardquery, toCaseInsensitiveWildcardAutomaton(wildcardquery, Integer.MAX_VALUE), method); + } + + /** + * Build an automaton matching a given pattern with rewrite method, if the rewrite method is null, then will use {@link MultiTermQuery#CONSTANT_SCORE_REWRITE}. + */ + public static AutomatonQuery createAutomatonQuery(Term term, Automaton automaton, MultiTermQuery.RewriteMethod method) { + if (method == null) { + method = MultiTermQuery.CONSTANT_SCORE_REWRITE; + } + return new AutomatonQuery(term, automaton, Operations.DEFAULT_DETERMINIZE_WORK_LIMIT, false, method); } - /** String equality with support for wildcards */ + /** + * String equality with support for wildcards + */ public static final char WILDCARD_STRING = '*'; - /** Char equality with support for wildcards */ + /** + * Char equality with support for wildcards + */ public static final char WILDCARD_CHAR = '?'; - /** Escape character */ + /** + * Escape character + */ public static final char WILDCARD_ESCAPE = '\\'; /** diff --git a/server/src/main/java/org/opensearch/index/mapper/StringFieldType.java b/server/src/main/java/org/opensearch/index/mapper/StringFieldType.java index 42bd52dddf520..9aa6bf09a1176 100644 --- a/server/src/main/java/org/opensearch/index/mapper/StringFieldType.java +++ b/server/src/main/java/org/opensearch/index/mapper/StringFieldType.java @@ -34,7 +34,6 @@ import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.index.Term; -import org.apache.lucene.search.AutomatonQuery; import org.apache.lucene.search.FuzzyQuery; import org.apache.lucene.search.MultiTermQuery; import org.apache.lucene.search.PrefixQuery; @@ -44,12 +43,12 @@ import org.apache.lucene.search.WildcardQuery; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRefBuilder; +import org.apache.lucene.util.automaton.Operations; import org.opensearch.OpenSearchException; import org.opensearch.common.lucene.BytesRefs; import org.opensearch.common.lucene.search.AutomatonQueries; import org.opensearch.common.unit.Fuzziness; import org.opensearch.index.query.QueryShardContext; -import org.opensearch.index.query.support.QueryParsers; import java.util.Map; import java.util.regex.Matcher; @@ -111,19 +110,13 @@ public Query prefixQuery(String value, MultiTermQuery.RewriteMethod method, bool ); } failIfNotIndexed(); - if (caseInsensitive) { - AutomatonQuery query = AutomatonQueries.caseInsensitivePrefixQuery((new Term(name(), indexedValueForSearch(value)))); - if (method != null) { - query.setRewriteMethod(method); - } - return query; - + if (method == null) { + method = MultiTermQuery.CONSTANT_SCORE_REWRITE; } - PrefixQuery query = new PrefixQuery(new Term(name(), indexedValueForSearch(value))); - if (method != null) { - query.setRewriteMethod(method); + if (caseInsensitive) { + return AutomatonQueries.caseInsensitivePrefixQuery((new Term(name(), indexedValueForSearch(value))), method); } - return query; + return new PrefixQuery(new Term(name(), indexedValueForSearch(value)), method); } public static final String normalizeWildcardPattern(String fieldname, String value, Analyzer normalizer) { @@ -173,13 +166,12 @@ public Query wildcardQuery(String value, MultiTermQuery.RewriteMethod method, bo term = new Term(name(), indexedValueForSearch(value)); } if (caseInsensitive) { - AutomatonQuery query = AutomatonQueries.caseInsensitiveWildcardQuery(term); - QueryParsers.setRewriteMethod(query, method); - return query; + return AutomatonQueries.caseInsensitiveWildcardQuery(term, method); } - WildcardQuery query = new WildcardQuery(term); - QueryParsers.setRewriteMethod(query, method); - return query; + if (method == null) { + method = MultiTermQuery.CONSTANT_SCORE_REWRITE; + } + return new WildcardQuery(term, Operations.DEFAULT_DETERMINIZE_WORK_LIMIT, method); } @Override @@ -197,11 +189,17 @@ public Query regexpQuery( ); } failIfNotIndexed(); - RegexpQuery query = new RegexpQuery(new Term(name(), indexedValueForSearch(value)), syntaxFlags, matchFlags, maxDeterminizedStates); - if (method != null) { - query.setRewriteMethod(method); + if (method == null) { + method = MultiTermQuery.CONSTANT_SCORE_REWRITE; } - return query; + return new RegexpQuery( + new Term(name(), indexedValueForSearch(value)), + syntaxFlags, + matchFlags, + RegexpQuery.DEFAULT_PROVIDER, + maxDeterminizedStates, + method + ); } @Override diff --git a/server/src/main/java/org/opensearch/index/mapper/TextFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/TextFieldMapper.java index 4b2c20586834d..360240eb9d59c 100644 --- a/server/src/main/java/org/opensearch/index/mapper/TextFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/TextFieldMapper.java @@ -582,10 +582,7 @@ public Query prefixQuery(String value, MultiTermQuery.RewriteMethod method, bool automata.add(Automata.makeAnyChar()); } Automaton automaton = Operations.concatenate(automata); - AutomatonQuery query = new AutomatonQuery(new Term(name(), value + "*"), automaton); - if (method != null) { - query.setRewriteMethod(method); - } + AutomatonQuery query = AutomatonQueries.createAutomatonQuery(new Term(name(), value + "*"), automaton, method); return new BooleanQuery.Builder().add(query, BooleanClause.Occur.SHOULD) .add(new TermQuery(new Term(parentField.name(), value)), BooleanClause.Occur.SHOULD) .build(); diff --git a/server/src/main/java/org/opensearch/index/query/RegexpQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/RegexpQueryBuilder.java index dc6546a3fd3a2..c8192557ef266 100644 --- a/server/src/main/java/org/opensearch/index/query/RegexpQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/RegexpQueryBuilder.java @@ -309,16 +309,17 @@ protected Query doToQuery(QueryShardContext context) throws QueryShardException, query = fieldType.regexpQuery(value, sanitisedSyntaxFlag, matchFlagsValue, maxDeterminizedStates, method, context); } if (query == null) { - RegexpQuery regexpQuery = new RegexpQuery( + if (method == null) { + method = MultiTermQuery.CONSTANT_SCORE_REWRITE; + } + query = new RegexpQuery( new Term(fieldName, BytesRefs.toBytesRef(value)), sanitisedSyntaxFlag, matchFlagsValue, - maxDeterminizedStates + RegexpQuery.DEFAULT_PROVIDER, + maxDeterminizedStates, + method ); - if (method != null) { - regexpQuery.setRewriteMethod(method); - } - query = regexpQuery; } return query; } diff --git a/server/src/main/java/org/opensearch/index/search/QueryStringQueryParser.java b/server/src/main/java/org/opensearch/index/search/QueryStringQueryParser.java index e9437f5704851..980a42163c9c9 100644 --- a/server/src/main/java/org/opensearch/index/search/QueryStringQueryParser.java +++ b/server/src/main/java/org/opensearch/index/search/QueryStringQueryParser.java @@ -70,7 +70,6 @@ import org.opensearch.index.query.ExistsQueryBuilder; import org.opensearch.index.query.MultiMatchQueryBuilder; import org.opensearch.index.query.QueryShardContext; -import org.opensearch.index.query.support.QueryParsers; import java.io.IOException; import java.time.ZoneId; @@ -110,7 +109,7 @@ public class QueryStringQueryParser extends XQueryParser { private ZoneId timeZone; private Fuzziness fuzziness = Fuzziness.AUTO; private int fuzzyMaxExpansions = FuzzyQuery.defaultMaxExpansions; - private MultiTermQuery.RewriteMethod fuzzyRewriteMethod; + private MultiTermQuery.RewriteMethod fuzzyRewriteMethod = MultiTermQuery.CONSTANT_SCORE_REWRITE; private boolean fuzzyTranspositions = FuzzyQuery.defaultTranspositions; /** @@ -527,9 +526,11 @@ private Query getFuzzyQuerySingle(String field, String termStr, float minSimilar @Override protected Query newFuzzyQuery(Term term, float minimumSimilarity, int prefixLength) { int numEdits = Fuzziness.build(minimumSimilarity).asDistance(term.text()); - FuzzyQuery query = new FuzzyQuery(term, numEdits, prefixLength, fuzzyMaxExpansions, fuzzyTranspositions); - QueryParsers.setRewriteMethod(query, fuzzyRewriteMethod); - return query; + if (fuzzyRewriteMethod != null) { + return new FuzzyQuery(term, numEdits, prefixLength, fuzzyMaxExpansions, fuzzyTranspositions, fuzzyRewriteMethod); + } else { + return new FuzzyQuery(term, numEdits, prefixLength, fuzzyMaxExpansions, fuzzyTranspositions); + } } @Override diff --git a/server/src/test/java/org/opensearch/deps/lucene/VectorHighlighterTests.java b/server/src/test/java/org/opensearch/deps/lucene/VectorHighlighterTests.java index e3a4c8a3e890d..e91da4f5ee46e 100644 --- a/server/src/test/java/org/opensearch/deps/lucene/VectorHighlighterTests.java +++ b/server/src/test/java/org/opensearch/deps/lucene/VectorHighlighterTests.java @@ -121,7 +121,7 @@ public void testVectorHighlighterPrefixQuery() throws Exception { ); assertThat(fragment, nullValue()); - prefixQuery.setRewriteMethod(PrefixQuery.SCORING_BOOLEAN_REWRITE); + prefixQuery = new PrefixQuery(new Term("content", "ba"), PrefixQuery.SCORING_BOOLEAN_REWRITE); Query rewriteQuery = prefixQuery.rewrite(reader); fragment = highlighter.getBestFragment(highlighter.getFieldQuery(rewriteQuery), reader, topDocs.scoreDocs[0].doc, "content", 30); assertThat(fragment, notNullValue()); diff --git a/server/src/test/java/org/opensearch/search/query/QueryPhaseTests.java b/server/src/test/java/org/opensearch/search/query/QueryPhaseTests.java index 1232347edea64..2234c8a980923 100644 --- a/server/src/test/java/org/opensearch/search/query/QueryPhaseTests.java +++ b/server/src/test/java/org/opensearch/search/query/QueryPhaseTests.java @@ -49,9 +49,7 @@ import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.NoMergePolicy; -import org.apache.lucene.tests.index.RandomIndexWriter; import org.apache.lucene.index.Term; -import org.opensearch.lucene.queries.MinDocQuery; import org.apache.lucene.queries.spans.SpanNearQuery; import org.apache.lucene.queries.spans.SpanTermQuery; import org.apache.lucene.search.BooleanClause.Occur; @@ -82,6 +80,7 @@ import org.apache.lucene.search.join.BitSetProducer; import org.apache.lucene.search.join.ScoreMode; import org.apache.lucene.store.Directory; +import org.apache.lucene.tests.index.RandomIndexWriter; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.FixedBitSet; import org.opensearch.action.search.SearchShardTask; @@ -97,6 +96,7 @@ import org.opensearch.index.search.OpenSearchToParentBlockJoinQuery; import org.opensearch.index.shard.IndexShard; import org.opensearch.index.shard.IndexShardTestCase; +import org.opensearch.lucene.queries.MinDocQuery; import org.opensearch.search.DocValueFormat; import org.opensearch.search.collapse.CollapseBuilder; import org.opensearch.search.internal.ContextIndexSearcher; @@ -111,16 +111,16 @@ import java.util.Collections; import java.util.List; -import static org.hamcrest.Matchers.lessThanOrEqualTo; +import static org.hamcrest.Matchers.anyOf; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.greaterThanOrEqualTo; -import static org.hamcrest.Matchers.anyOf; import static org.hamcrest.Matchers.instanceOf; -import static org.opensearch.search.query.TopDocsCollectorContext.hasInfMaxScore; +import static org.hamcrest.Matchers.lessThanOrEqualTo; import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.when; +import static org.opensearch.search.query.TopDocsCollectorContext.hasInfMaxScore; public class QueryPhaseTests extends IndexShardTestCase { @@ -1069,8 +1069,7 @@ public void testCancellationDuringPreprocess() throws IOException { try (IndexReader reader = DirectoryReader.open(dir)) { TestSearchContext context = new TestSearchContextWithRewriteAndCancellation(null, indexShard, newContextSearcher(reader)); - PrefixQuery prefixQuery = new PrefixQuery(new Term("foo", "a")); - prefixQuery.setRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_REWRITE); + PrefixQuery prefixQuery = new PrefixQuery(new Term("foo", "a"), MultiTermQuery.SCORING_BOOLEAN_REWRITE); context.parsedQuery(new ParsedQuery(prefixQuery)); SearchShardTask task = mock(SearchShardTask.class); when(task.isCancelled()).thenReturn(true); From 199fbb817c45346b40c98c23a7558aff05236920 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 21 Apr 2022 18:12:47 -0500 Subject: [PATCH 093/514] [Remove] MainResponse version override cluster setting (#3031) (#3032) With types removal OpenSearch 2.0.0 no longer supports HLRC compatibility with legacy clients. This commit removes all 1.x logic to spoof the version as a legacy cluster. Signed-off-by: Nicholas Walter Knize (cherry picked from commit cf78065481ded1d0a8a7777779dced20399848cb) Co-authored-by: Nick Knize --- .../org/opensearch/client/PingAndInfoIT.java | 22 ---------- .../opensearch/action/main/MainResponse.java | 37 ++-------------- .../action/main/TransportMainAction.java | 39 +---------------- .../common/settings/ClusterSettings.java | 2 - .../action/main/MainActionTests.java | 43 ------------------- .../action/main/MainResponseTests.java | 16 ------- 6 files changed, 5 insertions(+), 154 deletions(-) diff --git a/client/rest-high-level/src/test/java/org/opensearch/client/PingAndInfoIT.java b/client/rest-high-level/src/test/java/org/opensearch/client/PingAndInfoIT.java index 72201084570bb..09ef90cef144d 100644 --- a/client/rest-high-level/src/test/java/org/opensearch/client/PingAndInfoIT.java +++ b/client/rest-high-level/src/test/java/org/opensearch/client/PingAndInfoIT.java @@ -33,7 +33,6 @@ package org.opensearch.client; import org.apache.http.client.methods.HttpGet; -import org.opensearch.action.main.TransportMainAction; import org.opensearch.client.core.MainResponse; import java.io.IOException; @@ -63,25 +62,4 @@ public void testInfo() throws IOException { assertTrue(versionMap.get("number").toString().startsWith(info.getVersion().getNumber())); assertEquals(versionMap.get("lucene_version"), info.getVersion().getLuceneVersion()); } - - public void testInfo_overrideResponseVersion() throws IOException { - Request overrideResponseVersionRequest = new Request("PUT", "/_cluster/settings"); - overrideResponseVersionRequest.setOptions(expectWarnings(TransportMainAction.OVERRIDE_MAIN_RESPONSE_VERSION_DEPRECATION_MESSAGE)); - overrideResponseVersionRequest.setJsonEntity("{\"persistent\":{\"compatibility\": {\"override_main_response_version\":true}}}"); - client().performRequest(overrideResponseVersionRequest); - - MainResponse info = highLevelClient().info(RequestOptions.DEFAULT); - assertEquals("7.10.2", info.getVersion().getNumber()); - - // Set back to default version. - Request resetResponseVersionRequest = new Request("PUT", "/_cluster/settings"); - resetResponseVersionRequest.setJsonEntity("{\"persistent\":{\"compatibility\": {\"override_main_response_version\":null}}}"); - client().performRequest(resetResponseVersionRequest); - - Map infoAsMap = entityAsMap(adminClient().performRequest(new Request(HttpGet.METHOD_NAME, "/"))); - @SuppressWarnings("unchecked") - Map versionMap = (Map) infoAsMap.get("version"); - info = highLevelClient().info(RequestOptions.DEFAULT); - assertTrue(versionMap.get("number").toString().startsWith(info.getVersion().getNumber())); - } } diff --git a/server/src/main/java/org/opensearch/action/main/MainResponse.java b/server/src/main/java/org/opensearch/action/main/MainResponse.java index bd4be885fa210..1f460e5dfb019 100644 --- a/server/src/main/java/org/opensearch/action/main/MainResponse.java +++ b/server/src/main/java/org/opensearch/action/main/MainResponse.java @@ -55,7 +55,6 @@ public class MainResponse extends ActionResponse implements ToXContentObject { private ClusterName clusterName; private String clusterUuid; private Build build; - private String versionNumber; public static final String TAGLINE = "The OpenSearch Project: https://opensearch.org/"; MainResponse() {} @@ -70,7 +69,6 @@ public class MainResponse extends ActionResponse implements ToXContentObject { if (in.getVersion().before(LegacyESVersion.V_7_0_0)) { in.readBoolean(); } - versionNumber = build.getQualifiedVersion(); } public MainResponse(String nodeName, Version version, ClusterName clusterName, String clusterUuid, Build build) { @@ -79,16 +77,6 @@ public MainResponse(String nodeName, Version version, ClusterName clusterName, S this.clusterName = clusterName; this.clusterUuid = clusterUuid; this.build = build; - this.versionNumber = build.getQualifiedVersion(); - } - - public MainResponse(String nodeName, Version version, ClusterName clusterName, String clusterUuid, Build build, String versionNumber) { - this.nodeName = nodeName; - this.version = version; - this.clusterName = clusterName; - this.clusterUuid = clusterUuid; - this.build = build; - this.versionNumber = versionNumber; } public String getNodeName() { @@ -111,18 +99,10 @@ public Build getBuild() { return build; } - public String getVersionNumber() { - return versionNumber; - } - @Override public void writeTo(StreamOutput out) throws IOException { out.writeString(nodeName); - if (out.getVersion().before(Version.V_1_0_0)) { - Version.writeVersion(LegacyESVersion.V_7_10_2, out); - } else { - Version.writeVersion(version, out); - } + Version.writeVersion(version, out); clusterName.writeTo(out); out.writeString(clusterUuid); Build.writeBuild(build, out); @@ -137,11 +117,9 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.field("name", nodeName); builder.field("cluster_name", clusterName.value()); builder.field("cluster_uuid", clusterUuid); - builder.startObject("version"); - if (isCompatibilityModeDisabled()) { - builder.field("distribution", build.getDistribution()); - } - builder.field("number", versionNumber) + builder.startObject("version") + .field("distribution", build.getDistribution()) + .field("number", build.getQualifiedVersion()) .field("build_type", build.type().displayName()) .field("build_hash", build.hash()) .field("build_date", build.date()) @@ -155,12 +133,6 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } - private boolean isCompatibilityModeDisabled() { - // if we are not in compatibility mode (spoofing versionNumber), then - // build.getQualifiedVersion is always used. - return build.getQualifiedVersion().equals(versionNumber); - } - private static final ObjectParser PARSER = new ObjectParser<>( MainResponse.class.getName(), true, @@ -189,7 +161,6 @@ private boolean isCompatibilityModeDisabled() { response.version = Version.fromString( ((String) value.get("number")).replace("-SNAPSHOT", "").replaceFirst("-(alpha\\d+|beta\\d+|rc\\d+)", "") ); - response.versionNumber = response.version.toString(); }, (parser, context) -> parser.map(), new ParseField("version")); } diff --git a/server/src/main/java/org/opensearch/action/main/TransportMainAction.java b/server/src/main/java/org/opensearch/action/main/TransportMainAction.java index ef6ebb27c4505..5170b23977b1e 100644 --- a/server/src/main/java/org/opensearch/action/main/TransportMainAction.java +++ b/server/src/main/java/org/opensearch/action/main/TransportMainAction.java @@ -33,7 +33,6 @@ package org.opensearch.action.main; import org.opensearch.Build; -import org.opensearch.LegacyESVersion; import org.opensearch.Version; import org.opensearch.action.ActionListener; import org.opensearch.action.support.ActionFilters; @@ -41,8 +40,6 @@ import org.opensearch.cluster.ClusterState; import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.inject.Inject; -import org.opensearch.common.logging.DeprecationLogger; -import org.opensearch.common.settings.Setting; import org.opensearch.common.settings.Settings; import org.opensearch.node.Node; import org.opensearch.tasks.Task; @@ -50,23 +47,8 @@ public class TransportMainAction extends HandledTransportAction { - private static final DeprecationLogger DEPRECATION_LOGGER = DeprecationLogger.getLogger(TransportMainAction.class); - - public static final String OVERRIDE_MAIN_RESPONSE_VERSION_KEY = "compatibility.override_main_response_version"; - - public static final Setting OVERRIDE_MAIN_RESPONSE_VERSION = Setting.boolSetting( - OVERRIDE_MAIN_RESPONSE_VERSION_KEY, - false, - Setting.Property.NodeScope, - Setting.Property.Dynamic - ); - - public static final String OVERRIDE_MAIN_RESPONSE_VERSION_DEPRECATION_MESSAGE = "overriding main response version" - + " number will be removed in a future version"; - private final String nodeName; private final ClusterService clusterService; - private volatile String responseVersion; @Inject public TransportMainAction( @@ -78,32 +60,13 @@ public TransportMainAction( super(MainAction.NAME, transportService, actionFilters, MainRequest::new); this.nodeName = Node.NODE_NAME_SETTING.get(settings); this.clusterService = clusterService; - setResponseVersion(OVERRIDE_MAIN_RESPONSE_VERSION.get(settings)); - - clusterService.getClusterSettings().addSettingsUpdateConsumer(OVERRIDE_MAIN_RESPONSE_VERSION, this::setResponseVersion); - } - - private void setResponseVersion(boolean isResponseVersionOverrideEnabled) { - if (isResponseVersionOverrideEnabled) { - DEPRECATION_LOGGER.deprecate(OVERRIDE_MAIN_RESPONSE_VERSION.getKey(), OVERRIDE_MAIN_RESPONSE_VERSION_DEPRECATION_MESSAGE); - this.responseVersion = LegacyESVersion.V_7_10_2.toString(); - } else { - this.responseVersion = Build.CURRENT.getQualifiedVersion(); - } } @Override protected void doExecute(Task task, MainRequest request, ActionListener listener) { ClusterState clusterState = clusterService.state(); listener.onResponse( - new MainResponse( - nodeName, - Version.CURRENT, - clusterState.getClusterName(), - clusterState.metadata().clusterUUID(), - Build.CURRENT, - responseVersion - ) + new MainResponse(nodeName, Version.CURRENT, clusterState.getClusterName(), clusterState.metadata().clusterUUID(), Build.CURRENT) ); } } diff --git a/server/src/main/java/org/opensearch/common/settings/ClusterSettings.java b/server/src/main/java/org/opensearch/common/settings/ClusterSettings.java index c758b7d2918e7..c3f0212b99812 100644 --- a/server/src/main/java/org/opensearch/common/settings/ClusterSettings.java +++ b/server/src/main/java/org/opensearch/common/settings/ClusterSettings.java @@ -32,7 +32,6 @@ package org.opensearch.common.settings; import org.apache.logging.log4j.LogManager; -import org.opensearch.action.main.TransportMainAction; import org.opensearch.cluster.routing.allocation.decider.NodeLoadAwareAllocationDecider; import org.opensearch.index.IndexModule; import org.opensearch.index.IndexSettings; @@ -552,7 +551,6 @@ public void apply(Settings value, Settings current, Settings previous) { FsHealthService.REFRESH_INTERVAL_SETTING, FsHealthService.SLOW_PATH_LOGGING_THRESHOLD_SETTING, FsHealthService.HEALTHY_TIMEOUT_SETTING, - TransportMainAction.OVERRIDE_MAIN_RESPONSE_VERSION, NodeLoadAwareAllocationDecider.CLUSTER_ROUTING_ALLOCATION_LOAD_AWARENESS_PROVISIONED_CAPACITY_SETTING, NodeLoadAwareAllocationDecider.CLUSTER_ROUTING_ALLOCATION_LOAD_AWARENESS_SKEW_FACTOR_SETTING, NodeLoadAwareAllocationDecider.CLUSTER_ROUTING_ALLOCATION_LOAD_AWARENESS_ALLOW_UNASSIGNED_PRIMARIES_SETTING, diff --git a/server/src/test/java/org/opensearch/action/main/MainActionTests.java b/server/src/test/java/org/opensearch/action/main/MainActionTests.java index 3cbb6b3eb29bd..479e36c2e13ce 100644 --- a/server/src/test/java/org/opensearch/action/main/MainActionTests.java +++ b/server/src/test/java/org/opensearch/action/main/MainActionTests.java @@ -32,7 +32,6 @@ package org.opensearch.action.main; -import org.opensearch.LegacyESVersion; import org.opensearch.action.ActionListener; import org.opensearch.action.support.ActionFilters; import org.opensearch.cluster.ClusterName; @@ -56,7 +55,6 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import static org.opensearch.action.main.TransportMainAction.OVERRIDE_MAIN_RESPONSE_VERSION_KEY; public class MainActionTests extends OpenSearchTestCase { @@ -130,45 +128,4 @@ public void onFailure(Exception e) { assertNotNull(responseRef.get()); verify(clusterService, times(1)).state(); } - - public void testMainResponseVersionOverrideEnabledByConfigSetting() { - final ClusterName clusterName = new ClusterName("opensearch"); - ClusterState state = ClusterState.builder(clusterName).blocks(mock(ClusterBlocks.class)).build(); - - final ClusterService clusterService = mock(ClusterService.class); - when(clusterService.state()).thenReturn(state); - when(clusterService.getClusterSettings()).thenReturn( - new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS) - ); - - TransportService transportService = new TransportService( - Settings.EMPTY, - mock(Transport.class), - null, - TransportService.NOOP_TRANSPORT_INTERCEPTOR, - x -> null, - null, - Collections.emptySet() - ); - - final Settings settings = Settings.builder().put("node.name", "my-node").put(OVERRIDE_MAIN_RESPONSE_VERSION_KEY, true).build(); - - TransportMainAction action = new TransportMainAction(settings, transportService, mock(ActionFilters.class), clusterService); - AtomicReference responseRef = new AtomicReference<>(); - action.doExecute(mock(Task.class), new MainRequest(), new ActionListener() { - @Override - public void onResponse(MainResponse mainResponse) { - responseRef.set(mainResponse); - } - - @Override - public void onFailure(Exception e) { - logger.error("unexpected error", e); - } - }); - - final MainResponse mainResponse = responseRef.get(); - assertEquals(LegacyESVersion.V_7_10_2.toString(), mainResponse.getVersionNumber()); - assertWarnings(TransportMainAction.OVERRIDE_MAIN_RESPONSE_VERSION_DEPRECATION_MESSAGE); - } } diff --git a/server/src/test/java/org/opensearch/action/main/MainResponseTests.java b/server/src/test/java/org/opensearch/action/main/MainResponseTests.java index b333118c4e070..d2b6ae8bcaece 100644 --- a/server/src/test/java/org/opensearch/action/main/MainResponseTests.java +++ b/server/src/test/java/org/opensearch/action/main/MainResponseTests.java @@ -138,22 +138,6 @@ public void testToXContent() throws IOException { ); } - public void toXContent_overrideMainResponseVersion() throws IOException { - String responseVersion = LegacyESVersion.V_7_10_2.toString(); - MainResponse response = new MainResponse( - "nodeName", - Version.CURRENT, - new ClusterName("clusterName"), - randomAlphaOfLengthBetween(10, 20), - Build.CURRENT, - responseVersion - ); - XContentBuilder builder = XContentFactory.jsonBuilder(); - response.toXContent(builder, ToXContent.EMPTY_PARAMS); - assertTrue(Strings.toString(builder).contains("\"number\":\"" + responseVersion + "\",")); - assertFalse(Strings.toString(builder).contains("\"distribution\":\"" + Build.CURRENT.getDistribution() + "\",")); - } - @Override protected MainResponse mutateInstance(MainResponse mutateInstance) { String clusterUuid = mutateInstance.getClusterUuid(); From 5f94cde5a4ae61d60d8d7ef63aec77c909279abc Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 21 Apr 2022 20:26:53 -0400 Subject: [PATCH 094/514] Remove JavaVersion in favour of standard Runtime.Version (java-version-checker) (#3027) (#3034) Signed-off-by: Andriy Redko (cherry picked from commit 0cbd47c799b602c7bb8a68a1dea0d6677c564733) Co-authored-by: Andriy Redko --- .../java_version_checker/JavaVersion.java | 83 ------------------- .../JavaVersionChecker.java | 17 ++-- .../tools/launchers/JvmErgonomics.java | 14 ---- .../tools/launchers/JvmOptionsParser.java | 4 +- .../tools/launchers/SystemJvmOptions.java | 12 +-- .../tools/launchers/JvmErgonomicsTests.java | 6 -- 6 files changed, 9 insertions(+), 127 deletions(-) delete mode 100644 distribution/tools/java-version-checker/src/main/java/org/opensearch/tools/java_version_checker/JavaVersion.java diff --git a/distribution/tools/java-version-checker/src/main/java/org/opensearch/tools/java_version_checker/JavaVersion.java b/distribution/tools/java-version-checker/src/main/java/org/opensearch/tools/java_version_checker/JavaVersion.java deleted file mode 100644 index 7873f29fdff69..0000000000000 --- a/distribution/tools/java-version-checker/src/main/java/org/opensearch/tools/java_version_checker/JavaVersion.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.tools.java_version_checker; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -public class JavaVersion { - - public static final List CURRENT = parse(System.getProperty("java.specification.version")); - public static final List JAVA_8 = parse("1.8"); - public static final List JAVA_11 = parse("11"); - - static List parse(final String value) { - if (!value.matches("^0*[0-9]+(\\.[0-9]+)*$")) { - throw new IllegalArgumentException(value); - } - - final List version = new ArrayList(); - final String[] components = value.split("\\."); - for (final String component : components) { - version.add(Integer.valueOf(component)); - } - return version; - } - - public static int majorVersion(final List javaVersion) { - Objects.requireNonNull(javaVersion); - if (javaVersion.get(0) > 1) { - return javaVersion.get(0); - } else { - return javaVersion.get(1); - } - } - - static int compare(final List left, final List right) { - // lexicographically compare two lists, treating missing entries as zeros - final int len = Math.max(left.size(), right.size()); - for (int i = 0; i < len; i++) { - final int l = (i < left.size()) ? left.get(i) : 0; - final int r = (i < right.size()) ? right.get(i) : 0; - if (l < r) { - return -1; - } - if (r < l) { - return 1; - } - } - return 0; - } - -} diff --git a/distribution/tools/java-version-checker/src/main/java/org/opensearch/tools/java_version_checker/JavaVersionChecker.java b/distribution/tools/java-version-checker/src/main/java/org/opensearch/tools/java_version_checker/JavaVersionChecker.java index e8ff5f3e6f3f2..eb5c7cf1592e7 100644 --- a/distribution/tools/java-version-checker/src/main/java/org/opensearch/tools/java_version_checker/JavaVersionChecker.java +++ b/distribution/tools/java-version-checker/src/main/java/org/opensearch/tools/java_version_checker/JavaVersionChecker.java @@ -32,18 +32,19 @@ package org.opensearch.tools.java_version_checker; +import java.lang.Runtime.Version; import java.util.Arrays; import java.util.Locale; /** - * Simple program that checks if the runtime Java version is at least 1.8. + * Simple program that checks if the runtime Java version is at least 11 */ final class JavaVersionChecker { private JavaVersionChecker() {} /** - * The main entry point. The exit code is 0 if the Java version is at least 1.8, otherwise the exit code is 1. + * The main entry point. The exit code is 0 if the Java version is at least 11, otherwise the exit code is 1. * * @param args the args to the program which are rejected if not empty */ @@ -52,23 +53,15 @@ public static void main(final String[] args) { if (args.length != 0) { throw new IllegalArgumentException("expected zero arguments but was " + Arrays.toString(args)); } - if (JavaVersion.compare(JavaVersion.CURRENT, JavaVersion.JAVA_8) < 0) { + if (Runtime.version().compareTo(Version.parse("11")) < 0) { final String message = String.format( Locale.ROOT, - "the minimum required Java version is 8; your Java version from [%s] does not meet this requirement", + "OpenSearch requires Java 11; your Java version from [%s] does not meet this requirement", System.getProperty("java.home") ); errPrintln(message); exit(1); } - if (JavaVersion.compare(JavaVersion.CURRENT, JavaVersion.JAVA_11) < 0) { - final String message = String.format( - Locale.ROOT, - "future versions of OpenSearch will require Java 11; your Java version from [%s] does not meet this requirement", - System.getProperty("java.home") - ); - errPrintln(message); - } exit(0); } diff --git a/distribution/tools/launchers/src/main/java/org/opensearch/tools/launchers/JvmErgonomics.java b/distribution/tools/launchers/src/main/java/org/opensearch/tools/launchers/JvmErgonomics.java index 053d892d0ec2f..cd4bea689f776 100644 --- a/distribution/tools/launchers/src/main/java/org/opensearch/tools/launchers/JvmErgonomics.java +++ b/distribution/tools/launchers/src/main/java/org/opensearch/tools/launchers/JvmErgonomics.java @@ -32,8 +32,6 @@ package org.opensearch.tools.launchers; -import org.opensearch.tools.java_version_checker.JavaVersion; - import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; @@ -73,19 +71,7 @@ static List choose(final List userDefinedJvmOptions) throws Inte final long heapSize = extractHeapSize(finalJvmOptions); final long maxDirectMemorySize = extractMaxDirectMemorySize(finalJvmOptions); - if (System.getProperty("os.name").startsWith("Windows") && JavaVersion.majorVersion(JavaVersion.CURRENT) == 8) { - Launchers.errPrintln("Warning: with JDK 8 on Windows, OpenSearch may be unable to derive correct"); - Launchers.errPrintln(" ergonomic settings due to a JDK issue (JDK-8074459). Please use a newer"); - Launchers.errPrintln(" version of Java."); - } - if (maxDirectMemorySize == 0 && userDefinedJvmOptions.stream().noneMatch(s -> s.startsWith("-XX:MaxDirectMemorySize"))) { - - if (System.getProperty("os.name").startsWith("Windows") && JavaVersion.majorVersion(JavaVersion.CURRENT) == 8) { - Launchers.errPrintln("Warning: MaxDirectMemorySize may have been miscalculated due to JDK-8074459."); - Launchers.errPrintln(" Please use a newer version of Java or set MaxDirectMemorySize explicitly."); - } - ergonomicChoices.add("-XX:MaxDirectMemorySize=" + heapSize / 2); } return ergonomicChoices; diff --git a/distribution/tools/launchers/src/main/java/org/opensearch/tools/launchers/JvmOptionsParser.java b/distribution/tools/launchers/src/main/java/org/opensearch/tools/launchers/JvmOptionsParser.java index 7703efdc56986..533d1f7e782ba 100644 --- a/distribution/tools/launchers/src/main/java/org/opensearch/tools/launchers/JvmOptionsParser.java +++ b/distribution/tools/launchers/src/main/java/org/opensearch/tools/launchers/JvmOptionsParser.java @@ -32,8 +32,6 @@ package org.opensearch.tools.launchers; -import org.opensearch.tools.java_version_checker.JavaVersion; - import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; @@ -183,7 +181,7 @@ List readJvmOptionsFiles(final Path config) throws IOException, JvmOptio Reader reader = new InputStreamReader(is, StandardCharsets.UTF_8); BufferedReader br = new BufferedReader(reader) ) { - parse(JavaVersion.majorVersion(JavaVersion.CURRENT), br, jvmOptions::add, invalidLines::put); + parse(Runtime.version().feature(), br, jvmOptions::add, invalidLines::put); } if (invalidLines.isEmpty() == false) { throw new JvmOptionsFileParserException(jvmOptionsFile, invalidLines); diff --git a/distribution/tools/launchers/src/main/java/org/opensearch/tools/launchers/SystemJvmOptions.java b/distribution/tools/launchers/src/main/java/org/opensearch/tools/launchers/SystemJvmOptions.java index 738d57951c4ef..fc613ccdaae68 100644 --- a/distribution/tools/launchers/src/main/java/org/opensearch/tools/launchers/SystemJvmOptions.java +++ b/distribution/tools/launchers/src/main/java/org/opensearch/tools/launchers/SystemJvmOptions.java @@ -32,8 +32,6 @@ package org.opensearch.tools.launchers; -import org.opensearch.tools.java_version_checker.JavaVersion; - import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -86,7 +84,7 @@ static List systemJvmOptions() { } private static String maybeShowCodeDetailsInExceptionMessages() { - if (JavaVersion.majorVersion(JavaVersion.CURRENT) >= 14) { + if (Runtime.version().feature() >= 14) { return "-XX:+ShowCodeDetailsInExceptionMessages"; } else { return ""; @@ -101,14 +99,10 @@ private static String javaLocaleProviders() { * * Due to internationalization enhancements in JDK 9 OpenSearch need to set the provider to COMPAT otherwise time/date * parsing will break in an incompatible way for some date patterns and locales. - * //TODO COMPAT will be deprecated in jdk14 https://bugs.openjdk.java.net/browse/JDK-8232906 + * //TODO COMPAT will be deprecated in at some point, see please https://bugs.openjdk.java.net/browse/JDK-8232906 * See also: documentation in server/org.opensearch.common.time.IsoCalendarDataProvider */ - if (JavaVersion.majorVersion(JavaVersion.CURRENT) == 8) { - return "-Djava.locale.providers=SPI,JRE"; - } else { - return "-Djava.locale.providers=SPI,COMPAT"; - } + return "-Djava.locale.providers=SPI,COMPAT"; } } diff --git a/distribution/tools/launchers/src/test/java/org/opensearch/tools/launchers/JvmErgonomicsTests.java b/distribution/tools/launchers/src/test/java/org/opensearch/tools/launchers/JvmErgonomicsTests.java index ffdf2c2898032..5a8c9841aa0fe 100644 --- a/distribution/tools/launchers/src/test/java/org/opensearch/tools/launchers/JvmErgonomicsTests.java +++ b/distribution/tools/launchers/src/test/java/org/opensearch/tools/launchers/JvmErgonomicsTests.java @@ -32,8 +32,6 @@ package org.opensearch.tools.launchers; -import org.opensearch.tools.java_version_checker.JavaVersion; - import java.io.IOException; import java.util.Arrays; import java.util.Collections; @@ -69,8 +67,6 @@ public void testExtractValidHeapSizeUsingMaxHeapSize() throws InterruptedExcepti } public void testExtractValidHeapSizeNoOptionPresent() throws InterruptedException, IOException { - // Muted for jdk8/Windows, see: https://github.com/elastic/elasticsearch/issues/47384 - assumeFalse(System.getProperty("os.name").startsWith("Windows") && JavaVersion.majorVersion(JavaVersion.CURRENT) == 8); assertThat(JvmErgonomics.extractHeapSize(JvmErgonomics.finalJvmOptions(Collections.emptyList())), greaterThan(0L)); } @@ -141,8 +137,6 @@ public void testExtractNoSystemProperties() { } public void testMaxDirectMemorySizeChoice() throws InterruptedException, IOException { - // Muted for jdk8/Windows, see: https://github.com/elastic/elasticsearch/issues/47384 - assumeFalse(System.getProperty("os.name").startsWith("Windows") && JavaVersion.majorVersion(JavaVersion.CURRENT) == 8); final Map heapMaxDirectMemorySize = new HashMap<>(); heapMaxDirectMemorySize.put("64M", Long.toString((64L << 20) / 2)); heapMaxDirectMemorySize.put("512M", Long.toString((512L << 20) / 2)); From a17cc1be116914e93fb0659fb3673a75555c2839 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 21 Apr 2022 22:46:05 -0500 Subject: [PATCH 095/514] Add Github Workflow to build and publish lucene snapshots. (#2906) (#3038) This change introduces a github workflow so that we can build and push snapshots of lucene. The RepositoriesSetupPlugin is also updated with a url from where these snapshots can be retrieved. Signed-off-by: Marc Handalian (cherry picked from commit ca9151fa24222ff33ca0cc412b5c1ba8b9c65158) --- .github/workflows/lucene-snapshots.yml | 55 +++++++++++++++++++ DEVELOPER_GUIDE.md | 6 ++ .../gradle/RepositoriesSetupPlugin.java | 3 +- 3 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/lucene-snapshots.yml diff --git a/.github/workflows/lucene-snapshots.yml b/.github/workflows/lucene-snapshots.yml new file mode 100644 index 0000000000000..0fe025ad1aa16 --- /dev/null +++ b/.github/workflows/lucene-snapshots.yml @@ -0,0 +1,55 @@ +# This workflow will check out, build, and publish snapshots of lucene. + +name: OpenSearch Lucene snapshots + +on: + workflow_dispatch: + # Inputs the workflow accepts. + inputs: + ref: + description: + required: false + default: 'main' + +jobs: + publish-snapshots: + runs-on: ubuntu-latest + # These permissions are needed to interact with GitHub's OIDC Token endpoint. + permissions: + id-token: write + contents: read + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: '17' + distribution: 'adopt' + + - name: Checkout Lucene + uses: actions/checkout@v2 + with: + repository: 'apache/lucene' + path: lucene + ref: ${{ github.event.inputs.ref }} + + - name: Set hash + working-directory: ./lucene + run: | + echo "::set-output name=REVISION::$(git rev-parse --short HEAD)" + id: version + + - name: Publish Lucene to local maven repo. + working-directory: ./lucene + run: ./gradlew publishJarsPublicationToMavenLocal -Pversion.suffix=snapshot-${{ steps.version.outputs.REVISION }} + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: ${{ secrets.LUCENE_SNAPSHOTS_ROLE }} + aws-region: us-west-2 + + - name: Copy files to S3 with the aws CLI. + run: | + aws s3 cp ~/.m2/repository/org/apache/lucene/ s3://${{ secrets.LUCENE_SNAPSHOTS_BUCKET }}/snapshots/lucene/org/apache/lucene/ --recursive --no-progress diff --git a/DEVELOPER_GUIDE.md b/DEVELOPER_GUIDE.md index 11fcb324c8cae..70abfda767353 100644 --- a/DEVELOPER_GUIDE.md +++ b/DEVELOPER_GUIDE.md @@ -49,6 +49,7 @@ - [Submitting Changes](#submitting-changes) - [Backports](#backports) - [LineLint](#linelint) + - [Lucene Snapshots](#lucene-snapshots) # Developer Guide @@ -488,3 +489,8 @@ Executing the binary will automatically search the local directory tree for lint Pass a list of files or directories to limit your search. linelint README.md LICENSE + +# Lucene Snapshots +The Github workflow in [lucene-snapshots.yml](.github/workflows/lucene-snapshots.yml) is a Github worfklow executable by maintainers to build a top-down snapshot build of lucene. +These snapshots are available to test compatibility with upcoming changes to Lucene by updating the version at [version.properties](buildsrc/version.properties) with the `version-snapshot-sha` version. +Example: `lucene = 10.0.0-snapshot-2e941fc`. diff --git a/buildSrc/src/main/java/org/opensearch/gradle/RepositoriesSetupPlugin.java b/buildSrc/src/main/java/org/opensearch/gradle/RepositoriesSetupPlugin.java index 30847f0648c5c..63b88f671c84c 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/RepositoriesSetupPlugin.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/RepositoriesSetupPlugin.java @@ -92,10 +92,9 @@ public static void configureRepositories(Project project) { throw new GradleException("Malformed lucene snapshot version: " + luceneVersion); } String revision = matcher.group(1); - // TODO(cleanup) - Setup own lucene snapshot repo MavenArtifactRepository luceneRepo = repos.maven(repo -> { repo.setName("lucene-snapshots"); - repo.setUrl("https://artifacts.opensearch.org/snapshots/lucene/"); + repo.setUrl("https://d1nvenhzbhpy0q.cloudfront.net/snapshots/lucene/"); }); repos.exclusiveContent(exclusiveRepo -> { exclusiveRepo.filter( From c7e8b6bc8566353964c4e27e4b1b0d3aa026041f Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Fri, 22 Apr 2022 16:08:52 -0500 Subject: [PATCH 096/514] Temporary adding Apache Lucene repositories for snapshots (#3042) (#3047) Signed-off-by: Andriy Redko (cherry picked from commit f006afa969b25b9734d1fceef7c3860ed244dff9) Co-authored-by: Andriy Redko --- gradle/code-coverage.gradle | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gradle/code-coverage.gradle b/gradle/code-coverage.gradle index 61719282c1ca2..7f8af147e236c 100644 --- a/gradle/code-coverage.gradle +++ b/gradle/code-coverage.gradle @@ -11,6 +11,10 @@ apply plugin: 'jacoco' repositories { mavenCentral() gradlePluginPortal() + // TODO: Find the way to use the repositories from RepositoriesSetupPlugin + maven { + url = "https://d1nvenhzbhpy0q.cloudfront.net/snapshots/lucene/" + } } allprojects { From f3663f54991c4f373f01e487146895325b548754 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Fri, 22 Apr 2022 17:38:16 -0400 Subject: [PATCH 097/514] Added explicit 'null' check for response listener to prevent obscure NullPointerException issues (#3048) (#3049) Signed-off-by: Andriy Redko (cherry picked from commit f43856161523125a6641358619bd76429e43a6c2) Co-authored-by: Andriy Redko --- .../org/opensearch/client/RestHighLevelClient.java | 4 ++++ .../client/RestHighLevelClientTests.java | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/client/rest-high-level/src/main/java/org/opensearch/client/RestHighLevelClient.java b/client/rest-high-level/src/main/java/org/opensearch/client/RestHighLevelClient.java index e69ca149d697d..16e6648e7747e 100644 --- a/client/rest-high-level/src/main/java/org/opensearch/client/RestHighLevelClient.java +++ b/client/rest-high-level/src/main/java/org/opensearch/client/RestHighLevelClient.java @@ -1917,6 +1917,10 @@ private Cancellable internalPerformRequestAsync( ActionListener listener, Set ignores ) { + if (listener == null) { + throw new IllegalArgumentException("The listener is required and cannot be null"); + } + Request req; try { req = requestConverter.apply(request); diff --git a/client/rest-high-level/src/test/java/org/opensearch/client/RestHighLevelClientTests.java b/client/rest-high-level/src/test/java/org/opensearch/client/RestHighLevelClientTests.java index 7766fa76d5cfe..efcc13921c398 100644 --- a/client/rest-high-level/src/test/java/org/opensearch/client/RestHighLevelClientTests.java +++ b/client/rest-high-level/src/test/java/org/opensearch/client/RestHighLevelClientTests.java @@ -284,6 +284,20 @@ public ActionRequestValidationException validate() { } } + public void testNullableActionListener() { + ActionRequest request = new ActionRequest() { + @Override + public ActionRequestValidationException validate() { + return null; + } + }; + + assertThrows( + IllegalArgumentException.class, + () -> restHighLevelClient.performRequestAsync(request, null, RequestOptions.DEFAULT, null, null, null) + ); + } + public void testParseEntity() throws IOException { { IllegalStateException ise = expectThrows(IllegalStateException.class, () -> restHighLevelClient.parseEntity(null, null)); From a483f92b897ce954d3c3fec16799d283fecdeb40 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 25 Apr 2022 11:46:33 -0500 Subject: [PATCH 098/514] [Rename] ESTestCase stragglers to OpenSearchTestCase (#3053) (#3065) A few places still referenced legacy ESTestCase name. This refactors those instances to OpenSearchTestCase. Signed-off-by: Nicholas Walter Knize (cherry picked from commit 88bc268e29f8153ae89bea97433ee0ea9917715b) Co-authored-by: Nick Knize --- .../src/main/resources/forbidden/opensearch-test-signatures.txt | 2 +- .../src/main/resources/org/opensearch/bootstrap/security.policy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/resources/forbidden/opensearch-test-signatures.txt b/buildSrc/src/main/resources/forbidden/opensearch-test-signatures.txt index aeb5e25decf62..03dead38bd8b4 100644 --- a/buildSrc/src/main/resources/forbidden/opensearch-test-signatures.txt +++ b/buildSrc/src/main/resources/forbidden/opensearch-test-signatures.txt @@ -26,4 +26,4 @@ com.carrotsearch.randomizedtesting.annotations.Nightly @ We don't run nightly te org.junit.Test @defaultMessage Just name your test method testFooBar -java.lang.Math#random() @ Use one of the various randomization methods from LuceneTestCase or ESTestCase for reproducibility +java.lang.Math#random() @ Use one of the various randomization methods from LuceneTestCase or OpenSearchTestCase for reproducibility diff --git a/server/src/main/resources/org/opensearch/bootstrap/security.policy b/server/src/main/resources/org/opensearch/bootstrap/security.policy index 97b73aedf24bb..05d648212bc40 100644 --- a/server/src/main/resources/org/opensearch/bootstrap/security.policy +++ b/server/src/main/resources/org/opensearch/bootstrap/security.policy @@ -116,7 +116,7 @@ grant { permission java.util.PropertyPermission "solr.data.dir", "write"; permission java.util.PropertyPermission "solr.directoryFactory", "write"; - // set by ESTestCase to improve test reproducibility + // set by OpenSearchTestCase to improve test reproducibility // TODO: set this with gradle or some other way that repros with seed? permission java.util.PropertyPermission "processors.override", "write"; From 7b02dc080d830a8bbdf91981226e1aaffbf18180 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 25 Apr 2022 11:46:54 -0500 Subject: [PATCH 099/514] Bump json-schema-validator from 1.0.68 to 1.0.69 in /buildSrc (#3060) (#3066) Bumps [json-schema-validator](https://github.com/networknt/json-schema-validator) from 1.0.68 to 1.0.69. - [Release notes](https://github.com/networknt/json-schema-validator/releases) - [Changelog](https://github.com/networknt/json-schema-validator/blob/master/CHANGELOG.md) - [Commits](https://github.com/networknt/json-schema-validator/compare/1.0.68...1.0.69) --- updated-dependencies: - dependency-name: com.networknt:json-schema-validator dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> (cherry picked from commit 1c132495b009cf7924b5b620bc204211a73f1c43) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- buildSrc/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 71789ed61cfd0..8092153c9f685 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -115,7 +115,7 @@ dependencies { api 'de.thetaphi:forbiddenapis:3.3' api 'com.avast.gradle:gradle-docker-compose-plugin:0.14.12' api 'org.apache.maven:maven-model:3.6.2' - api 'com.networknt:json-schema-validator:1.0.68' + api 'com.networknt:json-schema-validator:1.0.69' api "com.fasterxml.jackson.core:jackson-databind:${props.getProperty('jackson_databind')}" testFixturesApi "junit:junit:${props.getProperty('junit')}" From 3299517887408d532107b7095cf440290b9ad4fa Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 25 Apr 2022 11:10:34 -0700 Subject: [PATCH 100/514] Bump protobuf-java from 3.20.0 to 3.20.1 in /plugins/repository-hdfs (#3062) (#3068) * Bump protobuf-java from 3.20.0 to 3.20.1 in /plugins/repository-hdfs Bumps [protobuf-java](https://github.com/protocolbuffers/protobuf) from 3.20.0 to 3.20.1. - [Release notes](https://github.com/protocolbuffers/protobuf/releases) - [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/generate_changelog.py) - [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.20.0...v3.20.1) --- updated-dependencies: - dependency-name: com.google.protobuf:protobuf-java dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Updating SHAs Signed-off-by: dependabot[bot] (cherry picked from commit f3404fdeecf056a27201c98a1fb52a26b01ae161) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- plugins/repository-hdfs/build.gradle | 2 +- plugins/repository-hdfs/licenses/protobuf-java-3.20.0.jar.sha1 | 1 - plugins/repository-hdfs/licenses/protobuf-java-3.20.1.jar.sha1 | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 plugins/repository-hdfs/licenses/protobuf-java-3.20.0.jar.sha1 create mode 100644 plugins/repository-hdfs/licenses/protobuf-java-3.20.1.jar.sha1 diff --git a/plugins/repository-hdfs/build.gradle b/plugins/repository-hdfs/build.gradle index d644df243ba95..a72113ef43ca8 100644 --- a/plugins/repository-hdfs/build.gradle +++ b/plugins/repository-hdfs/build.gradle @@ -67,7 +67,7 @@ dependencies { api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}" api 'com.google.code.gson:gson:2.9.0' runtimeOnly 'com.google.guava:guava:31.1-jre' - api 'com.google.protobuf:protobuf-java:3.20.0' + api 'com.google.protobuf:protobuf-java:3.20.1' api "commons-logging:commons-logging:${versions.commonslogging}" api 'commons-cli:commons-cli:1.2' api "commons-codec:commons-codec:${versions.commonscodec}" diff --git a/plugins/repository-hdfs/licenses/protobuf-java-3.20.0.jar.sha1 b/plugins/repository-hdfs/licenses/protobuf-java-3.20.0.jar.sha1 deleted file mode 100644 index c5b0169ce0dba..0000000000000 --- a/plugins/repository-hdfs/licenses/protobuf-java-3.20.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -3c72ddaaab7ffafe789e4f732c1fd614eb798bf4 \ No newline at end of file diff --git a/plugins/repository-hdfs/licenses/protobuf-java-3.20.1.jar.sha1 b/plugins/repository-hdfs/licenses/protobuf-java-3.20.1.jar.sha1 new file mode 100644 index 0000000000000..1ebc9838b7bea --- /dev/null +++ b/plugins/repository-hdfs/licenses/protobuf-java-3.20.1.jar.sha1 @@ -0,0 +1 @@ +5472700cd39a46060efbd35e29cb36b3fb89517b \ No newline at end of file From ec0d8332fd594d95290fa37847590e3fd537ad92 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 25 Apr 2022 11:10:59 -0700 Subject: [PATCH 101/514] Bump protobuf-java from 3.20.0 to 3.20.1 in /plugins/repository-hdfs (#3062) (#3068) * Bump protobuf-java from 3.20.0 to 3.20.1 in /plugins/repository-hdfs Bumps [protobuf-java](https://github.com/protocolbuffers/protobuf) from 3.20.0 to 3.20.1. - [Release notes](https://github.com/protocolbuffers/protobuf/releases) - [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/generate_changelog.py) - [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.20.0...v3.20.1) --- updated-dependencies: - dependency-name: com.google.protobuf:protobuf-java dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Updating SHAs Signed-off-by: dependabot[bot] (cherry picked from commit f3404fdeecf056a27201c98a1fb52a26b01ae161) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> From d8073db1c7bfbf8d2c3dea67a027c3abec51dc61 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 25 Apr 2022 11:11:35 -0700 Subject: [PATCH 102/514] Bump com.gradle.enterprise from 3.9 to 3.10 (#3055) (#3069) Bumps com.gradle.enterprise from 3.9 to 3.10. --- updated-dependencies: - dependency-name: com.gradle.enterprise dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> (cherry picked from commit abad0c5e6e3359e35b4230d5b07527c6e47504a6) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- settings.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle b/settings.gradle index 183a5ec8d1ae1..52e1e16fc1c01 100644 --- a/settings.gradle +++ b/settings.gradle @@ -10,7 +10,7 @@ */ plugins { - id "com.gradle.enterprise" version "3.9" + id "com.gradle.enterprise" version "3.10" } rootProject.name = "OpenSearch" From ddeb94c3923218c2c27789a186801c9da0004b63 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 25 Apr 2022 14:53:08 -0400 Subject: [PATCH 103/514] Bump reactor-netty-http from 1.0.16 to 1.0.18 in /plugins/repository-azure (#3057) (#3070) * Bump reactor-netty-http in /plugins/repository-azure Bumps [reactor-netty-http](https://github.com/reactor/reactor-netty) from 1.0.16 to 1.0.18. - [Release notes](https://github.com/reactor/reactor-netty/releases) - [Commits](https://github.com/reactor/reactor-netty/compare/v1.0.16...v1.0.18) --- updated-dependencies: - dependency-name: io.projectreactor.netty:reactor-netty-http dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Updating SHAs Signed-off-by: dependabot[bot] (cherry picked from commit c71dba0dfe4af550abeef8fb7b4146e7c3f9ba66) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- plugins/repository-azure/build.gradle | 2 +- .../licenses/reactor-netty-http-1.0.16.jar.sha1 | 1 - .../licenses/reactor-netty-http-1.0.18.jar.sha1 | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 plugins/repository-azure/licenses/reactor-netty-http-1.0.16.jar.sha1 create mode 100644 plugins/repository-azure/licenses/reactor-netty-http-1.0.18.jar.sha1 diff --git a/plugins/repository-azure/build.gradle b/plugins/repository-azure/build.gradle index 6e4cda952203d..8f566fce7b470 100644 --- a/plugins/repository-azure/build.gradle +++ b/plugins/repository-azure/build.gradle @@ -59,7 +59,7 @@ dependencies { api 'io.projectreactor:reactor-core:3.4.17' api 'io.projectreactor.netty:reactor-netty:1.0.17' api 'io.projectreactor.netty:reactor-netty-core:1.0.16' - api 'io.projectreactor.netty:reactor-netty-http:1.0.16' + api 'io.projectreactor.netty:reactor-netty-http:1.0.18' api "org.slf4j:slf4j-api:${versions.slf4j}" api "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}" api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}" diff --git a/plugins/repository-azure/licenses/reactor-netty-http-1.0.16.jar.sha1 b/plugins/repository-azure/licenses/reactor-netty-http-1.0.16.jar.sha1 deleted file mode 100644 index d737315b06b62..0000000000000 --- a/plugins/repository-azure/licenses/reactor-netty-http-1.0.16.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -93edb9a1dc774d843551a616e0f316e11ffa81ed \ No newline at end of file diff --git a/plugins/repository-azure/licenses/reactor-netty-http-1.0.18.jar.sha1 b/plugins/repository-azure/licenses/reactor-netty-http-1.0.18.jar.sha1 new file mode 100644 index 0000000000000..43599c0b6c691 --- /dev/null +++ b/plugins/repository-azure/licenses/reactor-netty-http-1.0.18.jar.sha1 @@ -0,0 +1 @@ +a34930cbd46b53ffdb19d2089605f39589eb2b99 \ No newline at end of file From e5a70db4b35e7aa0d70c5a2c366f7e43f4f9d289 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 25 Apr 2022 14:54:13 -0400 Subject: [PATCH 104/514] Adds the replication type index setting, alongside a formal notion of feature flags (#3037) (#3071) * This change formalizes the notion of feature flags, and adds a "replication type" setting that will differentiate between document and segment replication, gated by a feature flag. Since seg-rep is currently an incomplete implementation, the feature flag ensures that the setting is not visible to users without explicitly setting a system property. We can then continue to merge seg-rep related changes from the feature branch to `main` safely hidden behind the feature flag gate. Signed-off-by: Kartik Ganesh * Update security policy for testing feature flags Signed-off-by: Nicholas Walter Knize Co-authored-by: Nicholas Walter Knize (cherry picked from commit ee7b731975d9044d3239ee3a4fe97f50d45af3e5) Co-authored-by: Kartik Ganesh --- .../cluster/metadata/IndexMetadata.java | 13 ++++++ .../common/settings/IndexScopedSettings.java | 11 +++++ .../common/settings/SettingsModule.java | 7 +++ .../opensearch/common/util/FeatureFlags.java | 32 ++++++++++++++ .../org/opensearch/index/IndexSettings.java | 10 +++++ .../replication/common/ReplicationType.java | 30 +++++++++++++ .../org/opensearch/bootstrap/security.policy | 3 ++ .../common/util/FeatureFlagTests.java | 43 +++++++++++++++++++ 8 files changed, 149 insertions(+) create mode 100644 server/src/main/java/org/opensearch/common/util/FeatureFlags.java create mode 100644 server/src/main/java/org/opensearch/indices/replication/common/ReplicationType.java create mode 100644 server/src/test/java/org/opensearch/common/util/FeatureFlagTests.java diff --git a/server/src/main/java/org/opensearch/cluster/metadata/IndexMetadata.java b/server/src/main/java/org/opensearch/cluster/metadata/IndexMetadata.java index 6510c57060fe0..9139cbac2b0be 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/IndexMetadata.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/IndexMetadata.java @@ -70,6 +70,7 @@ import org.opensearch.index.mapper.MapperService; import org.opensearch.index.seqno.SequenceNumbers; import org.opensearch.index.shard.ShardId; +import org.opensearch.indices.replication.common.ReplicationType; import org.opensearch.rest.RestStatus; import java.io.IOException; @@ -260,6 +261,18 @@ public Iterator> settings() { Property.IndexScope ); + /** + * Used to specify the replication type for the index. By default, document replication is used. + */ + public static final String SETTING_REPLICATION_TYPE = "index.replication.type"; + public static final Setting INDEX_REPLICATION_TYPE_SETTING = new Setting<>( + SETTING_REPLICATION_TYPE, + ReplicationType.DOCUMENT.toString(), + ReplicationType::parseString, + Property.IndexScope, + Property.Final + ); + public static final String SETTING_AUTO_EXPAND_REPLICAS = "index.auto_expand_replicas"; public static final Setting INDEX_AUTO_EXPAND_REPLICAS_SETTING = AutoExpandReplicas.SETTING; diff --git a/server/src/main/java/org/opensearch/common/settings/IndexScopedSettings.java b/server/src/main/java/org/opensearch/common/settings/IndexScopedSettings.java index 528d6cc9f5e23..68e1b5b598d40 100644 --- a/server/src/main/java/org/opensearch/common/settings/IndexScopedSettings.java +++ b/server/src/main/java/org/opensearch/common/settings/IndexScopedSettings.java @@ -40,6 +40,7 @@ import org.opensearch.cluster.routing.allocation.decider.ShardsLimitAllocationDecider; import org.opensearch.common.logging.Loggers; import org.opensearch.common.settings.Setting.Property; +import org.opensearch.common.util.FeatureFlags; import org.opensearch.index.IndexModule; import org.opensearch.index.IndexSettings; import org.opensearch.index.IndexSortConfig; @@ -207,6 +208,16 @@ public final class IndexScopedSettings extends AbstractScopedSettings { ) ); + /** + * Map of feature flag name to feature-flagged index setting. Once each feature + * is ready for production release, the feature flag can be removed, and the + * setting should be moved to {@link #BUILT_IN_INDEX_SETTINGS}. + */ + public static final Map FEATURE_FLAGGED_INDEX_SETTINGS = Map.of( + FeatureFlags.REPLICATION_TYPE, + IndexMetadata.INDEX_REPLICATION_TYPE_SETTING + ); + public static final IndexScopedSettings DEFAULT_SCOPED_SETTINGS = new IndexScopedSettings(Settings.EMPTY, BUILT_IN_INDEX_SETTINGS); public IndexScopedSettings(Settings settings, Set> settingsSet) { diff --git a/server/src/main/java/org/opensearch/common/settings/SettingsModule.java b/server/src/main/java/org/opensearch/common/settings/SettingsModule.java index 79ee0bf9f975a..0874814f940d4 100644 --- a/server/src/main/java/org/opensearch/common/settings/SettingsModule.java +++ b/server/src/main/java/org/opensearch/common/settings/SettingsModule.java @@ -37,6 +37,7 @@ import org.opensearch.common.Strings; import org.opensearch.common.inject.Binder; import org.opensearch.common.inject.Module; +import org.opensearch.common.util.FeatureFlags; import org.opensearch.common.xcontent.ToXContent; import org.opensearch.common.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentType; @@ -85,6 +86,12 @@ public SettingsModule( registerSetting(setting); } + for (Map.Entry featureFlaggedSetting : IndexScopedSettings.FEATURE_FLAGGED_INDEX_SETTINGS.entrySet()) { + if (FeatureFlags.isEnabled(featureFlaggedSetting.getKey())) { + registerSetting(featureFlaggedSetting.getValue()); + } + } + for (Setting setting : additionalSettings) { registerSetting(setting); } diff --git a/server/src/main/java/org/opensearch/common/util/FeatureFlags.java b/server/src/main/java/org/opensearch/common/util/FeatureFlags.java new file mode 100644 index 0000000000000..34c613f5423d0 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/util/FeatureFlags.java @@ -0,0 +1,32 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.common.util; + +/** + * Utility class to manage feature flags. Feature flags are system properties that must be set on the JVM. + * These are used to gate the visibility/availability of incomplete features. Fore more information, see + * https://featureflags.io/feature-flag-introduction/ + */ +public class FeatureFlags { + + /** + * Gates the visibility of the index setting that allows changing of replication type. + * Once the feature is ready for production release, this feature flag can be removed. + */ + public static final String REPLICATION_TYPE = "opensearch.experimental.feature.replication_type.enabled"; + + /** + * Used to test feature flags whose values are expected to be booleans. + * This method returns true if the value is "true" (case-insensitive), + * and false otherwise. + */ + public static boolean isEnabled(String featureFlagName) { + return "true".equalsIgnoreCase(System.getProperty(featureFlagName)); + } +} diff --git a/server/src/main/java/org/opensearch/index/IndexSettings.java b/server/src/main/java/org/opensearch/index/IndexSettings.java index aa69417af1897..8ba9c47902115 100644 --- a/server/src/main/java/org/opensearch/index/IndexSettings.java +++ b/server/src/main/java/org/opensearch/index/IndexSettings.java @@ -46,6 +46,7 @@ import org.opensearch.common.unit.ByteSizeValue; import org.opensearch.common.unit.TimeValue; import org.opensearch.index.translog.Translog; +import org.opensearch.indices.replication.common.ReplicationType; import org.opensearch.ingest.IngestService; import org.opensearch.node.Node; @@ -530,6 +531,7 @@ public final class IndexSettings { private final String nodeName; private final Settings nodeSettings; private final int numberOfShards; + private final ReplicationType replicationType; // volatile fields are updated via #updateIndexMetadata(IndexMetadata) under lock private volatile Settings settings; private volatile IndexMetadata indexMetadata; @@ -681,6 +683,7 @@ public IndexSettings(final IndexMetadata indexMetadata, final Settings nodeSetti nodeName = Node.NODE_NAME_SETTING.get(settings); this.indexMetadata = indexMetadata; numberOfShards = settings.getAsInt(IndexMetadata.SETTING_NUMBER_OF_SHARDS, null); + replicationType = ReplicationType.parseString(settings.get(IndexMetadata.SETTING_REPLICATION_TYPE)); this.searchThrottled = INDEX_SEARCH_THROTTLED.get(settings); this.queryStringLenient = QUERY_STRING_LENIENT_SETTING.get(settings); @@ -915,6 +918,13 @@ public int getNumberOfReplicas() { return settings.getAsInt(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, null); } + /** + * Returns true if segment replication is enabled on the index. + */ + public boolean isSegRepEnabled() { + return ReplicationType.SEGMENT.equals(replicationType); + } + /** * Returns the node settings. The settings returned from {@link #getSettings()} are a merged version of the * index settings and the node settings where node settings are overwritten by index settings. diff --git a/server/src/main/java/org/opensearch/indices/replication/common/ReplicationType.java b/server/src/main/java/org/opensearch/indices/replication/common/ReplicationType.java new file mode 100644 index 0000000000000..98d68d67ba5e3 --- /dev/null +++ b/server/src/main/java/org/opensearch/indices/replication/common/ReplicationType.java @@ -0,0 +1,30 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.indices.replication.common; + +/** + * Enumerates the types of replication strategies supported by OpenSearch. + * For more information, see https://github.com/opensearch-project/OpenSearch/issues/1694 + */ +public enum ReplicationType { + + DOCUMENT, + SEGMENT; + + public static ReplicationType parseString(String replicationType) { + try { + return ReplicationType.valueOf(replicationType); + } catch (IllegalArgumentException e) { + throw new IllegalArgumentException("Could not parse ReplicationStrategy for [" + replicationType + "]"); + } catch (NullPointerException npe) { + // return a default value for null input + return DOCUMENT; + } + } +} diff --git a/server/src/main/resources/org/opensearch/bootstrap/security.policy b/server/src/main/resources/org/opensearch/bootstrap/security.policy index 05d648212bc40..3671782b9d12f 100644 --- a/server/src/main/resources/org/opensearch/bootstrap/security.policy +++ b/server/src/main/resources/org/opensearch/bootstrap/security.policy @@ -120,6 +120,9 @@ grant { // TODO: set this with gradle or some other way that repros with seed? permission java.util.PropertyPermission "processors.override", "write"; + // needed for feature flags + permission java.util.PropertyPermission "opensearch.experimental.feature.*", "write"; + // TODO: these simply trigger a noisy warning if its unable to clear the properties // fix that in randomizedtesting permission java.util.PropertyPermission "junit4.childvm.count", "write"; diff --git a/server/src/test/java/org/opensearch/common/util/FeatureFlagTests.java b/server/src/test/java/org/opensearch/common/util/FeatureFlagTests.java new file mode 100644 index 0000000000000..1084f9c658db4 --- /dev/null +++ b/server/src/test/java/org/opensearch/common/util/FeatureFlagTests.java @@ -0,0 +1,43 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.common.util; + +import org.junit.BeforeClass; +import org.opensearch.common.SuppressForbidden; +import org.opensearch.test.OpenSearchTestCase; + +import java.security.AccessController; +import java.security.PrivilegedAction; + +public class FeatureFlagTests extends OpenSearchTestCase { + + @SuppressForbidden(reason = "sets the feature flag") + @BeforeClass + public static void enableFeature() { + AccessController.doPrivileged((PrivilegedAction) () -> System.setProperty(FeatureFlags.REPLICATION_TYPE, "true")); + } + + public void testReplicationTypeFeatureFlag() { + String replicationTypeFlag = FeatureFlags.REPLICATION_TYPE; + assertNotNull(System.getProperty(replicationTypeFlag)); + assertTrue(FeatureFlags.isEnabled(replicationTypeFlag)); + } + + public void testMissingFeatureFlag() { + String testFlag = "missingFeatureFlag"; + assertNull(System.getProperty(testFlag)); + assertFalse(FeatureFlags.isEnabled(testFlag)); + } + + public void testNonBooleanFeatureFlag() { + String javaVersionProperty = "java.version"; + assertNotNull(System.getProperty(javaVersionProperty)); + assertFalse(FeatureFlags.isEnabled(javaVersionProperty)); + } +} From 32cfe530baa3b23f87437409896ad98dbcbfd6a4 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 25 Apr 2022 18:29:26 -0400 Subject: [PATCH 105/514] Correct the skip version, multi_terms aggregation is supported on 2.1 (#3072) (#3073) Signed-off-by: Peng Huo (cherry picked from commit 0bab4730b602408901843df02c8d10a0f4d26744) Co-authored-by: Peng Huo --- .../search.aggregation/370_multi_terms.yml | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/370_multi_terms.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/370_multi_terms.yml index a0e4762ea9b53..4da0f8eeed39b 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/370_multi_terms.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/370_multi_terms.yml @@ -46,8 +46,8 @@ setup: --- "Basic test": - skip: - version: "- 2.9.99" - reason: multi_terms aggregation is introduced in 3.0.0 + version: "- 2.0.99" + reason: multi_terms aggregation is introduced in 2.1.0 - do: bulk: @@ -96,8 +96,8 @@ setup: --- "IP test": - skip: - version: "- 2.9.99" - reason: multi_terms aggregation is introduced in 3.0.0 + version: "- 2.0.99" + reason: multi_terms aggregation is introduced in 2.1.0 - do: bulk: @@ -146,8 +146,8 @@ setup: --- "Boolean test": - skip: - version: "- 2.9.99" - reason: multi_terms aggregation is introduced in 3.0.0 + version: "- 2.0.99" + reason: multi_terms aggregation is introduced in 2.1.0 - do: bulk: @@ -196,8 +196,8 @@ setup: --- "Double test": - skip: - version: "- 2.9.99" - reason: multi_terms aggregation is introduced in 3.0.0 + version: "- 2.0.99" + reason: multi_terms aggregation is introduced in 2.1.0 - do: bulk: @@ -239,8 +239,8 @@ setup: --- "Date test": - skip: - version: "- 2.9.99" - reason: multi_terms aggregation is introduced in 3.0.0 + version: "- 2.0.99" + reason: multi_terms aggregation is introduced in 2.1.0 - do: bulk: @@ -282,8 +282,8 @@ setup: --- "Unmapped keywords": - skip: - version: "- 2.9.99" - reason: multi_terms aggregation is introduced in 3.0.0 + version: "- 2.0.99" + reason: multi_terms aggregation is introduced in 2.1.0 - do: bulk: @@ -322,8 +322,8 @@ setup: --- "Null value": - skip: - version: "- 2.9.99" - reason: multi_terms aggregation is introduced in 3.0.0 + version: "- 2.0.99" + reason: multi_terms aggregation is introduced in 2.1.0 - do: bulk: @@ -357,8 +357,8 @@ setup: --- "multiple multi_terms bucket": - skip: - version: "- 2.9.99" - reason: multi_terms aggregation is introduced in 3.0.0 + version: "- 2.0.99" + reason: multi_terms aggregation is introduced in 2.1.0 - do: bulk: @@ -409,8 +409,8 @@ setup: --- "ordered by metrics": - skip: - version: "- 3.0.0" - reason: multi_terms aggregation is introduced in 3.0.0 + version: "- 2.0.99" + reason: multi_terms aggregation is introduced in 2.1.0 - do: bulk: @@ -457,8 +457,8 @@ setup: --- "top 1 ordered by metrics ": - skip: - version: "- 2.9.99" - reason: multi_terms aggregation is introduced in 3.0.0 + version: "- 2.0.99" + reason: multi_terms aggregation is introduced in 2.1.0 - do: bulk: @@ -502,8 +502,8 @@ setup: --- "min_doc_count": - skip: - version: "- 2.9.99" - reason: multi_terms aggregation is introduced in 3.0.0 + version: "- 2.0.99" + reason: multi_terms aggregation is introduced in 2.1.0 - do: bulk: @@ -574,8 +574,8 @@ setup: --- "sum_other_doc_count": - skip: - version: "- 2.9.99" - reason: multi_terms aggregation is introduced in 3.0.0 + version: "- 2.0.99" + reason: multi_terms aggregation is introduced in 2.1.0 - do: bulk: From ff75b5ffee0ce08894f9670e539c99c5e3ef86b7 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 26 Apr 2022 14:01:39 -0500 Subject: [PATCH 106/514] [Type removal] Remove _type support in NOOP bulk indexing from client benchmark (#3076) (#3080) * [Type removal] Remove _type support in bulk indexing from client benchmark Signed-off-by: Suraj Singh (cherry picked from commit c5ff8d62bf93c78493a36a3a5ef22fad8d0a4bce) Co-authored-by: Suraj Singh --- client/benchmark/README.md | 3 +-- .../client/benchmark/AbstractBenchmark.java | 13 ++++++------- .../client/benchmark/rest/RestClientBenchmark.java | 10 +++++----- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/client/benchmark/README.md b/client/benchmark/README.md index ee99a1384d27e..2732586b9e575 100644 --- a/client/benchmark/README.md +++ b/client/benchmark/README.md @@ -29,7 +29,7 @@ Example invocation: wget http://benchmarks.elasticsearch.org.s3.amazonaws.com/corpora/geonames/documents-2.json.bz2 bzip2 -d documents-2.json.bz2 mv documents-2.json client/benchmark/build -gradlew -p client/benchmark run --args ' rest bulk localhost build/documents-2.json geonames type 8647880 5000' +gradlew -p client/benchmark run --args ' rest bulk localhost build/documents-2.json geonames 8647880 5000' ``` The parameters are all in the `'`s and are in order: @@ -39,7 +39,6 @@ The parameters are all in the `'`s and are in order: * Benchmark target host IP (the host where OpenSearch is running) * full path to the file that should be bulk indexed * name of the index -* name of the (sole) type in the index * number of documents in the file * bulk size diff --git a/client/benchmark/src/main/java/org/opensearch/client/benchmark/AbstractBenchmark.java b/client/benchmark/src/main/java/org/opensearch/client/benchmark/AbstractBenchmark.java index de9d075cb9a16..ab0a0d6b8a19c 100644 --- a/client/benchmark/src/main/java/org/opensearch/client/benchmark/AbstractBenchmark.java +++ b/client/benchmark/src/main/java/org/opensearch/client/benchmark/AbstractBenchmark.java @@ -49,7 +49,7 @@ public abstract class AbstractBenchmark { protected abstract T client(String benchmarkTargetHost) throws Exception; - protected abstract BulkRequestExecutor bulkRequestExecutor(T client, String indexName, String typeName); + protected abstract BulkRequestExecutor bulkRequestExecutor(T client, String indexName); protected abstract SearchRequestExecutor searchRequestExecutor(T client, String indexName); @@ -76,16 +76,15 @@ public final void run(String[] args) throws Exception { @SuppressForbidden(reason = "system out is ok for a command line tool") private void runBulkIndexBenchmark(String[] args) throws Exception { - if (args.length != 7) { - System.err.println("usage: 'bulk' benchmarkTargetHostIp indexFilePath indexName typeName numberOfDocuments bulkSize"); + if (args.length != 6) { + System.err.println("usage: 'bulk' benchmarkTargetHostIp indexFilePath indexName numberOfDocuments bulkSize"); System.exit(1); } String benchmarkTargetHost = args[1]; String indexFilePath = args[2]; String indexName = args[3]; - String typeName = args[4]; - int totalDocs = Integer.valueOf(args[5]); - int bulkSize = Integer.valueOf(args[6]); + int totalDocs = Integer.valueOf(args[4]); + int bulkSize = Integer.valueOf(args[5]); int totalIterationCount = (int) Math.floor(totalDocs / bulkSize); // consider 40% of all iterations as warmup iterations @@ -97,7 +96,7 @@ private void runBulkIndexBenchmark(String[] args) throws Exception { BenchmarkRunner benchmark = new BenchmarkRunner( warmupIterations, iterations, - new BulkBenchmarkTask(bulkRequestExecutor(client, indexName, typeName), indexFilePath, warmupIterations, iterations, bulkSize) + new BulkBenchmarkTask(bulkRequestExecutor(client, indexName), indexFilePath, warmupIterations, iterations, bulkSize) ); try { diff --git a/client/benchmark/src/main/java/org/opensearch/client/benchmark/rest/RestClientBenchmark.java b/client/benchmark/src/main/java/org/opensearch/client/benchmark/rest/RestClientBenchmark.java index 073fd5eab5c46..d2d7163b8dee2 100644 --- a/client/benchmark/src/main/java/org/opensearch/client/benchmark/rest/RestClientBenchmark.java +++ b/client/benchmark/src/main/java/org/opensearch/client/benchmark/rest/RestClientBenchmark.java @@ -65,8 +65,8 @@ protected RestClient client(String benchmarkTargetHost) { } @Override - protected BulkRequestExecutor bulkRequestExecutor(RestClient client, String indexName, String typeName) { - return new RestBulkRequestExecutor(client, indexName, typeName); + protected BulkRequestExecutor bulkRequestExecutor(RestClient client, String indexName) { + return new RestBulkRequestExecutor(client, indexName); } @Override @@ -78,9 +78,9 @@ private static final class RestBulkRequestExecutor implements BulkRequestExecuto private final RestClient client; private final String actionMetadata; - RestBulkRequestExecutor(RestClient client, String index, String type) { + RestBulkRequestExecutor(RestClient client, String index) { this.client = client; - this.actionMetadata = String.format(Locale.ROOT, "{ \"index\" : { \"_index\" : \"%s\", \"_type\" : \"%s\" } }%n", index, type); + this.actionMetadata = String.format(Locale.ROOT, "{ \"index\" : { \"_index\" : \"%s\" } }%n", index); } @Override @@ -91,7 +91,7 @@ public boolean bulkIndex(List bulkData) { bulkRequestBody.append(bulkItem); bulkRequestBody.append("\n"); } - Request request = new Request("POST", "/geonames/type/_noop_bulk"); + Request request = new Request("POST", "/geonames/_noop_bulk"); request.setJsonEntity(bulkRequestBody.toString()); try { Response response = client.performRequest(request); From 2561cbbe56f1d64fd4c72c77f2c1e9543962d078 Mon Sep 17 00:00:00 2001 From: Prudhvi Godithi Date: Wed, 27 Apr 2022 09:22:35 -0700 Subject: [PATCH 107/514] Custom plugin backport to 2.x branch (#3096) Signed-off-by: pgodithi --- .../org/opensearch/gradle/PublishPlugin.java | 23 ++-- .../opensearch/gradle/pluginzip/Publish.java | 74 +++++++++++++ .../opensearch.pluginzip.properties | 1 + .../gradle/pluginzip/PublishTests.java | 104 ++++++++++++++++++ 4 files changed, 192 insertions(+), 10 deletions(-) create mode 100644 buildSrc/src/main/java/org/opensearch/gradle/pluginzip/Publish.java create mode 100644 buildSrc/src/main/resources/META-INF/gradle-plugins/opensearch.pluginzip.properties create mode 100644 buildSrc/src/test/java/org/opensearch/gradle/pluginzip/PublishTests.java diff --git a/buildSrc/src/main/java/org/opensearch/gradle/PublishPlugin.java b/buildSrc/src/main/java/org/opensearch/gradle/PublishPlugin.java index d164b54c7506c..2a0521b17d55e 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/PublishPlugin.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/PublishPlugin.java @@ -125,18 +125,21 @@ public String call() throws Exception { // Add git origin info to generated POM files publication.getPom().withXml(PublishPlugin::addScmInfo); - // have to defer this until archivesBaseName is set - project.afterEvaluate(p -> publication.setArtifactId(getArchivesBaseName(project))); + if (!publication.getName().toLowerCase().contains("zip")) { - // publish sources and javadoc for Java projects. - if (project.getPluginManager().hasPlugin("opensearch.java")) { - publication.artifact(project.getTasks().getByName("sourcesJar")); - publication.artifact(project.getTasks().getByName("javadocJar")); - } + // have to defer this until archivesBaseName is set + project.afterEvaluate(p -> publication.setArtifactId(getArchivesBaseName(project))); + + // publish sources and javadoc for Java projects. + if (project.getPluginManager().hasPlugin("opensearch.java")) { + publication.artifact(project.getTasks().getByName("sourcesJar")); + publication.artifact(project.getTasks().getByName("javadocJar")); + } - generatePomTask.configure( - t -> t.dependsOn(String.format("generatePomFileFor%sPublication", Util.capitalize(publication.getName()))) - ); + generatePomTask.configure( + t -> t.dependsOn(String.format("generatePomFileFor%sPublication", Util.capitalize(publication.getName()))) + ); + } }); } diff --git a/buildSrc/src/main/java/org/opensearch/gradle/pluginzip/Publish.java b/buildSrc/src/main/java/org/opensearch/gradle/pluginzip/Publish.java new file mode 100644 index 0000000000000..e8b4ecec7a56d --- /dev/null +++ b/buildSrc/src/main/java/org/opensearch/gradle/pluginzip/Publish.java @@ -0,0 +1,74 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ +package org.opensearch.gradle.pluginzip; + +import java.util.*; +import org.gradle.api.Plugin; +import org.gradle.api.Project; +import org.gradle.api.publish.PublishingExtension; +import org.gradle.api.publish.maven.MavenPublication; +import org.gradle.api.publish.maven.plugins.MavenPublishPlugin; +import java.nio.file.Path; + +public class Publish implements Plugin { + private Project project; + + public final static String EXTENSION_NAME = "zipmavensettings"; + public final static String PUBLICATION_NAME = "pluginZip"; + public final static String STAGING_REPO = "zipStaging"; + public final static String PLUGIN_ZIP_PUBLISH_POM_TASK = "generatePomFileForPluginZipPublication"; + public final static String LOCALMAVEN = "publishToMavenLocal"; + public final static String LOCAL_STAGING_REPO_PATH = "/build/local-staging-repo"; + public String zipDistributionLocation = "/build/distributions/"; + + public static void configMaven(Project project) { + final Path buildDirectory = project.getRootDir().toPath(); + project.getPluginManager().apply(MavenPublishPlugin.class); + project.getExtensions().configure(PublishingExtension.class, publishing -> { + publishing.repositories(repositories -> { + repositories.maven(maven -> { + maven.setName(STAGING_REPO); + maven.setUrl(buildDirectory.toString() + LOCAL_STAGING_REPO_PATH); + }); + }); + publishing.publications(publications -> { + publications.create(PUBLICATION_NAME, MavenPublication.class, mavenZip -> { + String zipGroup = "org.opensearch.plugin"; + String zipArtifact = project.getName(); + String zipVersion = getProperty("version", project); + mavenZip.artifact(project.getTasks().named("bundlePlugin")); + mavenZip.setGroupId(zipGroup); + mavenZip.setArtifactId(zipArtifact); + mavenZip.setVersion(zipVersion); + }); + }); + }); + } + + static String getProperty(String name, Project project) { + if (project.hasProperty(name)) { + Object property = project.property(name); + if (property != null) { + return property.toString(); + } + } + return null; + } + + @Override + public void apply(Project project) { + this.project = project; + project.afterEvaluate(evaluatedProject -> { configMaven(project); }); + project.getGradle().getTaskGraph().whenReady(graph -> { + if (graph.hasTask(LOCALMAVEN)) { + project.getTasks().getByName(PLUGIN_ZIP_PUBLISH_POM_TASK).setEnabled(false); + } + + }); + } +} diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/opensearch.pluginzip.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/opensearch.pluginzip.properties new file mode 100644 index 0000000000000..600218ff76835 --- /dev/null +++ b/buildSrc/src/main/resources/META-INF/gradle-plugins/opensearch.pluginzip.properties @@ -0,0 +1 @@ +implementation-class=org.opensearch.gradle.pluginzip.Publish diff --git a/buildSrc/src/test/java/org/opensearch/gradle/pluginzip/PublishTests.java b/buildSrc/src/test/java/org/opensearch/gradle/pluginzip/PublishTests.java new file mode 100644 index 0000000000000..ae94ace55e637 --- /dev/null +++ b/buildSrc/src/test/java/org/opensearch/gradle/pluginzip/PublishTests.java @@ -0,0 +1,104 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.gradle.pluginzip; + +import org.gradle.testkit.runner.BuildResult; +import org.gradle.testkit.runner.GradleRunner; +import org.gradle.testfixtures.ProjectBuilder; +import org.gradle.api.Project; +import org.opensearch.gradle.test.GradleUnitTestCase; +import org.junit.Test; +import java.io.IOException; +import org.gradle.api.publish.maven.tasks.PublishToMavenRepository; +import java.io.File; +import org.gradle.testkit.runner.BuildResult; +import java.io.FileWriter; +import java.io.Writer; +import static org.gradle.testkit.runner.TaskOutcome.SUCCESS; +import static org.junit.Assert.assertEquals; +import java.nio.file.Files; +import org.apache.maven.model.Model; +import org.apache.maven.model.io.xpp3.MavenXpp3Reader; +import org.codehaus.plexus.util.xml.pull.XmlPullParserException; +import java.io.FileReader; +import org.gradle.api.tasks.bundling.Zip; + +public class PublishTests extends GradleUnitTestCase { + + @Test + public void testZipPublish() throws IOException, XmlPullParserException { + Project project = ProjectBuilder.builder().build(); + String zipPublishTask = "publishPluginZipPublicationToZipStagingRepository"; + // Apply the opensearch.pluginzip plugin + project.getPluginManager().apply("opensearch.pluginzip"); + // Check if the plugin has been applied to the project + assertTrue(project.getPluginManager().hasPlugin("opensearch.pluginzip")); + // Check if the project has the task from class PublishToMavenRepository after plugin apply + assertNotNull(project.getTasks().withType(PublishToMavenRepository.class)); + // Create a mock bundlePlugin task + Zip task = project.getTasks().create("bundlePlugin", Zip.class); + Publish.configMaven(project); + // Check if the main task publishPluginZipPublicationToZipStagingRepository exists after plugin apply + assertTrue(project.getTasks().getNames().contains(zipPublishTask)); + assertNotNull("Task to generate: ", project.getTasks().getByName(zipPublishTask)); + // Run Gradle functional tests, but calling a build.gradle file, that resembles the plugin publish behavior + File projectDir = new File("build/functionalTest"); + // Create a sample plugin zip file + File sampleZip = new File("build/functionalTest/sample-plugin.zip"); + Files.createDirectories(projectDir.toPath()); + Files.createFile(sampleZip.toPath()); + writeString(new File(projectDir, "settings.gradle"), ""); + // Generate the build.gradle file + String buildFileContent = "apply plugin: 'maven-publish' \n" + + "publishing {\n" + + " repositories {\n" + + " maven {\n" + + " url = 'local-staging-repo/'\n" + + " name = 'zipStaging'\n" + + " }\n" + + " }\n" + + " publications {\n" + + " pluginZip(MavenPublication) {\n" + + " groupId = 'org.opensearch.plugin' \n" + + " artifactId = 'sample-plugin' \n" + + " version = '2.0.0.0' \n" + + " artifact('sample-plugin.zip') \n" + + " }\n" + + " }\n" + + "}"; + writeString(new File(projectDir, "build.gradle"), buildFileContent); + // Execute the task publishPluginZipPublicationToZipStagingRepository + GradleRunner runner = GradleRunner.create(); + runner.forwardOutput(); + runner.withPluginClasspath(); + runner.withArguments(zipPublishTask); + runner.withProjectDir(projectDir); + BuildResult result = runner.build(); + // Check if task publishMavenzipPublicationToZipstagingRepository has ran well + assertEquals(SUCCESS, result.task(":" + zipPublishTask).getOutcome()); + // check if the zip has been published to local staging repo + assertTrue( + new File("build/functionalTest/local-staging-repo/org/opensearch/plugin/sample-plugin/2.0.0.0/sample-plugin-2.0.0.0.zip") + .exists() + ); + // Parse the maven file and validate the groupID to org.opensearch.plugin + MavenXpp3Reader reader = new MavenXpp3Reader(); + Model model = reader.read( + new FileReader("build/functionalTest/local-staging-repo/org/opensearch/plugin/sample-plugin/2.0.0.0/sample-plugin-2.0.0.0.pom") + ); + assertEquals(model.getGroupId(), "org.opensearch.plugin"); + } + + private void writeString(File file, String string) throws IOException { + try (Writer writer = new FileWriter(file)) { + writer.write(string); + } + } + +} From 0e267fe10bb603fb5a4923a2aa96a4f855f2333b Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 27 Apr 2022 17:09:38 -0400 Subject: [PATCH 108/514] [Remove] Type from nested fields using new metadata field mapper (#3004) (#3085) * [Remove] Type from nested fields using new metadata field mapper types support is removed yet nested documents use the _type field to store the path for nested documents. A new _nested_path metadata field mapper is added to take the place of the _type field in order to remove the type dependency in nested documents. BWC is handled in the new field mapper to ensure compatibility with older versions. Signed-off-by: Nicholas Walter Knize (cherry picked from commit 6b641d2fd29b9542b94f419fc083847fa5bdf55b) Co-authored-by: Nick Knize --- .../index/mapper/DocumentParser.java | 12 ++- .../index/mapper/NestedPathFieldMapper.java | 96 +++++++++++++++++++ .../opensearch/index/mapper/ObjectMapper.java | 21 ++-- .../org/opensearch/indices/IndicesModule.java | 2 + .../indices/mapper/MapperRegistry.java | 7 +- .../index/mapper/DocumentParserTests.java | 6 +- .../FieldAliasMapperValidationTests.java | 4 +- .../index/mapper/NestedObjectMapperTests.java | 6 +- .../mapper/NestedPathFieldMapperTests.java | 47 +++++++++ .../index/search/NestedHelperTests.java | 7 +- .../search/nested/NestedSortingTests.java | 66 ++++++------- .../index/shard/ShardSplittingQueryTests.java | 10 +- .../indices/IndicesModuleTests.java | 16 +++- .../indices/IndicesServiceTests.java | 9 +- .../bucket/nested/NestedAggregatorTests.java | 30 +++--- .../nested/ReverseNestedAggregatorTests.java | 6 +- .../terms/RareTermsAggregatorTests.java | 4 +- .../bucket/terms/TermsAggregatorTests.java | 4 +- .../search/sort/FieldSortBuilderTests.java | 4 +- .../sort/GeoDistanceSortBuilderTests.java | 4 +- .../search/sort/ScriptSortBuilderTests.java | 4 +- 21 files changed, 264 insertions(+), 101 deletions(-) create mode 100644 server/src/main/java/org/opensearch/index/mapper/NestedPathFieldMapper.java create mode 100644 server/src/test/java/org/opensearch/index/mapper/NestedPathFieldMapperTests.java diff --git a/server/src/main/java/org/opensearch/index/mapper/DocumentParser.java b/server/src/main/java/org/opensearch/index/mapper/DocumentParser.java index bcafddd6d5816..f9d6187d60eb8 100644 --- a/server/src/main/java/org/opensearch/index/mapper/DocumentParser.java +++ b/server/src/main/java/org/opensearch/index/mapper/DocumentParser.java @@ -455,21 +455,23 @@ private static void innerParseObject( private static void nested(ParseContext context, ObjectMapper.Nested nested) { ParseContext.Document nestedDoc = context.doc(); ParseContext.Document parentDoc = nestedDoc.getParent(); + Version indexVersion = context.indexSettings().getIndexVersionCreated(); if (nested.isIncludeInParent()) { - addFields(nestedDoc, parentDoc); + addFields(indexVersion, nestedDoc, parentDoc); } if (nested.isIncludeInRoot()) { ParseContext.Document rootDoc = context.rootDoc(); // don't add it twice, if its included in parent, and we are handling the master doc... if (!nested.isIncludeInParent() || parentDoc != rootDoc) { - addFields(nestedDoc, rootDoc); + addFields(indexVersion, nestedDoc, rootDoc); } } } - private static void addFields(ParseContext.Document nestedDoc, ParseContext.Document rootDoc) { + private static void addFields(Version indexVersion, ParseContext.Document nestedDoc, ParseContext.Document rootDoc) { + String nestedPathFieldName = NestedPathFieldMapper.name(indexVersion); for (IndexableField field : nestedDoc.getFields()) { - if (!field.name().equals(TypeFieldMapper.NAME)) { + if (field.name().equals(nestedPathFieldName) == false) { rootDoc.add(field); } } @@ -498,7 +500,7 @@ private static ParseContext nestedContext(ParseContext context, ObjectMapper map // the type of the nested doc starts with __, so we can identify that its a nested one in filters // note, we don't prefix it with the type of the doc since it allows us to execute a nested query // across types (for example, with similar nested objects) - nestedDoc.add(new Field(TypeFieldMapper.NAME, mapper.nestedTypePathAsString(), TypeFieldMapper.Defaults.NESTED_FIELD_TYPE)); + nestedDoc.add(NestedPathFieldMapper.field(context.indexSettings().getIndexVersionCreated(), mapper.nestedTypePath())); return context; } diff --git a/server/src/main/java/org/opensearch/index/mapper/NestedPathFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/NestedPathFieldMapper.java new file mode 100644 index 0000000000000..f420897ca187f --- /dev/null +++ b/server/src/main/java/org/opensearch/index/mapper/NestedPathFieldMapper.java @@ -0,0 +1,96 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.index.mapper; + +import org.apache.lucene.document.Field; +import org.apache.lucene.document.FieldType; +import org.apache.lucene.index.IndexOptions; +import org.apache.lucene.index.Term; +import org.apache.lucene.search.Query; +import org.apache.lucene.search.TermQuery; +import org.apache.lucene.util.BytesRef; +import org.opensearch.Version; +import org.opensearch.index.query.QueryShardContext; +import org.opensearch.search.lookup.SearchLookup; + +import java.util.Collections; + +public class NestedPathFieldMapper extends MetadataFieldMapper { + // OpenSearch version 2.0 removed types; this name is used for bwc + public static final String LEGACY_NAME = "_type"; + public static final String NAME = "_nested_path"; + + public static class Defaults { + public static final FieldType FIELD_TYPE = new FieldType(); + static { + FIELD_TYPE.setIndexOptions(IndexOptions.DOCS); + FIELD_TYPE.setTokenized(false); + FIELD_TYPE.setStored(false); + FIELD_TYPE.setOmitNorms(true); + FIELD_TYPE.freeze(); + } + } + + /** private ctor; using SINGLETON to control BWC */ + private NestedPathFieldMapper(String name) { + super(new NestedPathFieldType(name)); + } + + /** returns the field name */ + public static String name(Version version) { + if (version.before(Version.V_2_0_0)) { + return LEGACY_NAME; + } + return NAME; + } + + @Override + protected String contentType() { + return NAME; + } + + private static final NestedPathFieldMapper LEGACY_INSTANCE = new NestedPathFieldMapper(LEGACY_NAME); + private static final NestedPathFieldMapper INSTANCE = new NestedPathFieldMapper(NAME); + + public static final TypeParser PARSER = new FixedTypeParser( + c -> c.indexVersionCreated().before(Version.V_2_0_0) ? LEGACY_INSTANCE : INSTANCE + ); + + /** helper method to create a lucene field based on the opensearch version */ + public static Field field(Version version, String path) { + return new Field(name(version), path, Defaults.FIELD_TYPE); + } + + /** helper method to create a query based on the opensearch version */ + public static Query filter(Version version, String path) { + return new TermQuery(new Term(name(version), new BytesRef(path))); + } + + /** field type for the NestPath field */ + public static final class NestedPathFieldType extends StringFieldType { + private NestedPathFieldType(String name) { + super(name, true, false, false, TextSearchInfo.SIMPLE_MATCH_ONLY, Collections.emptyMap()); + } + + @Override + public String typeName() { + return NAME; + } + + @Override + public Query existsQuery(QueryShardContext context) { + throw new UnsupportedOperationException("Cannot run exists() query against the nested field path"); + } + + @Override + public ValueFetcher valueFetcher(QueryShardContext context, SearchLookup searchLookup, String format) { + throw new UnsupportedOperationException("Cannot fetch values for internal field [" + name() + "]."); + } + } +} diff --git a/server/src/main/java/org/opensearch/index/mapper/ObjectMapper.java b/server/src/main/java/org/opensearch/index/mapper/ObjectMapper.java index a9923d7c6d756..d3c2e7f1e5372 100644 --- a/server/src/main/java/org/opensearch/index/mapper/ObjectMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/ObjectMapper.java @@ -32,11 +32,9 @@ package org.opensearch.index.mapper; -import org.apache.lucene.index.Term; import org.apache.lucene.search.Query; -import org.apache.lucene.search.TermQuery; -import org.apache.lucene.util.BytesRef; import org.opensearch.OpenSearchParseException; +import org.opensearch.Version; import org.opensearch.common.Explicit; import org.opensearch.common.Nullable; import org.opensearch.common.collect.CopyOnWriteHashMap; @@ -388,8 +386,7 @@ protected static void parseProperties(ObjectMapper.Builder objBuilder, Map initBuiltInMetadataMa builtInMetadataMappers.put(IndexFieldMapper.NAME, IndexFieldMapper.PARSER); builtInMetadataMappers.put(DataStreamFieldMapper.NAME, DataStreamFieldMapper.PARSER); builtInMetadataMappers.put(SourceFieldMapper.NAME, SourceFieldMapper.PARSER); + builtInMetadataMappers.put(NestedPathFieldMapper.NAME, NestedPathFieldMapper.PARSER); builtInMetadataMappers.put(VersionFieldMapper.NAME, VersionFieldMapper.PARSER); builtInMetadataMappers.put(SeqNoFieldMapper.NAME, SeqNoFieldMapper.PARSER); // _field_names must be added last so that it has a chance to see all the other mappers diff --git a/server/src/main/java/org/opensearch/indices/mapper/MapperRegistry.java b/server/src/main/java/org/opensearch/indices/mapper/MapperRegistry.java index f56b2f98f0f6e..23ce1b277aeeb 100644 --- a/server/src/main/java/org/opensearch/indices/mapper/MapperRegistry.java +++ b/server/src/main/java/org/opensearch/indices/mapper/MapperRegistry.java @@ -35,6 +35,7 @@ import org.opensearch.Version; import org.opensearch.index.mapper.Mapper; import org.opensearch.index.mapper.MetadataFieldMapper; +import org.opensearch.index.mapper.NestedPathFieldMapper; import org.opensearch.plugins.MapperPlugin; import java.util.Collections; @@ -50,6 +51,7 @@ public final class MapperRegistry { private final Map mapperParsers; private final Map metadataMapperParsers; + private final Map metadataMapperParsersPre20; private final Function> fieldFilter; public MapperRegistry( @@ -59,6 +61,9 @@ public MapperRegistry( ) { this.mapperParsers = Collections.unmodifiableMap(new LinkedHashMap<>(mapperParsers)); this.metadataMapperParsers = Collections.unmodifiableMap(new LinkedHashMap<>(metadataMapperParsers)); + Map tempPre20 = new LinkedHashMap<>(metadataMapperParsers); + tempPre20.remove(NestedPathFieldMapper.NAME); + this.metadataMapperParsersPre20 = Collections.unmodifiableMap(tempPre20); this.fieldFilter = fieldFilter; } @@ -75,7 +80,7 @@ public Map getMapperParsers() { * returned map uses the name of the field as a key. */ public Map getMetadataMapperParsers(Version indexCreatedVersion) { - return metadataMapperParsers; + return indexCreatedVersion.onOrAfter(Version.V_2_0_0) ? metadataMapperParsers : metadataMapperParsersPre20; } /** diff --git a/server/src/test/java/org/opensearch/index/mapper/DocumentParserTests.java b/server/src/test/java/org/opensearch/index/mapper/DocumentParserTests.java index 0ad8dc3f138e0..659042c37d650 100644 --- a/server/src/test/java/org/opensearch/index/mapper/DocumentParserTests.java +++ b/server/src/test/java/org/opensearch/index/mapper/DocumentParserTests.java @@ -248,14 +248,14 @@ public void testNestedHaveIdAndTypeFields() throws Exception { assertNotNull(result.docs().get(0).getField(IdFieldMapper.NAME)); assertEquals(Uid.encodeId("1"), result.docs().get(0).getField(IdFieldMapper.NAME).binaryValue()); assertEquals(IdFieldMapper.Defaults.NESTED_FIELD_TYPE, result.docs().get(0).getField(IdFieldMapper.NAME).fieldType()); - assertNotNull(result.docs().get(0).getField(TypeFieldMapper.NAME)); - assertEquals("__foo", result.docs().get(0).getField(TypeFieldMapper.NAME).stringValue()); + assertNotNull(result.docs().get(0).getField(NestedPathFieldMapper.NAME)); + assertEquals("foo", result.docs().get(0).getField(NestedPathFieldMapper.NAME).stringValue()); assertEquals("value1", result.docs().get(0).getField("foo.bar").binaryValue().utf8ToString()); // Root document: assertNotNull(result.docs().get(1).getField(IdFieldMapper.NAME)); assertEquals(Uid.encodeId("1"), result.docs().get(1).getField(IdFieldMapper.NAME).binaryValue()); assertEquals(IdFieldMapper.Defaults.FIELD_TYPE, result.docs().get(1).getField(IdFieldMapper.NAME).fieldType()); - assertNull(result.docs().get(1).getField(TypeFieldMapper.NAME)); + assertNull(result.docs().get(1).getField(NestedPathFieldMapper.NAME)); assertEquals("value2", result.docs().get(1).getField("baz").binaryValue().utf8ToString()); } diff --git a/server/src/test/java/org/opensearch/index/mapper/FieldAliasMapperValidationTests.java b/server/src/test/java/org/opensearch/index/mapper/FieldAliasMapperValidationTests.java index 7ffc22f92d839..92de2707078f3 100644 --- a/server/src/test/java/org/opensearch/index/mapper/FieldAliasMapperValidationTests.java +++ b/server/src/test/java/org/opensearch/index/mapper/FieldAliasMapperValidationTests.java @@ -220,7 +220,7 @@ private static ObjectMapper createObjectMapper(String name) { ObjectMapper.Nested.NO, ObjectMapper.Dynamic.FALSE, emptyMap(), - Settings.EMPTY + SETTINGS ); } @@ -232,7 +232,7 @@ private static ObjectMapper createNestedObjectMapper(String name) { ObjectMapper.Nested.newNested(), ObjectMapper.Dynamic.FALSE, emptyMap(), - Settings.EMPTY + SETTINGS ); } } diff --git a/server/src/test/java/org/opensearch/index/mapper/NestedObjectMapperTests.java b/server/src/test/java/org/opensearch/index/mapper/NestedObjectMapperTests.java index fe3ce5da6c90a..245ba1404cb5c 100644 --- a/server/src/test/java/org/opensearch/index/mapper/NestedObjectMapperTests.java +++ b/server/src/test/java/org/opensearch/index/mapper/NestedObjectMapperTests.java @@ -149,7 +149,7 @@ public void testSingleNested() throws Exception { ); assertThat(doc.docs().size(), equalTo(2)); - assertThat(doc.docs().get(0).get(TypeFieldMapper.NAME), equalTo(nested1Mapper.nestedTypePathAsString())); + assertThat(doc.docs().get(0).get(NestedPathFieldMapper.NAME), equalTo(nested1Mapper.nestedTypePath())); assertThat(doc.docs().get(0).get("nested1.field1"), equalTo("1")); assertThat(doc.docs().get(0).get("nested1.field2"), equalTo("2")); @@ -180,10 +180,10 @@ public void testSingleNested() throws Exception { ); assertThat(doc.docs().size(), equalTo(3)); - assertThat(doc.docs().get(0).get(TypeFieldMapper.NAME), equalTo(nested1Mapper.nestedTypePathAsString())); + assertThat(doc.docs().get(0).get(NestedPathFieldMapper.NAME), equalTo(nested1Mapper.nestedTypePath())); assertThat(doc.docs().get(0).get("nested1.field1"), equalTo("1")); assertThat(doc.docs().get(0).get("nested1.field2"), equalTo("2")); - assertThat(doc.docs().get(1).get(TypeFieldMapper.NAME), equalTo(nested1Mapper.nestedTypePathAsString())); + assertThat(doc.docs().get(1).get(NestedPathFieldMapper.NAME), equalTo(nested1Mapper.nestedTypePath())); assertThat(doc.docs().get(1).get("nested1.field1"), equalTo("3")); assertThat(doc.docs().get(1).get("nested1.field2"), equalTo("4")); diff --git a/server/src/test/java/org/opensearch/index/mapper/NestedPathFieldMapperTests.java b/server/src/test/java/org/opensearch/index/mapper/NestedPathFieldMapperTests.java new file mode 100644 index 0000000000000..6ad1d0f7f09b9 --- /dev/null +++ b/server/src/test/java/org/opensearch/index/mapper/NestedPathFieldMapperTests.java @@ -0,0 +1,47 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.index.mapper; + +import org.apache.lucene.index.IndexableField; +import org.opensearch.common.bytes.BytesArray; +import org.opensearch.common.compress.CompressedXContent; +import org.opensearch.common.settings.Settings; +import org.opensearch.common.xcontent.XContentType; +import org.opensearch.test.OpenSearchSingleNodeTestCase; + +import java.io.IOException; +import java.util.Arrays; +import java.util.Collections; + +/** tests for {@link org.opensearch.index.mapper.NestedPathFieldMapper} */ +public class NestedPathFieldMapperTests extends OpenSearchSingleNodeTestCase { + + public void testDefaultConfig() throws IOException { + Settings indexSettings = Settings.EMPTY; + MapperService mapperService = createIndex("test", indexSettings).mapperService(); + DocumentMapper mapper = mapperService.merge( + MapperService.SINGLE_MAPPING_NAME, + new CompressedXContent("{\"" + MapperService.SINGLE_MAPPING_NAME + "\":{}}"), + MapperService.MergeReason.MAPPING_UPDATE + ); + ParsedDocument document = mapper.parse(new SourceToParse("index", "id", new BytesArray("{}"), XContentType.JSON)); + assertEquals(Collections.emptyList(), Arrays.asList(document.rootDoc().getFields(NestedPathFieldMapper.NAME))); + } + + public void testUpdatesWithSameMappings() throws IOException { + Settings indexSettings = Settings.EMPTY; + MapperService mapperService = createIndex("test", indexSettings).mapperService(); + DocumentMapper mapper = mapperService.merge( + MapperService.SINGLE_MAPPING_NAME, + new CompressedXContent("{\"" + MapperService.SINGLE_MAPPING_NAME + "\":{}}"), + MapperService.MergeReason.MAPPING_UPDATE + ); + mapper.merge(mapper.mapping(), MapperService.MergeReason.MAPPING_UPDATE); + } +} diff --git a/server/src/test/java/org/opensearch/index/search/NestedHelperTests.java b/server/src/test/java/org/opensearch/index/search/NestedHelperTests.java index c02df8168afee..7c9895a9e0642 100644 --- a/server/src/test/java/org/opensearch/index/search/NestedHelperTests.java +++ b/server/src/test/java/org/opensearch/index/search/NestedHelperTests.java @@ -47,6 +47,7 @@ import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.index.IndexService; import org.opensearch.index.mapper.MapperService; +import org.opensearch.index.mapper.NestedPathFieldMapper; import org.opensearch.index.query.MatchAllQueryBuilder; import org.opensearch.index.query.NestedQueryBuilder; import org.opensearch.index.query.QueryShardContext; @@ -324,7 +325,7 @@ public void testNested() throws IOException { Query expectedChildQuery = new BooleanQuery.Builder().add(new MatchAllDocsQuery(), Occur.MUST) // we automatically add a filter since the inner query might match non-nested docs - .add(new TermQuery(new Term("_type", "__nested1")), Occur.FILTER) + .add(new TermQuery(new Term(NestedPathFieldMapper.NAME, "nested1")), Occur.FILTER) .build(); assertEquals(expectedChildQuery, query.getChildQuery()); @@ -352,7 +353,7 @@ public void testNested() throws IOException { // we need to add the filter again because of include_in_parent expectedChildQuery = new BooleanQuery.Builder().add(new TermQuery(new Term("nested2.foo", "bar")), Occur.MUST) - .add(new TermQuery(new Term("_type", "__nested2")), Occur.FILTER) + .add(new TermQuery(new Term(NestedPathFieldMapper.NAME, "nested2")), Occur.FILTER) .build(); assertEquals(expectedChildQuery, query.getChildQuery()); @@ -367,7 +368,7 @@ public void testNested() throws IOException { // we need to add the filter again because of include_in_root expectedChildQuery = new BooleanQuery.Builder().add(new TermQuery(new Term("nested3.foo", "bar")), Occur.MUST) - .add(new TermQuery(new Term("_type", "__nested3")), Occur.FILTER) + .add(new TermQuery(new Term(NestedPathFieldMapper.NAME, "nested3")), Occur.FILTER) .build(); assertEquals(expectedChildQuery, query.getChildQuery()); diff --git a/server/src/test/java/org/opensearch/index/search/nested/NestedSortingTests.java b/server/src/test/java/org/opensearch/index/search/nested/NestedSortingTests.java index a8cd6c5411875..726e9f56f98c1 100644 --- a/server/src/test/java/org/opensearch/index/search/nested/NestedSortingTests.java +++ b/server/src/test/java/org/opensearch/index/search/nested/NestedSortingTests.java @@ -68,6 +68,7 @@ import org.opensearch.index.fielddata.NoOrdinalsStringFieldDataTests; import org.opensearch.index.fielddata.fieldcomparator.BytesRefFieldComparatorSource; import org.opensearch.index.fielddata.plain.PagedBytesIndexFieldData; +import org.opensearch.index.mapper.NestedPathFieldMapper; import org.opensearch.index.query.MatchAllQueryBuilder; import org.opensearch.index.query.NestedQueryBuilder; import org.opensearch.index.query.QueryBuilder; @@ -103,14 +104,14 @@ public void testDuel() throws Exception { for (int j = 0; j < numChildren; ++j) { Document doc = new Document(); doc.add(new StringField("f", TestUtil.randomSimpleString(random(), 2), Field.Store.NO)); - doc.add(new StringField("__type", "child", Field.Store.NO)); + doc.add(new StringField(NestedPathFieldMapper.NAME, "child", Field.Store.NO)); docs.add(doc); } if (randomBoolean()) { docs.add(new Document()); } Document parent = new Document(); - parent.add(new StringField("__type", "parent", Field.Store.NO)); + parent.add(new StringField(NestedPathFieldMapper.NAME, "parent", Field.Store.NO)); docs.add(parent); writer.addDocuments(docs); if (rarely()) { // we need to have a bit more segments than what RandomIndexWriter would do by default @@ -149,8 +150,8 @@ private TopDocs getTopDocs( int n, boolean reverse ) throws IOException { - Query parentFilter = new TermQuery(new Term("__type", "parent")); - Query childFilter = new TermQuery(new Term("__type", "child")); + Query parentFilter = new TermQuery(new Term(NestedPathFieldMapper.NAME, "parent")); + Query childFilter = new TermQuery(new Term(NestedPathFieldMapper.NAME, "child")); SortField sortField = indexFieldData.sortField(missingValue, sortMode, createNested(searcher, parentFilter, childFilter), reverse); Query query = new ConstantScoreQuery(parentFilter); Sort sort = new Sort(sortField); @@ -172,7 +173,7 @@ public void testNestedSorting() throws Exception { document.add(new StringField("filter_1", "T", Field.Store.NO)); docs.add(document); document = new Document(); - document.add(new StringField("__type", "parent", Field.Store.NO)); + document.add(new StringField(NestedPathFieldMapper.NAME, "parent", Field.Store.NO)); document.add(new StringField("field1", "a", Field.Store.NO)); docs.add(document); writer.addDocuments(docs); @@ -192,7 +193,7 @@ public void testNestedSorting() throws Exception { document.add(new StringField("filter_1", "T", Field.Store.NO)); docs.add(document); document = new Document(); - document.add(new StringField("__type", "parent", Field.Store.NO)); + document.add(new StringField(NestedPathFieldMapper.NAME, "parent", Field.Store.NO)); document.add(new StringField("field1", "b", Field.Store.NO)); docs.add(document); writer.addDocuments(docs); @@ -211,7 +212,7 @@ public void testNestedSorting() throws Exception { document.add(new StringField("filter_1", "T", Field.Store.NO)); docs.add(document); document = new Document(); - document.add(new StringField("__type", "parent", Field.Store.NO)); + document.add(new StringField(NestedPathFieldMapper.NAME, "parent", Field.Store.NO)); document.add(new StringField("field1", "c", Field.Store.NO)); docs.add(document); writer.addDocuments(docs); @@ -230,7 +231,7 @@ public void testNestedSorting() throws Exception { document.add(new StringField("filter_1", "F", Field.Store.NO)); docs.add(document); document = new Document(); - document.add(new StringField("__type", "parent", Field.Store.NO)); + document.add(new StringField(NestedPathFieldMapper.NAME, "parent", Field.Store.NO)); document.add(new StringField("field1", "d", Field.Store.NO)); docs.add(document); writer.addDocuments(docs); @@ -250,7 +251,7 @@ public void testNestedSorting() throws Exception { document.add(new StringField("filter_1", "F", Field.Store.NO)); docs.add(document); document = new Document(); - document.add(new StringField("__type", "parent", Field.Store.NO)); + document.add(new StringField(NestedPathFieldMapper.NAME, "parent", Field.Store.NO)); document.add(new StringField("field1", "f", Field.Store.NO)); docs.add(document); writer.addDocuments(docs); @@ -269,14 +270,14 @@ public void testNestedSorting() throws Exception { document.add(new StringField("filter_1", "T", Field.Store.NO)); docs.add(document); document = new Document(); - document.add(new StringField("__type", "parent", Field.Store.NO)); + document.add(new StringField(NestedPathFieldMapper.NAME, "parent", Field.Store.NO)); document.add(new StringField("field1", "g", Field.Store.NO)); docs.add(document); writer.addDocuments(docs); // This doc will not be included, because it doesn't have nested docs document = new Document(); - document.add(new StringField("__type", "parent", Field.Store.NO)); + document.add(new StringField(NestedPathFieldMapper.NAME, "parent", Field.Store.NO)); document.add(new StringField("field1", "h", Field.Store.NO)); writer.addDocument(document); @@ -294,7 +295,7 @@ public void testNestedSorting() throws Exception { document.add(new StringField("filter_1", "F", Field.Store.NO)); docs.add(document); document = new Document(); - document.add(new StringField("__type", "parent", Field.Store.NO)); + document.add(new StringField(NestedPathFieldMapper.NAME, "parent", Field.Store.NO)); document.add(new StringField("field1", "i", Field.Store.NO)); docs.add(document); writer.addDocuments(docs); @@ -316,7 +317,7 @@ public void testNestedSorting() throws Exception { reader = OpenSearchDirectoryReader.wrap(reader, new ShardId(indexService.index(), 0)); IndexSearcher searcher = new IndexSearcher(reader); PagedBytesIndexFieldData indexFieldData = getForField("field2"); - Query parentFilter = new TermQuery(new Term("__type", "parent")); + Query parentFilter = new TermQuery(new Term(NestedPathFieldMapper.NAME, "parent")); Query childFilter = Queries.not(parentFilter); BytesRefFieldComparatorSource nestedComparatorSource = new BytesRefFieldComparatorSource( indexFieldData, @@ -472,53 +473,52 @@ public void testMultiLevelNestedSorting() throws IOException { List book = new ArrayList<>(); Document document = new Document(); document.add(new TextField("chapters.paragraphs.header", "Paragraph 1", Field.Store.NO)); - document.add(new StringField("_type", "__chapters.paragraphs", Field.Store.NO)); + document.add(new StringField(NestedPathFieldMapper.NAME, "chapters.paragraphs", Field.Store.NO)); document.add(new TextField("chapters.paragraphs.text", "some text...", Field.Store.NO)); document.add(new SortedNumericDocValuesField("chapters.paragraphs.word_count", 743)); document.add(new IntPoint("chapters.paragraphs.word_count", 743)); book.add(document); document = new Document(); document.add(new TextField("chapters.title", "chapter 3", Field.Store.NO)); - document.add(new StringField("_type", "__chapters", Field.Store.NO)); + document.add(new StringField(NestedPathFieldMapper.NAME, "chapters", Field.Store.NO)); document.add(new IntPoint("chapters.read_time_seconds", 400)); document.add(new NumericDocValuesField("chapters.read_time_seconds", 400)); book.add(document); document = new Document(); document.add(new TextField("chapters.paragraphs.header", "Paragraph 1", Field.Store.NO)); - document.add(new StringField("_type", "__chapters.paragraphs", Field.Store.NO)); + document.add(new StringField(NestedPathFieldMapper.NAME, "chapters.paragraphs", Field.Store.NO)); document.add(new TextField("chapters.paragraphs.text", "some text...", Field.Store.NO)); document.add(new SortedNumericDocValuesField("chapters.paragraphs.word_count", 234)); document.add(new IntPoint("chapters.paragraphs.word_count", 234)); book.add(document); document = new Document(); document.add(new TextField("chapters.title", "chapter 2", Field.Store.NO)); - document.add(new StringField("_type", "__chapters", Field.Store.NO)); + document.add(new StringField(NestedPathFieldMapper.NAME, "chapters", Field.Store.NO)); document.add(new IntPoint("chapters.read_time_seconds", 200)); document.add(new NumericDocValuesField("chapters.read_time_seconds", 200)); book.add(document); document = new Document(); document.add(new TextField("chapters.paragraphs.header", "Paragraph 2", Field.Store.NO)); - document.add(new StringField("_type", "__chapters.paragraphs", Field.Store.NO)); + document.add(new StringField(NestedPathFieldMapper.NAME, "chapters.paragraphs", Field.Store.NO)); document.add(new TextField("chapters.paragraphs.text", "some text...", Field.Store.NO)); document.add(new SortedNumericDocValuesField("chapters.paragraphs.word_count", 478)); document.add(new IntPoint("chapters.paragraphs.word_count", 478)); book.add(document); document = new Document(); document.add(new TextField("chapters.paragraphs.header", "Paragraph 1", Field.Store.NO)); - document.add(new StringField("_type", "__chapters.paragraphs", Field.Store.NO)); + document.add(new StringField(NestedPathFieldMapper.NAME, "chapters.paragraphs", Field.Store.NO)); document.add(new TextField("chapters.paragraphs.text", "some text...", Field.Store.NO)); document.add(new SortedNumericDocValuesField("chapters.paragraphs.word_count", 849)); document.add(new IntPoint("chapters.paragraphs.word_count", 849)); book.add(document); document = new Document(); document.add(new TextField("chapters.title", "chapter 1", Field.Store.NO)); - document.add(new StringField("_type", "__chapters", Field.Store.NO)); + document.add(new StringField(NestedPathFieldMapper.NAME, "chapters", Field.Store.NO)); document.add(new IntPoint("chapters.read_time_seconds", 1400)); document.add(new NumericDocValuesField("chapters.read_time_seconds", 1400)); book.add(document); document = new Document(); document.add(new StringField("genre", "science fiction", Field.Store.NO)); - document.add(new StringField("_type", "_doc", Field.Store.NO)); document.add(new StringField("_id", "1", Field.Store.YES)); document.add(new NumericDocValuesField(PRIMARY_TERM_NAME, 0)); book.add(document); @@ -528,20 +528,19 @@ public void testMultiLevelNestedSorting() throws IOException { List book = new ArrayList<>(); Document document = new Document(); document.add(new TextField("chapters.paragraphs.header", "Introduction", Field.Store.NO)); - document.add(new StringField("_type", "__chapters.paragraphs", Field.Store.NO)); + document.add(new StringField(NestedPathFieldMapper.NAME, "chapters.paragraphs", Field.Store.NO)); document.add(new TextField("chapters.paragraphs.text", "some text...", Field.Store.NO)); document.add(new SortedNumericDocValuesField("chapters.paragraphs.word_count", 76)); document.add(new IntPoint("chapters.paragraphs.word_count", 76)); book.add(document); document = new Document(); document.add(new TextField("chapters.title", "chapter 1", Field.Store.NO)); - document.add(new StringField("_type", "__chapters", Field.Store.NO)); + document.add(new StringField(NestedPathFieldMapper.NAME, "chapters", Field.Store.NO)); document.add(new IntPoint("chapters.read_time_seconds", 20)); document.add(new NumericDocValuesField("chapters.read_time_seconds", 20)); book.add(document); document = new Document(); document.add(new StringField("genre", "romance", Field.Store.NO)); - document.add(new StringField("_type", "_doc", Field.Store.NO)); document.add(new StringField("_id", "2", Field.Store.YES)); document.add(new NumericDocValuesField(PRIMARY_TERM_NAME, 0)); book.add(document); @@ -551,20 +550,19 @@ public void testMultiLevelNestedSorting() throws IOException { List book = new ArrayList<>(); Document document = new Document(); document.add(new TextField("chapters.paragraphs.header", "A bad dream", Field.Store.NO)); - document.add(new StringField("_type", "__chapters.paragraphs", Field.Store.NO)); + document.add(new StringField(NestedPathFieldMapper.NAME, "chapters.paragraphs", Field.Store.NO)); document.add(new TextField("chapters.paragraphs.text", "some text...", Field.Store.NO)); document.add(new SortedNumericDocValuesField("chapters.paragraphs.word_count", 976)); document.add(new IntPoint("chapters.paragraphs.word_count", 976)); book.add(document); document = new Document(); document.add(new TextField("chapters.title", "The beginning of the end", Field.Store.NO)); - document.add(new StringField("_type", "__chapters", Field.Store.NO)); + document.add(new StringField(NestedPathFieldMapper.NAME, "chapters", Field.Store.NO)); document.add(new IntPoint("chapters.read_time_seconds", 1200)); document.add(new NumericDocValuesField("chapters.read_time_seconds", 1200)); book.add(document); document = new Document(); document.add(new StringField("genre", "horror", Field.Store.NO)); - document.add(new StringField("_type", "_doc", Field.Store.NO)); document.add(new StringField("_id", "3", Field.Store.YES)); document.add(new NumericDocValuesField(PRIMARY_TERM_NAME, 0)); book.add(document); @@ -574,47 +572,46 @@ public void testMultiLevelNestedSorting() throws IOException { List book = new ArrayList<>(); Document document = new Document(); document.add(new TextField("chapters.paragraphs.header", "macaroni", Field.Store.NO)); - document.add(new StringField("_type", "__chapters.paragraphs", Field.Store.NO)); + document.add(new StringField(NestedPathFieldMapper.NAME, "chapters.paragraphs", Field.Store.NO)); document.add(new TextField("chapters.paragraphs.text", "some text...", Field.Store.NO)); document.add(new SortedNumericDocValuesField("chapters.paragraphs.word_count", 180)); document.add(new IntPoint("chapters.paragraphs.word_count", 180)); book.add(document); document = new Document(); document.add(new TextField("chapters.paragraphs.header", "hamburger", Field.Store.NO)); - document.add(new StringField("_type", "__chapters.paragraphs", Field.Store.NO)); + document.add(new StringField(NestedPathFieldMapper.NAME, "chapters.paragraphs", Field.Store.NO)); document.add(new TextField("chapters.paragraphs.text", "some text...", Field.Store.NO)); document.add(new SortedNumericDocValuesField("chapters.paragraphs.word_count", 150)); document.add(new IntPoint("chapters.paragraphs.word_count", 150)); book.add(document); document = new Document(); document.add(new TextField("chapters.paragraphs.header", "tosti", Field.Store.NO)); - document.add(new StringField("_type", "__chapters.paragraphs", Field.Store.NO)); + document.add(new StringField(NestedPathFieldMapper.NAME, "chapters.paragraphs", Field.Store.NO)); document.add(new TextField("chapters.paragraphs.text", "some text...", Field.Store.NO)); document.add(new SortedNumericDocValuesField("chapters.paragraphs.word_count", 120)); document.add(new IntPoint("chapters.paragraphs.word_count", 120)); book.add(document); document = new Document(); document.add(new TextField("chapters.title", "easy meals", Field.Store.NO)); - document.add(new StringField("_type", "__chapters", Field.Store.NO)); + document.add(new StringField(NestedPathFieldMapper.NAME, "chapters", Field.Store.NO)); document.add(new IntPoint("chapters.read_time_seconds", 800)); document.add(new NumericDocValuesField("chapters.read_time_seconds", 800)); book.add(document); document = new Document(); document.add(new TextField("chapters.paragraphs.header", "introduction", Field.Store.NO)); - document.add(new StringField("_type", "__chapters.paragraphs", Field.Store.NO)); + document.add(new StringField(NestedPathFieldMapper.NAME, "chapters.paragraphs", Field.Store.NO)); document.add(new TextField("chapters.paragraphs.text", "some text...", Field.Store.NO)); document.add(new SortedNumericDocValuesField("chapters.paragraphs.word_count", 87)); document.add(new IntPoint("chapters.paragraphs.word_count", 87)); book.add(document); document = new Document(); document.add(new TextField("chapters.title", "introduction", Field.Store.NO)); - document.add(new StringField("_type", "__chapters", Field.Store.NO)); + document.add(new StringField(NestedPathFieldMapper.NAME, "chapters", Field.Store.NO)); document.add(new IntPoint("chapters.read_time_seconds", 10)); document.add(new NumericDocValuesField("chapters.read_time_seconds", 10)); book.add(document); document = new Document(); document.add(new StringField("genre", "cooking", Field.Store.NO)); - document.add(new StringField("_type", "_doc", Field.Store.NO)); document.add(new StringField("_id", "4", Field.Store.YES)); document.add(new NumericDocValuesField(PRIMARY_TERM_NAME, 0)); book.add(document); @@ -624,7 +621,6 @@ public void testMultiLevelNestedSorting() throws IOException { List book = new ArrayList<>(); Document document = new Document(); document.add(new StringField("genre", "unknown", Field.Store.NO)); - document.add(new StringField("_type", "_doc", Field.Store.NO)); document.add(new StringField("_id", "5", Field.Store.YES)); document.add(new NumericDocValuesField(PRIMARY_TERM_NAME, 0)); book.add(document); diff --git a/server/src/test/java/org/opensearch/index/shard/ShardSplittingQueryTests.java b/server/src/test/java/org/opensearch/index/shard/ShardSplittingQueryTests.java index b39ff0c9b97b3..04dcea210640c 100644 --- a/server/src/test/java/org/opensearch/index/shard/ShardSplittingQueryTests.java +++ b/server/src/test/java/org/opensearch/index/shard/ShardSplittingQueryTests.java @@ -52,9 +52,9 @@ import org.opensearch.cluster.routing.OperationRouting; import org.opensearch.common.settings.Settings; import org.opensearch.index.mapper.IdFieldMapper; +import org.opensearch.index.mapper.NestedPathFieldMapper; import org.opensearch.index.mapper.RoutingFieldMapper; import org.opensearch.index.mapper.SeqNoFieldMapper; -import org.opensearch.index.mapper.TypeFieldMapper; import org.opensearch.index.mapper.Uid; import org.opensearch.test.OpenSearchTestCase; @@ -88,7 +88,7 @@ public void testSplitOnID() throws IOException { docs.add( Arrays.asList( new StringField(IdFieldMapper.NAME, Uid.encodeId(Integer.toString(j)), Field.Store.YES), - new StringField(TypeFieldMapper.NAME, "__nested", Field.Store.YES), + new StringField(NestedPathFieldMapper.NAME, "__nested", Field.Store.YES), new SortedNumericDocValuesField("shard_id", shardId) ) ); @@ -142,7 +142,7 @@ public void testSplitOnRouting() throws IOException { docs.add( Arrays.asList( new StringField(IdFieldMapper.NAME, Uid.encodeId(Integer.toString(j)), Field.Store.YES), - new StringField(TypeFieldMapper.NAME, "__nested", Field.Store.YES), + new StringField(NestedPathFieldMapper.NAME, "__nested", Field.Store.YES), new SortedNumericDocValuesField("shard_id", shardId) ) ); @@ -215,7 +215,7 @@ public void testSplitOnIdOrRouting() throws IOException { docs.add( Arrays.asList( new StringField(IdFieldMapper.NAME, Uid.encodeId(Integer.toString(j)), Field.Store.YES), - new StringField(TypeFieldMapper.NAME, "__nested", Field.Store.YES), + new StringField(NestedPathFieldMapper.NAME, "__nested", Field.Store.YES), new SortedNumericDocValuesField("shard_id", shardId) ) ); @@ -258,7 +258,7 @@ public void testSplitOnRoutingPartitioned() throws IOException { docs.add( Arrays.asList( new StringField(IdFieldMapper.NAME, Uid.encodeId(Integer.toString(j)), Field.Store.YES), - new StringField(TypeFieldMapper.NAME, "__nested", Field.Store.YES), + new StringField(NestedPathFieldMapper.NAME, "__nested", Field.Store.YES), new SortedNumericDocValuesField("shard_id", shardId) ) ); diff --git a/server/src/test/java/org/opensearch/indices/IndicesModuleTests.java b/server/src/test/java/org/opensearch/indices/IndicesModuleTests.java index 8123f044798bd..afcc6aa006500 100644 --- a/server/src/test/java/org/opensearch/indices/IndicesModuleTests.java +++ b/server/src/test/java/org/opensearch/indices/IndicesModuleTests.java @@ -41,6 +41,7 @@ import org.opensearch.index.mapper.Mapper; import org.opensearch.index.mapper.MapperParsingException; import org.opensearch.index.mapper.MetadataFieldMapper; +import org.opensearch.index.mapper.NestedPathFieldMapper; import org.opensearch.index.mapper.RoutingFieldMapper; import org.opensearch.index.mapper.SeqNoFieldMapper; import org.opensearch.index.mapper.SourceFieldMapper; @@ -94,6 +95,7 @@ public Map getMetadataMappers() { IndexFieldMapper.NAME, DataStreamFieldMapper.NAME, SourceFieldMapper.NAME, + NestedPathFieldMapper.NAME, VersionFieldMapper.NAME, SeqNoFieldMapper.NAME, FieldNamesFieldMapper.NAME }; @@ -101,11 +103,7 @@ public Map getMetadataMappers() { public void testBuiltinMappers() { IndicesModule module = new IndicesModule(Collections.emptyList()); { - Version version = VersionUtils.randomVersionBetween( - random(), - Version.CURRENT.minimumIndexCompatibilityVersion(), - Version.CURRENT - ); + Version version = VersionUtils.randomVersionBetween(random(), Version.V_2_0_0, Version.CURRENT); assertFalse(module.getMapperRegistry().getMapperParsers().isEmpty()); assertFalse(module.getMapperRegistry().getMetadataMapperParsers(version).isEmpty()); Map metadataMapperParsers = module.getMapperRegistry() @@ -116,6 +114,14 @@ public void testBuiltinMappers() { assertEquals(EXPECTED_METADATA_FIELDS[i++], field); } } + { + Version version = VersionUtils.randomVersionBetween( + random(), + Version.V_1_0_0, + VersionUtils.getPreviousVersion(Version.V_2_0_0) + ); + assertEquals(EXPECTED_METADATA_FIELDS.length - 1, module.getMapperRegistry().getMetadataMapperParsers(version).size()); + } } public void testBuiltinWithPlugins() { diff --git a/server/src/test/java/org/opensearch/indices/IndicesServiceTests.java b/server/src/test/java/org/opensearch/indices/IndicesServiceTests.java index 8dd156dfcd0d2..da984084321e1 100644 --- a/server/src/test/java/org/opensearch/indices/IndicesServiceTests.java +++ b/server/src/test/java/org/opensearch/indices/IndicesServiceTests.java @@ -66,6 +66,7 @@ import org.opensearch.index.mapper.KeywordFieldMapper; import org.opensearch.index.mapper.Mapper; import org.opensearch.index.mapper.MapperService; +import org.opensearch.index.mapper.NestedPathFieldMapper; import org.opensearch.index.shard.IllegalIndexShardStateException; import org.opensearch.index.shard.IndexShard; import org.opensearch.index.shard.IndexShardState; @@ -567,7 +568,13 @@ public void testIsMetadataField() { final Version randVersion = VersionUtils.randomIndexCompatibleVersion(random()); assertFalse(indicesService.isMetadataField(randVersion, randomAlphaOfLengthBetween(10, 15))); for (String builtIn : IndicesModule.getBuiltInMetadataFields()) { - assertTrue(indicesService.isMetadataField(randVersion, builtIn)); + if (NestedPathFieldMapper.NAME.equals(builtIn) && randVersion.before(Version.V_2_0_0)) { + continue; // nested field mapper does not exist prior to 2.0 + } + assertTrue( + "Expected " + builtIn + " to be a metadata field for version " + randVersion, + indicesService.isMetadataField(randVersion, builtIn) + ); } } diff --git a/server/src/test/java/org/opensearch/search/aggregations/bucket/nested/NestedAggregatorTests.java b/server/src/test/java/org/opensearch/search/aggregations/bucket/nested/NestedAggregatorTests.java index 8ab0cc0023346..65ce02333bae0 100644 --- a/server/src/test/java/org/opensearch/search/aggregations/bucket/nested/NestedAggregatorTests.java +++ b/server/src/test/java/org/opensearch/search/aggregations/bucket/nested/NestedAggregatorTests.java @@ -57,9 +57,9 @@ import org.opensearch.index.mapper.IdFieldMapper; import org.opensearch.index.mapper.KeywordFieldMapper; import org.opensearch.index.mapper.MappedFieldType; +import org.opensearch.index.mapper.NestedPathFieldMapper; import org.opensearch.index.mapper.NumberFieldMapper; import org.opensearch.index.mapper.SeqNoFieldMapper; -import org.opensearch.index.mapper.TypeFieldMapper; import org.opensearch.index.mapper.Uid; import org.opensearch.index.query.MatchAllQueryBuilder; import org.opensearch.script.MockScriptEngine; @@ -343,15 +343,15 @@ public void testResetRootDocId() throws Exception { // 1 segment with, 1 root document, with 3 nested sub docs Document document = new Document(); document.add(new Field(IdFieldMapper.NAME, Uid.encodeId("1"), IdFieldMapper.Defaults.NESTED_FIELD_TYPE)); - document.add(new Field(TypeFieldMapper.NAME, "__nested_field", TypeFieldMapper.Defaults.NESTED_FIELD_TYPE)); + document.add(new Field(NestedPathFieldMapper.NAME, "nested_field", NestedPathFieldMapper.Defaults.FIELD_TYPE)); documents.add(document); document = new Document(); document.add(new Field(IdFieldMapper.NAME, Uid.encodeId("1"), IdFieldMapper.Defaults.NESTED_FIELD_TYPE)); - document.add(new Field(TypeFieldMapper.NAME, "__nested_field", TypeFieldMapper.Defaults.NESTED_FIELD_TYPE)); + document.add(new Field(NestedPathFieldMapper.NAME, "nested_field", NestedPathFieldMapper.Defaults.FIELD_TYPE)); documents.add(document); document = new Document(); document.add(new Field(IdFieldMapper.NAME, Uid.encodeId("1"), IdFieldMapper.Defaults.NESTED_FIELD_TYPE)); - document.add(new Field(TypeFieldMapper.NAME, "__nested_field", TypeFieldMapper.Defaults.NESTED_FIELD_TYPE)); + document.add(new Field(NestedPathFieldMapper.NAME, "nested_field", NestedPathFieldMapper.Defaults.FIELD_TYPE)); documents.add(document); document = new Document(); document.add(new Field(IdFieldMapper.NAME, Uid.encodeId("1"), IdFieldMapper.Defaults.FIELD_TYPE)); @@ -365,7 +365,7 @@ public void testResetRootDocId() throws Exception { // 1 document, with 1 nested subdoc document = new Document(); document.add(new Field(IdFieldMapper.NAME, Uid.encodeId("2"), IdFieldMapper.Defaults.NESTED_FIELD_TYPE)); - document.add(new Field(TypeFieldMapper.NAME, "__nested_field", TypeFieldMapper.Defaults.NESTED_FIELD_TYPE)); + document.add(new Field(NestedPathFieldMapper.NAME, "nested_field", NestedPathFieldMapper.Defaults.FIELD_TYPE)); documents.add(document); document = new Document(); document.add(new Field(IdFieldMapper.NAME, Uid.encodeId("2"), IdFieldMapper.Defaults.FIELD_TYPE)); @@ -376,7 +376,7 @@ public void testResetRootDocId() throws Exception { // and 1 document, with 1 nested subdoc document = new Document(); document.add(new Field(IdFieldMapper.NAME, Uid.encodeId("3"), IdFieldMapper.Defaults.NESTED_FIELD_TYPE)); - document.add(new Field(TypeFieldMapper.NAME, "__nested_field", TypeFieldMapper.Defaults.NESTED_FIELD_TYPE)); + document.add(new Field(NestedPathFieldMapper.NAME, "nested_field", NestedPathFieldMapper.Defaults.FIELD_TYPE)); documents.add(document); document = new Document(); document.add(new Field(IdFieldMapper.NAME, Uid.encodeId("3"), IdFieldMapper.Defaults.FIELD_TYPE)); @@ -613,13 +613,13 @@ public void testPreGetChildLeafCollectors() throws IOException { List documents = new ArrayList<>(); Document document = new Document(); document.add(new Field(IdFieldMapper.NAME, Uid.encodeId("1"), IdFieldMapper.Defaults.NESTED_FIELD_TYPE)); - document.add(new Field(TypeFieldMapper.NAME, "__nested_field", TypeFieldMapper.Defaults.NESTED_FIELD_TYPE)); + document.add(new Field(NestedPathFieldMapper.NAME, "nested_field", NestedPathFieldMapper.Defaults.FIELD_TYPE)); document.add(new SortedDocValuesField("key", new BytesRef("key1"))); document.add(new SortedDocValuesField("value", new BytesRef("a1"))); documents.add(document); document = new Document(); document.add(new Field(IdFieldMapper.NAME, Uid.encodeId("1"), IdFieldMapper.Defaults.NESTED_FIELD_TYPE)); - document.add(new Field(TypeFieldMapper.NAME, "__nested_field", TypeFieldMapper.Defaults.NESTED_FIELD_TYPE)); + document.add(new Field(NestedPathFieldMapper.NAME, "nested_field", NestedPathFieldMapper.Defaults.FIELD_TYPE)); document.add(new SortedDocValuesField("key", new BytesRef("key2"))); document.add(new SortedDocValuesField("value", new BytesRef("b1"))); documents.add(document); @@ -633,13 +633,13 @@ public void testPreGetChildLeafCollectors() throws IOException { document = new Document(); document.add(new Field(IdFieldMapper.NAME, Uid.encodeId("2"), IdFieldMapper.Defaults.NESTED_FIELD_TYPE)); - document.add(new Field(TypeFieldMapper.NAME, "__nested_field", TypeFieldMapper.Defaults.NESTED_FIELD_TYPE)); + document.add(new Field(NestedPathFieldMapper.NAME, "nested_field", NestedPathFieldMapper.Defaults.FIELD_TYPE)); document.add(new SortedDocValuesField("key", new BytesRef("key1"))); document.add(new SortedDocValuesField("value", new BytesRef("a2"))); documents.add(document); document = new Document(); document.add(new Field(IdFieldMapper.NAME, Uid.encodeId("2"), IdFieldMapper.Defaults.NESTED_FIELD_TYPE)); - document.add(new Field(TypeFieldMapper.NAME, "__nested_field", TypeFieldMapper.Defaults.NESTED_FIELD_TYPE)); + document.add(new Field(NestedPathFieldMapper.NAME, "nested_field", NestedPathFieldMapper.Defaults.FIELD_TYPE)); document.add(new SortedDocValuesField("key", new BytesRef("key2"))); document.add(new SortedDocValuesField("value", new BytesRef("b2"))); documents.add(document); @@ -653,13 +653,13 @@ public void testPreGetChildLeafCollectors() throws IOException { document = new Document(); document.add(new Field(IdFieldMapper.NAME, Uid.encodeId("3"), IdFieldMapper.Defaults.NESTED_FIELD_TYPE)); - document.add(new Field(TypeFieldMapper.NAME, "__nested_field", TypeFieldMapper.Defaults.NESTED_FIELD_TYPE)); + document.add(new Field(NestedPathFieldMapper.NAME, "nested_field", NestedPathFieldMapper.Defaults.FIELD_TYPE)); document.add(new SortedDocValuesField("key", new BytesRef("key1"))); document.add(new SortedDocValuesField("value", new BytesRef("a3"))); documents.add(document); document = new Document(); document.add(new Field(IdFieldMapper.NAME, Uid.encodeId("3"), IdFieldMapper.Defaults.NESTED_FIELD_TYPE)); - document.add(new Field(TypeFieldMapper.NAME, "__nested_field", TypeFieldMapper.Defaults.NESTED_FIELD_TYPE)); + document.add(new Field(NestedPathFieldMapper.NAME, "nested_field", NestedPathFieldMapper.Defaults.FIELD_TYPE)); document.add(new SortedDocValuesField("key", new BytesRef("key2"))); document.add(new SortedDocValuesField("value", new BytesRef("b3"))); documents.add(document); @@ -863,7 +863,7 @@ public static CheckedConsumer buildResellerData( } Document document = new Document(); document.add(new Field(IdFieldMapper.NAME, Uid.encodeId(Integer.toString(p)), IdFieldMapper.Defaults.FIELD_TYPE)); - document.add(new Field(TypeFieldMapper.NAME, "__nested_field", TypeFieldMapper.Defaults.NESTED_FIELD_TYPE)); + document.add(new Field(NestedPathFieldMapper.NAME, "nested_field", NestedPathFieldMapper.Defaults.FIELD_TYPE)); document.add(sequenceIDFields.primaryTerm); document.add(new SortedNumericDocValuesField("product_id", p)); documents.add(document); @@ -891,7 +891,7 @@ private static double[] generateDocuments(List documents, int numNeste for (int nested = 0; nested < numNestedDocs; nested++) { Document document = new Document(); document.add(new Field(IdFieldMapper.NAME, Uid.encodeId(Integer.toString(id)), IdFieldMapper.Defaults.NESTED_FIELD_TYPE)); - document.add(new Field(TypeFieldMapper.NAME, "__" + path, TypeFieldMapper.Defaults.NESTED_FIELD_TYPE)); + document.add(new Field(NestedPathFieldMapper.NAME, path, NestedPathFieldMapper.Defaults.FIELD_TYPE)); long value = randomNonNegativeLong() % 10000; document.add(new SortedNumericDocValuesField(fieldName, value)); documents.add(document); @@ -906,7 +906,7 @@ private List generateBook(String id, String[] authors, int[] numPages) for (int numPage : numPages) { Document document = new Document(); document.add(new Field(IdFieldMapper.NAME, Uid.encodeId(id), IdFieldMapper.Defaults.NESTED_FIELD_TYPE)); - document.add(new Field(TypeFieldMapper.NAME, "__nested_chapters", TypeFieldMapper.Defaults.NESTED_FIELD_TYPE)); + document.add(new Field(NestedPathFieldMapper.NAME, "nested_chapters", NestedPathFieldMapper.Defaults.FIELD_TYPE)); document.add(new SortedNumericDocValuesField("num_pages", numPage)); documents.add(document); } diff --git a/server/src/test/java/org/opensearch/search/aggregations/bucket/nested/ReverseNestedAggregatorTests.java b/server/src/test/java/org/opensearch/search/aggregations/bucket/nested/ReverseNestedAggregatorTests.java index cf0e31bc63467..61df6d01aef64 100644 --- a/server/src/test/java/org/opensearch/search/aggregations/bucket/nested/ReverseNestedAggregatorTests.java +++ b/server/src/test/java/org/opensearch/search/aggregations/bucket/nested/ReverseNestedAggregatorTests.java @@ -42,9 +42,9 @@ import org.apache.lucene.store.Directory; import org.opensearch.index.mapper.IdFieldMapper; import org.opensearch.index.mapper.MappedFieldType; +import org.opensearch.index.mapper.NestedPathFieldMapper; import org.opensearch.index.mapper.NumberFieldMapper; import org.opensearch.index.mapper.SeqNoFieldMapper; -import org.opensearch.index.mapper.TypeFieldMapper; import org.opensearch.index.mapper.Uid; import org.opensearch.search.aggregations.AggregationBuilder; import org.opensearch.search.aggregations.AggregatorTestCase; @@ -133,7 +133,7 @@ public void testMaxFromParentDocs() throws IOException { document.add( new Field(IdFieldMapper.NAME, Uid.encodeId(Integer.toString(i)), IdFieldMapper.Defaults.NESTED_FIELD_TYPE) ); - document.add(new Field(TypeFieldMapper.NAME, "__" + NESTED_OBJECT, TypeFieldMapper.Defaults.NESTED_FIELD_TYPE)); + document.add(new Field(NestedPathFieldMapper.NAME, NESTED_OBJECT, NestedPathFieldMapper.Defaults.FIELD_TYPE)); documents.add(document); expectedNestedDocs++; } @@ -193,7 +193,7 @@ public void testFieldAlias() throws IOException { document.add( new Field(IdFieldMapper.NAME, Uid.encodeId(Integer.toString(i)), IdFieldMapper.Defaults.NESTED_FIELD_TYPE) ); - document.add(new Field(TypeFieldMapper.NAME, "__" + NESTED_OBJECT, TypeFieldMapper.Defaults.NESTED_FIELD_TYPE)); + document.add(new Field(NestedPathFieldMapper.NAME, NESTED_OBJECT, NestedPathFieldMapper.Defaults.FIELD_TYPE)); documents.add(document); } Document document = new Document(); diff --git a/server/src/test/java/org/opensearch/search/aggregations/bucket/terms/RareTermsAggregatorTests.java b/server/src/test/java/org/opensearch/search/aggregations/bucket/terms/RareTermsAggregatorTests.java index 9a9a03e715644..678bc2fc6f536 100644 --- a/server/src/test/java/org/opensearch/search/aggregations/bucket/terms/RareTermsAggregatorTests.java +++ b/server/src/test/java/org/opensearch/search/aggregations/bucket/terms/RareTermsAggregatorTests.java @@ -60,11 +60,11 @@ import org.opensearch.index.mapper.KeywordFieldMapper; import org.opensearch.index.mapper.MappedFieldType; import org.opensearch.index.mapper.MapperService; +import org.opensearch.index.mapper.NestedPathFieldMapper; import org.opensearch.index.mapper.NumberFieldMapper; import org.opensearch.index.mapper.RangeFieldMapper; import org.opensearch.index.mapper.RangeType; import org.opensearch.index.mapper.SeqNoFieldMapper; -import org.opensearch.index.mapper.TypeFieldMapper; import org.opensearch.index.mapper.Uid; import org.opensearch.search.SearchHit; import org.opensearch.search.aggregations.Aggregation; @@ -551,7 +551,7 @@ private List generateDocsWithNested(String id, int value, int[] nested for (int nestedValue : nestedValues) { Document document = new Document(); document.add(new Field(IdFieldMapper.NAME, Uid.encodeId(id), IdFieldMapper.Defaults.NESTED_FIELD_TYPE)); - document.add(new Field(TypeFieldMapper.NAME, "__nested_object", TypeFieldMapper.Defaults.NESTED_FIELD_TYPE)); + document.add(new Field(NestedPathFieldMapper.NAME, "nested_object", NestedPathFieldMapper.Defaults.FIELD_TYPE)); document.add(new SortedNumericDocValuesField("nested_value", nestedValue)); documents.add(document); } diff --git a/server/src/test/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregatorTests.java b/server/src/test/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregatorTests.java index a9e819e7cbaf2..cb47bf6cba6a9 100644 --- a/server/src/test/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregatorTests.java +++ b/server/src/test/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregatorTests.java @@ -66,11 +66,11 @@ import org.opensearch.index.mapper.KeywordFieldMapper; import org.opensearch.index.mapper.MappedFieldType; import org.opensearch.index.mapper.MapperService; +import org.opensearch.index.mapper.NestedPathFieldMapper; import org.opensearch.index.mapper.NumberFieldMapper; import org.opensearch.index.mapper.RangeFieldMapper; import org.opensearch.index.mapper.RangeType; import org.opensearch.index.mapper.SeqNoFieldMapper; -import org.opensearch.index.mapper.TypeFieldMapper; import org.opensearch.index.mapper.Uid; import org.opensearch.index.query.MatchAllQueryBuilder; import org.opensearch.index.query.QueryBuilders; @@ -1464,7 +1464,7 @@ private List generateDocsWithNested(String id, int value, int[] nested for (int nestedValue : nestedValues) { Document document = new Document(); document.add(new Field(IdFieldMapper.NAME, Uid.encodeId(id), IdFieldMapper.Defaults.NESTED_FIELD_TYPE)); - document.add(new Field(TypeFieldMapper.NAME, "__nested_object", TypeFieldMapper.Defaults.NESTED_FIELD_TYPE)); + document.add(new Field(NestedPathFieldMapper.NAME, "nested_object", NestedPathFieldMapper.Defaults.FIELD_TYPE)); document.add(new SortedNumericDocValuesField("nested_value", nestedValue)); documents.add(document); } diff --git a/server/src/test/java/org/opensearch/search/sort/FieldSortBuilderTests.java b/server/src/test/java/org/opensearch/search/sort/FieldSortBuilderTests.java index 44d48e9073e23..bcf458c5028cd 100644 --- a/server/src/test/java/org/opensearch/search/sort/FieldSortBuilderTests.java +++ b/server/src/test/java/org/opensearch/search/sort/FieldSortBuilderTests.java @@ -63,8 +63,8 @@ import org.opensearch.index.mapper.DateFieldMapper; import org.opensearch.index.mapper.KeywordFieldMapper; import org.opensearch.index.mapper.MappedFieldType; +import org.opensearch.index.mapper.NestedPathFieldMapper; import org.opensearch.index.mapper.NumberFieldMapper; -import org.opensearch.index.mapper.TypeFieldMapper; import org.opensearch.index.query.MatchNoneQueryBuilder; import org.opensearch.index.query.QueryBuilder; import org.opensearch.index.query.QueryBuilders; @@ -325,7 +325,7 @@ public void testBuildNested() throws IOException { comparatorSource = (XFieldComparatorSource) sortField.getComparatorSource(); nested = comparatorSource.nested(); assertNotNull(nested); - assertEquals(new TermQuery(new Term(TypeFieldMapper.NAME, "__path")), nested.getInnerQuery()); + assertEquals(new TermQuery(new Term(NestedPathFieldMapper.NAME, "path")), nested.getInnerQuery()); sortBuilder = new FieldSortBuilder("fieldName").setNestedPath("path") .setNestedFilter(QueryBuilders.termQuery(MAPPED_STRING_FIELDNAME, "value")); diff --git a/server/src/test/java/org/opensearch/search/sort/GeoDistanceSortBuilderTests.java b/server/src/test/java/org/opensearch/search/sort/GeoDistanceSortBuilderTests.java index c14deb6add083..87adbd9532665 100644 --- a/server/src/test/java/org/opensearch/search/sort/GeoDistanceSortBuilderTests.java +++ b/server/src/test/java/org/opensearch/search/sort/GeoDistanceSortBuilderTests.java @@ -48,7 +48,7 @@ import org.opensearch.index.fielddata.IndexFieldData.XFieldComparatorSource.Nested; import org.opensearch.index.mapper.GeoPointFieldMapper; import org.opensearch.index.mapper.MappedFieldType; -import org.opensearch.index.mapper.TypeFieldMapper; +import org.opensearch.index.mapper.NestedPathFieldMapper; import org.opensearch.index.query.GeoValidationMethod; import org.opensearch.index.query.MatchAllQueryBuilder; import org.opensearch.index.query.MatchNoneQueryBuilder; @@ -552,7 +552,7 @@ public void testBuildNested() throws IOException { comparatorSource = (XFieldComparatorSource) sortField.getComparatorSource(); nested = comparatorSource.nested(); assertNotNull(nested); - assertEquals(new TermQuery(new Term(TypeFieldMapper.NAME, "__path")), nested.getInnerQuery()); + assertEquals(new TermQuery(new Term(NestedPathFieldMapper.NAME, "path")), nested.getInnerQuery()); sortBuilder = new GeoDistanceSortBuilder("fieldName", 1.0, 1.0).setNestedPath("path") .setNestedFilter(QueryBuilders.matchAllQuery()); diff --git a/server/src/test/java/org/opensearch/search/sort/ScriptSortBuilderTests.java b/server/src/test/java/org/opensearch/search/sort/ScriptSortBuilderTests.java index c1e430abbe3d2..53e15c1c094ab 100644 --- a/server/src/test/java/org/opensearch/search/sort/ScriptSortBuilderTests.java +++ b/server/src/test/java/org/opensearch/search/sort/ScriptSortBuilderTests.java @@ -43,7 +43,7 @@ import org.opensearch.index.fielddata.IndexFieldData.XFieldComparatorSource.Nested; import org.opensearch.index.fielddata.fieldcomparator.BytesRefFieldComparatorSource; import org.opensearch.index.fielddata.fieldcomparator.DoubleValuesComparatorSource; -import org.opensearch.index.mapper.TypeFieldMapper; +import org.opensearch.index.mapper.NestedPathFieldMapper; import org.opensearch.index.query.MatchNoneQueryBuilder; import org.opensearch.index.query.QueryBuilder; import org.opensearch.index.query.QueryBuilders; @@ -344,7 +344,7 @@ public void testBuildNested() throws IOException { comparatorSource = (XFieldComparatorSource) sortField.getComparatorSource(); nested = comparatorSource.nested(); assertNotNull(nested); - assertEquals(new TermQuery(new Term(TypeFieldMapper.NAME, "__path")), nested.getInnerQuery()); + assertEquals(new TermQuery(new Term(NestedPathFieldMapper.NAME, "path")), nested.getInnerQuery()); sortBuilder = new ScriptSortBuilder(mockScript(MOCK_SCRIPT_NAME), ScriptSortType.NUMBER).setNestedPath("path") .setNestedFilter(QueryBuilders.matchAllQuery()); From 872dc2f8c2a775dbb4c79fc0ad07b77c9d1ed9db Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Fri, 29 Apr 2022 09:41:32 -0500 Subject: [PATCH 109/514] [Refactor] XContentType to parse Accept or Content-Type headers (#3077) (#3103) Refactors XContentType.fromMediaTypeOrFormat to fromMediaType so Accept headers and Content-Type headers can be parsed separately. This helps in reusing the same parse logic in for REST Versioning API support. Signed-off-by: Nicholas Walter Knize (cherry picked from commit d86c88fe591fb0cca139b62c046633ed22305d13) Co-authored-by: Nick Knize --- .../client/RestHighLevelClient.java | 2 +- .../client/RequestConvertersTests.java | 2 +- .../opensearch/common/xcontent/MediaType.java | 65 +++++++++ .../common/xcontent/MediaTypeParser.java | 135 ++++++++++++++++++ .../common/xcontent/XContentType.java | 101 ++++++------- .../common/xcontent/MediaTypeParserTests.java | 84 +++++++++++ .../opensearch/rest/AbstractRestChannel.java | 10 +- .../opensearch/rest/action/cat/RestTable.java | 9 +- .../common/xcontent/XContentTypeTests.java | 70 +++++---- .../rest/BytesRestResponseTests.java | 2 +- .../test/rest/OpenSearchRestTestCase.java | 6 +- .../rest/yaml/ClientYamlTestResponse.java | 2 +- .../opensearch/test/rest/yaml/ObjectPath.java | 2 +- 13 files changed, 392 insertions(+), 98 deletions(-) create mode 100644 libs/x-content/src/main/java/org/opensearch/common/xcontent/MediaType.java create mode 100644 libs/x-content/src/main/java/org/opensearch/common/xcontent/MediaTypeParser.java create mode 100644 libs/x-content/src/test/java/org/opensearch/common/xcontent/MediaTypeParserTests.java diff --git a/client/rest-high-level/src/main/java/org/opensearch/client/RestHighLevelClient.java b/client/rest-high-level/src/main/java/org/opensearch/client/RestHighLevelClient.java index 16e6648e7747e..d293b979debb5 100644 --- a/client/rest-high-level/src/main/java/org/opensearch/client/RestHighLevelClient.java +++ b/client/rest-high-level/src/main/java/org/opensearch/client/RestHighLevelClient.java @@ -2073,7 +2073,7 @@ protected final Resp parseEntity(final HttpEntity entity, final CheckedFu if (entity.getContentType() == null) { throw new IllegalStateException("OpenSearch didn't return the [Content-Type] header, unable to parse response body"); } - XContentType xContentType = XContentType.fromMediaTypeOrFormat(entity.getContentType().getValue()); + XContentType xContentType = XContentType.fromMediaType(entity.getContentType().getValue()); if (xContentType == null) { throw new IllegalStateException("Unsupported Content-Type: " + entity.getContentType().getValue()); } diff --git a/client/rest-high-level/src/test/java/org/opensearch/client/RequestConvertersTests.java b/client/rest-high-level/src/test/java/org/opensearch/client/RequestConvertersTests.java index 32c6cde0725b4..c138d18ccd85c 100644 --- a/client/rest-high-level/src/test/java/org/opensearch/client/RequestConvertersTests.java +++ b/client/rest-high-level/src/test/java/org/opensearch/client/RequestConvertersTests.java @@ -806,7 +806,7 @@ public void testUpdate() throws IOException { UpdateRequest parsedUpdateRequest = new UpdateRequest(); - XContentType entityContentType = XContentType.fromMediaTypeOrFormat(entity.getContentType().getValue()); + XContentType entityContentType = XContentType.fromMediaType(entity.getContentType().getValue()); try (XContentParser parser = createParser(entityContentType.xContent(), entity.getContent())) { parsedUpdateRequest.fromXContent(parser); } diff --git a/libs/x-content/src/main/java/org/opensearch/common/xcontent/MediaType.java b/libs/x-content/src/main/java/org/opensearch/common/xcontent/MediaType.java new file mode 100644 index 0000000000000..5cfc52b20bfc5 --- /dev/null +++ b/libs/x-content/src/main/java/org/opensearch/common/xcontent/MediaType.java @@ -0,0 +1,65 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +package org.opensearch.common.xcontent; + +/** + * Abstracts a Media Type and a format parameter. + * Media types are used as values on Content-Type and Accept headers + * format is an URL parameter, specifies response media type. + */ +public interface MediaType { + /** + * Returns a type part of a MediaType + * i.e. application for application/json + */ + String type(); + + /** + * Returns a subtype part of a MediaType. + * i.e. json for application/json + */ + String subtype(); + + /** + * Returns a corresponding format for a MediaType. i.e. json for application/json media type + * Can differ from the MediaType's subtype i.e plain/text has a subtype of text but format is txt + */ + String format(); + + /** + * returns a string representation of a media type. + */ + default String typeWithSubtype() { + return type() + "/" + subtype(); + } +} diff --git a/libs/x-content/src/main/java/org/opensearch/common/xcontent/MediaTypeParser.java b/libs/x-content/src/main/java/org/opensearch/common/xcontent/MediaTypeParser.java new file mode 100644 index 0000000000000..cbd3589f5b500 --- /dev/null +++ b/libs/x-content/src/main/java/org/opensearch/common/xcontent/MediaTypeParser.java @@ -0,0 +1,135 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +package org.opensearch.common.xcontent; + +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +public class MediaTypeParser { + private final Map formatToMediaType; + private final Map typeWithSubtypeToMediaType; + + public MediaTypeParser(T[] acceptedMediaTypes) { + this(acceptedMediaTypes, Map.of()); + } + + public MediaTypeParser(T[] acceptedMediaTypes, Map additionalMediaTypes) { + final int size = acceptedMediaTypes.length + additionalMediaTypes.size(); + Map formatMap = new HashMap<>(size); + Map typeMap = new HashMap<>(size); + for (T mediaType : acceptedMediaTypes) { + typeMap.put(mediaType.typeWithSubtype(), mediaType); + formatMap.put(mediaType.format(), mediaType); + } + for (Map.Entry entry : additionalMediaTypes.entrySet()) { + String typeWithSubtype = entry.getKey(); + T mediaType = entry.getValue(); + + typeMap.put(typeWithSubtype.toLowerCase(Locale.ROOT), mediaType); + formatMap.put(mediaType.format(), mediaType); + } + + this.formatToMediaType = Map.copyOf(formatMap); + this.typeWithSubtypeToMediaType = Map.copyOf(typeMap); + } + + public T fromMediaType(String mediaType) { + ParsedMediaType parsedMediaType = parseMediaType(mediaType); + return parsedMediaType != null ? parsedMediaType.getMediaType() : null; + } + + public T fromFormat(String format) { + if (format == null) { + return null; + } + return formatToMediaType.get(format.toLowerCase(Locale.ROOT)); + } + + /** + * parsing media type that follows https://tools.ietf.org/html/rfc7231#section-3.1.1.1 + * @param headerValue a header value from Accept or Content-Type + * @return a parsed media-type + */ + public ParsedMediaType parseMediaType(String headerValue) { + if (headerValue != null) { + String[] split = headerValue.toLowerCase(Locale.ROOT).split(";"); + + String[] typeSubtype = split[0].trim().split("/"); + if (typeSubtype.length == 2) { + String type = typeSubtype[0]; + String subtype = typeSubtype[1]; + T xContentType = typeWithSubtypeToMediaType.get(type + "/" + subtype); + if (xContentType != null) { + Map parameters = new HashMap<>(); + for (int i = 1; i < split.length; i++) { + // spaces are allowed between parameters, but not between '=' sign + String[] keyValueParam = split[i].trim().split("="); + if (keyValueParam.length != 2 || hasSpaces(keyValueParam[0]) || hasSpaces(keyValueParam[1])) { + return null; + } + parameters.put(keyValueParam[0], keyValueParam[1]); + } + return new ParsedMediaType(xContentType, parameters); + } + } + + } + return null; + } + + private boolean hasSpaces(String s) { + return s.trim().equals(s) == false; + } + + /** + * A media type object that contains all the information provided on a Content-Type or Accept header + */ + public class ParsedMediaType { + private final Map parameters; + private final T mediaType; + + public ParsedMediaType(T mediaType, Map parameters) { + this.parameters = parameters; + this.mediaType = mediaType; + } + + public T getMediaType() { + return mediaType; + } + + public Map getParameters() { + return parameters; + } + } +} diff --git a/libs/x-content/src/main/java/org/opensearch/common/xcontent/XContentType.java b/libs/x-content/src/main/java/org/opensearch/common/xcontent/XContentType.java index b0986d603ef23..1c745f591e38b 100644 --- a/libs/x-content/src/main/java/org/opensearch/common/xcontent/XContentType.java +++ b/libs/x-content/src/main/java/org/opensearch/common/xcontent/XContentType.java @@ -38,12 +38,12 @@ import org.opensearch.common.xcontent.yaml.YamlXContent; import java.util.Locale; -import java.util.Objects; +import java.util.Map; /** * The content type of {@link org.opensearch.common.xcontent.XContent}. */ -public enum XContentType { +public enum XContentType implements MediaType { /** * A JSON based content type. @@ -60,7 +60,7 @@ public String mediaType() { } @Override - public String shortName() { + public String subtype() { return "json"; } @@ -79,7 +79,7 @@ public String mediaTypeWithoutParameters() { } @Override - public String shortName() { + public String subtype() { return "smile"; } @@ -98,7 +98,7 @@ public String mediaTypeWithoutParameters() { } @Override - public String shortName() { + public String subtype() { return "yaml"; } @@ -117,7 +117,7 @@ public String mediaTypeWithoutParameters() { } @Override - public String shortName() { + public String subtype() { return "cbor"; } @@ -127,34 +127,42 @@ public XContent xContent() { } }; + /** a parser of media types */ + private static final MediaTypeParser MEDIA_TYPE_PARSER = new MediaTypeParser<>( + XContentType.values(), + Map.of("application/*", JSON, "application/x-ndjson", JSON) + ); + + /** gets the {@link MediaTypeParser} singleton for use outside class */ + @SuppressWarnings("rawtypes") + public static MediaTypeParser getMediaTypeParser() { + return MEDIA_TYPE_PARSER; + } + /** - * Accepts either a format string, which is equivalent to {@link XContentType#shortName()} or a media type that optionally has - * parameters and attempts to match the value to an {@link XContentType}. The comparisons are done in lower case format and this method - * also supports a wildcard accept for {@code application/*}. This method can be used to parse the {@code Accept} HTTP header or a - * format query string parameter. This method will return {@code null} if no match is found + * Accepts a format string, which is most of the time is equivalent to {@link XContentType#subtype()} + * and attempts to match the value to an {@link XContentType}. + * The comparisons are done in lower case format. + * This method will return {@code null} if no match is found */ - public static XContentType fromMediaTypeOrFormat(String mediaType) { - if (mediaType == null) { - return null; - } - - mediaType = removeVersionInMediaType(mediaType); - for (XContentType type : values()) { - if (isSameMediaTypeOrFormatAs(mediaType, type)) { - return type; - } - } - final String lowercaseMediaType = mediaType.toLowerCase(Locale.ROOT); - if (lowercaseMediaType.startsWith("application/*")) { - return JSON; - } + public static XContentType fromFormat(String mediaType) { + return MEDIA_TYPE_PARSER.fromFormat(mediaType); + } - return null; + /** + * Attempts to match the given media type with the known {@link XContentType} values. This match is done in a case-insensitive manner. + * The provided media type can optionally has parameters. + * This method is suitable for parsing of the {@code Content-Type} and {@code Accept} HTTP headers. + * This method will return {@code null} if no match is found + */ + public static XContentType fromMediaType(String mediaTypeHeaderValue) { + mediaTypeHeaderValue = removeVersionInMediaType(mediaTypeHeaderValue); + return MEDIA_TYPE_PARSER.fromMediaType(mediaTypeHeaderValue); } /** * Clients compatible with ES 7.x might start sending media types with versioned media type - * in a form of application/vnd.opensearch+json;compatible-with=7. + * in a form of application/vnd.elasticsearch+json;compatible-with=7. * This has to be removed in order to be used in 7.x server. * The same client connecting using that media type will be able to communicate with ES 8 thanks to compatible API. * @param mediaType - a media type used on Content-Type header, might contain versioned media type. @@ -162,38 +170,12 @@ public static XContentType fromMediaTypeOrFormat(String mediaType) { * @return a media type string without */ private static String removeVersionInMediaType(String mediaType) { - if (mediaType.contains("vnd.opensearch")) { + if (mediaType != null && (mediaType = mediaType.toLowerCase(Locale.ROOT)).contains("vnd.opensearch")) { return mediaType.replaceAll("vnd.opensearch\\+", "").replaceAll("\\s*;\\s*compatible-with=\\d+", ""); } return mediaType; } - /** - * Attempts to match the given media type with the known {@link XContentType} values. This match is done in a case-insensitive manner. - * The provided media type should not include any parameters. This method is suitable for parsing part of the {@code Content-Type} - * HTTP header. This method will return {@code null} if no match is found - */ - public static XContentType fromMediaType(String mediaType) { - final String lowercaseMediaType = Objects.requireNonNull(mediaType, "mediaType cannot be null").toLowerCase(Locale.ROOT); - for (XContentType type : values()) { - if (type.mediaTypeWithoutParameters().equals(lowercaseMediaType)) { - return type; - } - } - // we also support newline delimited JSON: http://specs.okfnlabs.org/ndjson/ - if (lowercaseMediaType.toLowerCase(Locale.ROOT).equals("application/x-ndjson")) { - return XContentType.JSON; - } - - return null; - } - - private static boolean isSameMediaTypeOrFormatAs(String stringType, XContentType type) { - return type.mediaTypeWithoutParameters().equalsIgnoreCase(stringType) - || stringType.toLowerCase(Locale.ROOT).startsWith(type.mediaTypeWithoutParameters().toLowerCase(Locale.ROOT) + ";") - || type.shortName().equalsIgnoreCase(stringType); - } - private int index; XContentType(int index) { @@ -208,10 +190,17 @@ public String mediaType() { return mediaTypeWithoutParameters(); } - public abstract String shortName(); - public abstract XContent xContent(); public abstract String mediaTypeWithoutParameters(); + @Override + public String type() { + return "application"; + } + + @Override + public String format() { + return subtype(); + } } diff --git a/libs/x-content/src/test/java/org/opensearch/common/xcontent/MediaTypeParserTests.java b/libs/x-content/src/test/java/org/opensearch/common/xcontent/MediaTypeParserTests.java new file mode 100644 index 0000000000000..06dbd4ebd24dc --- /dev/null +++ b/libs/x-content/src/test/java/org/opensearch/common/xcontent/MediaTypeParserTests.java @@ -0,0 +1,84 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +package org.opensearch.common.xcontent; + +import org.opensearch.test.OpenSearchTestCase; + +import java.util.Collections; +import java.util.Map; + +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.nullValue; + +public class MediaTypeParserTests extends OpenSearchTestCase { + + @SuppressWarnings("unchecked") + MediaTypeParser mediaTypeParser = XContentType.getMediaTypeParser(); + + public void testJsonWithParameters() throws Exception { + String mediaType = "application/json"; + assertThat(mediaTypeParser.parseMediaType(mediaType).getParameters(), equalTo(Collections.emptyMap())); + assertThat(mediaTypeParser.parseMediaType(mediaType + ";").getParameters(), equalTo(Collections.emptyMap())); + assertThat(mediaTypeParser.parseMediaType(mediaType + "; charset=UTF-8").getParameters(), equalTo(Map.of("charset", "utf-8"))); + assertThat( + mediaTypeParser.parseMediaType(mediaType + "; custom=123;charset=UTF-8").getParameters(), + equalTo(Map.of("charset", "utf-8", "custom", "123")) + ); + } + + public void testWhiteSpaceInTypeSubtype() { + String mediaType = " application/json "; + assertThat(mediaTypeParser.parseMediaType(mediaType).getMediaType(), equalTo(XContentType.JSON)); + + assertThat( + mediaTypeParser.parseMediaType(mediaType + "; custom=123; charset=UTF-8").getParameters(), + equalTo(Map.of("charset", "utf-8", "custom", "123")) + ); + assertThat( + mediaTypeParser.parseMediaType(mediaType + "; custom=123;\n charset=UTF-8").getParameters(), + equalTo(Map.of("charset", "utf-8", "custom", "123")) + ); + + mediaType = " application / json "; + assertThat(mediaTypeParser.parseMediaType(mediaType), is(nullValue())); + } + + public void testInvalidParameters() { + String mediaType = "application/json"; + assertThat(mediaTypeParser.parseMediaType(mediaType + "; keyvalueNoEqualsSign"), is(nullValue())); + + assertThat(mediaTypeParser.parseMediaType(mediaType + "; key = value"), is(nullValue())); + assertThat(mediaTypeParser.parseMediaType(mediaType + "; key="), is(nullValue())); + } +} diff --git a/server/src/main/java/org/opensearch/rest/AbstractRestChannel.java b/server/src/main/java/org/opensearch/rest/AbstractRestChannel.java index 536972aa5a5d7..eb5fcccee3868 100644 --- a/server/src/main/java/org/opensearch/rest/AbstractRestChannel.java +++ b/server/src/main/java/org/opensearch/rest/AbstractRestChannel.java @@ -58,6 +58,7 @@ public abstract class AbstractRestChannel implements RestChannel { private final String filterPath; private final boolean pretty; private final boolean human; + private final String acceptHeader; private BytesStreamOutput bytesOut; @@ -71,7 +72,8 @@ public abstract class AbstractRestChannel implements RestChannel { protected AbstractRestChannel(RestRequest request, boolean detailedErrorsEnabled) { this.request = request; this.detailedErrorsEnabled = detailedErrorsEnabled; - this.format = request.param("format", request.header("Accept")); + this.format = request.param("format"); + this.acceptHeader = request.header("Accept"); this.filterPath = request.param("filter_path", null); this.pretty = request.paramAsBoolean("pretty", false); this.human = request.paramAsBoolean("human", false); @@ -112,7 +114,11 @@ public XContentBuilder newBuilder( boolean useFiltering ) throws IOException { if (responseContentType == null) { - responseContentType = XContentType.fromMediaTypeOrFormat(format); + // TODO should format vs acceptHeader always be the same, do we allow overriding? + responseContentType = XContentType.fromFormat(format); + if (responseContentType == null) { + responseContentType = XContentType.fromMediaType(acceptHeader); + } } // try to determine the response content type from the media type or the format query string parameter, with the format parameter // taking precedence over the Accept header diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestTable.java b/server/src/main/java/org/opensearch/rest/action/cat/RestTable.java index 69977cb73645a..542c428901475 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestTable.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestTable.java @@ -64,13 +64,20 @@ public class RestTable { public static RestResponse buildResponse(Table table, RestChannel channel) throws Exception { RestRequest request = channel.request(); - XContentType xContentType = XContentType.fromMediaTypeOrFormat(request.param("format", request.header("Accept"))); + XContentType xContentType = getXContentType(request); if (xContentType != null) { return buildXContentBuilder(table, channel); } return buildTextPlainResponse(table, channel); } + private static XContentType getXContentType(RestRequest request) { + if (request.hasParam("format")) { + return XContentType.fromFormat(request.param("format")); + } + return XContentType.fromMediaType(request.header("Accept")); + } + public static RestResponse buildXContentBuilder(Table table, RestChannel channel) throws Exception { RestRequest request = channel.request(); XContentBuilder builder = channel.newBuilder(); diff --git a/server/src/test/java/org/opensearch/common/xcontent/XContentTypeTests.java b/server/src/test/java/org/opensearch/common/xcontent/XContentTypeTests.java index 4d4fea5a41b82..978db14225f00 100644 --- a/server/src/test/java/org/opensearch/common/xcontent/XContentTypeTests.java +++ b/server/src/test/java/org/opensearch/common/xcontent/XContentTypeTests.java @@ -43,72 +43,80 @@ public class XContentTypeTests extends OpenSearchTestCase { public void testFromJson() throws Exception { String mediaType = "application/json"; XContentType expectedXContentType = XContentType.JSON; - assertThat(XContentType.fromMediaTypeOrFormat(mediaType), equalTo(expectedXContentType)); - assertThat(XContentType.fromMediaTypeOrFormat(mediaType + ";"), equalTo(expectedXContentType)); - assertThat(XContentType.fromMediaTypeOrFormat(mediaType + "; charset=UTF-8"), equalTo(expectedXContentType)); + assertThat(XContentType.fromMediaType(mediaType), equalTo(expectedXContentType)); + assertThat(XContentType.fromMediaType(mediaType + ";"), equalTo(expectedXContentType)); + assertThat(XContentType.fromMediaType(mediaType + "; charset=UTF-8"), equalTo(expectedXContentType)); + } + + public void testFromNdJson() throws Exception { + String mediaType = "application/x-ndjson"; + XContentType expectedXContentType = XContentType.JSON; + assertThat(XContentType.fromMediaType(mediaType), equalTo(expectedXContentType)); + assertThat(XContentType.fromMediaType(mediaType + ";"), equalTo(expectedXContentType)); + assertThat(XContentType.fromMediaType(mediaType + "; charset=UTF-8"), equalTo(expectedXContentType)); } public void testFromJsonUppercase() throws Exception { String mediaType = "application/json".toUpperCase(Locale.ROOT); XContentType expectedXContentType = XContentType.JSON; - assertThat(XContentType.fromMediaTypeOrFormat(mediaType), equalTo(expectedXContentType)); - assertThat(XContentType.fromMediaTypeOrFormat(mediaType + ";"), equalTo(expectedXContentType)); - assertThat(XContentType.fromMediaTypeOrFormat(mediaType + "; charset=UTF-8"), equalTo(expectedXContentType)); + assertThat(XContentType.fromMediaType(mediaType), equalTo(expectedXContentType)); + assertThat(XContentType.fromMediaType(mediaType + ";"), equalTo(expectedXContentType)); + assertThat(XContentType.fromMediaType(mediaType + "; charset=UTF-8"), equalTo(expectedXContentType)); } public void testFromYaml() throws Exception { String mediaType = "application/yaml"; XContentType expectedXContentType = XContentType.YAML; - assertThat(XContentType.fromMediaTypeOrFormat(mediaType), equalTo(expectedXContentType)); - assertThat(XContentType.fromMediaTypeOrFormat(mediaType + ";"), equalTo(expectedXContentType)); - assertThat(XContentType.fromMediaTypeOrFormat(mediaType + "; charset=UTF-8"), equalTo(expectedXContentType)); + assertThat(XContentType.fromMediaType(mediaType), equalTo(expectedXContentType)); + assertThat(XContentType.fromMediaType(mediaType + ";"), equalTo(expectedXContentType)); + assertThat(XContentType.fromMediaType(mediaType + "; charset=UTF-8"), equalTo(expectedXContentType)); } public void testFromSmile() throws Exception { String mediaType = "application/smile"; XContentType expectedXContentType = XContentType.SMILE; - assertThat(XContentType.fromMediaTypeOrFormat(mediaType), equalTo(expectedXContentType)); - assertThat(XContentType.fromMediaTypeOrFormat(mediaType + ";"), equalTo(expectedXContentType)); + assertThat(XContentType.fromMediaType(mediaType), equalTo(expectedXContentType)); + assertThat(XContentType.fromMediaType(mediaType + ";"), equalTo(expectedXContentType)); } public void testFromCbor() throws Exception { String mediaType = "application/cbor"; XContentType expectedXContentType = XContentType.CBOR; - assertThat(XContentType.fromMediaTypeOrFormat(mediaType), equalTo(expectedXContentType)); - assertThat(XContentType.fromMediaTypeOrFormat(mediaType + ";"), equalTo(expectedXContentType)); + assertThat(XContentType.fromMediaType(mediaType), equalTo(expectedXContentType)); + assertThat(XContentType.fromMediaType(mediaType + ";"), equalTo(expectedXContentType)); } public void testFromWildcard() throws Exception { String mediaType = "application/*"; XContentType expectedXContentType = XContentType.JSON; - assertThat(XContentType.fromMediaTypeOrFormat(mediaType), equalTo(expectedXContentType)); - assertThat(XContentType.fromMediaTypeOrFormat(mediaType + ";"), equalTo(expectedXContentType)); + assertThat(XContentType.fromMediaType(mediaType), equalTo(expectedXContentType)); + assertThat(XContentType.fromMediaType(mediaType + ";"), equalTo(expectedXContentType)); } public void testFromWildcardUppercase() throws Exception { String mediaType = "APPLICATION/*"; XContentType expectedXContentType = XContentType.JSON; - assertThat(XContentType.fromMediaTypeOrFormat(mediaType), equalTo(expectedXContentType)); - assertThat(XContentType.fromMediaTypeOrFormat(mediaType + ";"), equalTo(expectedXContentType)); + assertThat(XContentType.fromMediaType(mediaType), equalTo(expectedXContentType)); + assertThat(XContentType.fromMediaType(mediaType + ";"), equalTo(expectedXContentType)); } public void testFromRubbish() throws Exception { - assertThat(XContentType.fromMediaTypeOrFormat(null), nullValue()); - assertThat(XContentType.fromMediaTypeOrFormat(""), nullValue()); - assertThat(XContentType.fromMediaTypeOrFormat("text/plain"), nullValue()); - assertThat(XContentType.fromMediaTypeOrFormat("gobbly;goop"), nullValue()); + assertThat(XContentType.fromMediaType(null), nullValue()); + assertThat(XContentType.fromMediaType(""), nullValue()); + assertThat(XContentType.fromMediaType("text/plain"), nullValue()); + assertThat(XContentType.fromMediaType("gobbly;goop"), nullValue()); } public void testVersionedMediaType() throws Exception { - assertThat(XContentType.fromMediaTypeOrFormat("application/vnd.opensearch+json;compatible-with=7"), equalTo(XContentType.JSON)); - assertThat(XContentType.fromMediaTypeOrFormat("application/vnd.opensearch+yaml;compatible-with=7"), equalTo(XContentType.YAML)); - assertThat(XContentType.fromMediaTypeOrFormat("application/vnd.opensearch+cbor;compatible-with=7"), equalTo(XContentType.CBOR)); - assertThat(XContentType.fromMediaTypeOrFormat("application/vnd.opensearch+smile;compatible-with=7"), equalTo(XContentType.SMILE)); - - assertThat(XContentType.fromMediaTypeOrFormat("application/vnd.opensearch+json ;compatible-with=7"), equalTo(XContentType.JSON)); - assertThat( - XContentType.fromMediaTypeOrFormat("application/vnd.opensearch+json ;compatible-with=7;charset=utf-8"), - equalTo(XContentType.JSON) - ); + assertThat(XContentType.fromMediaType("application/vnd.opensearch+json;compatible-with=7"), equalTo(XContentType.JSON)); + assertThat(XContentType.fromMediaType("application/vnd.opensearch+yaml;compatible-with=7"), equalTo(XContentType.YAML)); + assertThat(XContentType.fromMediaType("application/vnd.opensearch+cbor;compatible-with=7"), equalTo(XContentType.CBOR)); + assertThat(XContentType.fromMediaType("application/vnd.opensearch+smile;compatible-with=7"), equalTo(XContentType.SMILE)); + + assertThat(XContentType.fromMediaType("application/vnd.opensearch+json ;compatible-with=7"), equalTo(XContentType.JSON)); + + String mthv = "application/vnd.opensearch+json ;compatible-with=7;charset=utf-8"; + assertThat(XContentType.fromMediaType(mthv), equalTo(XContentType.JSON)); + assertThat(XContentType.fromMediaType(mthv.toUpperCase(Locale.ROOT)), equalTo(XContentType.JSON)); } } diff --git a/server/src/test/java/org/opensearch/rest/BytesRestResponseTests.java b/server/src/test/java/org/opensearch/rest/BytesRestResponseTests.java index 4e6d9b25409a8..1ea7f006cf482 100644 --- a/server/src/test/java/org/opensearch/rest/BytesRestResponseTests.java +++ b/server/src/test/java/org/opensearch/rest/BytesRestResponseTests.java @@ -325,7 +325,7 @@ public void testErrorToAndFromXContent() throws IOException { final XContentType xContentType = randomFrom(XContentType.values()); - Map params = Collections.singletonMap("format", xContentType.mediaType()); + Map params = Collections.singletonMap("format", xContentType.format()); RestRequest request = new FakeRestRequest.Builder(xContentRegistry()).withParams(params).build(); RestChannel channel = detailed ? new DetailedExceptionRestChannel(request) : new SimpleExceptionRestChannel(request); diff --git a/test/framework/src/main/java/org/opensearch/test/rest/OpenSearchRestTestCase.java b/test/framework/src/main/java/org/opensearch/test/rest/OpenSearchRestTestCase.java index a25dd31e69098..6e3618b708eff 100644 --- a/test/framework/src/main/java/org/opensearch/test/rest/OpenSearchRestTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/rest/OpenSearchRestTestCase.java @@ -136,7 +136,7 @@ public abstract class OpenSearchRestTestCase extends OpenSearchTestCase { * Convert the entity from a {@link Response} into a map of maps. */ public static Map entityAsMap(Response response) throws IOException { - XContentType xContentType = XContentType.fromMediaTypeOrFormat(response.getEntity().getContentType().getValue()); + XContentType xContentType = XContentType.fromMediaType(response.getEntity().getContentType().getValue()); // EMPTY and THROW are fine here because `.map` doesn't use named x content or deprecation try ( XContentParser parser = xContentType.xContent() @@ -154,7 +154,7 @@ public static Map entityAsMap(Response response) throws IOExcept * Convert the entity from a {@link Response} into a list of maps. */ public static List entityAsList(Response response) throws IOException { - XContentType xContentType = XContentType.fromMediaTypeOrFormat(response.getEntity().getContentType().getValue()); + XContentType xContentType = XContentType.fromMediaType(response.getEntity().getContentType().getValue()); // EMPTY and THROW are fine here because `.map` doesn't use named x content or deprecation try ( XContentParser parser = xContentType.xContent() @@ -1089,7 +1089,7 @@ protected static Map getAsMap(final String endpoint) throws IOEx } protected static Map responseAsMap(Response response) throws IOException { - XContentType entityContentType = XContentType.fromMediaTypeOrFormat(response.getEntity().getContentType().getValue()); + XContentType entityContentType = XContentType.fromMediaType(response.getEntity().getContentType().getValue()); Map responseEntity = XContentHelper.convertToMap( entityContentType.xContent(), response.getEntity().getContent(), diff --git a/test/framework/src/main/java/org/opensearch/test/rest/yaml/ClientYamlTestResponse.java b/test/framework/src/main/java/org/opensearch/test/rest/yaml/ClientYamlTestResponse.java index 4e8799b9a618e..8fc0554e2b31e 100644 --- a/test/framework/src/main/java/org/opensearch/test/rest/yaml/ClientYamlTestResponse.java +++ b/test/framework/src/main/java/org/opensearch/test/rest/yaml/ClientYamlTestResponse.java @@ -66,7 +66,7 @@ public ClientYamlTestResponse(Response response) throws IOException { this.response = response; if (response.getEntity() != null) { String contentType = response.getHeader("Content-Type"); - this.bodyContentType = XContentType.fromMediaTypeOrFormat(contentType); + this.bodyContentType = XContentType.fromMediaType(contentType); try { byte[] bytes = EntityUtils.toByteArray(response.getEntity()); // skip parsing if we got text back (e.g. if we called _cat apis) diff --git a/test/framework/src/main/java/org/opensearch/test/rest/yaml/ObjectPath.java b/test/framework/src/main/java/org/opensearch/test/rest/yaml/ObjectPath.java index 0ff1b36d1f5ae..473511825ef60 100644 --- a/test/framework/src/main/java/org/opensearch/test/rest/yaml/ObjectPath.java +++ b/test/framework/src/main/java/org/opensearch/test/rest/yaml/ObjectPath.java @@ -57,7 +57,7 @@ public class ObjectPath { public static ObjectPath createFromResponse(Response response) throws IOException { byte[] bytes = EntityUtils.toByteArray(response.getEntity()); String contentType = response.getHeader("Content-Type"); - XContentType xContentType = XContentType.fromMediaTypeOrFormat(contentType); + XContentType xContentType = XContentType.fromMediaType(contentType); return ObjectPath.createFromXContent(xContentType.xContent(), new BytesArray(bytes)); } From c9eda7db37df2bc041453e109a083834caa57594 Mon Sep 17 00:00:00 2001 From: "Daniel Doubrovkine (dB.)" Date: Mon, 2 May 2022 19:48:58 -0400 Subject: [PATCH 110/514] Sync maintainers with actual permissions. (#3127) (#3132) Signed-off-by: dblock --- MAINTAINERS.md | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/MAINTAINERS.md b/MAINTAINERS.md index db6cd6c0f3309..ed20b6f5ab314 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -1,29 +1,34 @@ -## Maintainers +- [Current Maintainers](#current-maintainers) +- [Emeritus](#emeritus) + +## Current Maintainers | Maintainer | GitHub ID | Affiliation | | --------------- | --------- | ----------- | | Abbas Hussain | [abbashus](https://github.com/abbashus) | Amazon | +| Anas Alkouz | [anasalkouz](https://github.com/anasalkouz) | Amazon | +| Andrew Ross | [andrross](https://github.com/andrross)| Amazon | +| Andriy Redko | [reta](https://github.com/reta) | Aiven | | Charlotte Henkle | [CEHENKLE](https://github.com/CEHENKLE) | Amazon | +| Daniel "dB." Doubrovkine | [dblock](https://github.com/dblock) | Amazon | | Himanshu Setia | [setiah](https://github.com/setiah) | Amazon | +| Kartik Ganesh | [kartg](https://github.com/kartg) | Amazon | +| Kunal Kotwani | [kotwanikunal](https://github.com/kotwanikunal) | Amazon | +| Marc Handalian | [mch2](https://github.com/mch2) | Amazon | | Nick Knize | [nknize](https://github.com/nknize) | Amazon | +| Owais Kazi | [owaiskazi19](https://github.com/owaiskazi19) | Amazon | | Rabi Panda | [adnapibar](https://github.com/adnapibar) | Amazon | +| Rishikesh Pasham | [Rishikesh1159](https://github.com/Rishikesh1159) | Amazon| +| Ryan Bogan | [ryanbogan](https://github.com/ryanbogan) | Amazon | | Sarat Vemulapalli | [saratvemulapalli](https://github.com/saratvemulapalli) | Amazon | -| Tianli Feng | [tlfeng](https://github.com/tlfeng) | Amazon | -| Gopala Krishna Ambareesh | [krishna-ggk](https://github.com/krishna-ggk) |Amazon | -| Vengadanathan Srinivasan | [vengadanathan-s](https://github.com/vengadanathan-s) | Amazon | | Shweta Thareja |[shwetathareja](https://github.com/shwetathareja) | Amazon | -| Itiyama Sadana | [itiyamas](https://github.com/itiyamas) | Amazon | -| Daniel "dB." Doubrovkine | [dblock](https://github.com/dblock) | Amazon | -| Andrew Ross | [andross](https://github.com/andrross)| Amazon | +| Tianli Feng | [tlfeng](https://github.com/tlfeng) | Amazon | | Vacha Shah | [VachaShah](https://github.com/VachaShah) | Amazon | -| Anas Alkouz | [anasalkouz](https://github.com/anasalkouz) | Amazon | -| Megha Sai Kavikondala | [meghasaik](https://github.com/meghasaik) | Amazon | -| Rishikesh Pasham | [Rishikesh1159](https://github.com/Rishikesh1159) | Amazon| | Xue Zhou | [xuezhou25](https://github.com/xuezhou25) | Amazon | -| Kartik Ganesh | [kartg](https://github.com/kartg) | Amazon | -| Marc Handalian | [mch2](https://github.com/mch2) | Amazon | -| Ryan Bogan | [ryanbogan](https://github.com/ryanbogan) | Amazon | -| Owais Kazi | [owaiskazi19](https://github.com/owaiskazi19) | Amazon | +## Emeritus + +| Maintainer | GitHub ID | Affiliation | +| Megha Sai Kavikondala | [meghasaik](https://github.com/meghasaik) | Amazon | [This document](https://github.com/opensearch-project/.github/blob/main/MAINTAINERS.md) explains what maintainers do in this repo, and how they should be doing it. If you're interested in contributing, see [CONTRIBUTING](CONTRIBUTING.md). From be2a9ae742858a1e153f5a2a5a8c0a3f119e807d Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 3 May 2022 10:19:14 -0400 Subject: [PATCH 111/514] [Javadoc] Add missing package-info.java files to server (#3128) (#3129) In preparation for re-enabling the missingJavadoc gradle task this change adds in the missing package-info.java files to the server folder. For now general javadocs are added to these files with the intent to clean up with better descriptions over time. Signed-off-by: Nicholas Walter Knize (cherry picked from commit 21468279b2731aea5556f290c6e4fca7ea0e291e) Co-authored-by: Nick Knize --- gradle/missing-javadoc.gradle | 13 ++++++++++++- .../admin/cluster/allocation/package-info.java | 10 ++++++++++ .../admin/cluster/configuration/package-info.java | 10 ++++++++++ .../action/admin/cluster/health/package-info.java | 10 ++++++++++ .../admin/cluster/node/hotthreads/package-info.java | 10 ++++++++++ .../admin/cluster/node/info/package-info.java | 10 ++++++++++ .../admin/cluster/node/liveness/package-info.java | 10 ++++++++++ .../action/admin/cluster/node/package-info.java | 10 ++++++++++ .../admin/cluster/node/reload/package-info.java | 10 ++++++++++ .../admin/cluster/node/stats/package-info.java | 10 ++++++++++ .../cluster/node/tasks/cancel/package-info.java | 10 ++++++++++ .../admin/cluster/node/tasks/get/package-info.java | 10 ++++++++++ .../admin/cluster/node/tasks/list/package-info.java | 10 ++++++++++ .../admin/cluster/node/tasks/package-info.java | 10 ++++++++++ .../admin/cluster/node/usage/package-info.java | 10 ++++++++++ .../action/admin/cluster/remote/package-info.java | 10 ++++++++++ .../cluster/repositories/cleanup/package-info.java | 10 ++++++++++ .../cluster/repositories/delete/package-info.java | 10 ++++++++++ .../cluster/repositories/get/package-info.java | 10 ++++++++++ .../admin/cluster/repositories/package-info.java | 10 ++++++++++ .../cluster/repositories/put/package-info.java | 10 ++++++++++ .../cluster/repositories/verify/package-info.java | 10 ++++++++++ .../action/admin/cluster/reroute/package-info.java | 10 ++++++++++ .../action/admin/cluster/settings/package-info.java | 10 ++++++++++ .../action/admin/cluster/shards/package-info.java | 10 ++++++++++ .../admin/cluster/snapshots/clone/package-info.java | 10 ++++++++++ .../cluster/snapshots/create/package-info.java | 10 ++++++++++ .../cluster/snapshots/delete/package-info.java | 10 ++++++++++ .../admin/cluster/snapshots/get/package-info.java | 10 ++++++++++ .../admin/cluster/snapshots/package-info.java | 10 ++++++++++ .../cluster/snapshots/restore/package-info.java | 10 ++++++++++ .../cluster/snapshots/status/package-info.java | 10 ++++++++++ .../action/admin/cluster/state/package-info.java | 10 ++++++++++ .../action/admin/cluster/stats/package-info.java | 10 ++++++++++ .../admin/cluster/storedscripts/package-info.java | 10 ++++++++++ .../action/admin/cluster/tasks/package-info.java | 10 ++++++++++ .../admin/indices/alias/exists/package-info.java | 10 ++++++++++ .../admin/indices/alias/get/package-info.java | 10 ++++++++++ .../action/admin/indices/alias/package-info.java | 10 ++++++++++ .../action/admin/indices/analyze/package-info.java | 10 ++++++++++ .../admin/indices/cache/clear/package-info.java | 10 ++++++++++ .../action/admin/indices/cache/package-info.java | 10 ++++++++++ .../action/admin/indices/close/package-info.java | 10 ++++++++++ .../action/admin/indices/create/package-info.java | 6 +++--- .../admin/indices/dangling/delete/package-info.java | 10 ++++++++++ .../admin/indices/dangling/find/package-info.java | 10 ++++++++++ .../indices/dangling/import_index/package-info.java | 10 ++++++++++ .../admin/indices/dangling/list/package-info.java | 10 ++++++++++ .../action/admin/indices/dangling/package-info.java | 9 +++++---- .../admin/indices/datastream/package-info.java | 10 ++++++++++ .../admin/indices/exists/indices/package-info.java | 10 ++++++++++ .../action/admin/indices/exists/package-info.java | 10 ++++++++++ .../admin/indices/exists/types/package-info.java | 13 +++++++++++++ .../action/admin/indices/get/package-info.java | 10 ++++++++++ .../admin/indices/mapping/get/package-info.java | 10 ++++++++++ .../action/admin/indices/open/package-info.java | 10 ++++++++++ .../action/admin/indices/readonly/package-info.java | 10 ++++++++++ .../action/admin/indices/recovery/package-info.java | 10 ++++++++++ .../action/admin/indices/resolve/package-info.java | 10 ++++++++++ .../action/admin/indices/rollover/package-info.java | 10 ++++++++++ .../action/admin/indices/segments/package-info.java | 10 ++++++++++ .../admin/indices/settings/get/package-info.java | 10 ++++++++++ .../action/admin/indices/settings/package-info.java | 10 ++++++++++ .../admin/indices/settings/put/package-info.java | 10 ++++++++++ .../action/admin/indices/shards/package-info.java | 10 ++++++++++ .../action/admin/indices/shrink/package-info.java | 10 ++++++++++ .../action/admin/indices/stats/package-info.java | 10 ++++++++++ .../admin/indices/template/delete/package-info.java | 10 ++++++++++ .../admin/indices/template/get/package-info.java | 10 ++++++++++ .../action/admin/indices/template/package-info.java | 10 ++++++++++ .../admin/indices/template/post/package-info.java | 10 ++++++++++ .../admin/indices/template/put/package-info.java | 10 ++++++++++ .../admin/indices/upgrade/get/package-info.java | 10 ++++++++++ .../action/admin/indices/upgrade/package-info.java | 10 ++++++++++ .../admin/indices/upgrade/post/package-info.java | 10 ++++++++++ .../action/admin/indices/validate/package-info.java | 10 ++++++++++ .../org/opensearch/action/admin/package-info.java | 6 +++--- .../org/opensearch/action/bulk/package-info.java | 10 ++++++++++ .../opensearch/action/fieldcaps/package-info.java | 10 ++++++++++ .../org/opensearch/action/ingest/package-info.java | 10 ++++++++++ .../org/opensearch/action/main/package-info.java | 10 ++++++++++ .../org/opensearch/action/resync/package-info.java | 10 ++++++++++ .../action/support/broadcast/node/package-info.java | 10 ++++++++++ .../action/support/broadcast/package-info.java | 10 ++++++++++ .../action/support/master/info/package-info.java | 10 ++++++++++ .../action/support/master/package-info.java | 10 ++++++++++ .../action/support/nodes/package-info.java | 10 ++++++++++ .../org/opensearch/action/support/package-info.java | 10 ++++++++++ .../action/support/replication/package-info.java | 10 ++++++++++ .../support/single/instance/package-info.java | 10 ++++++++++ .../action/support/single/package-info.java | 10 ++++++++++ .../action/support/single/shard/package-info.java | 10 ++++++++++ .../action/support/tasks/package-info.java | 10 ++++++++++ .../org/opensearch/action/update/package-info.java | 10 ++++++++++ .../java/org/opensearch/bootstrap/package-info.java | 12 ++++++++++++ .../main/java/org/opensearch/cli/package-info.java | 12 ++++++++++++ .../org/opensearch/client/node/package-info.java | 12 ++++++++++++ .../java/org/opensearch/client/package-info.java | 6 +++--- .../org/opensearch/client/support/package-info.java | 12 ++++++++++++ .../opensearch/client/transport/package-info.java | 12 ++++++++++++ .../org/opensearch/cluster/ack/package-info.java | 10 ++++++++++ .../cluster/action/index/package-info.java | 10 ++++++++++ .../org/opensearch/cluster/action/package-info.java | 10 ++++++++++ .../cluster/action/shard/package-info.java | 10 ++++++++++ .../org/opensearch/cluster/block/package-info.java | 10 ++++++++++ .../cluster/coordination/package-info.java | 10 ++++++++++ .../org/opensearch/cluster/health/package-info.java | 10 ++++++++++ .../opensearch/cluster/metadata/package-info.java | 10 ++++++++++ .../org/opensearch/cluster/node/package-info.java | 10 ++++++++++ .../java/org/opensearch/cluster/package-info.java | 10 ++++++++++ .../routing/allocation/allocator/package-info.java | 10 ++++++++++ .../routing/allocation/command/package-info.java | 10 ++++++++++ .../routing/allocation/decider/package-info.java | 10 ++++++++++ .../cluster/routing/allocation/package-info.java | 10 ++++++++++ .../opensearch/cluster/routing/package-info.java | 10 ++++++++++ .../opensearch/cluster/service/package-info.java | 10 ++++++++++ .../common/blobstore/fs/package-info.java | 10 ++++++++++ .../opensearch/common/blobstore/package-info.java | 10 ++++++++++ .../common/blobstore/support/package-info.java | 10 ++++++++++ .../org/opensearch/common/breaker/package-info.java | 10 ++++++++++ .../org/opensearch/common/bytes/package-info.java | 10 ++++++++++ .../org/opensearch/common/cache/package-info.java | 10 ++++++++++ .../org/opensearch/common/collect/package-info.java | 10 ++++++++++ .../opensearch/common/component/package-info.java | 10 ++++++++++ .../opensearch/common/compress/package-info.java | 10 ++++++++++ .../opensearch/common/concurrent/package-info.java | 10 ++++++++++ .../opensearch/common/document/package-info.java | 10 ++++++++++ .../common/geo/builders/package-info.java | 10 ++++++++++ .../org/opensearch/common/geo/package-info.java | 10 ++++++++++ .../opensearch/common/geo/parsers/package-info.java | 10 ++++++++++ .../org/opensearch/common/hash/package-info.java | 10 ++++++++++ .../java/org/opensearch/common/io/package-info.java | 10 ++++++++++ .../org/opensearch/common/joda/package-info.java | 10 ++++++++++ .../org/opensearch/common/lease/package-info.java | 10 ++++++++++ .../org/opensearch/common/logging/package-info.java | 10 ++++++++++ .../common/lucene/index/package-info.java | 10 ++++++++++ .../org/opensearch/common/lucene/package-info.java | 10 ++++++++++ .../common/lucene/search/function/package-info.java | 10 ++++++++++ .../common/lucene/search/package-info.java | 10 ++++++++++ .../common/lucene/store/package-info.java | 10 ++++++++++ .../opensearch/common/lucene/uid/package-info.java | 10 ++++++++++ .../org/opensearch/common/metrics/package-info.java | 10 ++++++++++ .../org/opensearch/common/network/package-info.java | 10 ++++++++++ .../java/org/opensearch/common/package-info.java | 10 ++++++++++ .../org/opensearch/common/path/package-info.java | 10 ++++++++++ .../opensearch/common/recycler/package-info.java | 10 ++++++++++ .../org/opensearch/common/regex/package-info.java | 10 ++++++++++ .../opensearch/common/rounding/package-info.java | 10 ++++++++++ .../org/opensearch/common/text/package-info.java | 10 ++++++++++ .../org/opensearch/common/time/package-info.java | 10 ++++++++++ .../opensearch/common/transport/package-info.java | 10 ++++++++++ .../org/opensearch/common/unit/package-info.java | 10 ++++++++++ .../common/util/concurrent/package-info.java | 10 ++++++++++ .../common/util/iterable/package-info.java | 10 ++++++++++ .../org/opensearch/common/util/package-info.java | 10 ++++++++++ .../opensearch/common/util/set/package-info.java | 10 ++++++++++ .../opensearch/common/xcontent/package-info.java | 10 ++++++++++ .../common/xcontent/support/package-info.java | 10 ++++++++++ .../java/org/opensearch/discovery/package-info.java | 10 ++++++++++ .../main/java/org/opensearch/env/package-info.java | 10 ++++++++++ .../java/org/opensearch/gateway/package-info.java | 10 ++++++++++ .../main/java/org/opensearch/http/package-info.java | 10 ++++++++++ .../org/opensearch/index/analysis/package-info.java | 10 ++++++++++ .../opensearch/index/cache/bitset/package-info.java | 10 ++++++++++ .../org/opensearch/index/cache/package-info.java | 10 ++++++++++ .../opensearch/index/cache/query/package-info.java | 10 ++++++++++ .../index/cache/request/package-info.java | 10 ++++++++++ .../org/opensearch/index/codec/package-info.java | 10 ++++++++++ .../org/opensearch/index/engine/package-info.java | 10 ++++++++++ .../fielddata/fieldcomparator/package-info.java | 10 ++++++++++ .../index/fielddata/ordinals/package-info.java | 10 ++++++++++ .../opensearch/index/fielddata/package-info.java | 10 ++++++++++ .../index/fielddata/plain/package-info.java | 10 ++++++++++ .../opensearch/index/fieldvisitor/package-info.java | 10 ++++++++++ .../org/opensearch/index/flush/package-info.java | 10 ++++++++++ .../java/org/opensearch/index/get/package-info.java | 10 ++++++++++ .../org/opensearch/index/mapper/package-info.java | 10 ++++++++++ .../org/opensearch/index/merge/package-info.java | 10 ++++++++++ .../java/org/opensearch/index/package-info.java | 10 ++++++++++ .../index/query/functionscore/package-info.java | 10 ++++++++++ .../org/opensearch/index/query/package-info.java | 10 ++++++++++ .../index/query/support/package-info.java | 10 ++++++++++ .../org/opensearch/index/recovery/package-info.java | 10 ++++++++++ .../org/opensearch/index/refresh/package-info.java | 10 ++++++++++ .../org/opensearch/index/reindex/package-info.java | 10 ++++++++++ .../org/opensearch/index/search/package-info.java | 10 ++++++++++ .../opensearch/index/search/stats/package-info.java | 10 ++++++++++ .../org/opensearch/index/seqno/package-info.java | 10 ++++++++++ .../org/opensearch/index/shard/package-info.java | 10 ++++++++++ .../opensearch/index/similarity/package-info.java | 10 ++++++++++ .../index/snapshots/blobstore/package-info.java | 10 ++++++++++ .../opensearch/index/snapshots/package-info.java | 10 ++++++++++ .../org/opensearch/index/stats/package-info.java | 10 ++++++++++ .../org/opensearch/index/store/package-info.java | 13 +++++++++++++ .../opensearch/index/termvectors/package-info.java | 10 ++++++++++ .../org/opensearch/index/translog/package-info.java | 10 ++++++++++ .../org/opensearch/index/warmer/package-info.java | 10 ++++++++++ .../opensearch/indices/analysis/package-info.java | 10 ++++++++++ .../opensearch/indices/breaker/package-info.java | 10 ++++++++++ .../opensearch/indices/cluster/package-info.java | 10 ++++++++++ .../indices/fielddata/cache/package-info.java | 10 ++++++++++ .../opensearch/indices/fielddata/package-info.java | 10 ++++++++++ .../org/opensearch/indices/mapper/package-info.java | 10 ++++++++++ .../java/org/opensearch/indices/package-info.java | 10 ++++++++++ .../opensearch/indices/recovery/package-info.java | 10 ++++++++++ .../indices/replication/common/package-info.java | 10 ++++++++++ .../indices/replication/package-info.java | 10 ++++++++++ .../org/opensearch/indices/store/package-info.java | 10 ++++++++++ .../java/org/opensearch/ingest/package-info.java | 10 ++++++++++ .../java/org/opensearch/lucene/package-info.java | 10 ++++++++++ .../org/opensearch/lucene/queries/package-info.java | 10 ++++++++++ .../org/opensearch/monitor/fs/package-info.java | 10 ++++++++++ .../org/opensearch/monitor/jvm/package-info.java | 10 ++++++++++ .../org/opensearch/monitor/os/package-info.java | 10 ++++++++++ .../opensearch/monitor/process/package-info.java | 10 ++++++++++ .../opensearch/persistent/decider/package-info.java | 10 ++++++++++ .../opensearch/repositories/fs/package-info.java | 10 ++++++++++ .../aggregations/bucket/adjacency/package-info.java | 10 ++++++++++ .../aggregations/bucket/composite/package-info.java | 10 ++++++++++ .../aggregations/bucket/filter/package-info.java | 10 ++++++++++ .../aggregations/bucket/geogrid/package-info.java | 10 ++++++++++ .../aggregations/bucket/global/package-info.java | 10 ++++++++++ .../aggregations/bucket/missing/package-info.java | 10 ++++++++++ .../aggregations/bucket/nested/package-info.java | 10 ++++++++++ .../bucket/{package-info => package-info.java} | 0 .../aggregations/bucket/range/package-info.java | 10 ++++++++++ .../aggregations/bucket/sampler/package-info.java | 10 ++++++++++ .../bucket/terms/heuristic/package-info.java | 10 ++++++++++ .../aggregations/bucket/terms/package-info.java | 10 ++++++++++ .../search/aggregations/pipeline/package-info.java | 10 ++++++++++ .../search/aggregations/support/package-info.java | 3 +-- .../aggregations/support/values/package-info.java | 10 ++++++++++ .../org/opensearch/search/builder/package-info.java | 10 ++++++++++ .../opensearch/search/collapse/package-info.java | 10 ++++++++++ .../org/opensearch/search/dfs/package-info.java | 10 ++++++++++ .../opensearch/search/internal/package-info.java | 10 ++++++++++ .../org/opensearch/search/lookup/package-info.java | 10 ++++++++++ .../java/org/opensearch/search/package-info.java | 10 ++++++++++ .../org/opensearch/search/query/package-info.java | 10 ++++++++++ .../org/opensearch/search/rescore/package-info.java | 10 ++++++++++ .../opensearch/search/searchafter/package-info.java | 10 ++++++++++ .../org/opensearch/search/slice/package-info.java | 10 ++++++++++ .../org/opensearch/search/sort/package-info.java | 10 ++++++++++ .../org/opensearch/threadpool/package-info.java | 10 ++++++++++ .../java/org/opensearch/transport/package-info.java | 10 ++++++++++ .../java/org/opensearch/usage/package-info.java | 10 ++++++++++ .../java/org/opensearch/watcher/package-info.java | 10 ++++++++++ 247 files changed, 2443 insertions(+), 16 deletions(-) create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/allocation/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/configuration/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/health/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/node/info/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/node/liveness/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/node/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/node/reload/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/node/stats/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/cancel/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/get/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/node/usage/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/remote/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/repositories/cleanup/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/repositories/delete/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/repositories/get/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/repositories/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/repositories/put/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/repositories/verify/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/reroute/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/settings/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/shards/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/snapshots/clone/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/snapshots/create/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/snapshots/delete/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/snapshots/get/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/snapshots/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/state/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/stats/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/cluster/tasks/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/alias/exists/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/alias/get/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/alias/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/analyze/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/cache/clear/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/cache/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/close/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/dangling/delete/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/dangling/find/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/dangling/import_index/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/dangling/list/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/datastream/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/exists/indices/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/exists/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/exists/types/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/get/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/mapping/get/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/open/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/readonly/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/recovery/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/resolve/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/rollover/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/segments/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/settings/get/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/settings/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/settings/put/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/shards/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/shrink/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/stats/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/template/delete/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/template/get/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/template/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/template/post/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/template/put/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/upgrade/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/admin/indices/validate/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/bulk/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/fieldcaps/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/ingest/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/main/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/resync/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/support/broadcast/node/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/support/broadcast/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/support/master/info/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/support/master/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/support/nodes/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/support/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/support/replication/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/support/single/instance/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/support/single/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/support/single/shard/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/support/tasks/package-info.java create mode 100644 server/src/main/java/org/opensearch/action/update/package-info.java create mode 100644 server/src/main/java/org/opensearch/bootstrap/package-info.java create mode 100644 server/src/main/java/org/opensearch/cli/package-info.java create mode 100644 server/src/main/java/org/opensearch/client/node/package-info.java create mode 100644 server/src/main/java/org/opensearch/client/support/package-info.java create mode 100644 server/src/main/java/org/opensearch/client/transport/package-info.java create mode 100644 server/src/main/java/org/opensearch/cluster/ack/package-info.java create mode 100644 server/src/main/java/org/opensearch/cluster/action/index/package-info.java create mode 100644 server/src/main/java/org/opensearch/cluster/action/package-info.java create mode 100644 server/src/main/java/org/opensearch/cluster/action/shard/package-info.java create mode 100644 server/src/main/java/org/opensearch/cluster/block/package-info.java create mode 100644 server/src/main/java/org/opensearch/cluster/coordination/package-info.java create mode 100644 server/src/main/java/org/opensearch/cluster/health/package-info.java create mode 100644 server/src/main/java/org/opensearch/cluster/metadata/package-info.java create mode 100644 server/src/main/java/org/opensearch/cluster/node/package-info.java create mode 100644 server/src/main/java/org/opensearch/cluster/package-info.java create mode 100644 server/src/main/java/org/opensearch/cluster/routing/allocation/allocator/package-info.java create mode 100644 server/src/main/java/org/opensearch/cluster/routing/allocation/command/package-info.java create mode 100644 server/src/main/java/org/opensearch/cluster/routing/allocation/decider/package-info.java create mode 100644 server/src/main/java/org/opensearch/cluster/routing/allocation/package-info.java create mode 100644 server/src/main/java/org/opensearch/cluster/routing/package-info.java create mode 100644 server/src/main/java/org/opensearch/cluster/service/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/blobstore/fs/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/blobstore/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/blobstore/support/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/breaker/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/bytes/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/cache/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/collect/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/component/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/compress/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/concurrent/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/document/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/geo/builders/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/geo/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/geo/parsers/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/hash/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/io/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/joda/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/lease/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/logging/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/lucene/index/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/lucene/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/lucene/search/function/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/lucene/search/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/lucene/store/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/lucene/uid/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/metrics/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/network/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/path/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/recycler/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/regex/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/rounding/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/text/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/time/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/transport/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/unit/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/util/concurrent/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/util/iterable/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/util/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/util/set/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/xcontent/package-info.java create mode 100644 server/src/main/java/org/opensearch/common/xcontent/support/package-info.java create mode 100644 server/src/main/java/org/opensearch/discovery/package-info.java create mode 100644 server/src/main/java/org/opensearch/env/package-info.java create mode 100644 server/src/main/java/org/opensearch/gateway/package-info.java create mode 100644 server/src/main/java/org/opensearch/http/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/analysis/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/cache/bitset/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/cache/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/cache/query/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/cache/request/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/codec/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/engine/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/fielddata/fieldcomparator/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/fielddata/ordinals/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/fielddata/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/fielddata/plain/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/fieldvisitor/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/flush/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/get/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/mapper/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/merge/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/query/functionscore/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/query/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/query/support/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/recovery/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/refresh/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/reindex/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/search/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/search/stats/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/seqno/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/shard/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/similarity/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/snapshots/blobstore/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/snapshots/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/stats/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/store/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/termvectors/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/translog/package-info.java create mode 100644 server/src/main/java/org/opensearch/index/warmer/package-info.java create mode 100644 server/src/main/java/org/opensearch/indices/analysis/package-info.java create mode 100644 server/src/main/java/org/opensearch/indices/breaker/package-info.java create mode 100644 server/src/main/java/org/opensearch/indices/cluster/package-info.java create mode 100644 server/src/main/java/org/opensearch/indices/fielddata/cache/package-info.java create mode 100644 server/src/main/java/org/opensearch/indices/fielddata/package-info.java create mode 100644 server/src/main/java/org/opensearch/indices/mapper/package-info.java create mode 100644 server/src/main/java/org/opensearch/indices/package-info.java create mode 100644 server/src/main/java/org/opensearch/indices/recovery/package-info.java create mode 100644 server/src/main/java/org/opensearch/indices/replication/common/package-info.java create mode 100644 server/src/main/java/org/opensearch/indices/replication/package-info.java create mode 100644 server/src/main/java/org/opensearch/indices/store/package-info.java create mode 100644 server/src/main/java/org/opensearch/ingest/package-info.java create mode 100644 server/src/main/java/org/opensearch/lucene/package-info.java create mode 100644 server/src/main/java/org/opensearch/lucene/queries/package-info.java create mode 100644 server/src/main/java/org/opensearch/monitor/fs/package-info.java create mode 100644 server/src/main/java/org/opensearch/monitor/jvm/package-info.java create mode 100644 server/src/main/java/org/opensearch/monitor/os/package-info.java create mode 100644 server/src/main/java/org/opensearch/monitor/process/package-info.java create mode 100644 server/src/main/java/org/opensearch/persistent/decider/package-info.java create mode 100644 server/src/main/java/org/opensearch/repositories/fs/package-info.java create mode 100644 server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/package-info.java create mode 100644 server/src/main/java/org/opensearch/search/aggregations/bucket/composite/package-info.java create mode 100644 server/src/main/java/org/opensearch/search/aggregations/bucket/filter/package-info.java create mode 100644 server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/package-info.java create mode 100644 server/src/main/java/org/opensearch/search/aggregations/bucket/global/package-info.java create mode 100644 server/src/main/java/org/opensearch/search/aggregations/bucket/missing/package-info.java create mode 100644 server/src/main/java/org/opensearch/search/aggregations/bucket/nested/package-info.java rename server/src/main/java/org/opensearch/search/aggregations/bucket/{package-info => package-info.java} (100%) create mode 100644 server/src/main/java/org/opensearch/search/aggregations/bucket/range/package-info.java create mode 100644 server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/package-info.java create mode 100644 server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/package-info.java create mode 100644 server/src/main/java/org/opensearch/search/aggregations/bucket/terms/package-info.java create mode 100644 server/src/main/java/org/opensearch/search/aggregations/pipeline/package-info.java create mode 100644 server/src/main/java/org/opensearch/search/aggregations/support/values/package-info.java create mode 100644 server/src/main/java/org/opensearch/search/builder/package-info.java create mode 100644 server/src/main/java/org/opensearch/search/collapse/package-info.java create mode 100644 server/src/main/java/org/opensearch/search/dfs/package-info.java create mode 100644 server/src/main/java/org/opensearch/search/internal/package-info.java create mode 100644 server/src/main/java/org/opensearch/search/lookup/package-info.java create mode 100644 server/src/main/java/org/opensearch/search/package-info.java create mode 100644 server/src/main/java/org/opensearch/search/query/package-info.java create mode 100644 server/src/main/java/org/opensearch/search/rescore/package-info.java create mode 100644 server/src/main/java/org/opensearch/search/searchafter/package-info.java create mode 100644 server/src/main/java/org/opensearch/search/slice/package-info.java create mode 100644 server/src/main/java/org/opensearch/search/sort/package-info.java create mode 100644 server/src/main/java/org/opensearch/threadpool/package-info.java create mode 100644 server/src/main/java/org/opensearch/transport/package-info.java create mode 100644 server/src/main/java/org/opensearch/usage/package-info.java create mode 100644 server/src/main/java/org/opensearch/watcher/package-info.java diff --git a/gradle/missing-javadoc.gradle b/gradle/missing-javadoc.gradle index 05531487f35f3..2dea9a0e11d91 100644 --- a/gradle/missing-javadoc.gradle +++ b/gradle/missing-javadoc.gradle @@ -162,7 +162,6 @@ configure([ project(":qa:os"), project(":qa:wildfly"), project(":rest-api-spec"), - project(":server"), project(":test:external-modules:test-delayed-aggs"), project(":test:fixtures:azure-fixture"), project(":test:fixtures:gcs-fixture"), @@ -177,6 +176,14 @@ configure([ } } +configure(project(":server")) { + project.tasks.withType(MissingJavadocTask) { + isExcluded = true + // TODO: reenable after fixing missing javadocs + // javadocMissingLevel = "class" + } +} + class MissingJavadocTask extends DefaultTask { @InputFiles @SkipWhenEmpty @@ -274,6 +281,10 @@ class MissingJavadocTask extends DefaultTask { if (!classpath.isEmpty()) { opts << [ '-classpath', classpath.asPath ] } + + opts << [ '-tag', 'opensearch.experimental:a:WARNING: This API is experimental and might change in incompatible ways in the next release.' ] + opts << [ '-tag', 'opensearch.internal:a:NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.' ] + opts << [ '-doclet', "org.opensearch.missingdoclet.MissingDoclet" ] opts << [ '-docletpath', docletpath.asPath ] opts << [ '--missing-level', javadocMissingLevel ] diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/allocation/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/allocation/package-info.java new file mode 100644 index 0000000000000..ef38d39ede82a --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/allocation/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Cluster allocation transport handlers. */ +package org.opensearch.action.admin.cluster.allocation; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/configuration/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/configuration/package-info.java new file mode 100644 index 0000000000000..5543e7a6bde2f --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/configuration/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Cluster configuration transport handlers. */ +package org.opensearch.action.admin.cluster.configuration; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/health/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/health/package-info.java new file mode 100644 index 0000000000000..7512ea5cdaafb --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/health/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Cluster Health transport handlers. */ +package org.opensearch.action.admin.cluster.health; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/package-info.java new file mode 100644 index 0000000000000..a7e6b7c897fe5 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Hot threads at node level transport handlers. */ +package org.opensearch.action.admin.cluster.node.hotthreads; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/info/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/info/package-info.java new file mode 100644 index 0000000000000..4203adc8ed2d6 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/info/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Node Info transport handlers. */ +package org.opensearch.action.admin.cluster.node.info; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/liveness/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/liveness/package-info.java new file mode 100644 index 0000000000000..97dae1e4a4ef4 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/liveness/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Node liveness transport handlers. */ +package org.opensearch.action.admin.cluster.node.liveness; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/package-info.java new file mode 100644 index 0000000000000..f92091587eb04 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Node level transport handlers. */ +package org.opensearch.action.admin.cluster.node; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/package-info.java new file mode 100644 index 0000000000000..a2ddf57796a4a --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Node reloading secured settings transport handlers. */ +package org.opensearch.action.admin.cluster.node.reload; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/package-info.java new file mode 100644 index 0000000000000..14efa77f066d6 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Node Stats transport handlers. */ +package org.opensearch.action.admin.cluster.node.stats; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/cancel/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/cancel/package-info.java new file mode 100644 index 0000000000000..898aa26d16792 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/cancel/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Transport handler for Cancelling Node Tasks */ +package org.opensearch.action.admin.cluster.node.tasks.cancel; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/get/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/get/package-info.java new file mode 100644 index 0000000000000..0eb044c2a29eb --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/get/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Transport handlers for getting Node Tasks. */ +package org.opensearch.action.admin.cluster.node.tasks.get; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/package-info.java new file mode 100644 index 0000000000000..df84d7fe19d02 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Transport handlers for listing node tasks. */ +package org.opensearch.action.admin.cluster.node.tasks.list; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/package-info.java new file mode 100644 index 0000000000000..9d809646460f2 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Node tasks transport handlers. */ +package org.opensearch.action.admin.cluster.node.tasks; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/package-info.java new file mode 100644 index 0000000000000..37943b23dbe10 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Node Usage transport handlers. */ +package org.opensearch.action.admin.cluster.node.usage; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/remote/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/remote/package-info.java new file mode 100644 index 0000000000000..e5be56ff1d139 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/remote/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Remote Node Information transport handlers. */ +package org.opensearch.action.admin.cluster.remote; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/cleanup/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/cleanup/package-info.java new file mode 100644 index 0000000000000..1a9c0f2ce113b --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/cleanup/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Transport handler for cleaning up a snapshot repository. */ +package org.opensearch.action.admin.cluster.repositories.cleanup; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/delete/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/delete/package-info.java new file mode 100644 index 0000000000000..db9d5e7f8ceea --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/delete/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Transport handler for deleting a snapshot repository. */ +package org.opensearch.action.admin.cluster.repositories.delete; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/get/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/get/package-info.java new file mode 100644 index 0000000000000..9f053ae11d8bc --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/get/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Transport handler for getting a snapshot repository. */ +package org.opensearch.action.admin.cluster.repositories.get; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/package-info.java new file mode 100644 index 0000000000000..75eb53cb11748 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Repository transport handlers. */ +package org.opensearch.action.admin.cluster.repositories; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/put/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/put/package-info.java new file mode 100644 index 0000000000000..e5b6305416174 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/put/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Transport handlers for putting a new snapshot repository */ +package org.opensearch.action.admin.cluster.repositories.put; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/verify/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/verify/package-info.java new file mode 100644 index 0000000000000..236e7a6b26369 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/verify/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Transport handler for verifying a snapshot repository. */ +package org.opensearch.action.admin.cluster.repositories.verify; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/reroute/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/reroute/package-info.java new file mode 100644 index 0000000000000..af26371347c0d --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/reroute/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Cluster reroute transport handlers. */ +package org.opensearch.action.admin.cluster.reroute; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/settings/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/settings/package-info.java new file mode 100644 index 0000000000000..a532b3e9f4158 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/settings/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Cluster settings transport handlers. */ +package org.opensearch.action.admin.cluster.settings; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/shards/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/shards/package-info.java new file mode 100644 index 0000000000000..94866d102ac15 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/shards/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Search Shards transport handlers. */ +package org.opensearch.action.admin.cluster.shards; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/clone/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/clone/package-info.java new file mode 100644 index 0000000000000..14738fe5e95b4 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/clone/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Clone Snapshot transport handler. */ +package org.opensearch.action.admin.cluster.snapshots.clone; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/create/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/create/package-info.java new file mode 100644 index 0000000000000..58e1f4f9311ae --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/create/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Create Snapshot transport handler. */ +package org.opensearch.action.admin.cluster.snapshots.create; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/delete/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/delete/package-info.java new file mode 100644 index 0000000000000..5ad5e58ebe1fd --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/delete/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Delete Snapshot transport handler. */ +package org.opensearch.action.admin.cluster.snapshots.delete; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/get/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/get/package-info.java new file mode 100644 index 0000000000000..a00088759051c --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/get/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Get Snapshot transport handler. */ +package org.opensearch.action.admin.cluster.snapshots.get; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/package-info.java new file mode 100644 index 0000000000000..9bfd68dd93178 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Snapshot transport handlers. */ +package org.opensearch.action.admin.cluster.snapshots; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/package-info.java new file mode 100644 index 0000000000000..69db3f77010ff --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Restore Snapshot transport handler. */ +package org.opensearch.action.admin.cluster.snapshots.restore; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/package-info.java new file mode 100644 index 0000000000000..3244beaf97961 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Snapshot Status transport handlers. */ +package org.opensearch.action.admin.cluster.snapshots.status; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/state/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/state/package-info.java new file mode 100644 index 0000000000000..ab935d939e459 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/state/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Cluster State transport handler. */ +package org.opensearch.action.admin.cluster.state; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/stats/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/stats/package-info.java new file mode 100644 index 0000000000000..b10c976bbddf6 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/stats/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Cluster Stats transport handlers. */ +package org.opensearch.action.admin.cluster.stats; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/package-info.java new file mode 100644 index 0000000000000..8f2196ded7c23 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Stored Scripts transport handlers. */ +package org.opensearch.action.admin.cluster.storedscripts; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/tasks/package-info.java b/server/src/main/java/org/opensearch/action/admin/cluster/tasks/package-info.java new file mode 100644 index 0000000000000..4169a343aaabf --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/cluster/tasks/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Pending Cluster Tasks transport handlers. */ +package org.opensearch.action.admin.cluster.tasks; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/alias/exists/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/alias/exists/package-info.java new file mode 100644 index 0000000000000..dd4886e6b3419 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/alias/exists/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Alias Exists transport handler. */ +package org.opensearch.action.admin.indices.alias.exists; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/alias/get/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/alias/get/package-info.java new file mode 100644 index 0000000000000..e4ea33da95743 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/alias/get/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Get Alias transport handler. */ +package org.opensearch.action.admin.indices.alias.get; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/alias/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/alias/package-info.java new file mode 100644 index 0000000000000..3630775073c68 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/alias/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Alias transport handlers. */ +package org.opensearch.action.admin.indices.alias; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/analyze/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/analyze/package-info.java new file mode 100644 index 0000000000000..2de987da0f204 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/analyze/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Indices analyze transport handler. */ +package org.opensearch.action.admin.indices.analyze; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/cache/clear/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/cache/clear/package-info.java new file mode 100644 index 0000000000000..41e8437bc15c1 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/cache/clear/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Clear indices cache transport handler. */ +package org.opensearch.action.admin.indices.cache.clear; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/cache/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/cache/package-info.java new file mode 100644 index 0000000000000..367c663bdc637 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/cache/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Indices Cache transport handlers. */ +package org.opensearch.action.admin.indices.cache; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/close/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/close/package-info.java new file mode 100644 index 0000000000000..fb2d419124461 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/close/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Close indices transport handlers. */ +package org.opensearch.action.admin.indices.close; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/create/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/create/package-info.java index e386817090285..07bdc0eaa5c64 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/create/package-info.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/create/package-info.java @@ -25,12 +25,12 @@ * under the License. */ -/** - * Create index action. - */ /* * Modifications Copyright OpenSearch Contributors. See * GitHub history for details. */ +/** + * Create index action. + */ package org.opensearch.action.admin.indices.create; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/delete/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/delete/package-info.java new file mode 100644 index 0000000000000..15a966b35ab55 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/delete/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Delete Dangling Indices transport handlers. */ +package org.opensearch.action.admin.indices.dangling.delete; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/package-info.java new file mode 100644 index 0000000000000..d5536d5794f3c --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Find Dangling Indices transport handlers. */ +package org.opensearch.action.admin.indices.dangling.find; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/import_index/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/import_index/package-info.java new file mode 100644 index 0000000000000..fce0f5a130c2f --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/import_index/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Import Dangling Index transport handler. */ +package org.opensearch.action.admin.indices.dangling.import_index; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/package-info.java new file mode 100644 index 0000000000000..f6c37345fb73c --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** List Dangling Indices transport handler. */ +package org.opensearch.action.admin.indices.dangling.list; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/package-info.java index e97ff628d8d79..9c29e7ec53da0 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/dangling/package-info.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/package-info.java @@ -25,6 +25,11 @@ * under the License. */ +/* + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + /** * Dangling indices are indices that exist on disk on one or more nodes but * which do not currently exist in the cluster state. They arise in a @@ -41,9 +46,5 @@ * *

The classes in this package form an API for managing dangling indices, allowing them to be listed, imported or deleted. */ -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ package org.opensearch.action.admin.indices.dangling; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/datastream/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/datastream/package-info.java new file mode 100644 index 0000000000000..a37c2bed1adff --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/datastream/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Data Stream transport handlers. */ +package org.opensearch.action.admin.indices.datastream; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/exists/indices/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/exists/indices/package-info.java new file mode 100644 index 0000000000000..e5b320dc1bdcd --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/exists/indices/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Index Exists transport handler. */ +package org.opensearch.action.admin.indices.exists.indices; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/exists/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/exists/package-info.java new file mode 100644 index 0000000000000..0a91ac2fd9a20 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/exists/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Index Exists transport handlers. */ +package org.opensearch.action.admin.indices.exists; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/exists/types/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/exists/types/package-info.java new file mode 100644 index 0000000000000..30bc4569e221a --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/exists/types/package-info.java @@ -0,0 +1,13 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** + * Index Type transport handlers. + * @deprecated types are deprecated and will be removed + **/ +package org.opensearch.action.admin.indices.exists.types; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/get/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/get/package-info.java new file mode 100644 index 0000000000000..b438da7ef31dc --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/get/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Get Index transport handler. */ +package org.opensearch.action.admin.indices.get; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/package-info.java new file mode 100644 index 0000000000000..fcdd9846640bc --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Get Mapping transport handlers. */ +package org.opensearch.action.admin.indices.mapping.get; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/open/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/open/package-info.java new file mode 100644 index 0000000000000..4fdea8fd18769 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/open/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Open Index transport handlers. */ +package org.opensearch.action.admin.indices.open; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/readonly/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/readonly/package-info.java new file mode 100644 index 0000000000000..d34d3c64eb1ad --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/readonly/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** ReadOnly Index transport handlers. */ +package org.opensearch.action.admin.indices.readonly; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/recovery/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/recovery/package-info.java new file mode 100644 index 0000000000000..51b7dd7997a15 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/recovery/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Index Recovery transport handlers. */ +package org.opensearch.action.admin.indices.recovery; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/resolve/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/resolve/package-info.java new file mode 100644 index 0000000000000..a7732563cb041 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/resolve/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Index Resolve transport handler. */ +package org.opensearch.action.admin.indices.resolve; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/rollover/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/rollover/package-info.java new file mode 100644 index 0000000000000..23b5b18e3ae87 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/rollover/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Index Rollover transport handlers. */ +package org.opensearch.action.admin.indices.rollover; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/segments/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/segments/package-info.java new file mode 100644 index 0000000000000..0bbd0164b8205 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/segments/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Segment level transport handlers. */ +package org.opensearch.action.admin.indices.segments; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/settings/get/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/settings/get/package-info.java new file mode 100644 index 0000000000000..e767b1a8870e0 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/settings/get/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Get Index Settings transport handler. */ +package org.opensearch.action.admin.indices.settings.get; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/settings/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/settings/package-info.java new file mode 100644 index 0000000000000..862dfad419bd4 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/settings/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Index Settings transport handlers. */ +package org.opensearch.action.admin.indices.settings; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/settings/put/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/settings/put/package-info.java new file mode 100644 index 0000000000000..dc38136b72d57 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/settings/put/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Put Settings transport handler. */ +package org.opensearch.action.admin.indices.settings.put; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/shards/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/shards/package-info.java new file mode 100644 index 0000000000000..187ffc0714e7e --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/shards/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Index Shards transport handlers. */ +package org.opensearch.action.admin.indices.shards; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/shrink/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/shrink/package-info.java new file mode 100644 index 0000000000000..414095575f0d9 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/shrink/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Shrink Index transport handlers. */ +package org.opensearch.action.admin.indices.shrink; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/stats/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/stats/package-info.java new file mode 100644 index 0000000000000..38241a0d3bcbb --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/stats/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Index Stats transport handlers. */ +package org.opensearch.action.admin.indices.stats; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/delete/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/template/delete/package-info.java new file mode 100644 index 0000000000000..f331c9dae4a38 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/delete/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Delete Index Templates transport handlers. */ +package org.opensearch.action.admin.indices.template.delete; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/get/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/template/get/package-info.java new file mode 100644 index 0000000000000..e7173f4d6caaa --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/get/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Get Index Templates transport handlers. */ +package org.opensearch.action.admin.indices.template.get; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/template/package-info.java new file mode 100644 index 0000000000000..066a63f079232 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Index Templates transport handlers. */ +package org.opensearch.action.admin.indices.template; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/post/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/template/post/package-info.java new file mode 100644 index 0000000000000..60b5a1d2abce8 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/post/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Post Index Templates transport handlers. */ +package org.opensearch.action.admin.indices.template.post; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/put/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/template/put/package-info.java new file mode 100644 index 0000000000000..a0033a434b7b3 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/put/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Put Index Templates transport handlers. */ +package org.opensearch.action.admin.indices.template.put; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/package-info.java new file mode 100644 index 0000000000000..58ad55e715d94 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Get Upgrade Indices transport handlers. */ +package org.opensearch.action.admin.indices.upgrade.get; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/package-info.java new file mode 100644 index 0000000000000..ee5633c39fc2f --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Upgrade Indices transport handlers. */ +package org.opensearch.action.admin.indices.upgrade; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/package-info.java new file mode 100644 index 0000000000000..ae8c8839acaba --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Post Upgrade Indices transport handlers. */ +package org.opensearch.action.admin.indices.upgrade.post; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/validate/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/validate/package-info.java new file mode 100644 index 0000000000000..ee210f7495e70 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/admin/indices/validate/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Query Validation transport handlers. */ +package org.opensearch.action.admin.indices.validate; diff --git a/server/src/main/java/org/opensearch/action/admin/package-info.java b/server/src/main/java/org/opensearch/action/admin/package-info.java index 1ee6ebacef3a5..4be3b7cf12e9c 100644 --- a/server/src/main/java/org/opensearch/action/admin/package-info.java +++ b/server/src/main/java/org/opensearch/action/admin/package-info.java @@ -25,12 +25,12 @@ * under the License. */ -/** - * Administrative Actions. - */ /* * Modifications Copyright OpenSearch Contributors. See * GitHub history for details. */ +/** + * Administrative Actions. + */ package org.opensearch.action.admin; diff --git a/server/src/main/java/org/opensearch/action/bulk/package-info.java b/server/src/main/java/org/opensearch/action/bulk/package-info.java new file mode 100644 index 0000000000000..45c42c0efa3f2 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/bulk/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Bulk API transport handlers. */ +package org.opensearch.action.bulk; diff --git a/server/src/main/java/org/opensearch/action/fieldcaps/package-info.java b/server/src/main/java/org/opensearch/action/fieldcaps/package-info.java new file mode 100644 index 0000000000000..c7b7c01875d2b --- /dev/null +++ b/server/src/main/java/org/opensearch/action/fieldcaps/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Field Capabilities transport handlers. */ +package org.opensearch.action.fieldcaps; diff --git a/server/src/main/java/org/opensearch/action/ingest/package-info.java b/server/src/main/java/org/opensearch/action/ingest/package-info.java new file mode 100644 index 0000000000000..42414f2090b41 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/ingest/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Ingest API transport handlers. */ +package org.opensearch.action.ingest; diff --git a/server/src/main/java/org/opensearch/action/main/package-info.java b/server/src/main/java/org/opensearch/action/main/package-info.java new file mode 100644 index 0000000000000..dc08f0a7b6303 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/main/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Main Response transport handlers. */ +package org.opensearch.action.main; diff --git a/server/src/main/java/org/opensearch/action/resync/package-info.java b/server/src/main/java/org/opensearch/action/resync/package-info.java new file mode 100644 index 0000000000000..61c46d85aecda --- /dev/null +++ b/server/src/main/java/org/opensearch/action/resync/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Resync action transport handlers. */ +package org.opensearch.action.resync; diff --git a/server/src/main/java/org/opensearch/action/support/broadcast/node/package-info.java b/server/src/main/java/org/opensearch/action/support/broadcast/node/package-info.java new file mode 100644 index 0000000000000..1d5ebaf244f77 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/support/broadcast/node/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Node Level Broadcast transport handlers. */ +package org.opensearch.action.support.broadcast.node; diff --git a/server/src/main/java/org/opensearch/action/support/broadcast/package-info.java b/server/src/main/java/org/opensearch/action/support/broadcast/package-info.java new file mode 100644 index 0000000000000..00b5c640fd3a1 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/support/broadcast/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Broadcast info transport handlers. */ +package org.opensearch.action.support.broadcast; diff --git a/server/src/main/java/org/opensearch/action/support/master/info/package-info.java b/server/src/main/java/org/opensearch/action/support/master/info/package-info.java new file mode 100644 index 0000000000000..6ae2eb5465db5 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/support/master/info/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Master Node Information transport handlers. */ +package org.opensearch.action.support.master.info; diff --git a/server/src/main/java/org/opensearch/action/support/master/package-info.java b/server/src/main/java/org/opensearch/action/support/master/package-info.java new file mode 100644 index 0000000000000..b0f6f7942b688 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/support/master/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Master Node transport handlers. */ +package org.opensearch.action.support.master; diff --git a/server/src/main/java/org/opensearch/action/support/nodes/package-info.java b/server/src/main/java/org/opensearch/action/support/nodes/package-info.java new file mode 100644 index 0000000000000..f388527e30d8b --- /dev/null +++ b/server/src/main/java/org/opensearch/action/support/nodes/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Node request transport handlers. */ +package org.opensearch.action.support.nodes; diff --git a/server/src/main/java/org/opensearch/action/support/package-info.java b/server/src/main/java/org/opensearch/action/support/package-info.java new file mode 100644 index 0000000000000..58dd4c5190d8b --- /dev/null +++ b/server/src/main/java/org/opensearch/action/support/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Transport handler Support Classes. */ +package org.opensearch.action.support; diff --git a/server/src/main/java/org/opensearch/action/support/replication/package-info.java b/server/src/main/java/org/opensearch/action/support/replication/package-info.java new file mode 100644 index 0000000000000..912cd9197b10f --- /dev/null +++ b/server/src/main/java/org/opensearch/action/support/replication/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Replication transport handlers. */ +package org.opensearch.action.support.replication; diff --git a/server/src/main/java/org/opensearch/action/support/single/instance/package-info.java b/server/src/main/java/org/opensearch/action/support/single/instance/package-info.java new file mode 100644 index 0000000000000..1acd5c1503ed0 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/support/single/instance/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Single Instance transport handlers. */ +package org.opensearch.action.support.single.instance; diff --git a/server/src/main/java/org/opensearch/action/support/single/package-info.java b/server/src/main/java/org/opensearch/action/support/single/package-info.java new file mode 100644 index 0000000000000..918a755936fe3 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/support/single/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Single instance transport handlers. */ +package org.opensearch.action.support.single; diff --git a/server/src/main/java/org/opensearch/action/support/single/shard/package-info.java b/server/src/main/java/org/opensearch/action/support/single/shard/package-info.java new file mode 100644 index 0000000000000..0d93688ece5f1 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/support/single/shard/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Single Shard transport handlers. */ +package org.opensearch.action.support.single.shard; diff --git a/server/src/main/java/org/opensearch/action/support/tasks/package-info.java b/server/src/main/java/org/opensearch/action/support/tasks/package-info.java new file mode 100644 index 0000000000000..30924e1433c7b --- /dev/null +++ b/server/src/main/java/org/opensearch/action/support/tasks/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Task Request transport handlers. */ +package org.opensearch.action.support.tasks; diff --git a/server/src/main/java/org/opensearch/action/update/package-info.java b/server/src/main/java/org/opensearch/action/update/package-info.java new file mode 100644 index 0000000000000..a8c8720c9ac10 --- /dev/null +++ b/server/src/main/java/org/opensearch/action/update/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Update Action transport handlers. */ +package org.opensearch.action.update; diff --git a/server/src/main/java/org/opensearch/bootstrap/package-info.java b/server/src/main/java/org/opensearch/bootstrap/package-info.java new file mode 100644 index 0000000000000..a1761d8d38315 --- /dev/null +++ b/server/src/main/java/org/opensearch/bootstrap/package-info.java @@ -0,0 +1,12 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** + * The bootstrap module implementing OpenSearch bootstrap operations. + */ +package org.opensearch.bootstrap; diff --git a/server/src/main/java/org/opensearch/cli/package-info.java b/server/src/main/java/org/opensearch/cli/package-info.java new file mode 100644 index 0000000000000..8e9f9f6360870 --- /dev/null +++ b/server/src/main/java/org/opensearch/cli/package-info.java @@ -0,0 +1,12 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** + * The command line interface module. + */ +package org.opensearch.cli; diff --git a/server/src/main/java/org/opensearch/client/node/package-info.java b/server/src/main/java/org/opensearch/client/node/package-info.java new file mode 100644 index 0000000000000..0a3be1fad6bf0 --- /dev/null +++ b/server/src/main/java/org/opensearch/client/node/package-info.java @@ -0,0 +1,12 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** + * The node client module allowing to easily perform actions/operations at node level. + */ +package org.opensearch.client.node; diff --git a/server/src/main/java/org/opensearch/client/package-info.java b/server/src/main/java/org/opensearch/client/package-info.java index 24c744803a151..abfd9a9119971 100644 --- a/server/src/main/java/org/opensearch/client/package-info.java +++ b/server/src/main/java/org/opensearch/client/package-info.java @@ -25,12 +25,12 @@ * under the License. */ -/** - * The client module allowing to easily perform actions/operations. - */ /* * Modifications Copyright OpenSearch Contributors. See * GitHub history for details. */ +/** + * The client module allowing to easily perform actions/operations. + */ package org.opensearch.client; diff --git a/server/src/main/java/org/opensearch/client/support/package-info.java b/server/src/main/java/org/opensearch/client/support/package-info.java new file mode 100644 index 0000000000000..637f7f03101aa --- /dev/null +++ b/server/src/main/java/org/opensearch/client/support/package-info.java @@ -0,0 +1,12 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** + * The Abstract client for implementing new client types. + */ +package org.opensearch.client.support; diff --git a/server/src/main/java/org/opensearch/client/transport/package-info.java b/server/src/main/java/org/opensearch/client/transport/package-info.java new file mode 100644 index 0000000000000..a775d93350b19 --- /dev/null +++ b/server/src/main/java/org/opensearch/client/transport/package-info.java @@ -0,0 +1,12 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** + * Transport Client support classes. + */ +package org.opensearch.client.transport; diff --git a/server/src/main/java/org/opensearch/cluster/ack/package-info.java b/server/src/main/java/org/opensearch/cluster/ack/package-info.java new file mode 100644 index 0000000000000..e8206eeb37b26 --- /dev/null +++ b/server/src/main/java/org/opensearch/cluster/ack/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Cluster Acknowledgment transport handlers. */ +package org.opensearch.cluster.ack; diff --git a/server/src/main/java/org/opensearch/cluster/action/index/package-info.java b/server/src/main/java/org/opensearch/cluster/action/index/package-info.java new file mode 100644 index 0000000000000..3594d858b2970 --- /dev/null +++ b/server/src/main/java/org/opensearch/cluster/action/index/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Cluster Index Action transport handlers. */ +package org.opensearch.cluster.action.index; diff --git a/server/src/main/java/org/opensearch/cluster/action/package-info.java b/server/src/main/java/org/opensearch/cluster/action/package-info.java new file mode 100644 index 0000000000000..acd8cf0f63592 --- /dev/null +++ b/server/src/main/java/org/opensearch/cluster/action/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Cluster Action transport handlers. */ +package org.opensearch.cluster.action; diff --git a/server/src/main/java/org/opensearch/cluster/action/shard/package-info.java b/server/src/main/java/org/opensearch/cluster/action/shard/package-info.java new file mode 100644 index 0000000000000..5666176386d46 --- /dev/null +++ b/server/src/main/java/org/opensearch/cluster/action/shard/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Cluster Shard State transport handlers. */ +package org.opensearch.cluster.action.shard; diff --git a/server/src/main/java/org/opensearch/cluster/block/package-info.java b/server/src/main/java/org/opensearch/cluster/block/package-info.java new file mode 100644 index 0000000000000..a51b4623d34af --- /dev/null +++ b/server/src/main/java/org/opensearch/cluster/block/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Cluster Block level classes. */ +package org.opensearch.cluster.block; diff --git a/server/src/main/java/org/opensearch/cluster/coordination/package-info.java b/server/src/main/java/org/opensearch/cluster/coordination/package-info.java new file mode 100644 index 0000000000000..2f0514f25f6d6 --- /dev/null +++ b/server/src/main/java/org/opensearch/cluster/coordination/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Cluster Coordination foundation classes. */ +package org.opensearch.cluster.coordination; diff --git a/server/src/main/java/org/opensearch/cluster/health/package-info.java b/server/src/main/java/org/opensearch/cluster/health/package-info.java new file mode 100644 index 0000000000000..f022210548cfe --- /dev/null +++ b/server/src/main/java/org/opensearch/cluster/health/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Cluster Health Foundation classes. */ +package org.opensearch.cluster.health; diff --git a/server/src/main/java/org/opensearch/cluster/metadata/package-info.java b/server/src/main/java/org/opensearch/cluster/metadata/package-info.java new file mode 100644 index 0000000000000..ef618b435b3fb --- /dev/null +++ b/server/src/main/java/org/opensearch/cluster/metadata/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Cluster metadata foundation classes. */ +package org.opensearch.cluster.metadata; diff --git a/server/src/main/java/org/opensearch/cluster/node/package-info.java b/server/src/main/java/org/opensearch/cluster/node/package-info.java new file mode 100644 index 0000000000000..efb3e3d5f0248 --- /dev/null +++ b/server/src/main/java/org/opensearch/cluster/node/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Cluster Node discovery foundation classes. */ +package org.opensearch.cluster.node; diff --git a/server/src/main/java/org/opensearch/cluster/package-info.java b/server/src/main/java/org/opensearch/cluster/package-info.java new file mode 100644 index 0000000000000..f9cd00f32a6a6 --- /dev/null +++ b/server/src/main/java/org/opensearch/cluster/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Cluster level classes. */ +package org.opensearch.cluster; diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/allocator/package-info.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/allocator/package-info.java new file mode 100644 index 0000000000000..0481bbff1439c --- /dev/null +++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/allocator/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Foundation classes to ensure balanced shards. */ +package org.opensearch.cluster.routing.allocation.allocator; diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/command/package-info.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/command/package-info.java new file mode 100644 index 0000000000000..8489c49c78752 --- /dev/null +++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/command/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Allocation Command transport handlers. */ +package org.opensearch.cluster.routing.allocation.command; diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/package-info.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/package-info.java new file mode 100644 index 0000000000000..9429cb35c8adf --- /dev/null +++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/decider/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Foundation Classes to Decide how to allocate and balance shards */ +package org.opensearch.cluster.routing.allocation.decider; diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/package-info.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/package-info.java new file mode 100644 index 0000000000000..2f274f997f907 --- /dev/null +++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Shard Allocation Foundation Classes. */ +package org.opensearch.cluster.routing.allocation; diff --git a/server/src/main/java/org/opensearch/cluster/routing/package-info.java b/server/src/main/java/org/opensearch/cluster/routing/package-info.java new file mode 100644 index 0000000000000..91989d2bc9c80 --- /dev/null +++ b/server/src/main/java/org/opensearch/cluster/routing/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Cluster level shard routing and recovery classes. */ +package org.opensearch.cluster.routing; diff --git a/server/src/main/java/org/opensearch/cluster/service/package-info.java b/server/src/main/java/org/opensearch/cluster/service/package-info.java new file mode 100644 index 0000000000000..57ff5731355b1 --- /dev/null +++ b/server/src/main/java/org/opensearch/cluster/service/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Cluster Service foundation classes. */ +package org.opensearch.cluster.service; diff --git a/server/src/main/java/org/opensearch/common/blobstore/fs/package-info.java b/server/src/main/java/org/opensearch/common/blobstore/fs/package-info.java new file mode 100644 index 0000000000000..584d25f12738f --- /dev/null +++ b/server/src/main/java/org/opensearch/common/blobstore/fs/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base FileSystem Blobstore package. */ +package org.opensearch.common.blobstore.fs; diff --git a/server/src/main/java/org/opensearch/common/blobstore/package-info.java b/server/src/main/java/org/opensearch/common/blobstore/package-info.java new file mode 100644 index 0000000000000..bf7768b185084 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/blobstore/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Blob Store package. */ +package org.opensearch.common.blobstore; diff --git a/server/src/main/java/org/opensearch/common/blobstore/support/package-info.java b/server/src/main/java/org/opensearch/common/blobstore/support/package-info.java new file mode 100644 index 0000000000000..f93e9583a4c8b --- /dev/null +++ b/server/src/main/java/org/opensearch/common/blobstore/support/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Support classes package for BlobStore implementation. */ +package org.opensearch.common.blobstore.support; diff --git a/server/src/main/java/org/opensearch/common/breaker/package-info.java b/server/src/main/java/org/opensearch/common/breaker/package-info.java new file mode 100644 index 0000000000000..30c5d8d981697 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/breaker/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Common Circuit Breaker package. */ +package org.opensearch.common.breaker; diff --git a/server/src/main/java/org/opensearch/common/bytes/package-info.java b/server/src/main/java/org/opensearch/common/bytes/package-info.java new file mode 100644 index 0000000000000..96e3db1b7cd06 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/bytes/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base BytesRef package. */ +package org.opensearch.common.bytes; diff --git a/server/src/main/java/org/opensearch/common/cache/package-info.java b/server/src/main/java/org/opensearch/common/cache/package-info.java new file mode 100644 index 0000000000000..174f719b33d17 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/cache/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Cache package. */ +package org.opensearch.common.cache; diff --git a/server/src/main/java/org/opensearch/common/collect/package-info.java b/server/src/main/java/org/opensearch/common/collect/package-info.java new file mode 100644 index 0000000000000..6cd7b11582bb8 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/collect/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base collections package. */ +package org.opensearch.common.collect; diff --git a/server/src/main/java/org/opensearch/common/component/package-info.java b/server/src/main/java/org/opensearch/common/component/package-info.java new file mode 100644 index 0000000000000..34d034b5a3ffb --- /dev/null +++ b/server/src/main/java/org/opensearch/common/component/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Lifecycle Component package. */ +package org.opensearch.common.component; diff --git a/server/src/main/java/org/opensearch/common/compress/package-info.java b/server/src/main/java/org/opensearch/common/compress/package-info.java new file mode 100644 index 0000000000000..38fbba9076ca8 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/compress/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base compression package. */ +package org.opensearch.common.compress; diff --git a/server/src/main/java/org/opensearch/common/concurrent/package-info.java b/server/src/main/java/org/opensearch/common/concurrent/package-info.java new file mode 100644 index 0000000000000..886920af509ee --- /dev/null +++ b/server/src/main/java/org/opensearch/common/concurrent/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Concurrency package. */ +package org.opensearch.common.concurrent; diff --git a/server/src/main/java/org/opensearch/common/document/package-info.java b/server/src/main/java/org/opensearch/common/document/package-info.java new file mode 100644 index 0000000000000..8bd90082dfc17 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/document/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Document Level package. */ +package org.opensearch.common.document; diff --git a/server/src/main/java/org/opensearch/common/geo/builders/package-info.java b/server/src/main/java/org/opensearch/common/geo/builders/package-info.java new file mode 100644 index 0000000000000..bb4f9105835be --- /dev/null +++ b/server/src/main/java/org/opensearch/common/geo/builders/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Geo Builders package. */ +package org.opensearch.common.geo.builders; diff --git a/server/src/main/java/org/opensearch/common/geo/package-info.java b/server/src/main/java/org/opensearch/common/geo/package-info.java new file mode 100644 index 0000000000000..8debc310d9c72 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/geo/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Geo package. */ +package org.opensearch.common.geo; diff --git a/server/src/main/java/org/opensearch/common/geo/parsers/package-info.java b/server/src/main/java/org/opensearch/common/geo/parsers/package-info.java new file mode 100644 index 0000000000000..a465462d5d7de --- /dev/null +++ b/server/src/main/java/org/opensearch/common/geo/parsers/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Geo Parsers package. */ +package org.opensearch.common.geo.parsers; diff --git a/server/src/main/java/org/opensearch/common/hash/package-info.java b/server/src/main/java/org/opensearch/common/hash/package-info.java new file mode 100644 index 0000000000000..1babf570e7264 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/hash/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base hashing package. */ +package org.opensearch.common.hash; diff --git a/server/src/main/java/org/opensearch/common/io/package-info.java b/server/src/main/java/org/opensearch/common/io/package-info.java new file mode 100644 index 0000000000000..28e34bcead549 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/io/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base IO package. */ +package org.opensearch.common.io; diff --git a/server/src/main/java/org/opensearch/common/joda/package-info.java b/server/src/main/java/org/opensearch/common/joda/package-info.java new file mode 100644 index 0000000000000..55ed8d9592a6d --- /dev/null +++ b/server/src/main/java/org/opensearch/common/joda/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Joda Time package. */ +package org.opensearch.common.joda; diff --git a/server/src/main/java/org/opensearch/common/lease/package-info.java b/server/src/main/java/org/opensearch/common/lease/package-info.java new file mode 100644 index 0000000000000..f7097486a9c64 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/lease/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Releasables package. */ +package org.opensearch.common.lease; diff --git a/server/src/main/java/org/opensearch/common/logging/package-info.java b/server/src/main/java/org/opensearch/common/logging/package-info.java new file mode 100644 index 0000000000000..8440be23c5fee --- /dev/null +++ b/server/src/main/java/org/opensearch/common/logging/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base logger package. */ +package org.opensearch.common.logging; diff --git a/server/src/main/java/org/opensearch/common/lucene/index/package-info.java b/server/src/main/java/org/opensearch/common/lucene/index/package-info.java new file mode 100644 index 0000000000000..c605aec31752c --- /dev/null +++ b/server/src/main/java/org/opensearch/common/lucene/index/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** OpenSearch Lucene Index package. */ +package org.opensearch.common.lucene.index; diff --git a/server/src/main/java/org/opensearch/common/lucene/package-info.java b/server/src/main/java/org/opensearch/common/lucene/package-info.java new file mode 100644 index 0000000000000..845f99788cb83 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/lucene/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Common OpenSearch Lucene implementation package. */ +package org.opensearch.common.lucene; diff --git a/server/src/main/java/org/opensearch/common/lucene/search/function/package-info.java b/server/src/main/java/org/opensearch/common/lucene/search/function/package-info.java new file mode 100644 index 0000000000000..c24e917137415 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/lucene/search/function/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Lucene Function Scoring package. */ +package org.opensearch.common.lucene.search.function; diff --git a/server/src/main/java/org/opensearch/common/lucene/search/package-info.java b/server/src/main/java/org/opensearch/common/lucene/search/package-info.java new file mode 100644 index 0000000000000..e60b632a11d33 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/lucene/search/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base OpenSearch Specific Lucene Query package. */ +package org.opensearch.common.lucene.search; diff --git a/server/src/main/java/org/opensearch/common/lucene/store/package-info.java b/server/src/main/java/org/opensearch/common/lucene/store/package-info.java new file mode 100644 index 0000000000000..3d46f3be44b9b --- /dev/null +++ b/server/src/main/java/org/opensearch/common/lucene/store/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** OpenSearch specific lucene store package. */ +package org.opensearch.common.lucene.store; diff --git a/server/src/main/java/org/opensearch/common/lucene/uid/package-info.java b/server/src/main/java/org/opensearch/common/lucene/uid/package-info.java new file mode 100644 index 0000000000000..46d28f9c416e9 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/lucene/uid/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** OpenSearch specific lucene sequence numbers package. */ +package org.opensearch.common.lucene.uid; diff --git a/server/src/main/java/org/opensearch/common/metrics/package-info.java b/server/src/main/java/org/opensearch/common/metrics/package-info.java new file mode 100644 index 0000000000000..58d66e44ef07d --- /dev/null +++ b/server/src/main/java/org/opensearch/common/metrics/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base metrics package. */ +package org.opensearch.common.metrics; diff --git a/server/src/main/java/org/opensearch/common/network/package-info.java b/server/src/main/java/org/opensearch/common/network/package-info.java new file mode 100644 index 0000000000000..250423e4fb486 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/network/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base networking support classes package. */ +package org.opensearch.common.network; diff --git a/server/src/main/java/org/opensearch/common/package-info.java b/server/src/main/java/org/opensearch/common/package-info.java new file mode 100644 index 0000000000000..09e988590c22d --- /dev/null +++ b/server/src/main/java/org/opensearch/common/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base package for common classes used across the OpenSearch server codebase. */ +package org.opensearch.common; diff --git a/server/src/main/java/org/opensearch/common/path/package-info.java b/server/src/main/java/org/opensearch/common/path/package-info.java new file mode 100644 index 0000000000000..f171fd0ce8281 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/path/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Path utility package. */ +package org.opensearch.common.path; diff --git a/server/src/main/java/org/opensearch/common/recycler/package-info.java b/server/src/main/java/org/opensearch/common/recycler/package-info.java new file mode 100644 index 0000000000000..f59d4db545200 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/recycler/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Resource Recycler package. */ +package org.opensearch.common.recycler; diff --git a/server/src/main/java/org/opensearch/common/regex/package-info.java b/server/src/main/java/org/opensearch/common/regex/package-info.java new file mode 100644 index 0000000000000..30140269a2726 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/regex/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Regex utility package. */ +package org.opensearch.common.regex; diff --git a/server/src/main/java/org/opensearch/common/rounding/package-info.java b/server/src/main/java/org/opensearch/common/rounding/package-info.java new file mode 100644 index 0000000000000..5fa3e39c6a786 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/rounding/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base DateTime rounding package. */ +package org.opensearch.common.rounding; diff --git a/server/src/main/java/org/opensearch/common/text/package-info.java b/server/src/main/java/org/opensearch/common/text/package-info.java new file mode 100644 index 0000000000000..229d39aa4ff8d --- /dev/null +++ b/server/src/main/java/org/opensearch/common/text/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Text utility package. */ +package org.opensearch.common.text; diff --git a/server/src/main/java/org/opensearch/common/time/package-info.java b/server/src/main/java/org/opensearch/common/time/package-info.java new file mode 100644 index 0000000000000..8e946aa8a3b1b --- /dev/null +++ b/server/src/main/java/org/opensearch/common/time/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Time utility package. */ +package org.opensearch.common.time; diff --git a/server/src/main/java/org/opensearch/common/transport/package-info.java b/server/src/main/java/org/opensearch/common/transport/package-info.java new file mode 100644 index 0000000000000..abb8dfbb4e4f0 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/transport/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Transport utility package. */ +package org.opensearch.common.transport; diff --git a/server/src/main/java/org/opensearch/common/unit/package-info.java b/server/src/main/java/org/opensearch/common/unit/package-info.java new file mode 100644 index 0000000000000..5c5e1b17e55a6 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/unit/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Units of Measure utility package. */ +package org.opensearch.common.unit; diff --git a/server/src/main/java/org/opensearch/common/util/concurrent/package-info.java b/server/src/main/java/org/opensearch/common/util/concurrent/package-info.java new file mode 100644 index 0000000000000..7ccd4b6d8a6e8 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/util/concurrent/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base concurrency utilities package. */ +package org.opensearch.common.util.concurrent; diff --git a/server/src/main/java/org/opensearch/common/util/iterable/package-info.java b/server/src/main/java/org/opensearch/common/util/iterable/package-info.java new file mode 100644 index 0000000000000..5b3c307dd0ea5 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/util/iterable/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base iterables utility package. */ +package org.opensearch.common.util.iterable; diff --git a/server/src/main/java/org/opensearch/common/util/package-info.java b/server/src/main/java/org/opensearch/common/util/package-info.java new file mode 100644 index 0000000000000..234c075d68d73 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/util/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Utilitiy Classes package. */ +package org.opensearch.common.util; diff --git a/server/src/main/java/org/opensearch/common/util/set/package-info.java b/server/src/main/java/org/opensearch/common/util/set/package-info.java new file mode 100644 index 0000000000000..298e5f53ff215 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/util/set/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Set collection utility package. */ +package org.opensearch.common.util.set; diff --git a/server/src/main/java/org/opensearch/common/xcontent/package-info.java b/server/src/main/java/org/opensearch/common/xcontent/package-info.java new file mode 100644 index 0000000000000..5f820fe4d973f --- /dev/null +++ b/server/src/main/java/org/opensearch/common/xcontent/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base XContent parsing and building utiilty class package. */ +package org.opensearch.common.xcontent; diff --git a/server/src/main/java/org/opensearch/common/xcontent/support/package-info.java b/server/src/main/java/org/opensearch/common/xcontent/support/package-info.java new file mode 100644 index 0000000000000..021ccf0a07a98 --- /dev/null +++ b/server/src/main/java/org/opensearch/common/xcontent/support/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** XContent specific support classes package. */ +package org.opensearch.common.xcontent.support; diff --git a/server/src/main/java/org/opensearch/discovery/package-info.java b/server/src/main/java/org/opensearch/discovery/package-info.java new file mode 100644 index 0000000000000..052a7d3027f07 --- /dev/null +++ b/server/src/main/java/org/opensearch/discovery/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Node Discovery Module Foundation Classes. */ +package org.opensearch.discovery; diff --git a/server/src/main/java/org/opensearch/env/package-info.java b/server/src/main/java/org/opensearch/env/package-info.java new file mode 100644 index 0000000000000..8675321616eaa --- /dev/null +++ b/server/src/main/java/org/opensearch/env/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** OpenSearch Environment Foundation Classes. */ +package org.opensearch.env; diff --git a/server/src/main/java/org/opensearch/gateway/package-info.java b/server/src/main/java/org/opensearch/gateway/package-info.java new file mode 100644 index 0000000000000..e89db75e04023 --- /dev/null +++ b/server/src/main/java/org/opensearch/gateway/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Gateway Foundation Classes. */ +package org.opensearch.gateway; diff --git a/server/src/main/java/org/opensearch/http/package-info.java b/server/src/main/java/org/opensearch/http/package-info.java new file mode 100644 index 0000000000000..814c82450e5ad --- /dev/null +++ b/server/src/main/java/org/opensearch/http/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Core http module implementing http transport request and responses */ +package org.opensearch.http; diff --git a/server/src/main/java/org/opensearch/index/analysis/package-info.java b/server/src/main/java/org/opensearch/index/analysis/package-info.java new file mode 100644 index 0000000000000..28cd10ffae0ab --- /dev/null +++ b/server/src/main/java/org/opensearch/index/analysis/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Core classes responsible for handling all indexing analysis operations */ +package org.opensearch.index.analysis; diff --git a/server/src/main/java/org/opensearch/index/cache/bitset/package-info.java b/server/src/main/java/org/opensearch/index/cache/bitset/package-info.java new file mode 100644 index 0000000000000..cb15224dd7613 --- /dev/null +++ b/server/src/main/java/org/opensearch/index/cache/bitset/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Core classes responsible for handling all bitset operations for indexing cache */ +package org.opensearch.index.cache.bitset; diff --git a/server/src/main/java/org/opensearch/index/cache/package-info.java b/server/src/main/java/org/opensearch/index/cache/package-info.java new file mode 100644 index 0000000000000..6ea72a6e17f83 --- /dev/null +++ b/server/src/main/java/org/opensearch/index/cache/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Core classes responsible for handling all indexing cache operations */ +package org.opensearch.index.cache; diff --git a/server/src/main/java/org/opensearch/index/cache/query/package-info.java b/server/src/main/java/org/opensearch/index/cache/query/package-info.java new file mode 100644 index 0000000000000..4843b1fb5c29b --- /dev/null +++ b/server/src/main/java/org/opensearch/index/cache/query/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Core classes responsible for handling all query cache operations */ +package org.opensearch.index.cache.query; diff --git a/server/src/main/java/org/opensearch/index/cache/request/package-info.java b/server/src/main/java/org/opensearch/index/cache/request/package-info.java new file mode 100644 index 0000000000000..d88c79d17b9fd --- /dev/null +++ b/server/src/main/java/org/opensearch/index/cache/request/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Core transport classes responsible for handling all indexing cache requests */ +package org.opensearch.index.cache.request; diff --git a/server/src/main/java/org/opensearch/index/codec/package-info.java b/server/src/main/java/org/opensearch/index/codec/package-info.java new file mode 100644 index 0000000000000..2f96ecea4f434 --- /dev/null +++ b/server/src/main/java/org/opensearch/index/codec/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Core classes responsible for handling all codec service and operations */ +package org.opensearch.index.codec; diff --git a/server/src/main/java/org/opensearch/index/engine/package-info.java b/server/src/main/java/org/opensearch/index/engine/package-info.java new file mode 100644 index 0000000000000..283ef24f04d50 --- /dev/null +++ b/server/src/main/java/org/opensearch/index/engine/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Core classes responsible for handling all indexing engine operations */ +package org.opensearch.index.engine; diff --git a/server/src/main/java/org/opensearch/index/fielddata/fieldcomparator/package-info.java b/server/src/main/java/org/opensearch/index/fielddata/fieldcomparator/package-info.java new file mode 100644 index 0000000000000..7735d4e8088dd --- /dev/null +++ b/server/src/main/java/org/opensearch/index/fielddata/fieldcomparator/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Core classes responsible for handling all indexing field comparator operations */ +package org.opensearch.index.fielddata.fieldcomparator; diff --git a/server/src/main/java/org/opensearch/index/fielddata/ordinals/package-info.java b/server/src/main/java/org/opensearch/index/fielddata/ordinals/package-info.java new file mode 100644 index 0000000000000..275bd283cf90f --- /dev/null +++ b/server/src/main/java/org/opensearch/index/fielddata/ordinals/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Core classes responsible for handling all field ordinals operations */ +package org.opensearch.index.fielddata.ordinals; diff --git a/server/src/main/java/org/opensearch/index/fielddata/package-info.java b/server/src/main/java/org/opensearch/index/fielddata/package-info.java new file mode 100644 index 0000000000000..6892a82fdbfaa --- /dev/null +++ b/server/src/main/java/org/opensearch/index/fielddata/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Core classes responsible for handling all field data logic */ +package org.opensearch.index.fielddata; diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/package-info.java b/server/src/main/java/org/opensearch/index/fielddata/plain/package-info.java new file mode 100644 index 0000000000000..f719dfb72f842 --- /dev/null +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Core classes responsible for handling all core field data operations */ +package org.opensearch.index.fielddata.plain; diff --git a/server/src/main/java/org/opensearch/index/fieldvisitor/package-info.java b/server/src/main/java/org/opensearch/index/fieldvisitor/package-info.java new file mode 100644 index 0000000000000..d6ab3f388c16a --- /dev/null +++ b/server/src/main/java/org/opensearch/index/fieldvisitor/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** FieldVisitor classes for retrieving field values from lucene */ +package org.opensearch.index.fieldvisitor; diff --git a/server/src/main/java/org/opensearch/index/flush/package-info.java b/server/src/main/java/org/opensearch/index/flush/package-info.java new file mode 100644 index 0000000000000..c048eace8b798 --- /dev/null +++ b/server/src/main/java/org/opensearch/index/flush/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Core classes responsible for handling all indexing flush statistics */ +package org.opensearch.index.flush; diff --git a/server/src/main/java/org/opensearch/index/get/package-info.java b/server/src/main/java/org/opensearch/index/get/package-info.java new file mode 100644 index 0000000000000..7a2f40441c1b5 --- /dev/null +++ b/server/src/main/java/org/opensearch/index/get/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Package containing support Classes for Getting data from an Index */ +package org.opensearch.index.get; diff --git a/server/src/main/java/org/opensearch/index/mapper/package-info.java b/server/src/main/java/org/opensearch/index/mapper/package-info.java new file mode 100644 index 0000000000000..431f5b0f4debb --- /dev/null +++ b/server/src/main/java/org/opensearch/index/mapper/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Package containing OpenSearch Field Mappers */ +package org.opensearch.index.mapper; diff --git a/server/src/main/java/org/opensearch/index/merge/package-info.java b/server/src/main/java/org/opensearch/index/merge/package-info.java new file mode 100644 index 0000000000000..b184c9e5443bd --- /dev/null +++ b/server/src/main/java/org/opensearch/index/merge/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Core classes responsible for handling all merge stats requests */ +package org.opensearch.index.merge; diff --git a/server/src/main/java/org/opensearch/index/package-info.java b/server/src/main/java/org/opensearch/index/package-info.java new file mode 100644 index 0000000000000..0f7d564e76ee5 --- /dev/null +++ b/server/src/main/java/org/opensearch/index/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Core classes responsible for handling all indexing operations in OpenSearch */ +package org.opensearch.index; diff --git a/server/src/main/java/org/opensearch/index/query/functionscore/package-info.java b/server/src/main/java/org/opensearch/index/query/functionscore/package-info.java new file mode 100644 index 0000000000000..e590fd4a605d0 --- /dev/null +++ b/server/src/main/java/org/opensearch/index/query/functionscore/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Foundation classes for implementing Function Scoring */ +package org.opensearch.index.query.functionscore; diff --git a/server/src/main/java/org/opensearch/index/query/package-info.java b/server/src/main/java/org/opensearch/index/query/package-info.java new file mode 100644 index 0000000000000..fe9ea6e4ba1b6 --- /dev/null +++ b/server/src/main/java/org/opensearch/index/query/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Query implementations */ +package org.opensearch.index.query; diff --git a/server/src/main/java/org/opensearch/index/query/support/package-info.java b/server/src/main/java/org/opensearch/index/query/support/package-info.java new file mode 100644 index 0000000000000..f14412c0fde3c --- /dev/null +++ b/server/src/main/java/org/opensearch/index/query/support/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Support classes for OpenSearch Queries - todo remove this package? */ +package org.opensearch.index.query.support; diff --git a/server/src/main/java/org/opensearch/index/recovery/package-info.java b/server/src/main/java/org/opensearch/index/recovery/package-info.java new file mode 100644 index 0000000000000..44f4291157718 --- /dev/null +++ b/server/src/main/java/org/opensearch/index/recovery/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Recovery stats implementation */ +package org.opensearch.index.recovery; diff --git a/server/src/main/java/org/opensearch/index/refresh/package-info.java b/server/src/main/java/org/opensearch/index/refresh/package-info.java new file mode 100644 index 0000000000000..fdd0f5658504f --- /dev/null +++ b/server/src/main/java/org/opensearch/index/refresh/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Refresh stats implementation */ +package org.opensearch.index.refresh; diff --git a/server/src/main/java/org/opensearch/index/reindex/package-info.java b/server/src/main/java/org/opensearch/index/reindex/package-info.java new file mode 100644 index 0000000000000..b3374e4b1853d --- /dev/null +++ b/server/src/main/java/org/opensearch/index/reindex/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Reindex implementation */ +package org.opensearch.index.reindex; diff --git a/server/src/main/java/org/opensearch/index/search/package-info.java b/server/src/main/java/org/opensearch/index/search/package-info.java new file mode 100644 index 0000000000000..a421f5372264f --- /dev/null +++ b/server/src/main/java/org/opensearch/index/search/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Utility classes for building OpenSearch queries */ +package org.opensearch.index.search; diff --git a/server/src/main/java/org/opensearch/index/search/stats/package-info.java b/server/src/main/java/org/opensearch/index/search/stats/package-info.java new file mode 100644 index 0000000000000..9b664d5619ce0 --- /dev/null +++ b/server/src/main/java/org/opensearch/index/search/stats/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Classes for obtaining search statistics */ +package org.opensearch.index.search.stats; diff --git a/server/src/main/java/org/opensearch/index/seqno/package-info.java b/server/src/main/java/org/opensearch/index/seqno/package-info.java new file mode 100644 index 0000000000000..495cde64a67ae --- /dev/null +++ b/server/src/main/java/org/opensearch/index/seqno/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Sequence number and retention lease implementation */ +package org.opensearch.index.seqno; diff --git a/server/src/main/java/org/opensearch/index/shard/package-info.java b/server/src/main/java/org/opensearch/index/shard/package-info.java new file mode 100644 index 0000000000000..4b36049f27a55 --- /dev/null +++ b/server/src/main/java/org/opensearch/index/shard/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Package containing classes to implement an Index Shard */ +package org.opensearch.index.shard; diff --git a/server/src/main/java/org/opensearch/index/similarity/package-info.java b/server/src/main/java/org/opensearch/index/similarity/package-info.java new file mode 100644 index 0000000000000..384dcf63f0298 --- /dev/null +++ b/server/src/main/java/org/opensearch/index/similarity/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Package containing the OpenSearch SimilarityService and Providers */ +package org.opensearch.index.similarity; diff --git a/server/src/main/java/org/opensearch/index/snapshots/blobstore/package-info.java b/server/src/main/java/org/opensearch/index/snapshots/blobstore/package-info.java new file mode 100644 index 0000000000000..0d1eb6f5942ea --- /dev/null +++ b/server/src/main/java/org/opensearch/index/snapshots/blobstore/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Classes implementing blob store for snapshot / restore */ +package org.opensearch.index.snapshots.blobstore; diff --git a/server/src/main/java/org/opensearch/index/snapshots/package-info.java b/server/src/main/java/org/opensearch/index/snapshots/package-info.java new file mode 100644 index 0000000000000..7cebfe5152d48 --- /dev/null +++ b/server/src/main/java/org/opensearch/index/snapshots/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Foundation classes for snapshot / restore */ +package org.opensearch.index.snapshots; diff --git a/server/src/main/java/org/opensearch/index/stats/package-info.java b/server/src/main/java/org/opensearch/index/stats/package-info.java new file mode 100644 index 0000000000000..f431a013b82b1 --- /dev/null +++ b/server/src/main/java/org/opensearch/index/stats/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Classes responsible for handing ShardIndexingPressure statistics */ +package org.opensearch.index.stats; diff --git a/server/src/main/java/org/opensearch/index/store/package-info.java b/server/src/main/java/org/opensearch/index/store/package-info.java new file mode 100644 index 0000000000000..cec95f35dba06 --- /dev/null +++ b/server/src/main/java/org/opensearch/index/store/package-info.java @@ -0,0 +1,13 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** + * Package containing classes to access files written by an index shard. + * see {@link org.opensearch.index.store.Store} for details + */ +package org.opensearch.index.store; diff --git a/server/src/main/java/org/opensearch/index/termvectors/package-info.java b/server/src/main/java/org/opensearch/index/termvectors/package-info.java new file mode 100644 index 0000000000000..9c5ab1da547f6 --- /dev/null +++ b/server/src/main/java/org/opensearch/index/termvectors/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** TermVectorsService package */ +package org.opensearch.index.termvectors; diff --git a/server/src/main/java/org/opensearch/index/translog/package-info.java b/server/src/main/java/org/opensearch/index/translog/package-info.java new file mode 100644 index 0000000000000..ba824031420ed --- /dev/null +++ b/server/src/main/java/org/opensearch/index/translog/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Core classes responsible for handling all translog operations */ +package org.opensearch.index.translog; diff --git a/server/src/main/java/org/opensearch/index/warmer/package-info.java b/server/src/main/java/org/opensearch/index/warmer/package-info.java new file mode 100644 index 0000000000000..b3635b6ea286a --- /dev/null +++ b/server/src/main/java/org/opensearch/index/warmer/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Core classes responsible for handling all indexing warming operations */ +package org.opensearch.index.warmer; diff --git a/server/src/main/java/org/opensearch/indices/analysis/package-info.java b/server/src/main/java/org/opensearch/indices/analysis/package-info.java new file mode 100644 index 0000000000000..3f4103298b04e --- /dev/null +++ b/server/src/main/java/org/opensearch/indices/analysis/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Analysis Module package. */ +package org.opensearch.indices.analysis; diff --git a/server/src/main/java/org/opensearch/indices/breaker/package-info.java b/server/src/main/java/org/opensearch/indices/breaker/package-info.java new file mode 100644 index 0000000000000..9e455c0a54c15 --- /dev/null +++ b/server/src/main/java/org/opensearch/indices/breaker/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** CircuitBreaker Service package. */ +package org.opensearch.indices.breaker; diff --git a/server/src/main/java/org/opensearch/indices/cluster/package-info.java b/server/src/main/java/org/opensearch/indices/cluster/package-info.java new file mode 100644 index 0000000000000..9d42103a9af41 --- /dev/null +++ b/server/src/main/java/org/opensearch/indices/cluster/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Indices ClusterState Service package. */ +package org.opensearch.indices.cluster; diff --git a/server/src/main/java/org/opensearch/indices/fielddata/cache/package-info.java b/server/src/main/java/org/opensearch/indices/fielddata/cache/package-info.java new file mode 100644 index 0000000000000..fc52c884edeb7 --- /dev/null +++ b/server/src/main/java/org/opensearch/indices/fielddata/cache/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** FieldData Cache package. */ +package org.opensearch.indices.fielddata.cache; diff --git a/server/src/main/java/org/opensearch/indices/fielddata/package-info.java b/server/src/main/java/org/opensearch/indices/fielddata/package-info.java new file mode 100644 index 0000000000000..465badca28de7 --- /dev/null +++ b/server/src/main/java/org/opensearch/indices/fielddata/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Indices FieldData package. */ +package org.opensearch.indices.fielddata; diff --git a/server/src/main/java/org/opensearch/indices/mapper/package-info.java b/server/src/main/java/org/opensearch/indices/mapper/package-info.java new file mode 100644 index 0000000000000..85c2927ae4c03 --- /dev/null +++ b/server/src/main/java/org/opensearch/indices/mapper/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Field Mapper Registry package. */ +package org.opensearch.indices.mapper; diff --git a/server/src/main/java/org/opensearch/indices/package-info.java b/server/src/main/java/org/opensearch/indices/package-info.java new file mode 100644 index 0000000000000..0f2ea1e1a9848 --- /dev/null +++ b/server/src/main/java/org/opensearch/indices/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Indices Module package. */ +package org.opensearch.indices; diff --git a/server/src/main/java/org/opensearch/indices/recovery/package-info.java b/server/src/main/java/org/opensearch/indices/recovery/package-info.java new file mode 100644 index 0000000000000..3c850b2a84122 --- /dev/null +++ b/server/src/main/java/org/opensearch/indices/recovery/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Peer Recovery Package. */ +package org.opensearch.indices.recovery; diff --git a/server/src/main/java/org/opensearch/indices/replication/common/package-info.java b/server/src/main/java/org/opensearch/indices/replication/common/package-info.java new file mode 100644 index 0000000000000..77a8422f83829 --- /dev/null +++ b/server/src/main/java/org/opensearch/indices/replication/common/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Foundation classes for Replication Implementation. */ +package org.opensearch.indices.replication.common; diff --git a/server/src/main/java/org/opensearch/indices/replication/package-info.java b/server/src/main/java/org/opensearch/indices/replication/package-info.java new file mode 100644 index 0000000000000..270f8b820f7b3 --- /dev/null +++ b/server/src/main/java/org/opensearch/indices/replication/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Document vs Segment Replication classes. */ +package org.opensearch.indices.replication; diff --git a/server/src/main/java/org/opensearch/indices/store/package-info.java b/server/src/main/java/org/opensearch/indices/store/package-info.java new file mode 100644 index 0000000000000..47b19d6d40141 --- /dev/null +++ b/server/src/main/java/org/opensearch/indices/store/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base package for index store. */ +package org.opensearch.indices.store; diff --git a/server/src/main/java/org/opensearch/ingest/package-info.java b/server/src/main/java/org/opensearch/ingest/package-info.java new file mode 100644 index 0000000000000..513d288495520 --- /dev/null +++ b/server/src/main/java/org/opensearch/ingest/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Ingest Processor base package. */ +package org.opensearch.ingest; diff --git a/server/src/main/java/org/opensearch/lucene/package-info.java b/server/src/main/java/org/opensearch/lucene/package-info.java new file mode 100644 index 0000000000000..b56e64b670cbd --- /dev/null +++ b/server/src/main/java/org/opensearch/lucene/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Package for OpenSearch Lucene Extensions. */ +package org.opensearch.lucene; diff --git a/server/src/main/java/org/opensearch/lucene/queries/package-info.java b/server/src/main/java/org/opensearch/lucene/queries/package-info.java new file mode 100644 index 0000000000000..4fee9a059b80b --- /dev/null +++ b/server/src/main/java/org/opensearch/lucene/queries/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** OpenSearch specific lucene query implementations. */ +package org.opensearch.lucene.queries; diff --git a/server/src/main/java/org/opensearch/monitor/fs/package-info.java b/server/src/main/java/org/opensearch/monitor/fs/package-info.java new file mode 100644 index 0000000000000..bfd99560f8eb6 --- /dev/null +++ b/server/src/main/java/org/opensearch/monitor/fs/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** FileSystem monitoring package. For _cat APIs. */ +package org.opensearch.monitor.fs; diff --git a/server/src/main/java/org/opensearch/monitor/jvm/package-info.java b/server/src/main/java/org/opensearch/monitor/jvm/package-info.java new file mode 100644 index 0000000000000..bff07e3886af2 --- /dev/null +++ b/server/src/main/java/org/opensearch/monitor/jvm/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** JVM Monitoring base package. For _cat APIs. */ +package org.opensearch.monitor.jvm; diff --git a/server/src/main/java/org/opensearch/monitor/os/package-info.java b/server/src/main/java/org/opensearch/monitor/os/package-info.java new file mode 100644 index 0000000000000..73a912ead3fd5 --- /dev/null +++ b/server/src/main/java/org/opensearch/monitor/os/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** OperatingSystem monitoring base package. For _cat APIs. */ +package org.opensearch.monitor.os; diff --git a/server/src/main/java/org/opensearch/monitor/process/package-info.java b/server/src/main/java/org/opensearch/monitor/process/package-info.java new file mode 100644 index 0000000000000..c99241bf534ba --- /dev/null +++ b/server/src/main/java/org/opensearch/monitor/process/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Process monitoring base package. For _cat APIs. */ +package org.opensearch.monitor.process; diff --git a/server/src/main/java/org/opensearch/persistent/decider/package-info.java b/server/src/main/java/org/opensearch/persistent/decider/package-info.java new file mode 100644 index 0000000000000..83f96dc23db19 --- /dev/null +++ b/server/src/main/java/org/opensearch/persistent/decider/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Persistant Task Decider package. */ +package org.opensearch.persistent.decider; diff --git a/server/src/main/java/org/opensearch/repositories/fs/package-info.java b/server/src/main/java/org/opensearch/repositories/fs/package-info.java new file mode 100644 index 0000000000000..2f3f9aedad933 --- /dev/null +++ b/server/src/main/java/org/opensearch/repositories/fs/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** FileSystem snapshot repository store package. */ +package org.opensearch.repositories.fs; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/package-info.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/package-info.java new file mode 100644 index 0000000000000..93eed08c5dd2d --- /dev/null +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Adjacency Aggregation package. */ +package org.opensearch.search.aggregations.bucket.adjacency; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/package-info.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/package-info.java new file mode 100644 index 0000000000000..33a87b342d74d --- /dev/null +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Composite Aggregation package. */ +package org.opensearch.search.aggregations.bucket.composite; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/package-info.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/package-info.java new file mode 100644 index 0000000000000..112f2f3221858 --- /dev/null +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** filter Aggregation package. */ +package org.opensearch.search.aggregations.bucket.filter; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/package-info.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/package-info.java new file mode 100644 index 0000000000000..c59685e06cf79 --- /dev/null +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** geo_grid Aggregation package. */ +package org.opensearch.search.aggregations.bucket.geogrid; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/global/package-info.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/global/package-info.java new file mode 100644 index 0000000000000..b278c91af36ea --- /dev/null +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/global/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Global Aggregation package. */ +package org.opensearch.search.aggregations.bucket.global; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/package-info.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/package-info.java new file mode 100644 index 0000000000000..9e10d8fe090d7 --- /dev/null +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Missing Aggregation package. */ +package org.opensearch.search.aggregations.bucket.missing; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/package-info.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/package-info.java new file mode 100644 index 0000000000000..1eceaa248afb6 --- /dev/null +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Nested Aggregation package. */ +package org.opensearch.search.aggregations.bucket.nested; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/package-info b/server/src/main/java/org/opensearch/search/aggregations/bucket/package-info.java similarity index 100% rename from server/src/main/java/org/opensearch/search/aggregations/bucket/package-info rename to server/src/main/java/org/opensearch/search/aggregations/bucket/package-info.java diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/package-info.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/package-info.java new file mode 100644 index 0000000000000..5567c241abcae --- /dev/null +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Range Aggregation package. */ +package org.opensearch.search.aggregations.bucket.range; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/package-info.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/package-info.java new file mode 100644 index 0000000000000..8a4cc512da13a --- /dev/null +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Sampler Aggregation package. */ +package org.opensearch.search.aggregations.bucket.sampler; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/package-info.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/package-info.java new file mode 100644 index 0000000000000..2a9d4fe5de436 --- /dev/null +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Heuristic package for the Terms Aggregations. */ +package org.opensearch.search.aggregations.bucket.terms.heuristic; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/package-info.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/package-info.java new file mode 100644 index 0000000000000..808b7d065b01f --- /dev/null +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Terms Aggregation package. */ +package org.opensearch.search.aggregations.bucket.terms; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/package-info.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/package-info.java new file mode 100644 index 0000000000000..87172ec5f4ca6 --- /dev/null +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Pipeline Aggregation package. */ +package org.opensearch.search.aggregations.pipeline; diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/package-info.java b/server/src/main/java/org/opensearch/search/aggregations/support/package-info.java index b31c2e1d7b5c4..e16e8c91b3fd0 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/package-info.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/package-info.java @@ -30,8 +30,6 @@ * GitHub history for details. */ -package org.opensearch.search.aggregations.support; - /** *

* This package holds shared code for the aggregations framework, especially around dealing with values. @@ -88,3 +86,4 @@ *

* */ +package org.opensearch.search.aggregations.support; diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/values/package-info.java b/server/src/main/java/org/opensearch/search/aggregations/support/values/package-info.java new file mode 100644 index 0000000000000..d39782586fc1a --- /dev/null +++ b/server/src/main/java/org/opensearch/search/aggregations/support/values/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Values Source for Aggregations package. */ +package org.opensearch.search.aggregations.support.values; diff --git a/server/src/main/java/org/opensearch/search/builder/package-info.java b/server/src/main/java/org/opensearch/search/builder/package-info.java new file mode 100644 index 0000000000000..7de5bce1f7c14 --- /dev/null +++ b/server/src/main/java/org/opensearch/search/builder/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Search builders package. */ +package org.opensearch.search.builder; diff --git a/server/src/main/java/org/opensearch/search/collapse/package-info.java b/server/src/main/java/org/opensearch/search/collapse/package-info.java new file mode 100644 index 0000000000000..2a3c6e3a4f507 --- /dev/null +++ b/server/src/main/java/org/opensearch/search/collapse/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Collapse package. */ +package org.opensearch.search.collapse; diff --git a/server/src/main/java/org/opensearch/search/dfs/package-info.java b/server/src/main/java/org/opensearch/search/dfs/package-info.java new file mode 100644 index 0000000000000..1469d4d0e9dc4 --- /dev/null +++ b/server/src/main/java/org/opensearch/search/dfs/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base DFS search package. */ +package org.opensearch.search.dfs; diff --git a/server/src/main/java/org/opensearch/search/internal/package-info.java b/server/src/main/java/org/opensearch/search/internal/package-info.java new file mode 100644 index 0000000000000..fb49927753d9c --- /dev/null +++ b/server/src/main/java/org/opensearch/search/internal/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Search Internals package. */ +package org.opensearch.search.internal; diff --git a/server/src/main/java/org/opensearch/search/lookup/package-info.java b/server/src/main/java/org/opensearch/search/lookup/package-info.java new file mode 100644 index 0000000000000..c50520ac84b62 --- /dev/null +++ b/server/src/main/java/org/opensearch/search/lookup/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Lookup package for Fields, Docs, Source, and Leaves. */ +package org.opensearch.search.lookup; diff --git a/server/src/main/java/org/opensearch/search/package-info.java b/server/src/main/java/org/opensearch/search/package-info.java new file mode 100644 index 0000000000000..ee35b70defbb2 --- /dev/null +++ b/server/src/main/java/org/opensearch/search/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Search package. */ +package org.opensearch.search; diff --git a/server/src/main/java/org/opensearch/search/query/package-info.java b/server/src/main/java/org/opensearch/search/query/package-info.java new file mode 100644 index 0000000000000..f0d4b039fe192 --- /dev/null +++ b/server/src/main/java/org/opensearch/search/query/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Query Listeners package. */ +package org.opensearch.search.query; diff --git a/server/src/main/java/org/opensearch/search/rescore/package-info.java b/server/src/main/java/org/opensearch/search/rescore/package-info.java new file mode 100644 index 0000000000000..623f8ece8d24a --- /dev/null +++ b/server/src/main/java/org/opensearch/search/rescore/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Query rescorer package. */ +package org.opensearch.search.rescore; diff --git a/server/src/main/java/org/opensearch/search/searchafter/package-info.java b/server/src/main/java/org/opensearch/search/searchafter/package-info.java new file mode 100644 index 0000000000000..a4f14a3e6cc23 --- /dev/null +++ b/server/src/main/java/org/opensearch/search/searchafter/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base search after package. */ +package org.opensearch.search.searchafter; diff --git a/server/src/main/java/org/opensearch/search/slice/package-info.java b/server/src/main/java/org/opensearch/search/slice/package-info.java new file mode 100644 index 0000000000000..b24c5ff7416a6 --- /dev/null +++ b/server/src/main/java/org/opensearch/search/slice/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base slice query package. */ +package org.opensearch.search.slice; diff --git a/server/src/main/java/org/opensearch/search/sort/package-info.java b/server/src/main/java/org/opensearch/search/sort/package-info.java new file mode 100644 index 0000000000000..2c83ef57a3a60 --- /dev/null +++ b/server/src/main/java/org/opensearch/search/sort/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base sorting package. */ +package org.opensearch.search.sort; diff --git a/server/src/main/java/org/opensearch/threadpool/package-info.java b/server/src/main/java/org/opensearch/threadpool/package-info.java new file mode 100644 index 0000000000000..f1afdb705d6dd --- /dev/null +++ b/server/src/main/java/org/opensearch/threadpool/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base OpenSearch ThreadPool package. */ +package org.opensearch.threadpool; diff --git a/server/src/main/java/org/opensearch/transport/package-info.java b/server/src/main/java/org/opensearch/transport/package-info.java new file mode 100644 index 0000000000000..d7005c3e221aa --- /dev/null +++ b/server/src/main/java/org/opensearch/transport/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** All Transport Classes needed for wire communication in OpenSearch */ +package org.opensearch.transport; diff --git a/server/src/main/java/org/opensearch/usage/package-info.java b/server/src/main/java/org/opensearch/usage/package-info.java new file mode 100644 index 0000000000000..708bd8af33b39 --- /dev/null +++ b/server/src/main/java/org/opensearch/usage/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base Usage Service package for tracking OpenSearch telemetry. */ +package org.opensearch.usage; diff --git a/server/src/main/java/org/opensearch/watcher/package-info.java b/server/src/main/java/org/opensearch/watcher/package-info.java new file mode 100644 index 0000000000000..e10cd0fcb90dd --- /dev/null +++ b/server/src/main/java/org/opensearch/watcher/package-info.java @@ -0,0 +1,10 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +/** Base File / Directory Watcher package. */ +package org.opensearch.watcher; From 97a6f2c2f58d6270c94e376b4716445cf98619e2 Mon Sep 17 00:00:00 2001 From: Tianli Feng Date: Tue, 3 May 2022 07:23:32 -0700 Subject: [PATCH 112/514] Deprecated reserved node id '_must_join_elected_master_' that used by DetachClusterCommand and replace with '_must_join_elected_cluster_manager_' (#3138) Signed-off-by: Tianli Feng --- .../ClusterFormationFailureHelper.java | 3 +- .../coordination/CoordinationMetadata.java | 7 ++++ .../coordination/DetachClusterCommand.java | 4 +-- .../ClusterFormationFailureHelperTests.java | 33 ++++++++++++++++++- .../CoordinationStateTestCluster.java | 2 +- 5 files changed, 44 insertions(+), 5 deletions(-) diff --git a/server/src/main/java/org/opensearch/cluster/coordination/ClusterFormationFailureHelper.java b/server/src/main/java/org/opensearch/cluster/coordination/ClusterFormationFailureHelper.java index 0f419aa7a0937..80fc90f126860 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/ClusterFormationFailureHelper.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/ClusterFormationFailureHelper.java @@ -218,7 +218,8 @@ String getDescription() { assert clusterState.getLastCommittedConfiguration().isEmpty() == false; - if (clusterState.getLastCommittedConfiguration().equals(VotingConfiguration.MUST_JOIN_ELECTED_MASTER)) { + if (clusterState.getLastCommittedConfiguration().equals(VotingConfiguration.MUST_JOIN_ELECTED_MASTER) + || clusterState.getLastCommittedConfiguration().equals(VotingConfiguration.MUST_JOIN_ELECTED_CLUSTER_MANAGER)) { return String.format( Locale.ROOT, "cluster-manager not discovered yet and this node was detached from its previous cluster, have discovered %s; %s", diff --git a/server/src/main/java/org/opensearch/cluster/coordination/CoordinationMetadata.java b/server/src/main/java/org/opensearch/cluster/coordination/CoordinationMetadata.java index c7671cb9e9b2b..6efd5475ccb97 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/CoordinationMetadata.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/CoordinationMetadata.java @@ -350,9 +350,16 @@ public String toString() { public static class VotingConfiguration implements Writeable, ToXContentFragment { public static final VotingConfiguration EMPTY_CONFIG = new VotingConfiguration(Collections.emptySet()); + /** + * @deprecated As of 2.0, because supporting inclusive language, replaced by {@link #MUST_JOIN_ELECTED_CLUSTER_MANAGER} + */ + @Deprecated public static final VotingConfiguration MUST_JOIN_ELECTED_MASTER = new VotingConfiguration( Collections.singleton("_must_join_elected_master_") ); + public static final VotingConfiguration MUST_JOIN_ELECTED_CLUSTER_MANAGER = new VotingConfiguration( + Collections.singleton("_must_join_elected_cluster_manager_") + ); private final Set nodeIds; diff --git a/server/src/main/java/org/opensearch/cluster/coordination/DetachClusterCommand.java b/server/src/main/java/org/opensearch/cluster/coordination/DetachClusterCommand.java index efa5a5ee600ab..afc8a68a74e9c 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/DetachClusterCommand.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/DetachClusterCommand.java @@ -86,8 +86,8 @@ protected void processNodePaths(Terminal terminal, Path[] dataPaths, int nodeLoc // package-private for tests static Metadata updateMetadata(Metadata oldMetadata) { final CoordinationMetadata coordinationMetadata = CoordinationMetadata.builder() - .lastAcceptedConfiguration(CoordinationMetadata.VotingConfiguration.MUST_JOIN_ELECTED_MASTER) - .lastCommittedConfiguration(CoordinationMetadata.VotingConfiguration.MUST_JOIN_ELECTED_MASTER) + .lastAcceptedConfiguration(CoordinationMetadata.VotingConfiguration.MUST_JOIN_ELECTED_CLUSTER_MANAGER) + .lastCommittedConfiguration(CoordinationMetadata.VotingConfiguration.MUST_JOIN_ELECTED_CLUSTER_MANAGER) .term(0) .build(); return Metadata.builder(oldMetadata).coordinationMetadata(coordinationMetadata).clusterUUIDCommitted(false).build(); diff --git a/server/src/test/java/org/opensearch/cluster/coordination/ClusterFormationFailureHelperTests.java b/server/src/test/java/org/opensearch/cluster/coordination/ClusterFormationFailureHelperTests.java index 391d7b0e56332..b9a4064f2288b 100644 --- a/server/src/test/java/org/opensearch/cluster/coordination/ClusterFormationFailureHelperTests.java +++ b/server/src/test/java/org/opensearch/cluster/coordination/ClusterFormationFailureHelperTests.java @@ -428,7 +428,7 @@ public void testDescriptionAfterDetachCluster() { final ClusterState clusterState = state( localNode, - VotingConfiguration.MUST_JOIN_ELECTED_MASTER.getNodeIds().toArray(new String[0]) + VotingConfiguration.MUST_JOIN_ELECTED_CLUSTER_MANAGER.getNodeIds().toArray(new String[0]) ); assertThat( @@ -899,4 +899,35 @@ public void testDescriptionAfterBootstrapping() { ); } + + /* + * Validate the Cluster State with deprecated VotingConfiguration.MUST_JOIN_ELECTED_MASTER can get correct ClusterFormationState description. + */ + public void testDescriptionAfterDetachClusterWithDeprecatedMasterVotingConfiguration() { + final DiscoveryNode localNode = new DiscoveryNode("local", buildNewFakeTransportAddress(), Version.CURRENT); + + final ClusterState clusterState = state( + localNode, + VotingConfiguration.MUST_JOIN_ELECTED_MASTER.getNodeIds().toArray(new String[0]) + ); + + assertThat( + new ClusterFormationState( + Settings.EMPTY, + clusterState, + emptyList(), + emptyList(), + 0L, + electionStrategy, + new StatusInfo(HEALTHY, "healthy-info") + ).getDescription(), + is( + "cluster-manager not discovered yet and this node was detached from its previous cluster, " + + "have discovered []; " + + "discovery will continue using [] from hosts providers and [" + + localNode + + "] from last-known cluster state; node term 0, last-accepted version 0 in term 0" + ) + ); + } } diff --git a/test/framework/src/main/java/org/opensearch/cluster/coordination/CoordinationStateTestCluster.java b/test/framework/src/main/java/org/opensearch/cluster/coordination/CoordinationStateTestCluster.java index 291eee501c4df..471b9043281e9 100644 --- a/test/framework/src/main/java/org/opensearch/cluster/coordination/CoordinationStateTestCluster.java +++ b/test/framework/src/main/java/org/opensearch/cluster/coordination/CoordinationStateTestCluster.java @@ -155,7 +155,7 @@ void reboot() { .getLastAcceptedConfiguration() .isEmpty() ? CoordinationMetadata.VotingConfiguration.EMPTY_CONFIG - : CoordinationMetadata.VotingConfiguration.MUST_JOIN_ELECTED_MASTER; + : CoordinationMetadata.VotingConfiguration.MUST_JOIN_ELECTED_CLUSTER_MANAGER; persistedState = new InMemoryPersistedState( 0L, clusterState(0L, 0L, localNode, votingConfiguration, votingConfiguration, 0L) From a7032a0efe7f943c254adfa6888652974ec10aff Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 3 May 2022 11:26:17 -0400 Subject: [PATCH 113/514] Rename ClusterBlock description 'no master' to 'no cluster-manager' (#3133) (#3151) * Rename ClusterBlock description 'no master' to 'no cluster-manager' Signed-off-by: Tianli Feng * Adjust format by spotlessApply task Signed-off-by: Tianli Feng (cherry picked from commit bb870f70c8fdafbe4c01e44c34698d37a508b537) Co-authored-by: Tianli Feng --- .../org/opensearch/cluster/MinimumMasterNodesIT.java | 12 ++++++------ .../opensearch/cluster/SpecificMasterNodesIT.java | 6 +++--- .../opensearch/discovery/DiscoveryDisruptionIT.java | 2 +- .../org/opensearch/discovery/MasterDisruptionIT.java | 12 ++++++++---- .../cluster/coordination/NoMasterBlockService.java | 6 +++--- .../org/opensearch/discovery/SeedHostsProvider.java | 2 +- .../org/opensearch/ExceptionSerializationTests.java | 2 +- .../org/opensearch/OpenSearchExceptionTests.java | 7 ++++--- .../org/opensearch/cluster/ClusterStateTests.java | 2 +- .../replication/ClusterStateCreationUtils.java | 2 +- .../coordination/AbstractCoordinatorTestCase.java | 6 +++++- .../org/opensearch/test/InternalTestCluster.java | 2 +- .../main/java/org/opensearch/test/RandomObjects.java | 3 ++- .../test/test/InternalTestClusterTests.java | 2 +- 14 files changed, 38 insertions(+), 28 deletions(-) diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/MinimumMasterNodesIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/MinimumMasterNodesIT.java index c3dc686921eb6..32899690799d3 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/MinimumMasterNodesIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/MinimumMasterNodesIT.java @@ -91,7 +91,7 @@ public void testTwoNodesNoMasterBlock() throws Exception { logger.info("--> start first node"); String node1Name = internalCluster().startNode(settings); - logger.info("--> should be blocked, no master..."); + logger.info("--> should be blocked, no cluster-manager..."); ClusterState state = client().admin().cluster().prepareState().setLocal(true).execute().actionGet().getState(); assertThat(state.blocks().hasGlobalBlockWithId(NoMasterBlockService.NO_MASTER_BLOCK_ID), equalTo(true)); assertThat(state.nodes().getSize(), equalTo(1)); // verify that we still see the local node in the cluster state @@ -155,7 +155,7 @@ public void testTwoNodesNoMasterBlock() throws Exception { String otherNode = node1Name.equals(masterNode) ? node2Name : node1Name; logger.info("--> add voting config exclusion for non-master node, to be sure it's not elected"); client().execute(AddVotingConfigExclusionsAction.INSTANCE, new AddVotingConfigExclusionsRequest(otherNode)).get(); - logger.info("--> stop master node, no master block should appear"); + logger.info("--> stop master node, no cluster-manager block should appear"); Settings masterDataPathSettings = internalCluster().dataPathSettings(masterNode); internalCluster().stopRandomNode(InternalTestCluster.nameFilter(masterNode)); @@ -166,7 +166,7 @@ public void testTwoNodesNoMasterBlock() throws Exception { state = client().admin().cluster().prepareState().setLocal(true).execute().actionGet().getState(); assertThat(state.blocks().hasGlobalBlockWithId(NoMasterBlockService.NO_MASTER_BLOCK_ID), equalTo(true)); - // verify that both nodes are still in the cluster state but there is no master + // verify that both nodes are still in the cluster state but there is no cluster-manager assertThat(state.nodes().getSize(), equalTo(2)); assertThat(state.nodes().getMasterNode(), equalTo(null)); @@ -208,7 +208,7 @@ public void testTwoNodesNoMasterBlock() throws Exception { otherNode = node1Name.equals(masterNode) ? node2Name : node1Name; logger.info("--> add voting config exclusion for master node, to be sure it's not elected"); client().execute(AddVotingConfigExclusionsAction.INSTANCE, new AddVotingConfigExclusionsRequest(masterNode)).get(); - logger.info("--> stop non-master node, no master block should appear"); + logger.info("--> stop non-master node, no cluster-manager block should appear"); Settings otherNodeDataPathSettings = internalCluster().dataPathSettings(otherNode); internalCluster().stopRandomNode(InternalTestCluster.nameFilter(otherNode)); @@ -317,7 +317,7 @@ public void testThreeNodesNoMasterBlock() throws Exception { internalCluster().stopRandomNonMasterNode(); internalCluster().stopRandomNonMasterNode(); - logger.info("--> verify that there is no master anymore on remaining node"); + logger.info("--> verify that there is no cluster-manager anymore on remaining node"); // spin here to wait till the state is set assertBusy(() -> { ClusterState st = client().admin().cluster().prepareState().setLocal(true).execute().actionGet().getState(); @@ -386,7 +386,7 @@ public void onFailure(String source, Exception e) { assertThat(failure.get(), instanceOf(FailedToCommitClusterStateException.class)); - logger.debug("--> check that there is no master in minor partition"); + logger.debug("--> check that there is no cluster-manager in minor partition"); assertBusy(() -> assertThat(masterClusterService.state().nodes().getMasterNode(), nullValue())); // let major partition to elect new master, to ensure that old master is not elected once partition is restored, diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/SpecificMasterNodesIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/SpecificMasterNodesIT.java index fc193163f75cc..5380b61c446d4 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/SpecificMasterNodesIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/SpecificMasterNodesIT.java @@ -74,7 +74,7 @@ public void testSimpleOnlyMasterNodeElection() throws IOException { ); fail("should not be able to find master"); } catch (MasterNotDiscoveredException e) { - // all is well, no master elected + // all is well, no cluster-manager elected } logger.info("--> start master node"); final String masterNodeName = internalCluster().startMasterOnlyNode(); @@ -124,7 +124,7 @@ public void testSimpleOnlyMasterNodeElection() throws IOException { ); fail("should not be able to find master"); } catch (MasterNotDiscoveredException e) { - // all is well, no master elected + // all is well, no cluster-manager elected } logger.info("--> start previous master node again"); @@ -178,7 +178,7 @@ public void testElectOnlyBetweenMasterNodes() throws Exception { ); fail("should not be able to find master"); } catch (MasterNotDiscoveredException e) { - // all is well, no master elected + // all is well, no cluster-manager elected } logger.info("--> start master node (1)"); final String masterNodeName = internalCluster().startMasterOnlyNode(); diff --git a/server/src/internalClusterTest/java/org/opensearch/discovery/DiscoveryDisruptionIT.java b/server/src/internalClusterTest/java/org/opensearch/discovery/DiscoveryDisruptionIT.java index 079aaa714a15c..bea70bd0f5919 100644 --- a/server/src/internalClusterTest/java/org/opensearch/discovery/DiscoveryDisruptionIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/discovery/DiscoveryDisruptionIT.java @@ -220,7 +220,7 @@ public void testNodeNotReachableFromMaster() throws Exception { logger.info("waiting for [{}] to be removed from cluster", nonMasterNode); ensureStableCluster(2, masterNode); - logger.info("waiting for [{}] to have no master", nonMasterNode); + logger.info("waiting for [{}] to have no cluster-manager", nonMasterNode); assertNoMaster(nonMasterNode); logger.info("healing partition and checking cluster reforms"); diff --git a/server/src/internalClusterTest/java/org/opensearch/discovery/MasterDisruptionIT.java b/server/src/internalClusterTest/java/org/opensearch/discovery/MasterDisruptionIT.java index 14e7a26bb448e..2434537d7a424 100644 --- a/server/src/internalClusterTest/java/org/opensearch/discovery/MasterDisruptionIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/discovery/MasterDisruptionIT.java @@ -217,7 +217,7 @@ public void testVerifyApiBlocksDuringPartition() throws Exception { // The unlucky node must report *no* master node, since it can't connect to master and in fact it should // continuously ping until network failures have been resolved. However // It may a take a bit before the node detects it has been cut off from the elected master - logger.info("waiting for isolated node [{}] to have no master", isolatedNode); + logger.info("waiting for isolated node [{}] to have no cluster-manager", isolatedNode); assertNoMaster(isolatedNode, NoMasterBlockService.NO_MASTER_BLOCK_WRITES, TimeValue.timeValueSeconds(30)); logger.info("wait until elected master has been removed and a new 2 node cluster was from (via [{}])", isolatedNode); @@ -236,7 +236,7 @@ public void testVerifyApiBlocksDuringPartition() throws Exception { fail( "node [" + node - + "] has no master or has blocks, despite of being on the right side of the partition. State dump:\n" + + "] has no cluster-manager or has blocks, despite of being on the right side of the partition. State dump:\n" + nodeState ); } @@ -247,7 +247,11 @@ public void testVerifyApiBlocksDuringPartition() throws Exception { // Wait until the master node sees al 3 nodes again. ensureStableCluster(3, new TimeValue(DISRUPTION_HEALING_OVERHEAD.millis() + networkDisruption.expectedTimeToHeal().millis())); - logger.info("Verify no master block with {} set to {}", NoMasterBlockService.NO_CLUSTER_MANAGER_BLOCK_SETTING.getKey(), "all"); + logger.info( + "Verify no cluster-manager block with {} set to {}", + NoMasterBlockService.NO_CLUSTER_MANAGER_BLOCK_SETTING.getKey(), + "all" + ); client().admin() .cluster() .prepareUpdateSettings() @@ -259,7 +263,7 @@ public void testVerifyApiBlocksDuringPartition() throws Exception { // The unlucky node must report *no* master node, since it can't connect to master and in fact it should // continuously ping until network failures have been resolved. However // It may a take a bit before the node detects it has been cut off from the elected master - logger.info("waiting for isolated node [{}] to have no master", isolatedNode); + logger.info("waiting for isolated node [{}] to have no cluster-manager", isolatedNode); assertNoMaster(isolatedNode, NoMasterBlockService.NO_MASTER_BLOCK_ALL, TimeValue.timeValueSeconds(30)); // make sure we have stable cluster & cross partition recoveries are canceled by the removal of the missing node diff --git a/server/src/main/java/org/opensearch/cluster/coordination/NoMasterBlockService.java b/server/src/main/java/org/opensearch/cluster/coordination/NoMasterBlockService.java index 8cbb0446a1337..e346d3f20112d 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/NoMasterBlockService.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/NoMasterBlockService.java @@ -45,7 +45,7 @@ public class NoMasterBlockService { public static final int NO_MASTER_BLOCK_ID = 2; public static final ClusterBlock NO_MASTER_BLOCK_WRITES = new ClusterBlock( NO_MASTER_BLOCK_ID, - "no master", + "no cluster-manager", true, false, false, @@ -54,7 +54,7 @@ public class NoMasterBlockService { ); public static final ClusterBlock NO_MASTER_BLOCK_ALL = new ClusterBlock( NO_MASTER_BLOCK_ID, - "no master", + "no cluster-manager", true, true, false, @@ -63,7 +63,7 @@ public class NoMasterBlockService { ); public static final ClusterBlock NO_MASTER_BLOCK_METADATA_WRITES = new ClusterBlock( NO_MASTER_BLOCK_ID, - "no master", + "no cluster-manager", true, false, false, diff --git a/server/src/main/java/org/opensearch/discovery/SeedHostsProvider.java b/server/src/main/java/org/opensearch/discovery/SeedHostsProvider.java index ddea57db44476..23944f7bb122c 100644 --- a/server/src/main/java/org/opensearch/discovery/SeedHostsProvider.java +++ b/server/src/main/java/org/opensearch/discovery/SeedHostsProvider.java @@ -42,7 +42,7 @@ public interface SeedHostsProvider { /** - * Returns a list of seed hosts to use for discovery. Called repeatedly while discovery is active (i.e. while there is no master) + * Returns a list of seed hosts to use for discovery. Called repeatedly while discovery is active (i.e. while there is no cluster-manager) * so that this list may be dynamic. */ List getSeedAddresses(HostsResolver hostsResolver); diff --git a/server/src/test/java/org/opensearch/ExceptionSerializationTests.java b/server/src/test/java/org/opensearch/ExceptionSerializationTests.java index b5859e1fb18a9..888e855176fe6 100644 --- a/server/src/test/java/org/opensearch/ExceptionSerializationTests.java +++ b/server/src/test/java/org/opensearch/ExceptionSerializationTests.java @@ -511,7 +511,7 @@ public void testFailedNodeException() throws IOException { public void testClusterBlockException() throws IOException { ClusterBlockException ex = serialize(new ClusterBlockException(singleton(NoMasterBlockService.NO_MASTER_BLOCK_WRITES))); - assertEquals("blocked by: [SERVICE_UNAVAILABLE/2/no master];", ex.getMessage()); + assertEquals("blocked by: [SERVICE_UNAVAILABLE/2/no cluster-manager];", ex.getMessage()); assertTrue(ex.blocks().contains(NoMasterBlockService.NO_MASTER_BLOCK_WRITES)); assertEquals(1, ex.blocks().size()); } diff --git a/server/src/test/java/org/opensearch/OpenSearchExceptionTests.java b/server/src/test/java/org/opensearch/OpenSearchExceptionTests.java index 9f32af143ee2d..31c2d77370941 100644 --- a/server/src/test/java/org/opensearch/OpenSearchExceptionTests.java +++ b/server/src/test/java/org/opensearch/OpenSearchExceptionTests.java @@ -499,7 +499,7 @@ public void testToXContentWithHeadersAndMetadata() throws IOException { + "\"reason\":\"baz\"," + "\"caused_by\":{" + "\"type\":\"cluster_block_exception\"," - + "\"reason\":\"blocked by: [SERVICE_UNAVAILABLE/2/no master];\"" + + "\"reason\":\"blocked by: [SERVICE_UNAVAILABLE/2/no cluster-manager];\"" + "}" + "}" + "}," @@ -537,7 +537,7 @@ public void testToXContentWithHeadersAndMetadata() throws IOException { cause = (OpenSearchException) cause.getCause(); assertEquals( cause.getMessage(), - "OpenSearch exception [type=cluster_block_exception, reason=blocked by: [SERVICE_UNAVAILABLE/2/no master];]" + "OpenSearch exception [type=cluster_block_exception, reason=blocked by: [SERVICE_UNAVAILABLE/2/no cluster-manager];]" ); } @@ -1034,7 +1034,8 @@ public static Tuple randomExceptions() { case 0: actual = new ClusterBlockException(singleton(NoMasterBlockService.NO_MASTER_BLOCK_WRITES)); expected = new OpenSearchException( - "OpenSearch exception [type=cluster_block_exception, " + "reason=blocked by: [SERVICE_UNAVAILABLE/2/no master];]" + "OpenSearch exception [type=cluster_block_exception, " + + "reason=blocked by: [SERVICE_UNAVAILABLE/2/no cluster-manager];]" ); break; case 1: // Simple opensearch exception with headers (other metadata of type number are not parsed) diff --git a/server/src/test/java/org/opensearch/cluster/ClusterStateTests.java b/server/src/test/java/org/opensearch/cluster/ClusterStateTests.java index 7cbab104cd07a..8904e4391a89f 100644 --- a/server/src/test/java/org/opensearch/cluster/ClusterStateTests.java +++ b/server/src/test/java/org/opensearch/cluster/ClusterStateTests.java @@ -101,7 +101,7 @@ public void testSupersedes() { .nodes(DiscoveryNodes.builder(nodes).masterNodeId(node2.getId())) .build(); - // states with no master should never supersede anything + // states with no cluster-manager should never supersede anything assertFalse(noMaster1.supersedes(noMaster2)); assertFalse(noMaster1.supersedes(withMaster1a)); diff --git a/test/framework/src/main/java/org/opensearch/action/support/replication/ClusterStateCreationUtils.java b/test/framework/src/main/java/org/opensearch/action/support/replication/ClusterStateCreationUtils.java index 64b82f9fd1b92..72ca3617c40a3 100644 --- a/test/framework/src/main/java/org/opensearch/action/support/replication/ClusterStateCreationUtils.java +++ b/test/framework/src/main/java/org/opensearch/action/support/replication/ClusterStateCreationUtils.java @@ -429,7 +429,7 @@ public static ClusterState stateWithNoShard() { * Creates a cluster state where local node and master node can be specified * * @param localNode node in allNodes that is the local node - * @param masterNode node in allNodes that is the master node. Can be null if no master exists + * @param masterNode node in allNodes that is the master node. Can be null if no cluster-manager exists * @param allNodes all nodes in the cluster * @return cluster state */ diff --git a/test/framework/src/main/java/org/opensearch/cluster/coordination/AbstractCoordinatorTestCase.java b/test/framework/src/main/java/org/opensearch/cluster/coordination/AbstractCoordinatorTestCase.java index 6617102c12ffc..6178ead662870 100644 --- a/test/framework/src/main/java/org/opensearch/cluster/coordination/AbstractCoordinatorTestCase.java +++ b/test/framework/src/main/java/org/opensearch/cluster/coordination/AbstractCoordinatorTestCase.java @@ -632,7 +632,11 @@ void stabilise(long stabilisationDurationMillis) { ); } else { assertThat(nodeId + " is not following " + leaderId, clusterNode.coordinator.getMode(), is(CANDIDATE)); - assertThat(nodeId + " has no master", clusterNode.getLastAppliedClusterState().nodes().getMasterNode(), nullValue()); + assertThat( + nodeId + " has no cluster-manager", + clusterNode.getLastAppliedClusterState().nodes().getMasterNode(), + nullValue() + ); assertThat( nodeId + " has NO_MASTER_BLOCK", clusterNode.getLastAppliedClusterState().blocks().hasGlobalBlockWithId(NO_MASTER_BLOCK_ID), diff --git a/test/framework/src/main/java/org/opensearch/test/InternalTestCluster.java b/test/framework/src/main/java/org/opensearch/test/InternalTestCluster.java index a7c819609c619..99783cb173a8f 100644 --- a/test/framework/src/main/java/org/opensearch/test/InternalTestCluster.java +++ b/test/framework/src/main/java/org/opensearch/test/InternalTestCluster.java @@ -825,7 +825,7 @@ public Client masterClient() { if (randomNodeAndClient != null) { return randomNodeAndClient.nodeClient(); // ensure node client master is requested } - throw new AssertionError("No master client found"); + throw new AssertionError("No cluster-manager client found"); } /** diff --git a/test/framework/src/main/java/org/opensearch/test/RandomObjects.java b/test/framework/src/main/java/org/opensearch/test/RandomObjects.java index 55da731e8311f..8beac9e441787 100644 --- a/test/framework/src/main/java/org/opensearch/test/RandomObjects.java +++ b/test/framework/src/main/java/org/opensearch/test/RandomObjects.java @@ -333,7 +333,8 @@ private static Tuple randomShardInfoFailure(Random random) { case 0: actualException = new ClusterBlockException(singleton(NoMasterBlockService.NO_MASTER_BLOCK_WRITES)); expectedException = new OpenSearchException( - "OpenSearch exception [type=cluster_block_exception, " + "reason=blocked by: [SERVICE_UNAVAILABLE/2/no master];]" + "OpenSearch exception [type=cluster_block_exception, " + + "reason=blocked by: [SERVICE_UNAVAILABLE/2/no cluster-manager];]" ); break; case 1: diff --git a/test/framework/src/test/java/org/opensearch/test/test/InternalTestClusterTests.java b/test/framework/src/test/java/org/opensearch/test/test/InternalTestClusterTests.java index f1aee04d92a19..87cd98a717be6 100644 --- a/test/framework/src/test/java/org/opensearch/test/test/InternalTestClusterTests.java +++ b/test/framework/src/test/java/org/opensearch/test/test/InternalTestClusterTests.java @@ -404,7 +404,7 @@ public Path nodeConfigPath(int nodeOrdinal) { List roles = new ArrayList<>(); for (int i = 0; i < numNodes; i++) { final DiscoveryNodeRole role = i == numNodes - 1 && roles.contains(clusterManagerRole) == false - ? clusterManagerRole // last node and still no master + ? clusterManagerRole // last node and still no cluster-manager : randomFrom(clusterManagerRole, DiscoveryNodeRole.DATA_ROLE, DiscoveryNodeRole.INGEST_ROLE); roles.add(role); } From 48bbaa3ff1d6c8baacc8096ba605ce739053fa78 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 3 May 2022 11:27:54 -0400 Subject: [PATCH 114/514] [Remove] TypesExist Action (#3139) (#3153) The types exist transport action can be removed now that the TransportClient has been removed and types support has been removed. Signed-off-by: Nicholas Walter Knize (cherry picked from commit 15f035b4790f23fe65761f22129babfc6ccd7ce1) Co-authored-by: Nick Knize --- .../indices/IndicesOptionsIntegrationIT.java | 20 --- .../org/opensearch/action/ActionModule.java | 3 - .../types/TransportTypesExistsAction.java | 125 ------------------ .../exists/types/TypesExistsAction.java | 44 ------ .../exists/types/TypesExistsRequest.java | 115 ---------------- .../types/TypesExistsRequestBuilder.java | 82 ------------ .../exists/types/TypesExistsResponse.java | 64 --------- .../indices/exists/types/package-info.java | 13 -- .../opensearch/client/IndicesAdminClient.java | 31 ----- .../client/support/AbstractClient.java | 20 --- 10 files changed, 517 deletions(-) delete mode 100644 server/src/main/java/org/opensearch/action/admin/indices/exists/types/TransportTypesExistsAction.java delete mode 100644 server/src/main/java/org/opensearch/action/admin/indices/exists/types/TypesExistsAction.java delete mode 100644 server/src/main/java/org/opensearch/action/admin/indices/exists/types/TypesExistsRequest.java delete mode 100644 server/src/main/java/org/opensearch/action/admin/indices/exists/types/TypesExistsRequestBuilder.java delete mode 100644 server/src/main/java/org/opensearch/action/admin/indices/exists/types/TypesExistsResponse.java delete mode 100644 server/src/main/java/org/opensearch/action/admin/indices/exists/types/package-info.java diff --git a/server/src/internalClusterTest/java/org/opensearch/indices/IndicesOptionsIntegrationIT.java b/server/src/internalClusterTest/java/org/opensearch/indices/IndicesOptionsIntegrationIT.java index 3432cc967bf22..0ea35a24d7c26 100644 --- a/server/src/internalClusterTest/java/org/opensearch/indices/IndicesOptionsIntegrationIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/indices/IndicesOptionsIntegrationIT.java @@ -37,7 +37,6 @@ import org.opensearch.action.admin.indices.alias.exists.AliasesExistRequestBuilder; import org.opensearch.action.admin.indices.alias.get.GetAliasesRequestBuilder; import org.opensearch.action.admin.indices.cache.clear.ClearIndicesCacheRequestBuilder; -import org.opensearch.action.admin.indices.exists.types.TypesExistsRequestBuilder; import org.opensearch.action.admin.indices.flush.FlushRequestBuilder; import org.opensearch.action.admin.indices.forcemerge.ForceMergeRequestBuilder; import org.opensearch.action.admin.indices.mapping.get.GetFieldMappingsRequestBuilder; @@ -99,7 +98,6 @@ public void testSpecifiedIndexUnavailableMultipleIndices() throws Exception { verify(refreshBuilder("test1", "test2"), true); verify(validateQuery("test1", "test2"), true); verify(aliasExists("test1", "test2"), true); - verify(typesExists("test1", "test2"), true); verify(getAliases("test1", "test2"), true); verify(getFieldMapping("test1", "test2"), true); verify(getMapping("test1", "test2"), true); @@ -116,7 +114,6 @@ public void testSpecifiedIndexUnavailableMultipleIndices() throws Exception { verify(refreshBuilder("test1", "test2").setIndicesOptions(options), true); verify(validateQuery("test1", "test2").setIndicesOptions(options), true); verify(aliasExists("test1", "test2").setIndicesOptions(options), true); - verify(typesExists("test1", "test2").setIndicesOptions(options), true); verify(getAliases("test1", "test2").setIndicesOptions(options), true); verify(getFieldMapping("test1", "test2").setIndicesOptions(options), true); verify(getMapping("test1", "test2").setIndicesOptions(options), true); @@ -133,7 +130,6 @@ public void testSpecifiedIndexUnavailableMultipleIndices() throws Exception { verify(refreshBuilder("test1", "test2").setIndicesOptions(options), false); verify(validateQuery("test1", "test2").setIndicesOptions(options), false); verify(aliasExists("test1", "test2").setIndicesOptions(options), false); - verify(typesExists("test1", "test2").setIndicesOptions(options), false); verify(getAliases("test1", "test2").setIndicesOptions(options), false); verify(getFieldMapping("test1", "test2").setIndicesOptions(options), false); verify(getMapping("test1", "test2").setIndicesOptions(options), false); @@ -151,7 +147,6 @@ public void testSpecifiedIndexUnavailableMultipleIndices() throws Exception { verify(refreshBuilder("test1", "test2").setIndicesOptions(options), false); verify(validateQuery("test1", "test2").setIndicesOptions(options), false); verify(aliasExists("test1", "test2").setIndicesOptions(options), false); - verify(typesExists("test1", "test2").setIndicesOptions(options), false); verify(getAliases("test1", "test2").setIndicesOptions(options), false); verify(getFieldMapping("test1", "test2").setIndicesOptions(options), false); verify(getMapping("test1", "test2").setIndicesOptions(options), false); @@ -178,7 +173,6 @@ public void testSpecifiedIndexUnavailableSingleIndexThatIsClosed() throws Except verify(refreshBuilder("test1").setIndicesOptions(options), true); verify(validateQuery("test1").setIndicesOptions(options), true); verify(aliasExists("test1").setIndicesOptions(options), true); - verify(typesExists("test1").setIndicesOptions(options), true); verify(getAliases("test1").setIndicesOptions(options), true); verify(getFieldMapping("test1").setIndicesOptions(options), true); verify(getMapping("test1").setIndicesOptions(options), true); @@ -201,7 +195,6 @@ public void testSpecifiedIndexUnavailableSingleIndexThatIsClosed() throws Except verify(refreshBuilder("test1").setIndicesOptions(options), false); verify(validateQuery("test1").setIndicesOptions(options), false); verify(aliasExists("test1").setIndicesOptions(options), false); - verify(typesExists("test1").setIndicesOptions(options), false); verify(getAliases("test1").setIndicesOptions(options), false); verify(getFieldMapping("test1").setIndicesOptions(options), false); verify(getMapping("test1").setIndicesOptions(options), false); @@ -221,7 +214,6 @@ public void testSpecifiedIndexUnavailableSingleIndexThatIsClosed() throws Except verify(refreshBuilder("test1").setIndicesOptions(options), false); verify(validateQuery("test1").setIndicesOptions(options), false); verify(aliasExists("test1").setIndicesOptions(options), false); - verify(typesExists("test1").setIndicesOptions(options), false); verify(getAliases("test1").setIndicesOptions(options), false); verify(getFieldMapping("test1").setIndicesOptions(options), false); verify(getMapping("test1").setIndicesOptions(options), false); @@ -240,7 +232,6 @@ public void testSpecifiedIndexUnavailableSingleIndex() throws Exception { verify(refreshBuilder("test1").setIndicesOptions(options), true); verify(validateQuery("test1").setIndicesOptions(options), true); verify(aliasExists("test1").setIndicesOptions(options), true); - verify(typesExists("test1").setIndicesOptions(options), true); verify(getAliases("test1").setIndicesOptions(options), true); verify(getFieldMapping("test1").setIndicesOptions(options), true); verify(getMapping("test1").setIndicesOptions(options), true); @@ -263,7 +254,6 @@ public void testSpecifiedIndexUnavailableSingleIndex() throws Exception { verify(refreshBuilder("test1").setIndicesOptions(options), false); verify(validateQuery("test1").setIndicesOptions(options), false); verify(aliasExists("test1").setIndicesOptions(options), false); - verify(typesExists("test1").setIndicesOptions(options), false); verify(getAliases("test1").setIndicesOptions(options), false); verify(getFieldMapping("test1").setIndicesOptions(options), false); verify(getMapping("test1").setIndicesOptions(options), false); @@ -282,7 +272,6 @@ public void testSpecifiedIndexUnavailableSingleIndex() throws Exception { verify(refreshBuilder("test1").setIndicesOptions(options), false); verify(validateQuery("test1").setIndicesOptions(options), false); verify(aliasExists("test1").setIndicesOptions(options), false); - verify(typesExists("test1").setIndicesOptions(options), false); verify(getAliases("test1").setIndicesOptions(options), false); verify(getFieldMapping("test1").setIndicesOptions(options), false); verify(getMapping("test1").setIndicesOptions(options), false); @@ -336,7 +325,6 @@ public void testWildcardBehaviour() throws Exception { verify(refreshBuilder(indices), false); verify(validateQuery(indices), true); verify(aliasExists(indices), false); - verify(typesExists(indices), false); verify(getAliases(indices), false); verify(getFieldMapping(indices), false); verify(getMapping(indices), false); @@ -354,7 +342,6 @@ public void testWildcardBehaviour() throws Exception { verify(refreshBuilder(indices).setIndicesOptions(options), false); verify(validateQuery(indices).setIndicesOptions(options), false); verify(aliasExists(indices).setIndicesOptions(options), false); - verify(typesExists(indices).setIndicesOptions(options), false); verify(getAliases(indices).setIndicesOptions(options), false); verify(getFieldMapping(indices).setIndicesOptions(options), false); verify(getMapping(indices).setIndicesOptions(options), false); @@ -375,7 +362,6 @@ public void testWildcardBehaviour() throws Exception { verify(refreshBuilder(indices), false); verify(validateQuery(indices), false); verify(aliasExists(indices), false); - verify(typesExists(indices), false); verify(getAliases(indices), false); verify(getFieldMapping(indices), false); verify(getMapping(indices), false); @@ -393,7 +379,6 @@ public void testWildcardBehaviour() throws Exception { verify(refreshBuilder(indices), false); verify(validateQuery(indices), true); verify(aliasExists(indices), false); - verify(typesExists(indices), false); verify(getAliases(indices), false); verify(getFieldMapping(indices), false); verify(getMapping(indices), false); @@ -411,7 +396,6 @@ public void testWildcardBehaviour() throws Exception { verify(refreshBuilder(indices).setIndicesOptions(options), false); verify(validateQuery(indices).setIndicesOptions(options), false); verify(aliasExists(indices).setIndicesOptions(options), false); - verify(typesExists(indices).setIndicesOptions(options), false); verify(getAliases(indices).setIndicesOptions(options), false); verify(getFieldMapping(indices).setIndicesOptions(options), false); verify(getMapping(indices).setIndicesOptions(options), false); @@ -725,10 +709,6 @@ private static AliasesExistRequestBuilder aliasExists(String... indices) { return client().admin().indices().prepareAliasesExist("dummy").addIndices(indices); } - private static TypesExistsRequestBuilder typesExists(String... indices) { - return client().admin().indices().prepareTypesExists(indices).setTypes("dummy"); - } - static GetAliasesRequestBuilder getAliases(String... indices) { return client().admin().indices().prepareGetAliases("dummy").addIndices(indices); } diff --git a/server/src/main/java/org/opensearch/action/ActionModule.java b/server/src/main/java/org/opensearch/action/ActionModule.java index 8e31aa23d88cf..d5d9660dbcf1e 100644 --- a/server/src/main/java/org/opensearch/action/ActionModule.java +++ b/server/src/main/java/org/opensearch/action/ActionModule.java @@ -137,8 +137,6 @@ import org.opensearch.action.admin.indices.delete.TransportDeleteIndexAction; import org.opensearch.action.admin.indices.exists.indices.IndicesExistsAction; import org.opensearch.action.admin.indices.exists.indices.TransportIndicesExistsAction; -import org.opensearch.action.admin.indices.exists.types.TransportTypesExistsAction; -import org.opensearch.action.admin.indices.exists.types.TypesExistsAction; import org.opensearch.action.admin.indices.flush.FlushAction; import org.opensearch.action.admin.indices.flush.TransportFlushAction; import org.opensearch.action.admin.indices.forcemerge.ForceMergeAction; @@ -560,7 +558,6 @@ public void reg actions.register(OpenIndexAction.INSTANCE, TransportOpenIndexAction.class); actions.register(CloseIndexAction.INSTANCE, TransportCloseIndexAction.class); actions.register(IndicesExistsAction.INSTANCE, TransportIndicesExistsAction.class); - actions.register(TypesExistsAction.INSTANCE, TransportTypesExistsAction.class); actions.register(AddIndexBlockAction.INSTANCE, TransportAddIndexBlockAction.class); actions.register(GetMappingsAction.INSTANCE, TransportGetMappingsAction.class); actions.register( diff --git a/server/src/main/java/org/opensearch/action/admin/indices/exists/types/TransportTypesExistsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/exists/types/TransportTypesExistsAction.java deleted file mode 100644 index bf4e0375941e7..0000000000000 --- a/server/src/main/java/org/opensearch/action/admin/indices/exists/types/TransportTypesExistsAction.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.action.admin.indices.exists.types; - -import org.opensearch.action.ActionListener; -import org.opensearch.action.support.ActionFilters; -import org.opensearch.action.support.master.TransportMasterNodeReadAction; -import org.opensearch.cluster.ClusterState; -import org.opensearch.cluster.block.ClusterBlockException; -import org.opensearch.cluster.block.ClusterBlockLevel; -import org.opensearch.cluster.metadata.IndexNameExpressionResolver; -import org.opensearch.cluster.metadata.MappingMetadata; -import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.inject.Inject; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.threadpool.ThreadPool; -import org.opensearch.transport.TransportService; - -import java.io.IOException; - -/** - * Types exists transport action. - */ -public class TransportTypesExistsAction extends TransportMasterNodeReadAction { - - @Inject - public TransportTypesExistsAction( - TransportService transportService, - ClusterService clusterService, - ThreadPool threadPool, - ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver - ) { - super( - TypesExistsAction.NAME, - transportService, - clusterService, - threadPool, - actionFilters, - TypesExistsRequest::new, - indexNameExpressionResolver - ); - } - - @Override - protected String executor() { - // lightweight check - return ThreadPool.Names.SAME; - } - - @Override - protected TypesExistsResponse read(StreamInput in) throws IOException { - return new TypesExistsResponse(in); - } - - @Override - protected ClusterBlockException checkBlock(TypesExistsRequest request, ClusterState state) { - return state.blocks() - .indicesBlockedException(ClusterBlockLevel.METADATA_READ, indexNameExpressionResolver.concreteIndexNames(state, request)); - } - - @Override - protected void masterOperation( - final TypesExistsRequest request, - final ClusterState state, - final ActionListener listener - ) { - String[] concreteIndices = indexNameExpressionResolver.concreteIndexNames(state, request.indicesOptions(), request.indices()); - if (concreteIndices.length == 0) { - listener.onResponse(new TypesExistsResponse(false)); - return; - } - - for (String concreteIndex : concreteIndices) { - if (!state.metadata().hasConcreteIndex(concreteIndex)) { - listener.onResponse(new TypesExistsResponse(false)); - return; - } - - MappingMetadata mapping = state.metadata().getIndices().get(concreteIndex).mapping(); - if (mapping == null) { - listener.onResponse(new TypesExistsResponse(false)); - return; - } - - for (String type : request.types()) { - if (mapping.type().equals(type) == false) { - listener.onResponse(new TypesExistsResponse(false)); - return; - } - } - } - - listener.onResponse(new TypesExistsResponse(true)); - } -} diff --git a/server/src/main/java/org/opensearch/action/admin/indices/exists/types/TypesExistsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/exists/types/TypesExistsAction.java deleted file mode 100644 index df461559dda7c..0000000000000 --- a/server/src/main/java/org/opensearch/action/admin/indices/exists/types/TypesExistsAction.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.action.admin.indices.exists.types; - -import org.opensearch.action.ActionType; - -public class TypesExistsAction extends ActionType { - - public static final TypesExistsAction INSTANCE = new TypesExistsAction(); - public static final String NAME = "indices:admin/types/exists"; - - private TypesExistsAction() { - super(NAME, TypesExistsResponse::new); - } -} diff --git a/server/src/main/java/org/opensearch/action/admin/indices/exists/types/TypesExistsRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/exists/types/TypesExistsRequest.java deleted file mode 100644 index eee8076a9b176..0000000000000 --- a/server/src/main/java/org/opensearch/action/admin/indices/exists/types/TypesExistsRequest.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.action.admin.indices.exists.types; - -import org.opensearch.action.ActionRequestValidationException; -import org.opensearch.action.IndicesRequest; -import org.opensearch.action.support.IndicesOptions; -import org.opensearch.action.support.master.MasterNodeReadRequest; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; - -import java.io.IOException; - -import static org.opensearch.action.ValidateActions.addValidationError; - -public class TypesExistsRequest extends MasterNodeReadRequest implements IndicesRequest.Replaceable { - - private String[] indices; - private String[] types; - - private IndicesOptions indicesOptions = IndicesOptions.strictExpandOpen(); - - public TypesExistsRequest() {} - - public TypesExistsRequest(String[] indices, String... types) { - this.indices = indices; - this.types = types; - } - - public TypesExistsRequest(StreamInput in) throws IOException { - super(in); - indices = in.readStringArray(); - types = in.readStringArray(); - indicesOptions = IndicesOptions.readIndicesOptions(in); - } - - @Override - public void writeTo(StreamOutput out) throws IOException { - super.writeTo(out); - out.writeStringArray(indices); - out.writeStringArray(types); - indicesOptions.writeIndicesOptions(out); - } - - @Override - public String[] indices() { - return indices; - } - - @Override - public TypesExistsRequest indices(String... indices) { - this.indices = indices; - return this; - } - - public String[] types() { - return types; - } - - public void types(String[] types) { - this.types = types; - } - - @Override - public IndicesOptions indicesOptions() { - return indicesOptions; - } - - public TypesExistsRequest indicesOptions(IndicesOptions indicesOptions) { - this.indicesOptions = indicesOptions; - return this; - } - - @Override - public ActionRequestValidationException validate() { - ActionRequestValidationException validationException = null; - if (indices == null) { // Specifying '*' via rest api results in an empty array - validationException = addValidationError("index/indices is missing", validationException); - } - if (types == null || types.length == 0) { - validationException = addValidationError("type/types is missing", validationException); - } - - return validationException; - } -} diff --git a/server/src/main/java/org/opensearch/action/admin/indices/exists/types/TypesExistsRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/exists/types/TypesExistsRequestBuilder.java deleted file mode 100644 index 12ed1b5766775..0000000000000 --- a/server/src/main/java/org/opensearch/action/admin/indices/exists/types/TypesExistsRequestBuilder.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.action.admin.indices.exists.types; - -import org.opensearch.action.support.IndicesOptions; -import org.opensearch.action.support.master.MasterNodeReadOperationRequestBuilder; -import org.opensearch.client.OpenSearchClient; -import org.opensearch.common.Strings; - -/** - * A builder for {@link TypesExistsRequest}. - */ -@Deprecated -public class TypesExistsRequestBuilder extends MasterNodeReadOperationRequestBuilder< - TypesExistsRequest, - TypesExistsResponse, - TypesExistsRequestBuilder> { - - /** - * @param indices What indices to check for types - */ - public TypesExistsRequestBuilder(OpenSearchClient client, TypesExistsAction action, String... indices) { - super(client, action, new TypesExistsRequest(indices, Strings.EMPTY_ARRAY)); - } - - TypesExistsRequestBuilder(OpenSearchClient client, TypesExistsAction action) { - super(client, action, new TypesExistsRequest()); - } - - /** - * @param indices What indices to check for types - */ - public TypesExistsRequestBuilder setIndices(String[] indices) { - request.indices(indices); - return this; - } - - /** - * @param types The types to check if they exist - */ - public TypesExistsRequestBuilder setTypes(String... types) { - request.types(types); - return this; - } - - /** - * @param indicesOptions Specifies how to resolve indices that aren't active / ready and indices wildcard expressions - */ - public TypesExistsRequestBuilder setIndicesOptions(IndicesOptions indicesOptions) { - request.indicesOptions(indicesOptions); - return this; - } -} diff --git a/server/src/main/java/org/opensearch/action/admin/indices/exists/types/TypesExistsResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/exists/types/TypesExistsResponse.java deleted file mode 100644 index d7e08b5c9cdc9..0000000000000 --- a/server/src/main/java/org/opensearch/action/admin/indices/exists/types/TypesExistsResponse.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.action.admin.indices.exists.types; - -import org.opensearch.action.ActionResponse; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; - -import java.io.IOException; - -/** - * Whether all of the existed types exist. - */ -public class TypesExistsResponse extends ActionResponse { - - private boolean exists; - - TypesExistsResponse(StreamInput in) throws IOException { - super(in); - exists = in.readBoolean(); - } - - public TypesExistsResponse(boolean exists) { - this.exists = exists; - } - - public boolean isExists() { - return this.exists; - } - - @Override - public void writeTo(StreamOutput out) throws IOException { - out.writeBoolean(exists); - } -} diff --git a/server/src/main/java/org/opensearch/action/admin/indices/exists/types/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/exists/types/package-info.java deleted file mode 100644 index 30bc4569e221a..0000000000000 --- a/server/src/main/java/org/opensearch/action/admin/indices/exists/types/package-info.java +++ /dev/null @@ -1,13 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/** - * Index Type transport handlers. - * @deprecated types are deprecated and will be removed - **/ -package org.opensearch.action.admin.indices.exists.types; diff --git a/server/src/main/java/org/opensearch/client/IndicesAdminClient.java b/server/src/main/java/org/opensearch/client/IndicesAdminClient.java index 7f51b8af19e4b..35f880dbff5e3 100644 --- a/server/src/main/java/org/opensearch/client/IndicesAdminClient.java +++ b/server/src/main/java/org/opensearch/client/IndicesAdminClient.java @@ -60,9 +60,6 @@ import org.opensearch.action.admin.indices.exists.indices.IndicesExistsRequest; import org.opensearch.action.admin.indices.exists.indices.IndicesExistsRequestBuilder; import org.opensearch.action.admin.indices.exists.indices.IndicesExistsResponse; -import org.opensearch.action.admin.indices.exists.types.TypesExistsRequest; -import org.opensearch.action.admin.indices.exists.types.TypesExistsRequestBuilder; -import org.opensearch.action.admin.indices.exists.types.TypesExistsResponse; import org.opensearch.action.admin.indices.flush.FlushRequest; import org.opensearch.action.admin.indices.flush.FlushRequestBuilder; import org.opensearch.action.admin.indices.flush.FlushResponse; @@ -163,34 +160,6 @@ public interface IndicesAdminClient extends OpenSearchClient { */ IndicesExistsRequestBuilder prepareExists(String... indices); - /** - * Types exists. - * - * @deprecated Types are deprecated and are in the process of being removed. - * @param request The types exists request - * @return The result future - */ - @Deprecated - ActionFuture typesExists(TypesExistsRequest request); - - /** - * Types exists. - * - * @deprecated Types are deprecated and are in the process of being removed. - * @param request The types exists - * @param listener A listener to be notified with a result - */ - @Deprecated - void typesExists(TypesExistsRequest request, ActionListener listener); - - /** - * Types exists. - * - * @deprecated Types are deprecated and are in the process of being removed. - */ - @Deprecated - TypesExistsRequestBuilder prepareTypesExists(String... index); - /** * Indices stats. */ diff --git a/server/src/main/java/org/opensearch/client/support/AbstractClient.java b/server/src/main/java/org/opensearch/client/support/AbstractClient.java index a37d293ee5dd2..96380904304b5 100644 --- a/server/src/main/java/org/opensearch/client/support/AbstractClient.java +++ b/server/src/main/java/org/opensearch/client/support/AbstractClient.java @@ -192,10 +192,6 @@ import org.opensearch.action.admin.indices.exists.indices.IndicesExistsRequest; import org.opensearch.action.admin.indices.exists.indices.IndicesExistsRequestBuilder; import org.opensearch.action.admin.indices.exists.indices.IndicesExistsResponse; -import org.opensearch.action.admin.indices.exists.types.TypesExistsAction; -import org.opensearch.action.admin.indices.exists.types.TypesExistsRequest; -import org.opensearch.action.admin.indices.exists.types.TypesExistsRequestBuilder; -import org.opensearch.action.admin.indices.exists.types.TypesExistsResponse; import org.opensearch.action.admin.indices.flush.FlushAction; import org.opensearch.action.admin.indices.flush.FlushRequest; import org.opensearch.action.admin.indices.flush.FlushRequestBuilder; @@ -1332,22 +1328,6 @@ public IndicesExistsRequestBuilder prepareExists(String... indices) { return new IndicesExistsRequestBuilder(this, IndicesExistsAction.INSTANCE, indices); } - @Deprecated - @Override - public ActionFuture typesExists(TypesExistsRequest request) { - return execute(TypesExistsAction.INSTANCE, request); - } - - @Override - public void typesExists(TypesExistsRequest request, ActionListener listener) { - execute(TypesExistsAction.INSTANCE, request, listener); - } - - @Override - public TypesExistsRequestBuilder prepareTypesExists(String... index) { - return new TypesExistsRequestBuilder(this, TypesExistsAction.INSTANCE, index); - } - @Override public ActionFuture aliases(final IndicesAliasesRequest request) { return execute(IndicesAliasesAction.INSTANCE, request); From 40fc71cd3f1c5607bc3781ea9d11c16716b5ced3 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 3 May 2022 11:28:13 -0400 Subject: [PATCH 115/514] Fix Emeritus Table in MAINTAINERS.md (#3137) (#3152) Fixes emeritus table formatting in Maintainers document. Signed-off-by: Nicholas Walter Knize (cherry picked from commit ae4c612580502a2b358de074b1d661ac162eceaa) Co-authored-by: Nick Knize --- MAINTAINERS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS.md b/MAINTAINERS.md index ed20b6f5ab314..988823682b6c1 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -29,6 +29,7 @@ ## Emeritus | Maintainer | GitHub ID | Affiliation | +| --------------- | --------- | ----------- | | Megha Sai Kavikondala | [meghasaik](https://github.com/meghasaik) | Amazon | [This document](https://github.com/opensearch-project/.github/blob/main/MAINTAINERS.md) explains what maintainers do in this repo, and how they should be doing it. If you're interested in contributing, see [CONTRIBUTING](CONTRIBUTING.md). From 300620edada9ef41403f5ae27a3b581b651f5cb2 Mon Sep 17 00:00:00 2001 From: Andrew Ross Date: Tue, 3 May 2022 14:48:07 -0500 Subject: [PATCH 116/514] Fix minimum index compatibility error message (#3159) This is a very simple fix that adds a special case for the backward compatibility message for OS 1.x/ES 7.x. This basically mirrors a special case already codified in [Version][1]. I think this is a reasonable fix because it allows the message to be quite verbose. It should also only need to exist on the 2.x branch of OpenSearch since it is a special case that will no longer exist in 3.x when the entire LegacyESVersion concept can be removed from the code base. [1]: https://github.com/opensearch-project/OpenSearch/blob/cb238aae616d6a0fd8f82e128a1f94c8e4e8b1f7/server/src/main/java/org/opensearch/Version.java#L398 Signed-off-by: Andrew Ross --- .../metadata/MetadataIndexUpgradeService.java | 44 +++++++++++++------ .../MetadataIndexUpgradeServiceTests.java | 27 +++++------- 2 files changed, 42 insertions(+), 29 deletions(-) diff --git a/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexUpgradeService.java b/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexUpgradeService.java index f6f42e0d81063..eb2126bddf7a6 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexUpgradeService.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexUpgradeService.java @@ -37,6 +37,7 @@ import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.search.similarities.BM25Similarity; import org.apache.lucene.search.similarities.Similarity; +import org.opensearch.LegacyESVersion; import org.opensearch.Version; import org.opensearch.common.TriFunction; import org.opensearch.common.settings.IndexScopedSettings; @@ -134,20 +135,35 @@ boolean isUpgraded(IndexMetadata indexMetadata) { private void checkSupportedVersion(IndexMetadata indexMetadata, Version minimumIndexCompatibilityVersion) { if (indexMetadata.getState() == IndexMetadata.State.OPEN && isSupportedVersion(indexMetadata, minimumIndexCompatibilityVersion) == false) { - throw new IllegalStateException( - "The index [" - + indexMetadata.getIndex() - + "] was created with version [" - + indexMetadata.getCreationVersion() - + "] but the minimum compatible version is [" - - + minimumIndexCompatibilityVersion - + "]. It should be re-indexed in OpenSearch " - + minimumIndexCompatibilityVersion.major - + ".x before upgrading to " - + Version.CURRENT - + "." - ); + if (minimumIndexCompatibilityVersion.equals(LegacyESVersion.V_7_0_0)) { + // This branch can be removed when LegacyESVersion is removed + throw new IllegalStateException( + "The index [" + + indexMetadata.getIndex() + + "] was created with version [" + + indexMetadata.getCreationVersion() + + "] but the minimum compatible version is " + + "OpenSearch 1.0.0 (or Elasticsearch 7.0.0). " + + "It should be re-indexed in OpenSearch 1.x " + + "(or Elasticsearch 7.x) before upgrading to " + + Version.CURRENT + + "." + ); + } else { + throw new IllegalStateException( + "The index [" + + indexMetadata.getIndex() + + "] was created with version [" + + indexMetadata.getCreationVersion() + + "] but the minimum compatible version is [" + + minimumIndexCompatibilityVersion + + "]. It should be re-indexed in OpenSearch " + + minimumIndexCompatibilityVersion.major + + ".x before upgrading to " + + Version.CURRENT + + "." + ); + } } } diff --git a/server/src/test/java/org/opensearch/cluster/metadata/MetadataIndexUpgradeServiceTests.java b/server/src/test/java/org/opensearch/cluster/metadata/MetadataIndexUpgradeServiceTests.java index cee95323b8129..ed01f1753e70e 100644 --- a/server/src/test/java/org/opensearch/cluster/metadata/MetadataIndexUpgradeServiceTests.java +++ b/server/src/test/java/org/opensearch/cluster/metadata/MetadataIndexUpgradeServiceTests.java @@ -139,24 +139,21 @@ public void testFailUpgrade() { .put(IndexMetadata.SETTING_VERSION_CREATED, indexCreated) .build() ); - String message = expectThrows( + String actualMessage = expectThrows( IllegalStateException.class, () -> service.upgradeIndexMetadata(metadata, Version.CURRENT.minimumIndexCompatibilityVersion()) ).getMessage(); - assertEquals( - message, - "The index [[foo/BOOM]] was created with version [" - + indexCreated - + "] " - + "but the minimum compatible version is [" - + minCompat - + "]." - + " It should be re-indexed in OpenSearch " - + minCompat.major - + ".x before upgrading to " - + Version.CURRENT.toString() - + "." - ); + + String expectedMessage = "The index [[foo/BOOM]] was created with version [" + + indexCreated + + "] but the minimum compatible version is " + + "OpenSearch 1.0.0 (or Elasticsearch 7.0.0). " + + "It should be re-indexed in OpenSearch 1.x " + + "(or Elasticsearch 7.x) before upgrading to " + + Version.CURRENT + + "."; + + assertEquals(expectedMessage, actualMessage); indexCreated = VersionUtils.randomVersionBetween(random(), minCompat, Version.CURRENT); indexUpgraded = VersionUtils.randomVersionBetween(random(), indexCreated, Version.CURRENT); From d1d387ce2b2594c9cf38775f25cc24965d320470 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 3 May 2022 15:02:30 -0500 Subject: [PATCH 117/514] [Remove] AliasesExistAction (#3149) (#3157) With the removal of Transport Client AliasesExistAction is no longer needed and is removed. Signed-off-by: Nicholas Walter Knize (cherry picked from commit 5f531b366efcf1db02baf48b7bf6dec1e0d9237a) --- .../ValidateIndicesAliasesRequestIT.java | 5 +- .../opensearch/aliases/IndexAliasesIT.java | 59 +++++------- .../indices/IndicesOptionsIntegrationIT.java | 40 ++------ .../org/opensearch/action/ActionModule.java | 3 - .../alias/exists/AliasesExistAction.java | 45 --------- .../exists/AliasesExistRequestBuilder.java | 43 --------- .../alias/exists/AliasesExistResponse.java | 66 ------------- .../exists/TransportAliasesExistAction.java | 95 ------------------- .../indices/alias/exists/package-info.java | 10 -- .../opensearch/client/IndicesAdminClient.java | 22 ----- .../client/support/AbstractClient.java | 18 ---- .../opensearch/cluster/metadata/Metadata.java | 32 ------- .../test/hamcrest/OpenSearchAssertions.java | 16 ---- 13 files changed, 35 insertions(+), 419 deletions(-) delete mode 100644 server/src/main/java/org/opensearch/action/admin/indices/alias/exists/AliasesExistAction.java delete mode 100644 server/src/main/java/org/opensearch/action/admin/indices/alias/exists/AliasesExistRequestBuilder.java delete mode 100644 server/src/main/java/org/opensearch/action/admin/indices/alias/exists/AliasesExistResponse.java delete mode 100644 server/src/main/java/org/opensearch/action/admin/indices/alias/exists/TransportAliasesExistAction.java delete mode 100644 server/src/main/java/org/opensearch/action/admin/indices/alias/exists/package-info.java diff --git a/server/src/internalClusterTest/java/org/opensearch/action/admin/indices/alias/ValidateIndicesAliasesRequestIT.java b/server/src/internalClusterTest/java/org/opensearch/action/admin/indices/alias/ValidateIndicesAliasesRequestIT.java index 60243bd52ded3..bcbc93b5500bc 100644 --- a/server/src/internalClusterTest/java/org/opensearch/action/admin/indices/alias/ValidateIndicesAliasesRequestIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/action/admin/indices/alias/ValidateIndicesAliasesRequestIT.java @@ -33,7 +33,6 @@ package org.opensearch.action.admin.indices.alias; import org.opensearch.action.RequestValidators; -import org.opensearch.action.admin.indices.alias.exists.AliasesExistResponse; import org.opensearch.action.admin.indices.alias.get.GetAliasesRequest; import org.opensearch.action.admin.indices.alias.get.GetAliasesResponse; import org.opensearch.cluster.metadata.AliasMetadata; @@ -143,8 +142,6 @@ public void testSomeAllowed() { final Exception e = expectThrows(IllegalStateException.class, () -> client().admin().indices().aliases(request).actionGet()); final String index = "foo_allowed".equals(origin) ? "bar" : "foo"; assertThat(e, hasToString(containsString("origin [" + origin + "] not allowed for index [" + index + "]"))); - final AliasesExistResponse response = client().admin().indices().aliasesExist(new GetAliasesRequest("alias")).actionGet(); - assertFalse(response.exists()); + assertTrue(client().admin().indices().getAliases(new GetAliasesRequest("alias")).actionGet().getAliases().isEmpty()); } - } diff --git a/server/src/internalClusterTest/java/org/opensearch/aliases/IndexAliasesIT.java b/server/src/internalClusterTest/java/org/opensearch/aliases/IndexAliasesIT.java index ff64a2cd90cb8..574046509de75 100644 --- a/server/src/internalClusterTest/java/org/opensearch/aliases/IndexAliasesIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/aliases/IndexAliasesIT.java @@ -35,7 +35,6 @@ import com.carrotsearch.hppc.cursors.ObjectObjectCursor; import org.opensearch.action.admin.indices.alias.Alias; import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest.AliasActions; -import org.opensearch.action.admin.indices.alias.exists.AliasesExistResponse; import org.opensearch.action.admin.indices.alias.get.GetAliasesResponse; import org.opensearch.action.admin.indices.create.CreateIndexRequestBuilder; import org.opensearch.action.delete.DeleteResponse; @@ -684,8 +683,9 @@ public void testDeleteAliases() throws Exception { assertAliasesVersionIncreases(indices, () -> admin().indices().prepareAliases().removeAlias(indices, aliases).get()); - AliasesExistResponse response = admin().indices().prepareAliasesExist(aliases).get(); - assertThat(response.exists(), equalTo(false)); + for (String alias : aliases) { + assertTrue(admin().indices().prepareGetAliases(alias).get().getAliases().isEmpty()); + } logger.info("--> creating index [foo_foo] and [bar_bar]"); assertAcked(prepareCreate("foo_foo")); @@ -701,9 +701,9 @@ public void testDeleteAliases() throws Exception { () -> assertAcked(admin().indices().prepareAliases().addAliasAction(AliasActions.remove().index("foo*").alias("foo"))) ); - assertTrue(admin().indices().prepareAliasesExist("foo").get().exists()); - assertFalse(admin().indices().prepareAliasesExist("foo").setIndices("foo_foo").get().exists()); - assertTrue(admin().indices().prepareAliasesExist("foo").setIndices("bar_bar").get().exists()); + assertFalse(admin().indices().prepareGetAliases("foo").get().getAliases().isEmpty()); + assertTrue(admin().indices().prepareGetAliases("foo").setIndices("foo_foo").get().getAliases().isEmpty()); + assertFalse(admin().indices().prepareGetAliases("foo").setIndices("bar_bar").get().getAliases().isEmpty()); IllegalArgumentException iae = expectThrows( IllegalArgumentException.class, () -> admin().indices().prepareAliases().addAliasAction(AliasActions.remove().index("foo").alias("foo")).execute().actionGet() @@ -880,8 +880,7 @@ public void testIndicesGetAliases() throws Exception { assertThat(getResponse.getAliases().get("foobar").get(0).getFilter(), nullValue()); assertThat(getResponse.getAliases().get("foobar").get(0).getIndexRouting(), nullValue()); assertThat(getResponse.getAliases().get("foobar").get(0).getSearchRouting(), nullValue()); - AliasesExistResponse existsResponse = admin().indices().prepareAliasesExist("alias1").get(); - assertThat(existsResponse.exists(), equalTo(true)); + assertFalse(admin().indices().prepareGetAliases("alias1").get().getAliases().isEmpty()); logger.info("--> getting all aliases that start with alias*"); getResponse = admin().indices().prepareGetAliases("alias*").get(); @@ -898,8 +897,7 @@ public void testIndicesGetAliases() throws Exception { assertThat(getResponse.getAliases().get("foobar").get(1).getFilter(), nullValue()); assertThat(getResponse.getAliases().get("foobar").get(1).getIndexRouting(), nullValue()); assertThat(getResponse.getAliases().get("foobar").get(1).getSearchRouting(), nullValue()); - existsResponse = admin().indices().prepareAliasesExist("alias*").get(); - assertThat(existsResponse.exists(), equalTo(true)); + assertFalse(admin().indices().prepareGetAliases("alias*").get().getAliases().isEmpty()); logger.info("--> creating aliases [bar, baz, foo]"); assertAliasesVersionIncreases( @@ -937,8 +935,10 @@ public void testIndicesGetAliases() throws Exception { assertThat(getResponse.getAliases().get("bazbar").get(1).getFilter(), nullValue()); assertThat(getResponse.getAliases().get("bazbar").get(1).getIndexRouting(), nullValue()); assertThat(getResponse.getAliases().get("bazbar").get(1).getSearchRouting(), nullValue()); - existsResponse = admin().indices().prepareAliasesExist("bar", "bac").addIndices("bazbar").get(); - assertThat(existsResponse.exists(), equalTo(true)); + assertFalse(admin().indices().prepareGetAliases("bar").get().getAliases().isEmpty()); + assertFalse(admin().indices().prepareGetAliases("bac").get().getAliases().isEmpty()); + assertFalse(admin().indices().prepareGetAliases("bar").addIndices("bazbar").get().getAliases().isEmpty()); + assertFalse(admin().indices().prepareGetAliases("bac").addIndices("bazbar").get().getAliases().isEmpty()); logger.info("--> getting *b* for index baz*"); getResponse = admin().indices().prepareGetAliases("*b*").addIndices("baz*").get(); @@ -957,8 +957,7 @@ public void testIndicesGetAliases() throws Exception { assertThat(getResponse.getAliases().get("bazbar").get(1).getFilter(), nullValue()); assertThat(getResponse.getAliases().get("bazbar").get(1).getIndexRouting(), nullValue()); assertThat(getResponse.getAliases().get("bazbar").get(1).getSearchRouting(), nullValue()); - existsResponse = admin().indices().prepareAliasesExist("*b*").addIndices("baz*").get(); - assertThat(existsResponse.exists(), equalTo(true)); + assertFalse(admin().indices().prepareGetAliases("*b*").addIndices("baz*").get().getAliases().isEmpty()); logger.info("--> getting *b* for index *bar"); getResponse = admin().indices().prepareGetAliases("b*").addIndices("*bar").get(); @@ -982,8 +981,7 @@ public void testIndicesGetAliases() throws Exception { assertThat(getResponse.getAliases().get("foobar").get(0).getFilter(), nullValue()); assertThat(getResponse.getAliases().get("foobar").get(0).getIndexRouting(), equalTo("bla")); assertThat(getResponse.getAliases().get("foobar").get(0).getSearchRouting(), equalTo("bla")); - existsResponse = admin().indices().prepareAliasesExist("b*").addIndices("*bar").get(); - assertThat(existsResponse.exists(), equalTo(true)); + assertFalse(admin().indices().prepareGetAliases("b*").addIndices("*bar").get().getAliases().isEmpty()); logger.info("--> getting f* for index *bar"); getResponse = admin().indices().prepareGetAliases("f*").addIndices("*bar").get(); @@ -994,8 +992,7 @@ public void testIndicesGetAliases() throws Exception { assertThat(getResponse.getAliases().get("foobar").get(0).getFilter(), nullValue()); assertThat(getResponse.getAliases().get("foobar").get(0).getIndexRouting(), nullValue()); assertThat(getResponse.getAliases().get("foobar").get(0).getSearchRouting(), nullValue()); - existsResponse = admin().indices().prepareAliasesExist("f*").addIndices("*bar").get(); - assertThat(existsResponse.exists(), equalTo(true)); + assertFalse(admin().indices().prepareGetAliases("f*").addIndices("*bar").get().getAliases().isEmpty()); // alias at work logger.info("--> getting f* for index *bac"); @@ -1008,8 +1005,7 @@ public void testIndicesGetAliases() throws Exception { assertThat(getResponse.getAliases().get("foobar").get(0).getFilter(), nullValue()); assertThat(getResponse.getAliases().get("foobar").get(0).getIndexRouting(), nullValue()); assertThat(getResponse.getAliases().get("foobar").get(0).getSearchRouting(), nullValue()); - existsResponse = admin().indices().prepareAliasesExist("foo").addIndices("*bac").get(); - assertThat(existsResponse.exists(), equalTo(true)); + assertFalse(admin().indices().prepareGetAliases("foo").addIndices("*bac").get().getAliases().isEmpty()); logger.info("--> getting foo for index foobar"); getResponse = admin().indices().prepareGetAliases("foo").addIndices("foobar").get(); @@ -1020,8 +1016,7 @@ public void testIndicesGetAliases() throws Exception { assertThat(getResponse.getAliases().get("foobar").get(0).getFilter(), nullValue()); assertThat(getResponse.getAliases().get("foobar").get(0).getIndexRouting(), nullValue()); assertThat(getResponse.getAliases().get("foobar").get(0).getSearchRouting(), nullValue()); - existsResponse = admin().indices().prepareAliasesExist("foo").addIndices("foobar").get(); - assertThat(existsResponse.exists(), equalTo(true)); + assertFalse(admin().indices().prepareGetAliases("foo").addIndices("foobar").get().getAliases().isEmpty()); for (String aliasName : new String[] { null, "_all", "*" }) { logger.info("--> getting {} alias for index foobar", aliasName); @@ -1044,8 +1039,7 @@ public void testIndicesGetAliases() throws Exception { assertThat(getResponse.getAliases().size(), equalTo(2)); assertThat(getResponse.getAliases().get("foobar").size(), equalTo(4)); assertThat(getResponse.getAliases().get("bazbar").size(), equalTo(2)); - existsResponse = admin().indices().prepareAliasesExist("*").addIndices("*bac").get(); - assertThat(existsResponse.exists(), equalTo(true)); + assertFalse(admin().indices().prepareGetAliases("*").addIndices("*bac").get().getAliases().isEmpty()); assertAcked(admin().indices().prepareAliases().removeAlias("foobar", "foo")); @@ -1053,8 +1047,7 @@ public void testIndicesGetAliases() throws Exception { for (final ObjectObjectCursor> entry : getResponse.getAliases()) { assertTrue(entry.value.isEmpty()); } - existsResponse = admin().indices().prepareAliasesExist("foo").addIndices("foobar").get(); - assertThat(existsResponse.exists(), equalTo(false)); + assertTrue(admin().indices().prepareGetAliases("foo").addIndices("foobar").get().getAliases().isEmpty()); } public void testGetAllAliasesWorks() { @@ -1226,7 +1219,7 @@ public void testAliasesWithBlocks() { ); assertAliasesVersionIncreases("test", () -> assertAcked(admin().indices().prepareAliases().removeAlias("test", "alias1"))); assertThat(admin().indices().prepareGetAliases("alias2").execute().actionGet().getAliases().get("test").size(), equalTo(1)); - assertThat(admin().indices().prepareAliasesExist("alias2").get().exists(), equalTo(true)); + assertFalse(admin().indices().prepareGetAliases("alias2").get().getAliases().isEmpty()); } finally { disableIndexBlock("test", block); } @@ -1244,8 +1237,7 @@ public void testAliasesWithBlocks() { () -> assertBlocked(admin().indices().prepareAliases().removeAlias("test", "alias2"), INDEX_READ_ONLY_BLOCK) ); assertThat(admin().indices().prepareGetAliases("alias2").execute().actionGet().getAliases().get("test").size(), equalTo(1)); - assertThat(admin().indices().prepareAliasesExist("alias2").get().exists(), equalTo(true)); - + assertFalse(admin().indices().prepareGetAliases("alias2").get().getAliases().isEmpty()); } finally { disableIndexBlock("test", SETTING_READ_ONLY); } @@ -1262,8 +1254,7 @@ public void testAliasesWithBlocks() { () -> assertBlocked(admin().indices().prepareAliases().removeAlias("test", "alias2"), INDEX_METADATA_BLOCK) ); assertBlocked(admin().indices().prepareGetAliases("alias2"), INDEX_METADATA_BLOCK); - assertBlocked(admin().indices().prepareAliasesExist("alias2"), INDEX_METADATA_BLOCK); - + assertBlocked(admin().indices().prepareGetAliases("alias2"), INDEX_METADATA_BLOCK); } finally { disableIndexBlock("test", SETTING_BLOCKS_METADATA); } @@ -1288,12 +1279,12 @@ public void testAliasActionRemoveIndex() throws InterruptedException, ExecutionE assertAcked(client().admin().indices().prepareAliases().removeIndex("foo*")); assertFalse(client().admin().indices().prepareExists("foo_foo").execute().actionGet().isExists()); - assertTrue(admin().indices().prepareAliasesExist("foo").get().exists()); + assertFalse(admin().indices().prepareGetAliases("foo").get().getAliases().isEmpty()); assertTrue(client().admin().indices().prepareExists("bar_bar").execute().actionGet().isExists()); - assertTrue(admin().indices().prepareAliasesExist("foo").setIndices("bar_bar").get().exists()); + assertFalse(admin().indices().prepareGetAliases("foo").setIndices("bar_bar").get().getAliases().isEmpty()); assertAcked(client().admin().indices().prepareAliases().removeIndex("bar_bar")); - assertFalse(admin().indices().prepareAliasesExist("foo").get().exists()); + assertTrue(admin().indices().prepareGetAliases("foo").get().getAliases().isEmpty()); assertFalse(client().admin().indices().prepareExists("bar_bar").execute().actionGet().isExists()); } diff --git a/server/src/internalClusterTest/java/org/opensearch/indices/IndicesOptionsIntegrationIT.java b/server/src/internalClusterTest/java/org/opensearch/indices/IndicesOptionsIntegrationIT.java index 0ea35a24d7c26..1f3d865811939 100644 --- a/server/src/internalClusterTest/java/org/opensearch/indices/IndicesOptionsIntegrationIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/indices/IndicesOptionsIntegrationIT.java @@ -34,7 +34,6 @@ import org.opensearch.action.ActionRequestBuilder; import org.opensearch.action.admin.cluster.snapshots.create.CreateSnapshotRequestBuilder; import org.opensearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequestBuilder; -import org.opensearch.action.admin.indices.alias.exists.AliasesExistRequestBuilder; import org.opensearch.action.admin.indices.alias.get.GetAliasesRequestBuilder; import org.opensearch.action.admin.indices.cache.clear.ClearIndicesCacheRequestBuilder; import org.opensearch.action.admin.indices.flush.FlushRequestBuilder; @@ -97,7 +96,6 @@ public void testSpecifiedIndexUnavailableMultipleIndices() throws Exception { verify(forceMerge("test1", "test2"), true); verify(refreshBuilder("test1", "test2"), true); verify(validateQuery("test1", "test2"), true); - verify(aliasExists("test1", "test2"), true); verify(getAliases("test1", "test2"), true); verify(getFieldMapping("test1", "test2"), true); verify(getMapping("test1", "test2"), true); @@ -113,7 +111,6 @@ public void testSpecifiedIndexUnavailableMultipleIndices() throws Exception { verify(forceMerge("test1", "test2").setIndicesOptions(options), true); verify(refreshBuilder("test1", "test2").setIndicesOptions(options), true); verify(validateQuery("test1", "test2").setIndicesOptions(options), true); - verify(aliasExists("test1", "test2").setIndicesOptions(options), true); verify(getAliases("test1", "test2").setIndicesOptions(options), true); verify(getFieldMapping("test1", "test2").setIndicesOptions(options), true); verify(getMapping("test1", "test2").setIndicesOptions(options), true); @@ -129,7 +126,6 @@ public void testSpecifiedIndexUnavailableMultipleIndices() throws Exception { verify(forceMerge("test1", "test2").setIndicesOptions(options), false); verify(refreshBuilder("test1", "test2").setIndicesOptions(options), false); verify(validateQuery("test1", "test2").setIndicesOptions(options), false); - verify(aliasExists("test1", "test2").setIndicesOptions(options), false); verify(getAliases("test1", "test2").setIndicesOptions(options), false); verify(getFieldMapping("test1", "test2").setIndicesOptions(options), false); verify(getMapping("test1", "test2").setIndicesOptions(options), false); @@ -146,7 +142,6 @@ public void testSpecifiedIndexUnavailableMultipleIndices() throws Exception { verify(forceMerge("test1", "test2").setIndicesOptions(options), false); verify(refreshBuilder("test1", "test2").setIndicesOptions(options), false); verify(validateQuery("test1", "test2").setIndicesOptions(options), false); - verify(aliasExists("test1", "test2").setIndicesOptions(options), false); verify(getAliases("test1", "test2").setIndicesOptions(options), false); verify(getFieldMapping("test1", "test2").setIndicesOptions(options), false); verify(getMapping("test1", "test2").setIndicesOptions(options), false); @@ -172,7 +167,6 @@ public void testSpecifiedIndexUnavailableSingleIndexThatIsClosed() throws Except verify(forceMerge("test1").setIndicesOptions(options), true); verify(refreshBuilder("test1").setIndicesOptions(options), true); verify(validateQuery("test1").setIndicesOptions(options), true); - verify(aliasExists("test1").setIndicesOptions(options), true); verify(getAliases("test1").setIndicesOptions(options), true); verify(getFieldMapping("test1").setIndicesOptions(options), true); verify(getMapping("test1").setIndicesOptions(options), true); @@ -194,7 +188,6 @@ public void testSpecifiedIndexUnavailableSingleIndexThatIsClosed() throws Except verify(forceMerge("test1").setIndicesOptions(options), false); verify(refreshBuilder("test1").setIndicesOptions(options), false); verify(validateQuery("test1").setIndicesOptions(options), false); - verify(aliasExists("test1").setIndicesOptions(options), false); verify(getAliases("test1").setIndicesOptions(options), false); verify(getFieldMapping("test1").setIndicesOptions(options), false); verify(getMapping("test1").setIndicesOptions(options), false); @@ -213,7 +206,6 @@ public void testSpecifiedIndexUnavailableSingleIndexThatIsClosed() throws Except verify(forceMerge("test1").setIndicesOptions(options), false); verify(refreshBuilder("test1").setIndicesOptions(options), false); verify(validateQuery("test1").setIndicesOptions(options), false); - verify(aliasExists("test1").setIndicesOptions(options), false); verify(getAliases("test1").setIndicesOptions(options), false); verify(getFieldMapping("test1").setIndicesOptions(options), false); verify(getMapping("test1").setIndicesOptions(options), false); @@ -231,7 +223,6 @@ public void testSpecifiedIndexUnavailableSingleIndex() throws Exception { verify(forceMerge("test1").setIndicesOptions(options), true); verify(refreshBuilder("test1").setIndicesOptions(options), true); verify(validateQuery("test1").setIndicesOptions(options), true); - verify(aliasExists("test1").setIndicesOptions(options), true); verify(getAliases("test1").setIndicesOptions(options), true); verify(getFieldMapping("test1").setIndicesOptions(options), true); verify(getMapping("test1").setIndicesOptions(options), true); @@ -253,7 +244,6 @@ public void testSpecifiedIndexUnavailableSingleIndex() throws Exception { verify(forceMerge("test1").setIndicesOptions(options), false); verify(refreshBuilder("test1").setIndicesOptions(options), false); verify(validateQuery("test1").setIndicesOptions(options), false); - verify(aliasExists("test1").setIndicesOptions(options), false); verify(getAliases("test1").setIndicesOptions(options), false); verify(getFieldMapping("test1").setIndicesOptions(options), false); verify(getMapping("test1").setIndicesOptions(options), false); @@ -271,7 +261,6 @@ public void testSpecifiedIndexUnavailableSingleIndex() throws Exception { verify(forceMerge("test1").setIndicesOptions(options), false); verify(refreshBuilder("test1").setIndicesOptions(options), false); verify(validateQuery("test1").setIndicesOptions(options), false); - verify(aliasExists("test1").setIndicesOptions(options), false); verify(getAliases("test1").setIndicesOptions(options), false); verify(getFieldMapping("test1").setIndicesOptions(options), false); verify(getMapping("test1").setIndicesOptions(options), false); @@ -324,7 +313,6 @@ public void testWildcardBehaviour() throws Exception { verify(forceMerge(indices), false); verify(refreshBuilder(indices), false); verify(validateQuery(indices), true); - verify(aliasExists(indices), false); verify(getAliases(indices), false); verify(getFieldMapping(indices), false); verify(getMapping(indices), false); @@ -341,7 +329,6 @@ public void testWildcardBehaviour() throws Exception { verify(forceMerge(indices).setIndicesOptions(options), false); verify(refreshBuilder(indices).setIndicesOptions(options), false); verify(validateQuery(indices).setIndicesOptions(options), false); - verify(aliasExists(indices).setIndicesOptions(options), false); verify(getAliases(indices).setIndicesOptions(options), false); verify(getFieldMapping(indices).setIndicesOptions(options), false); verify(getMapping(indices).setIndicesOptions(options), false); @@ -361,7 +348,6 @@ public void testWildcardBehaviour() throws Exception { verify(forceMerge(indices), false); verify(refreshBuilder(indices), false); verify(validateQuery(indices), false); - verify(aliasExists(indices), false); verify(getAliases(indices), false); verify(getFieldMapping(indices), false); verify(getMapping(indices), false); @@ -378,7 +364,6 @@ public void testWildcardBehaviour() throws Exception { verify(forceMerge(indices), false); verify(refreshBuilder(indices), false); verify(validateQuery(indices), true); - verify(aliasExists(indices), false); verify(getAliases(indices), false); verify(getFieldMapping(indices), false); verify(getMapping(indices), false); @@ -395,7 +380,6 @@ public void testWildcardBehaviour() throws Exception { verify(forceMerge(indices).setIndicesOptions(options), false); verify(refreshBuilder(indices).setIndicesOptions(options), false); verify(validateQuery(indices).setIndicesOptions(options), false); - verify(aliasExists(indices).setIndicesOptions(options), false); verify(getAliases(indices).setIndicesOptions(options), false); verify(getFieldMapping(indices).setIndicesOptions(options), false); verify(getMapping(indices).setIndicesOptions(options), false); @@ -557,25 +541,23 @@ public void testDeleteIndexWildcard() throws Exception { public void testPutAlias() throws Exception { createIndex("foobar"); verify(client().admin().indices().prepareAliases().addAlias("foobar", "foobar_alias"), false); - assertThat(client().admin().indices().prepareAliasesExist("foobar_alias").setIndices("foobar").get().exists(), equalTo(true)); - + assertFalse(client().admin().indices().prepareGetAliases("foobar_alias").setIndices("foobar").get().getAliases().isEmpty()); } public void testPutAliasWildcard() throws Exception { createIndex("foo", "foobar", "bar", "barbaz"); verify(client().admin().indices().prepareAliases().addAlias("foo*", "foobar_alias"), false); - assertThat(client().admin().indices().prepareAliasesExist("foobar_alias").setIndices("foo").get().exists(), equalTo(true)); - assertThat(client().admin().indices().prepareAliasesExist("foobar_alias").setIndices("foobar").get().exists(), equalTo(true)); - assertThat(client().admin().indices().prepareAliasesExist("foobar_alias").setIndices("bar").get().exists(), equalTo(false)); - assertThat(client().admin().indices().prepareAliasesExist("foobar_alias").setIndices("barbaz").get().exists(), equalTo(false)); + assertFalse(client().admin().indices().prepareGetAliases("foobar_alias").setIndices("foo").get().getAliases().isEmpty()); + assertFalse(client().admin().indices().prepareGetAliases("foobar_alias").setIndices("foobar").get().getAliases().isEmpty()); + assertTrue(client().admin().indices().prepareGetAliases("foobar_alias").setIndices("bar").get().getAliases().isEmpty()); + assertTrue(client().admin().indices().prepareGetAliases("foobar_alias").setIndices("barbaz").get().getAliases().isEmpty()); verify(client().admin().indices().prepareAliases().addAlias("*", "foobar_alias"), false); - assertThat(client().admin().indices().prepareAliasesExist("foobar_alias").setIndices("foo").get().exists(), equalTo(true)); - assertThat(client().admin().indices().prepareAliasesExist("foobar_alias").setIndices("foobar").get().exists(), equalTo(true)); - assertThat(client().admin().indices().prepareAliasesExist("foobar_alias").setIndices("bar").get().exists(), equalTo(true)); - assertThat(client().admin().indices().prepareAliasesExist("foobar_alias").setIndices("barbaz").get().exists(), equalTo(true)); - + assertFalse(client().admin().indices().prepareGetAliases("foobar_alias").setIndices("foo").get().getAliases().isEmpty()); + assertFalse(client().admin().indices().prepareGetAliases("foobar_alias").setIndices("foobar").get().getAliases().isEmpty()); + assertFalse(client().admin().indices().prepareGetAliases("foobar_alias").setIndices("bar").get().getAliases().isEmpty()); + assertFalse(client().admin().indices().prepareGetAliases("foobar_alias").setIndices("barbaz").get().getAliases().isEmpty()); } public void testPutMapping() throws Exception { @@ -705,10 +687,6 @@ static ValidateQueryRequestBuilder validateQuery(String... indices) { return client().admin().indices().prepareValidateQuery(indices); } - private static AliasesExistRequestBuilder aliasExists(String... indices) { - return client().admin().indices().prepareAliasesExist("dummy").addIndices(indices); - } - static GetAliasesRequestBuilder getAliases(String... indices) { return client().admin().indices().prepareGetAliases("dummy").addIndices(indices); } diff --git a/server/src/main/java/org/opensearch/action/ActionModule.java b/server/src/main/java/org/opensearch/action/ActionModule.java index d5d9660dbcf1e..9d1926f0d5ae5 100644 --- a/server/src/main/java/org/opensearch/action/ActionModule.java +++ b/server/src/main/java/org/opensearch/action/ActionModule.java @@ -108,8 +108,6 @@ import org.opensearch.action.admin.indices.alias.IndicesAliasesAction; import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest; import org.opensearch.action.admin.indices.alias.TransportIndicesAliasesAction; -import org.opensearch.action.admin.indices.alias.exists.AliasesExistAction; -import org.opensearch.action.admin.indices.alias.exists.TransportAliasesExistAction; import org.opensearch.action.admin.indices.alias.get.GetAliasesAction; import org.opensearch.action.admin.indices.alias.get.TransportGetAliasesAction; import org.opensearch.action.admin.indices.analyze.AnalyzeAction; @@ -590,7 +588,6 @@ public void reg actions.register(UpgradeSettingsAction.INSTANCE, TransportUpgradeSettingsAction.class); actions.register(ClearIndicesCacheAction.INSTANCE, TransportClearIndicesCacheAction.class); actions.register(GetAliasesAction.INSTANCE, TransportGetAliasesAction.class); - actions.register(AliasesExistAction.INSTANCE, TransportAliasesExistAction.class); actions.register(GetSettingsAction.INSTANCE, TransportGetSettingsAction.class); actions.register(IndexAction.INSTANCE, TransportIndexAction.class); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/alias/exists/AliasesExistAction.java b/server/src/main/java/org/opensearch/action/admin/indices/alias/exists/AliasesExistAction.java deleted file mode 100644 index 964648ab04705..0000000000000 --- a/server/src/main/java/org/opensearch/action/admin/indices/alias/exists/AliasesExistAction.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.action.admin.indices.alias.exists; - -import org.opensearch.action.ActionType; - -public class AliasesExistAction extends ActionType { - - public static final AliasesExistAction INSTANCE = new AliasesExistAction(); - public static final String NAME = "indices:admin/aliases/exists"; - - private AliasesExistAction() { - super(NAME, AliasesExistResponse::new); - } -} diff --git a/server/src/main/java/org/opensearch/action/admin/indices/alias/exists/AliasesExistRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/alias/exists/AliasesExistRequestBuilder.java deleted file mode 100644 index 20949360ddab8..0000000000000 --- a/server/src/main/java/org/opensearch/action/admin/indices/alias/exists/AliasesExistRequestBuilder.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.action.admin.indices.alias.exists; - -import org.opensearch.action.admin.indices.alias.get.BaseAliasesRequestBuilder; -import org.opensearch.client.OpenSearchClient; - -public class AliasesExistRequestBuilder extends BaseAliasesRequestBuilder { - - public AliasesExistRequestBuilder(OpenSearchClient client, AliasesExistAction action, String... aliases) { - super(client, action, aliases); - } -} diff --git a/server/src/main/java/org/opensearch/action/admin/indices/alias/exists/AliasesExistResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/alias/exists/AliasesExistResponse.java deleted file mode 100644 index 447f10e5ab34a..0000000000000 --- a/server/src/main/java/org/opensearch/action/admin/indices/alias/exists/AliasesExistResponse.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.action.admin.indices.alias.exists; - -import org.opensearch.action.ActionResponse; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; - -import java.io.IOException; - -public class AliasesExistResponse extends ActionResponse { - - private boolean exists; - - public AliasesExistResponse(boolean exists) { - this.exists = exists; - } - - AliasesExistResponse(StreamInput in) throws IOException { - super(in); - exists = in.readBoolean(); - } - - public boolean exists() { - return exists; - } - - public boolean isExists() { - return exists(); - } - - @Override - public void writeTo(StreamOutput out) throws IOException { - out.writeBoolean(exists); - } -} diff --git a/server/src/main/java/org/opensearch/action/admin/indices/alias/exists/TransportAliasesExistAction.java b/server/src/main/java/org/opensearch/action/admin/indices/alias/exists/TransportAliasesExistAction.java deleted file mode 100644 index 8a86a27561527..0000000000000 --- a/server/src/main/java/org/opensearch/action/admin/indices/alias/exists/TransportAliasesExistAction.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.action.admin.indices.alias.exists; - -import org.opensearch.action.ActionListener; -import org.opensearch.action.admin.indices.alias.get.GetAliasesRequest; -import org.opensearch.action.support.ActionFilters; -import org.opensearch.action.support.master.TransportMasterNodeReadAction; -import org.opensearch.cluster.ClusterState; -import org.opensearch.cluster.block.ClusterBlockException; -import org.opensearch.cluster.block.ClusterBlockLevel; -import org.opensearch.cluster.metadata.IndexNameExpressionResolver; -import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.inject.Inject; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.threadpool.ThreadPool; -import org.opensearch.transport.TransportService; - -import java.io.IOException; - -public class TransportAliasesExistAction extends TransportMasterNodeReadAction { - - @Inject - public TransportAliasesExistAction( - TransportService transportService, - ClusterService clusterService, - ThreadPool threadPool, - ActionFilters actionFilters, - IndexNameExpressionResolver indexNameExpressionResolver - ) { - super( - AliasesExistAction.NAME, - transportService, - clusterService, - threadPool, - actionFilters, - GetAliasesRequest::new, - indexNameExpressionResolver - ); - } - - @Override - protected String executor() { - // very lightweight operation, no need to fork - return ThreadPool.Names.SAME; - } - - @Override - protected AliasesExistResponse read(StreamInput in) throws IOException { - return new AliasesExistResponse(in); - } - - @Override - protected ClusterBlockException checkBlock(GetAliasesRequest request, ClusterState state) { - return state.blocks() - .indicesBlockedException(ClusterBlockLevel.METADATA_READ, indexNameExpressionResolver.concreteIndexNames(state, request)); - } - - @Override - protected void masterOperation(GetAliasesRequest request, ClusterState state, ActionListener listener) { - String[] concreteIndices = indexNameExpressionResolver.concreteIndexNames(state, request); - boolean result = state.metadata().hasAliases(request.aliases(), concreteIndices); - listener.onResponse(new AliasesExistResponse(result)); - } - -} diff --git a/server/src/main/java/org/opensearch/action/admin/indices/alias/exists/package-info.java b/server/src/main/java/org/opensearch/action/admin/indices/alias/exists/package-info.java deleted file mode 100644 index dd4886e6b3419..0000000000000 --- a/server/src/main/java/org/opensearch/action/admin/indices/alias/exists/package-info.java +++ /dev/null @@ -1,10 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/** Alias Exists transport handler. */ -package org.opensearch.action.admin.indices.alias.exists; diff --git a/server/src/main/java/org/opensearch/client/IndicesAdminClient.java b/server/src/main/java/org/opensearch/client/IndicesAdminClient.java index 35f880dbff5e3..50430e3eb8507 100644 --- a/server/src/main/java/org/opensearch/client/IndicesAdminClient.java +++ b/server/src/main/java/org/opensearch/client/IndicesAdminClient.java @@ -36,8 +36,6 @@ import org.opensearch.action.ActionListener; import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest; import org.opensearch.action.admin.indices.alias.IndicesAliasesRequestBuilder; -import org.opensearch.action.admin.indices.alias.exists.AliasesExistRequestBuilder; -import org.opensearch.action.admin.indices.alias.exists.AliasesExistResponse; import org.opensearch.action.admin.indices.alias.get.GetAliasesRequest; import org.opensearch.action.admin.indices.alias.get.GetAliasesRequestBuilder; import org.opensearch.action.admin.indices.alias.get.GetAliasesResponse; @@ -564,26 +562,6 @@ public interface IndicesAdminClient extends OpenSearchClient { */ GetAliasesRequestBuilder prepareGetAliases(String... aliases); - /** - * Allows to check to existence of aliases from indices. - */ - AliasesExistRequestBuilder prepareAliasesExist(String... aliases); - - /** - * Check to existence of index aliases. - * - * @param request The result future - */ - ActionFuture aliasesExist(GetAliasesRequest request); - - /** - * Check the existence of specified index aliases. - * - * @param request The index aliases request - * @param listener A listener to be notified with a result - */ - void aliasesExist(GetAliasesRequest request, ActionListener listener); - /** * Get index metadata for particular indices. * diff --git a/server/src/main/java/org/opensearch/client/support/AbstractClient.java b/server/src/main/java/org/opensearch/client/support/AbstractClient.java index 96380904304b5..4c8f5935e3680 100644 --- a/server/src/main/java/org/opensearch/client/support/AbstractClient.java +++ b/server/src/main/java/org/opensearch/client/support/AbstractClient.java @@ -154,9 +154,6 @@ import org.opensearch.action.admin.indices.alias.IndicesAliasesAction; import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest; import org.opensearch.action.admin.indices.alias.IndicesAliasesRequestBuilder; -import org.opensearch.action.admin.indices.alias.exists.AliasesExistAction; -import org.opensearch.action.admin.indices.alias.exists.AliasesExistRequestBuilder; -import org.opensearch.action.admin.indices.alias.exists.AliasesExistResponse; import org.opensearch.action.admin.indices.alias.get.GetAliasesAction; import org.opensearch.action.admin.indices.alias.get.GetAliasesRequest; import org.opensearch.action.admin.indices.alias.get.GetAliasesRequestBuilder; @@ -1363,21 +1360,6 @@ public ActionFuture clearCache(final ClearIndicesCach return execute(ClearIndicesCacheAction.INSTANCE, request); } - @Override - public void aliasesExist(GetAliasesRequest request, ActionListener listener) { - execute(AliasesExistAction.INSTANCE, request, listener); - } - - @Override - public ActionFuture aliasesExist(GetAliasesRequest request) { - return execute(AliasesExistAction.INSTANCE, request); - } - - @Override - public AliasesExistRequestBuilder prepareAliasesExist(String... aliases) { - return new AliasesExistRequestBuilder(this, AliasesExistAction.INSTANCE, aliases); - } - @Override public ActionFuture getIndex(GetIndexRequest request) { return execute(GetIndexAction.INSTANCE, request); diff --git a/server/src/main/java/org/opensearch/cluster/metadata/Metadata.java b/server/src/main/java/org/opensearch/cluster/metadata/Metadata.java index 6e9c30877f9c2..7cf3700402b6b 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/Metadata.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/Metadata.java @@ -421,38 +421,6 @@ private ImmutableOpenMap> findAliases(final String[] return mapBuilder.build(); } - /** - * Checks if at least one of the specified aliases exists in the specified concrete indices. Wildcards are supported in the - * alias names for partial matches. - * - * @param aliases The names of the index aliases to find - * @param concreteIndices The concrete indexes the index aliases must point to order to be returned. - * @return whether at least one of the specified aliases exists in one of the specified concrete indices. - */ - public boolean hasAliases(final String[] aliases, String[] concreteIndices) { - assert aliases != null; - assert concreteIndices != null; - if (concreteIndices.length == 0) { - return false; - } - - Iterable intersection = HppcMaps.intersection(ObjectHashSet.from(concreteIndices), indices.keys()); - for (String index : intersection) { - IndexMetadata indexMetadata = indices.get(index); - List filteredValues = new ArrayList<>(); - for (ObjectCursor cursor : indexMetadata.getAliases().values()) { - AliasMetadata value = cursor.value; - if (Regex.simpleMatch(aliases, value.alias())) { - filteredValues.add(value); - } - } - if (!filteredValues.isEmpty()) { - return true; - } - } - return false; - } - /** * Finds all mappings for concrete indices. Only fields that match the provided field * filter will be returned (default is a predicate that always returns true, which can be diff --git a/test/framework/src/main/java/org/opensearch/test/hamcrest/OpenSearchAssertions.java b/test/framework/src/main/java/org/opensearch/test/hamcrest/OpenSearchAssertions.java index 28afed1a50e59..16d44d1f8eeb4 100644 --- a/test/framework/src/main/java/org/opensearch/test/hamcrest/OpenSearchAssertions.java +++ b/test/framework/src/main/java/org/opensearch/test/hamcrest/OpenSearchAssertions.java @@ -40,7 +40,6 @@ import org.opensearch.action.ActionRequestBuilder; import org.opensearch.action.admin.cluster.health.ClusterHealthRequestBuilder; import org.opensearch.action.admin.cluster.health.ClusterHealthResponse; -import org.opensearch.action.admin.indices.alias.exists.AliasesExistResponse; import org.opensearch.action.admin.indices.create.CreateIndexResponse; import org.opensearch.action.admin.indices.delete.DeleteIndexRequestBuilder; import org.opensearch.action.admin.indices.template.get.GetIndexTemplatesResponse; @@ -104,7 +103,6 @@ import static org.hamcrest.Matchers.notNullValue; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -518,20 +516,6 @@ public static void assertIndexTemplateExists(GetIndexTemplatesResponse templates assertThat(templateNames, hasItem(name)); } - /** - * Assert that aliases are missing - */ - public static void assertAliasesMissing(AliasesExistResponse aliasesExistResponse) { - assertFalse("Aliases shouldn't exist", aliasesExistResponse.exists()); - } - - /** - * Assert that aliases exist - */ - public static void assertAliasesExist(AliasesExistResponse aliasesExistResponse) { - assertTrue("Aliases should exist", aliasesExistResponse.exists()); - } - /* * matchers */ From 47bbe05fb7fea3cffee1c71fe214c2801bd05891 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 3 May 2022 14:57:51 -0700 Subject: [PATCH 118/514] Make discovered_master field optional on the client to support compatibility for opensearch client with odfe (#2641) (#2652) Signed-off-by: Mohit Godwani (cherry picked from commit ec4fe7066b80b684c719630bf9609bb4bedd5a90) --- .../cluster/health/ClusterHealthResponse.java | 4 ++-- .../health/ClusterHealthResponsesTests.java | 23 ++++++++++++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthResponse.java index d9094e307fff1..841231c971eaa 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthResponse.java @@ -90,7 +90,7 @@ public class ClusterHealthResponse extends ActionResponse implements StatusToXCo // ClusterStateHealth fields int numberOfNodes = (int) parsedObjects[i++]; int numberOfDataNodes = (int) parsedObjects[i++]; - boolean hasDiscoveredMaster = (boolean) parsedObjects[i++]; + boolean hasDiscoveredMaster = Boolean.TRUE.equals(parsedObjects[i++]); int activeShards = (int) parsedObjects[i++]; int relocatingShards = (int) parsedObjects[i++]; int activePrimaryShards = (int) parsedObjects[i++]; @@ -151,7 +151,7 @@ public class ClusterHealthResponse extends ActionResponse implements StatusToXCo // ClusterStateHealth fields PARSER.declareInt(constructorArg(), new ParseField(NUMBER_OF_NODES)); PARSER.declareInt(constructorArg(), new ParseField(NUMBER_OF_DATA_NODES)); - PARSER.declareBoolean(constructorArg(), new ParseField(DISCOVERED_MASTER)); + PARSER.declareBoolean(optionalConstructorArg(), new ParseField(DISCOVERED_MASTER)); PARSER.declareInt(constructorArg(), new ParseField(ACTIVE_SHARDS)); PARSER.declareInt(constructorArg(), new ParseField(RELOCATING_SHARDS)); PARSER.declareInt(constructorArg(), new ParseField(ACTIVE_PRIMARY_SHARDS)); diff --git a/server/src/test/java/org/opensearch/action/admin/cluster/health/ClusterHealthResponsesTests.java b/server/src/test/java/org/opensearch/action/admin/cluster/health/ClusterHealthResponsesTests.java index decad9d6f840e..5af15396dbefa 100644 --- a/server/src/test/java/org/opensearch/action/admin/cluster/health/ClusterHealthResponsesTests.java +++ b/server/src/test/java/org/opensearch/action/admin/cluster/health/ClusterHealthResponsesTests.java @@ -228,7 +228,7 @@ public void testParseFromXContentWithDiscoveredMasterField() throws IOException NamedXContentRegistry.EMPTY, DeprecationHandler.THROW_UNSUPPORTED_OPERATION, "{\"cluster_name\":\"535799904437:7-1-3-node\",\"status\":\"green\"," - + "\"timed_out\":false,\"number_of_nodes\":6,\"number_of_data_nodes\":3,\"discovered_master\":false," + + "\"timed_out\":false,\"number_of_nodes\":6,\"number_of_data_nodes\":3,\"discovered_master\":true," + "\"active_primary_shards\":4,\"active_shards\":5,\"relocating_shards\":0,\"initializing_shards\":0," + "\"unassigned_shards\":0,\"delayed_unassigned_shards\":0,\"number_of_pending_tasks\":0," + "\"number_of_in_flight_fetch\":0,\"task_max_waiting_in_queue_millis\":0," @@ -236,6 +236,27 @@ public void testParseFromXContentWithDiscoveredMasterField() throws IOException ) ) { + ClusterHealthResponse clusterHealth = ClusterHealthResponse.fromXContent(parser); + assertNotNull(clusterHealth); + assertThat(clusterHealth.getClusterName(), Matchers.equalTo("535799904437:7-1-3-node")); + assertThat(clusterHealth.getNumberOfNodes(), Matchers.equalTo(6)); + assertThat(clusterHealth.hasDiscoveredMaster(), Matchers.equalTo(true)); + } + } + + public void testParseFromXContentWithoutDiscoveredMasterField() throws IOException { + try ( + XContentParser parser = JsonXContent.jsonXContent.createParser( + NamedXContentRegistry.EMPTY, + DeprecationHandler.THROW_UNSUPPORTED_OPERATION, + "{\"cluster_name\":\"535799904437:7-1-3-node\",\"status\":\"green\"," + + "\"timed_out\":false,\"number_of_nodes\":6,\"number_of_data_nodes\":3," + + "\"active_primary_shards\":4,\"active_shards\":5,\"relocating_shards\":0,\"initializing_shards\":0," + + "\"unassigned_shards\":0,\"delayed_unassigned_shards\":0,\"number_of_pending_tasks\":0," + + "\"number_of_in_flight_fetch\":0,\"task_max_waiting_in_queue_millis\":0," + + "\"active_shards_percent_as_number\":100}" + ) + ) { ClusterHealthResponse clusterHealth = ClusterHealthResponse.fromXContent(parser); assertNotNull(clusterHealth); assertThat(clusterHealth.getClusterName(), Matchers.equalTo("535799904437:7-1-3-node")); From 536a68a3c959db4a9925577dae72c5d47a072db2 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 3 May 2022 22:17:31 -0500 Subject: [PATCH 119/514] [Javadocs] add to o.o.bootstrap, cli, and client (#3163) (#3167) Adds javadocs to o.o.bootstrap, o.o.cli, and o.o.client packages. Signed-off-by: Nicholas Walter Knize (cherry picked from commit c13b679aad33f1f4b622c926cc468b6bb3fff7ef) --- build.gradle | 9 +++++---- .../main/java/org/opensearch/bootstrap/Bootstrap.java | 2 ++ .../java/org/opensearch/bootstrap/BootstrapCheck.java | 2 ++ .../java/org/opensearch/bootstrap/BootstrapChecks.java | 2 ++ .../java/org/opensearch/bootstrap/BootstrapContext.java | 2 ++ .../org/opensearch/bootstrap/BootstrapException.java | 2 ++ .../java/org/opensearch/bootstrap/BootstrapInfo.java | 2 ++ .../java/org/opensearch/bootstrap/BootstrapSettings.java | 5 +++++ .../org/opensearch/bootstrap/ConsoleCtrlHandler.java | 5 +++++ .../org/opensearch/bootstrap/FilePermissionUtils.java | 5 +++++ .../main/java/org/opensearch/bootstrap/JNACLibrary.java | 2 ++ .../org/opensearch/bootstrap/JNAKernel32Library.java | 2 ++ .../main/java/org/opensearch/bootstrap/JNANatives.java | 2 ++ .../src/main/java/org/opensearch/bootstrap/Natives.java | 2 ++ .../main/java/org/opensearch/bootstrap/OpenSearch.java | 2 ++ .../java/org/opensearch/bootstrap/OpenSearchPolicy.java | 6 +++++- .../bootstrap/OpenSearchUncaughtExceptionHandler.java | 5 +++++ .../src/main/java/org/opensearch/bootstrap/Security.java | 2 ++ .../src/main/java/org/opensearch/bootstrap/Spawner.java | 2 ++ .../java/org/opensearch/bootstrap/StartupException.java | 2 ++ .../java/org/opensearch/bootstrap/SystemCallFilter.java | 2 ++ .../org/opensearch/cli/CommandLoggingConfigurator.java | 2 ++ .../java/org/opensearch/cli/EnvironmentAwareCommand.java | 6 +++++- .../java/org/opensearch/cli/KeyStoreAwareCommand.java | 2 ++ .../java/org/opensearch/cli/LoggingAwareCommand.java | 2 ++ .../org/opensearch/cli/LoggingAwareMultiCommand.java | 2 ++ .../src/main/java/org/opensearch/client/AdminClient.java | 3 ++- server/src/main/java/org/opensearch/client/Client.java | 2 ++ .../java/org/opensearch/client/ClusterAdminClient.java | 2 ++ .../main/java/org/opensearch/client/FilterClient.java | 2 ++ .../java/org/opensearch/client/IndicesAdminClient.java | 2 ++ .../java/org/opensearch/client/OpenSearchClient.java | 5 +++++ .../java/org/opensearch/client/OriginSettingClient.java | 2 ++ .../org/opensearch/client/ParentTaskAssigningClient.java | 2 ++ server/src/main/java/org/opensearch/client/Requests.java | 2 ++ .../main/java/org/opensearch/client/node/NodeClient.java | 2 ++ .../org/opensearch/client/support/AbstractClient.java | 5 +++++ .../client/transport/NoNodeAvailableException.java | 2 ++ 38 files changed, 103 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index ae2247bb865d1..83ff703d29308 100644 --- a/build.gradle +++ b/build.gradle @@ -278,6 +278,7 @@ allprojects { // see https://discuss.gradle.org/t/add-custom-javadoc-option-that-does-not-take-an-argument/5959 javadoc.options.encoding = 'UTF8' javadoc.options.addStringOption('Xdoclint:all,-missing', '-quiet') + javadoc.options.tags = ["opensearch.internal", "opensearch.api", "opensearch.experimental"] } // support for reproducible builds @@ -387,7 +388,7 @@ gradle.projectsEvaluated { } } } - + dependencies { subprojects.findAll { it.pluginManager.hasPlugin('java') }.forEach { testReportAggregation it @@ -413,7 +414,7 @@ subprojects { // eclipse configuration allprojects { apply plugin: 'eclipse' - + // Name all the non-root projects after their path so that paths get grouped together when imported into eclipse. if (path != ':') { eclipse.project.name = path @@ -573,12 +574,12 @@ subprojects { reporting { reports { - testAggregateTestReport(AggregateTestReport) { + testAggregateTestReport(AggregateTestReport) { testType = TestSuiteType.UNIT_TEST } } } tasks.named(JavaBasePlugin.CHECK_TASK_NAME) { - dependsOn tasks.named('testAggregateTestReport', TestReport) + dependsOn tasks.named('testAggregateTestReport', TestReport) } diff --git a/server/src/main/java/org/opensearch/bootstrap/Bootstrap.java b/server/src/main/java/org/opensearch/bootstrap/Bootstrap.java index 1b773b62ef77b..42fe15da006e3 100644 --- a/server/src/main/java/org/opensearch/bootstrap/Bootstrap.java +++ b/server/src/main/java/org/opensearch/bootstrap/Bootstrap.java @@ -82,6 +82,8 @@ /** * Internal startup code. + * + * @opensearch.internal */ final class Bootstrap { diff --git a/server/src/main/java/org/opensearch/bootstrap/BootstrapCheck.java b/server/src/main/java/org/opensearch/bootstrap/BootstrapCheck.java index 230b1bd05e579..429612ba1b93d 100644 --- a/server/src/main/java/org/opensearch/bootstrap/BootstrapCheck.java +++ b/server/src/main/java/org/opensearch/bootstrap/BootstrapCheck.java @@ -36,6 +36,8 @@ /** * Encapsulates a bootstrap check. + * + * @opensearch.internal */ public interface BootstrapCheck { diff --git a/server/src/main/java/org/opensearch/bootstrap/BootstrapChecks.java b/server/src/main/java/org/opensearch/bootstrap/BootstrapChecks.java index 6b75f2306431c..7953dee644ea4 100644 --- a/server/src/main/java/org/opensearch/bootstrap/BootstrapChecks.java +++ b/server/src/main/java/org/opensearch/bootstrap/BootstrapChecks.java @@ -71,6 +71,8 @@ * We enforce bootstrap checks once a node has the transport protocol bound to a non-loopback interface or if the system property {@code * opensearch.enforce.bootstrap.checks} is set to {@true}. In this case we assume the node is running in production and * all bootstrap checks must pass. + * + * @opensearch.internal */ final class BootstrapChecks { diff --git a/server/src/main/java/org/opensearch/bootstrap/BootstrapContext.java b/server/src/main/java/org/opensearch/bootstrap/BootstrapContext.java index b07a544e8521e..1cfd8bf6dfc35 100644 --- a/server/src/main/java/org/opensearch/bootstrap/BootstrapContext.java +++ b/server/src/main/java/org/opensearch/bootstrap/BootstrapContext.java @@ -37,6 +37,8 @@ /** * Context that is passed to every bootstrap check to make decisions on. + * + * @opensearch.internal */ public class BootstrapContext { /** diff --git a/server/src/main/java/org/opensearch/bootstrap/BootstrapException.java b/server/src/main/java/org/opensearch/bootstrap/BootstrapException.java index 8daa29aa3578b..77b66553cb46d 100644 --- a/server/src/main/java/org/opensearch/bootstrap/BootstrapException.java +++ b/server/src/main/java/org/opensearch/bootstrap/BootstrapException.java @@ -41,6 +41,8 @@ * these checked exceptions so that * {@link Bootstrap#init(boolean, Path, boolean, org.opensearch.env.Environment)} * does not have to declare all of these checked exceptions. + * + * @opensearch.internal */ class BootstrapException extends Exception { diff --git a/server/src/main/java/org/opensearch/bootstrap/BootstrapInfo.java b/server/src/main/java/org/opensearch/bootstrap/BootstrapInfo.java index d45d8ddab9c2c..0aa965ce46096 100644 --- a/server/src/main/java/org/opensearch/bootstrap/BootstrapInfo.java +++ b/server/src/main/java/org/opensearch/bootstrap/BootstrapInfo.java @@ -39,6 +39,8 @@ /** * Exposes system startup information + * + * @opensearch.internal */ @SuppressForbidden(reason = "exposes read-only view of system properties") public final class BootstrapInfo { diff --git a/server/src/main/java/org/opensearch/bootstrap/BootstrapSettings.java b/server/src/main/java/org/opensearch/bootstrap/BootstrapSettings.java index 208030b5d6d12..911bc92c433f1 100644 --- a/server/src/main/java/org/opensearch/bootstrap/BootstrapSettings.java +++ b/server/src/main/java/org/opensearch/bootstrap/BootstrapSettings.java @@ -35,6 +35,11 @@ import org.opensearch.common.settings.Setting; import org.opensearch.common.settings.Setting.Property; +/** + * Settings used for bootstrapping OpenSearch + * + * @opensearch.internal + */ public final class BootstrapSettings { private BootstrapSettings() {} diff --git a/server/src/main/java/org/opensearch/bootstrap/ConsoleCtrlHandler.java b/server/src/main/java/org/opensearch/bootstrap/ConsoleCtrlHandler.java index cbc1b6e761923..ae9b6ea7ce761 100644 --- a/server/src/main/java/org/opensearch/bootstrap/ConsoleCtrlHandler.java +++ b/server/src/main/java/org/opensearch/bootstrap/ConsoleCtrlHandler.java @@ -32,6 +32,11 @@ package org.opensearch.bootstrap; +/** + * Handler for ctrl events on the console + * + * @opensearch.internal + */ public interface ConsoleCtrlHandler { int CTRL_CLOSE_EVENT = 2; diff --git a/server/src/main/java/org/opensearch/bootstrap/FilePermissionUtils.java b/server/src/main/java/org/opensearch/bootstrap/FilePermissionUtils.java index b37aef5f9738d..18ff013b1e8cb 100644 --- a/server/src/main/java/org/opensearch/bootstrap/FilePermissionUtils.java +++ b/server/src/main/java/org/opensearch/bootstrap/FilePermissionUtils.java @@ -40,6 +40,11 @@ import java.nio.file.Path; import java.security.Permissions; +/** + * Utility for File Permissions during bootstrap + * + * @opensearch.internal + */ public class FilePermissionUtils { /** no instantiation */ diff --git a/server/src/main/java/org/opensearch/bootstrap/JNACLibrary.java b/server/src/main/java/org/opensearch/bootstrap/JNACLibrary.java index 7d3ce7728a9dc..aca2cb9656025 100644 --- a/server/src/main/java/org/opensearch/bootstrap/JNACLibrary.java +++ b/server/src/main/java/org/opensearch/bootstrap/JNACLibrary.java @@ -45,6 +45,8 @@ /** * java mapping to some libc functions + * + * @opensearch.internal */ final class JNACLibrary { diff --git a/server/src/main/java/org/opensearch/bootstrap/JNAKernel32Library.java b/server/src/main/java/org/opensearch/bootstrap/JNAKernel32Library.java index a0cd656f5fc01..8e556df4b2f9b 100644 --- a/server/src/main/java/org/opensearch/bootstrap/JNAKernel32Library.java +++ b/server/src/main/java/org/opensearch/bootstrap/JNAKernel32Library.java @@ -51,6 +51,8 @@ /** * Library for Windows/Kernel32 + * + * @opensearch.internal */ final class JNAKernel32Library { diff --git a/server/src/main/java/org/opensearch/bootstrap/JNANatives.java b/server/src/main/java/org/opensearch/bootstrap/JNANatives.java index 1e3c6c3af0386..033596033b0fd 100644 --- a/server/src/main/java/org/opensearch/bootstrap/JNANatives.java +++ b/server/src/main/java/org/opensearch/bootstrap/JNANatives.java @@ -48,6 +48,8 @@ /** * This class performs the actual work with JNA and library bindings to call native methods. It should only be used after * we are sure that the JNA classes are available to the JVM + * + * @opensearch.internal */ class JNANatives { diff --git a/server/src/main/java/org/opensearch/bootstrap/Natives.java b/server/src/main/java/org/opensearch/bootstrap/Natives.java index 65025e41958ce..aa5e29fbb2591 100644 --- a/server/src/main/java/org/opensearch/bootstrap/Natives.java +++ b/server/src/main/java/org/opensearch/bootstrap/Natives.java @@ -40,6 +40,8 @@ /** * The Natives class is a wrapper class that checks if the classes necessary for calling native methods are available on * startup. If they are not available, this class will avoid calling code that loads these classes. + * + * @opensearch.internal */ final class Natives { /** no instantiation */ diff --git a/server/src/main/java/org/opensearch/bootstrap/OpenSearch.java b/server/src/main/java/org/opensearch/bootstrap/OpenSearch.java index 4395ae98c9ba6..8df1d6c6df3da 100644 --- a/server/src/main/java/org/opensearch/bootstrap/OpenSearch.java +++ b/server/src/main/java/org/opensearch/bootstrap/OpenSearch.java @@ -55,6 +55,8 @@ /** * This class starts opensearch. + * + * @opensearch.internal */ class OpenSearch extends EnvironmentAwareCommand { diff --git a/server/src/main/java/org/opensearch/bootstrap/OpenSearchPolicy.java b/server/src/main/java/org/opensearch/bootstrap/OpenSearchPolicy.java index d31f11f153ae8..14435db64274c 100644 --- a/server/src/main/java/org/opensearch/bootstrap/OpenSearchPolicy.java +++ b/server/src/main/java/org/opensearch/bootstrap/OpenSearchPolicy.java @@ -48,7 +48,11 @@ import java.util.Map; import java.util.function.Predicate; -/** custom policy for union of static and dynamic permissions */ +/** + * custom policy for union of static and dynamic permissions + * + * @opensearch.internal + **/ final class OpenSearchPolicy extends Policy { /** template policy file, the one used in tests */ diff --git a/server/src/main/java/org/opensearch/bootstrap/OpenSearchUncaughtExceptionHandler.java b/server/src/main/java/org/opensearch/bootstrap/OpenSearchUncaughtExceptionHandler.java index 4834f4cb211fe..2b28260097ce1 100644 --- a/server/src/main/java/org/opensearch/bootstrap/OpenSearchUncaughtExceptionHandler.java +++ b/server/src/main/java/org/opensearch/bootstrap/OpenSearchUncaughtExceptionHandler.java @@ -41,6 +41,11 @@ import java.security.AccessController; import java.security.PrivilegedAction; +/** + * UncaughtException Handler used during bootstrapping + * + * @opensearch.internal + */ class OpenSearchUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler { private static final Logger logger = LogManager.getLogger(OpenSearchUncaughtExceptionHandler.class); diff --git a/server/src/main/java/org/opensearch/bootstrap/Security.java b/server/src/main/java/org/opensearch/bootstrap/Security.java index b3f4339f3e386..39614a786df82 100644 --- a/server/src/main/java/org/opensearch/bootstrap/Security.java +++ b/server/src/main/java/org/opensearch/bootstrap/Security.java @@ -116,6 +116,8 @@ * * See * Troubleshooting Security for information. + * + * @opensearch.internal */ final class Security { /** no instantiation */ diff --git a/server/src/main/java/org/opensearch/bootstrap/Spawner.java b/server/src/main/java/org/opensearch/bootstrap/Spawner.java index c5e7171946790..f42935a9cadd5 100644 --- a/server/src/main/java/org/opensearch/bootstrap/Spawner.java +++ b/server/src/main/java/org/opensearch/bootstrap/Spawner.java @@ -51,6 +51,8 @@ /** * Spawns native module controller processes if present. Will only work prior to a system call filter being installed. + * + * @opensearch.internal */ final class Spawner implements Closeable { diff --git a/server/src/main/java/org/opensearch/bootstrap/StartupException.java b/server/src/main/java/org/opensearch/bootstrap/StartupException.java index 735e8cfd287af..9ad89ab518006 100644 --- a/server/src/main/java/org/opensearch/bootstrap/StartupException.java +++ b/server/src/main/java/org/opensearch/bootstrap/StartupException.java @@ -44,6 +44,8 @@ * "reasonably". This means limits on stacktrace frames and * cleanup for guice, and some guidance about consulting full * logs for the whole exception. + * + * @opensearch.internal */ // TODO: remove this when guice is removed, and exceptions are cleaned up // this is horrible, but its what we must do diff --git a/server/src/main/java/org/opensearch/bootstrap/SystemCallFilter.java b/server/src/main/java/org/opensearch/bootstrap/SystemCallFilter.java index 8e179de9c28df..f8baee06c4315 100644 --- a/server/src/main/java/org/opensearch/bootstrap/SystemCallFilter.java +++ b/server/src/main/java/org/opensearch/bootstrap/SystemCallFilter.java @@ -102,6 +102,8 @@ * https://reverse.put.as/wp-content/uploads/2011/06/The-Apple-Sandbox-BHDC2011-Paper.pdf * @see * https://docs.oracle.com/cd/E23824_01/html/821-1456/prbac-2.html + * + * @opensearch.internal */ // not an example of how to write code!!! final class SystemCallFilter { diff --git a/server/src/main/java/org/opensearch/cli/CommandLoggingConfigurator.java b/server/src/main/java/org/opensearch/cli/CommandLoggingConfigurator.java index 1705e9ebdd4b9..8918725472160 100644 --- a/server/src/main/java/org/opensearch/cli/CommandLoggingConfigurator.java +++ b/server/src/main/java/org/opensearch/cli/CommandLoggingConfigurator.java @@ -39,6 +39,8 @@ /** * Holder class for method to configure logging without OpenSearch configuration files for use in CLI tools that will not read such * files. + * + * @opensearch.internal */ public final class CommandLoggingConfigurator { diff --git a/server/src/main/java/org/opensearch/cli/EnvironmentAwareCommand.java b/server/src/main/java/org/opensearch/cli/EnvironmentAwareCommand.java index e85af87213fd0..10c59ef673050 100644 --- a/server/src/main/java/org/opensearch/cli/EnvironmentAwareCommand.java +++ b/server/src/main/java/org/opensearch/cli/EnvironmentAwareCommand.java @@ -46,7 +46,11 @@ import java.util.Locale; import java.util.Map; -/** A cli command which requires an {@link org.opensearch.env.Environment} to use current paths and settings. */ +/** + * A cli command which requires an {@link org.opensearch.env.Environment} to use current paths and settings. + * + * @opensearch.internal + */ public abstract class EnvironmentAwareCommand extends Command { private final OptionSpec settingOption; diff --git a/server/src/main/java/org/opensearch/cli/KeyStoreAwareCommand.java b/server/src/main/java/org/opensearch/cli/KeyStoreAwareCommand.java index 404dacd504e8a..17067909315b2 100644 --- a/server/src/main/java/org/opensearch/cli/KeyStoreAwareCommand.java +++ b/server/src/main/java/org/opensearch/cli/KeyStoreAwareCommand.java @@ -44,6 +44,8 @@ /** * An {@link org.opensearch.cli.EnvironmentAwareCommand} that needs to access the opensearch keystore, possibly * decrypting it if it is password protected. + * + * @opensearch.internal */ public abstract class KeyStoreAwareCommand extends EnvironmentAwareCommand { public KeyStoreAwareCommand(String description) { diff --git a/server/src/main/java/org/opensearch/cli/LoggingAwareCommand.java b/server/src/main/java/org/opensearch/cli/LoggingAwareCommand.java index 7aee5e3fa1f76..07a6b7d523a33 100644 --- a/server/src/main/java/org/opensearch/cli/LoggingAwareCommand.java +++ b/server/src/main/java/org/opensearch/cli/LoggingAwareCommand.java @@ -35,6 +35,8 @@ /** * A command that is aware of logging. This class should be preferred over the base {@link Command} class for any CLI tools that depend on * core OpenSearch as they could directly or indirectly touch classes that touch logging and as such logging needs to be configured. + * + * @opensearch.internal */ public abstract class LoggingAwareCommand extends Command { diff --git a/server/src/main/java/org/opensearch/cli/LoggingAwareMultiCommand.java b/server/src/main/java/org/opensearch/cli/LoggingAwareMultiCommand.java index 2354a4978aec9..8453ed05a12d3 100644 --- a/server/src/main/java/org/opensearch/cli/LoggingAwareMultiCommand.java +++ b/server/src/main/java/org/opensearch/cli/LoggingAwareMultiCommand.java @@ -36,6 +36,8 @@ * A multi-command that is aware of logging. This class should be preferred over the base {@link MultiCommand} class for any CLI tools that * depend on core OpenSearch as they could directly or indirectly touch classes that touch logging and as such logging needs to be * configured. + * + * @opensearch.internal */ public abstract class LoggingAwareMultiCommand extends MultiCommand { diff --git a/server/src/main/java/org/opensearch/client/AdminClient.java b/server/src/main/java/org/opensearch/client/AdminClient.java index 995466ba5746c..0c6c97b795983 100644 --- a/server/src/main/java/org/opensearch/client/AdminClient.java +++ b/server/src/main/java/org/opensearch/client/AdminClient.java @@ -35,8 +35,9 @@ /** * Administrative actions/operations against the cluster or the indices. * - * * @see org.opensearch.client.Client#admin() + * + * @opensearch.internal */ public interface AdminClient { diff --git a/server/src/main/java/org/opensearch/client/Client.java b/server/src/main/java/org/opensearch/client/Client.java index bca68834ca3cf..50f8f52253815 100644 --- a/server/src/main/java/org/opensearch/client/Client.java +++ b/server/src/main/java/org/opensearch/client/Client.java @@ -93,6 +93,8 @@ * A client can be retrieved from a started {@link org.opensearch.node.Node}. * * @see org.opensearch.node.Node#client() + * + * @opensearch.internal */ public interface Client extends OpenSearchClient, Releasable { diff --git a/server/src/main/java/org/opensearch/client/ClusterAdminClient.java b/server/src/main/java/org/opensearch/client/ClusterAdminClient.java index 1088b85ae271f..f4eaa979ff18c 100644 --- a/server/src/main/java/org/opensearch/client/ClusterAdminClient.java +++ b/server/src/main/java/org/opensearch/client/ClusterAdminClient.java @@ -139,6 +139,8 @@ * Administrative actions/operations against indices. * * @see AdminClient#cluster() + * + * @opensearch.internal */ public interface ClusterAdminClient extends OpenSearchClient { diff --git a/server/src/main/java/org/opensearch/client/FilterClient.java b/server/src/main/java/org/opensearch/client/FilterClient.java index 4d7bf2ed30b00..d121fdd77dfeb 100644 --- a/server/src/main/java/org/opensearch/client/FilterClient.java +++ b/server/src/main/java/org/opensearch/client/FilterClient.java @@ -43,6 +43,8 @@ * A {@link Client} that contains another {@link Client} which it * uses as its basic source, possibly transforming the requests / responses along the * way or providing additional functionality. + * + * @opensearch.internal */ public abstract class FilterClient extends AbstractClient { diff --git a/server/src/main/java/org/opensearch/client/IndicesAdminClient.java b/server/src/main/java/org/opensearch/client/IndicesAdminClient.java index 50430e3eb8507..c9cd0d0900b5a 100644 --- a/server/src/main/java/org/opensearch/client/IndicesAdminClient.java +++ b/server/src/main/java/org/opensearch/client/IndicesAdminClient.java @@ -132,6 +132,8 @@ * Administrative actions/operations against indices. * * @see AdminClient#indices() + * + * @opensearch.internal */ public interface IndicesAdminClient extends OpenSearchClient { diff --git a/server/src/main/java/org/opensearch/client/OpenSearchClient.java b/server/src/main/java/org/opensearch/client/OpenSearchClient.java index 9b092c98aa5f5..755aca1f573e0 100644 --- a/server/src/main/java/org/opensearch/client/OpenSearchClient.java +++ b/server/src/main/java/org/opensearch/client/OpenSearchClient.java @@ -39,6 +39,11 @@ import org.opensearch.action.ActionResponse; import org.opensearch.threadpool.ThreadPool; +/** + * Interface for an OpenSearch client implementation + * + * @opensearch.internal + */ public interface OpenSearchClient { /** diff --git a/server/src/main/java/org/opensearch/client/OriginSettingClient.java b/server/src/main/java/org/opensearch/client/OriginSettingClient.java index acb6352b06185..41fe9741cc4e7 100644 --- a/server/src/main/java/org/opensearch/client/OriginSettingClient.java +++ b/server/src/main/java/org/opensearch/client/OriginSettingClient.java @@ -46,6 +46,8 @@ * {@link ThreadContext#stashWithOrigin origin} set to a particular * value and calls its {@linkplain ActionListener} in its original * {@link ThreadContext}. + * + * @opensearch.internal */ public final class OriginSettingClient extends FilterClient { diff --git a/server/src/main/java/org/opensearch/client/ParentTaskAssigningClient.java b/server/src/main/java/org/opensearch/client/ParentTaskAssigningClient.java index 444f0ea778b05..58ea99fa96bc3 100644 --- a/server/src/main/java/org/opensearch/client/ParentTaskAssigningClient.java +++ b/server/src/main/java/org/opensearch/client/ParentTaskAssigningClient.java @@ -43,6 +43,8 @@ /** * A {@linkplain Client} that sets the parent task on all requests that it makes. Use this to conveniently implement actions that cause * many other actions. + * + * @opensearch.internal */ public class ParentTaskAssigningClient extends FilterClient { private final TaskId parentTask; diff --git a/server/src/main/java/org/opensearch/client/Requests.java b/server/src/main/java/org/opensearch/client/Requests.java index d89f55a37a9cf..b04de7830a780 100644 --- a/server/src/main/java/org/opensearch/client/Requests.java +++ b/server/src/main/java/org/opensearch/client/Requests.java @@ -79,6 +79,8 @@ /** * A handy one stop shop for creating requests (make sure to import static this class). + * + * @opensearch.internal */ public class Requests { diff --git a/server/src/main/java/org/opensearch/client/node/NodeClient.java b/server/src/main/java/org/opensearch/client/node/NodeClient.java index bda7cdca91015..56cb7c406744a 100644 --- a/server/src/main/java/org/opensearch/client/node/NodeClient.java +++ b/server/src/main/java/org/opensearch/client/node/NodeClient.java @@ -52,6 +52,8 @@ /** * Client that executes actions on the local node. + * + * @opensearch.internal */ public class NodeClient extends AbstractClient { diff --git a/server/src/main/java/org/opensearch/client/support/AbstractClient.java b/server/src/main/java/org/opensearch/client/support/AbstractClient.java index 4c8f5935e3680..4fdf4b1166bd6 100644 --- a/server/src/main/java/org/opensearch/client/support/AbstractClient.java +++ b/server/src/main/java/org/opensearch/client/support/AbstractClient.java @@ -366,6 +366,11 @@ import java.util.Map; +/** + * Base client used to create concrete client implementations + * + * @opensearch.internal + */ public abstract class AbstractClient implements Client { protected final Logger logger; diff --git a/server/src/main/java/org/opensearch/client/transport/NoNodeAvailableException.java b/server/src/main/java/org/opensearch/client/transport/NoNodeAvailableException.java index a4ffe2102037e..e3424689c5152 100644 --- a/server/src/main/java/org/opensearch/client/transport/NoNodeAvailableException.java +++ b/server/src/main/java/org/opensearch/client/transport/NoNodeAvailableException.java @@ -40,6 +40,8 @@ /** * An exception indicating no node is available to perform the operation. + * + * @opensearch.internal */ public class NoNodeAvailableException extends OpenSearchException { From c19d537af07c882d59b236052e7c87286b467749 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 4 May 2022 10:25:36 -0500 Subject: [PATCH 120/514] [Remove] ShrinkAction, ShardUpgradeRequest, UpgradeSettingsRequestBuilder (#3169) (#3175) Removes unused ShrinkAction, ShardUpgradeRequest, and UpgradeSettingsRequestBuilder classes. Signed-off-by: Nicholas Walter Knize (cherry picked from commit c76a4c901450c4ad3b34bc1030f7d5b5fa2c46f0) --- .../admin/indices/shrink/ShrinkAction.java | 46 ------------- .../upgrade/post/ShardUpgradeRequest.java | 65 ------------------- .../post/UpgradeSettingsRequestBuilder.java | 62 ------------------ 3 files changed, 173 deletions(-) delete mode 100644 server/src/main/java/org/opensearch/action/admin/indices/shrink/ShrinkAction.java delete mode 100644 server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/ShardUpgradeRequest.java delete mode 100644 server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeSettingsRequestBuilder.java diff --git a/server/src/main/java/org/opensearch/action/admin/indices/shrink/ShrinkAction.java b/server/src/main/java/org/opensearch/action/admin/indices/shrink/ShrinkAction.java deleted file mode 100644 index 1fa894b265573..0000000000000 --- a/server/src/main/java/org/opensearch/action/admin/indices/shrink/ShrinkAction.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.action.admin.indices.shrink; - -import org.opensearch.action.ActionType; - -public class ShrinkAction extends ActionType { - - public static final ShrinkAction INSTANCE = new ShrinkAction(); - public static final String NAME = "indices:admin/shrink"; - - private ShrinkAction() { - super(NAME, ResizeResponse::new); - } - -} diff --git a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/ShardUpgradeRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/ShardUpgradeRequest.java deleted file mode 100644 index fcc85e1a9cb5c..0000000000000 --- a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/ShardUpgradeRequest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.action.admin.indices.upgrade.post; - -import org.opensearch.action.support.broadcast.BroadcastShardRequest; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.index.shard.ShardId; - -import java.io.IOException; - -public final class ShardUpgradeRequest extends BroadcastShardRequest { - - private UpgradeRequest request; - - public ShardUpgradeRequest(StreamInput in) throws IOException { - super(in); - request = new UpgradeRequest(in); - } - - ShardUpgradeRequest(ShardId shardId, UpgradeRequest request) { - super(shardId, request); - this.request = request; - } - - @Override - public void writeTo(StreamOutput out) throws IOException { - super.writeTo(out); - request.writeTo(out); - } - - public UpgradeRequest upgradeRequest() { - return this.request; - } -} diff --git a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeSettingsRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeSettingsRequestBuilder.java deleted file mode 100644 index d3a8cc311bb8a..0000000000000 --- a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeSettingsRequestBuilder.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.action.admin.indices.upgrade.post; - -import org.opensearch.Version; -import org.opensearch.action.support.master.AcknowledgedRequestBuilder; -import org.opensearch.action.support.master.AcknowledgedResponse; -import org.opensearch.client.OpenSearchClient; -import org.opensearch.common.collect.Tuple; - -import java.util.Map; - -/** - * Builder for an update index settings request - */ -public class UpgradeSettingsRequestBuilder extends AcknowledgedRequestBuilder< - UpgradeSettingsRequest, - AcknowledgedResponse, - UpgradeSettingsRequestBuilder> { - - public UpgradeSettingsRequestBuilder(OpenSearchClient client, UpgradeSettingsAction action) { - super(client, action, new UpgradeSettingsRequest()); - } - - /** - * Sets the index versions to be updated - */ - public UpgradeSettingsRequestBuilder setVersions(Map> versions) { - request.versions(versions); - return this; - } -} From acbcf761922dd97dace39e8718661e890348bd5e Mon Sep 17 00:00:00 2001 From: Tianli Feng Date: Wed, 4 May 2022 10:57:09 -0700 Subject: [PATCH 121/514] Replace internal usages of 'master' term in 'server/src/main' directory (#2519) (#3165) Signed-off-by: Tianli Feng --- .../UnsafeBootstrapAndDetachCommandIT.java | 4 +- .../discovery/SnapshotDisruptionIT.java | 4 +- .../env/NodeRepurposeCommandIT.java | 2 +- .../org/opensearch/OpenSearchException.java | 4 +- ...ansportClusterAllocationExplainAction.java | 2 +- .../cluster/health/ClusterHealthResponse.java | 4 +- .../health/TransportClusterHealthAction.java | 4 +- .../TransportCleanupRepositoryAction.java | 8 +- .../TransportClusterUpdateSettingsAction.java | 8 +- .../restore/RestoreClusterStateListener.java | 4 +- .../TransportSnapshotsStatusAction.java | 6 +- .../cluster/state/ClusterStateResponse.java | 10 +- .../state/TransportClusterStateAction.java | 2 +- .../stats/ClusterStatsNodeResponse.java | 2 +- .../cluster/stats/ClusterStatsResponse.java | 4 +- .../admin/indices/dangling/package-info.java | 4 +- .../bulk/BulkPrimaryExecutionContext.java | 6 +- .../action/bulk/MappingUpdatePerformer.java | 2 +- .../action/bulk/TransportShardBulkAction.java | 2 +- .../node/TransportBroadcastByNodeAction.java | 6 +- .../master/AcknowledgedRequestBuilder.java | 2 +- .../MasterNodeOperationRequestBuilder.java | 6 +- ...MasterNodeReadOperationRequestBuilder.java | 2 +- .../support/master/MasterNodeReadRequest.java | 6 +- .../support/master/MasterNodeRequest.java | 6 +- .../master/TransportMasterNodeAction.java | 14 +- .../master/TransportMasterNodeReadAction.java | 2 +- .../action/support/nodes/BaseNodeRequest.java | 2 +- .../replication/ReplicationOperation.java | 3 +- .../action/update/TransportUpdateAction.java | 2 +- .../cluster/ClusterChangedEvent.java | 8 +- .../org/opensearch/cluster/ClusterState.java | 39 ++--- .../cluster/ClusterStateObserver.java | 17 +-- .../cluster/ClusterStateTaskExecutor.java | 2 +- .../cluster/ClusterStateTaskListener.java | 4 +- .../cluster/ClusterStateUpdateTask.java | 2 +- .../cluster/LocalClusterUpdateTask.java | 2 +- .../cluster/LocalNodeMasterListener.java | 24 ++-- .../cluster/MasterNodeChangePredicate.java | 10 +- .../cluster/NodeConnectionsService.java | 2 +- .../cluster/NotMasterException.java | 6 +- .../cluster/SnapshotsInProgress.java | 6 +- .../opensearch/cluster/ack/AckedRequest.java | 2 +- .../ack/ClusterStateUpdateRequest.java | 4 +- .../action/index/MappingUpdatedAction.java | 6 +- .../index/NodeMappingRefreshAction.java | 8 +- .../action/shard/ShardStateAction.java | 43 +++--- .../coordination/ApplyCommitRequest.java | 2 +- .../coordination/ClusterBootstrapService.java | 8 +- .../coordination/ClusterStatePublisher.java | 4 +- .../coordination/CoordinationState.java | 6 +- .../cluster/coordination/Coordinator.java | 136 +++++++++--------- .../cluster/coordination/JoinHelper.java | 19 ++- .../cluster/coordination/JoinRequest.java | 8 +- .../coordination/JoinTaskExecutor.java | 27 ++-- .../cluster/coordination/LagDetector.java | 2 +- .../cluster/coordination/LeaderChecker.java | 6 +- .../coordination/NoMasterBlockService.java | 20 +-- .../NodeRemovalClusterStateTaskExecutor.java | 2 +- .../cluster/coordination/PeersResponse.java | 24 ++-- .../PublicationTransportHandler.java | 7 +- .../PublishClusterStateStats.java | 4 +- .../cluster/coordination/PublishRequest.java | 2 +- .../cluster/coordination/Reconfigurator.java | 39 ++--- .../UnsafeBootstrapMasterCommand.java | 14 +- .../metadata/MetadataIndexUpgradeService.java | 2 +- .../SystemIndexMetadataUpgradeService.java | 8 +- .../cluster/node/DiscoveryNode.java | 4 +- .../cluster/node/DiscoveryNodes.java | 104 +++++++------- .../routing/BatchedRerouteService.java | 4 +- .../cluster/routing/RecoverySource.java | 2 +- .../cluster/routing/UnassignedInfo.java | 2 +- .../allocation/ExistingShardsAllocator.java | 2 +- .../service/ClusterApplierService.java | 2 +- .../cluster/service/ClusterService.java | 2 +- .../cluster/service/MasterService.java | 33 +++-- .../settings/ConsistentSettingsService.java | 10 +- ...AckClusterStatePublishResponseHandler.java | 6 +- ...ingClusterStatePublishResponseHandler.java | 10 +- .../org/opensearch/discovery/Discovery.java | 2 +- .../opensearch/discovery/DiscoveryModule.java | 4 +- .../org/opensearch/discovery/PeerFinder.java | 4 +- .../opensearch/env/NodeRepurposeCommand.java | 12 +- .../gateway/DanglingIndicesState.java | 2 +- .../opensearch/gateway/GatewayMetaState.java | 8 +- .../opensearch/gateway/GatewayService.java | 32 +++-- .../gateway/LocalAllocateDangledIndices.java | 8 +- .../index/mapper/DocumentParser.java | 2 +- .../index/mapper/MapperService.java | 4 +- .../index/seqno/ReplicationTracker.java | 18 +-- .../index/shard/IndexEventListener.java | 2 +- .../opensearch/index/shard/IndexShard.java | 14 +- .../opensearch/index/shard/StoreRecovery.java | 2 +- .../cluster/IndicesClusterStateService.java | 30 ++-- .../indices/recovery/RecoverySettings.java | 2 +- .../indices/recovery/RecoveryTarget.java | 2 +- .../TransportNodesListShardStoreMetadata.java | 4 +- .../main/java/org/opensearch/node/Node.java | 4 +- .../PersistentTasksClusterService.java | 4 +- .../PersistentTasksNodeService.java | 16 +-- .../persistent/PersistentTasksService.java | 10 +- .../opensearch/persistent/package-info.java | 4 +- .../repositories/RepositoriesService.java | 12 +- .../opensearch/repositories/Repository.java | 8 +- .../blobstore/BlobStoreRepository.java | 24 ++-- .../repositories/blobstore/package-info.java | 18 +-- .../repositories/fs/FsRepository.java | 2 +- .../admin/indices/RestGetAliasesAction.java | 2 +- .../rest/action/cat/RestIndicesAction.java | 12 +- .../rest/action/cat/RestMasterAction.java | 12 +- .../rest/action/cat/RestNodesAction.java | 4 +- .../InternalSnapshotsInfoService.java | 4 +- .../opensearch/snapshots/RestoreService.java | 2 +- .../snapshots/SnapshotShardsService.java | 32 ++--- .../snapshots/SnapshotsService.java | 81 ++++++----- .../opensearch/snapshots/package-info.java | 22 +-- .../transport/ConnectionProfile.java | 2 +- .../TransportRequestDeduplicator.java | 2 +- .../action/shard/ShardStateActionTests.java | 4 +- .../coordination/LeaderCheckerTests.java | 2 +- .../cluster/coordination/NodeJoinTests.java | 6 +- .../cluster/node/DiscoveryNodesTests.java | 4 +- .../service/ClusterApplierServiceTests.java | 4 +- .../ConsistentSettingsServiceTests.java | 16 +-- .../opensearch/discovery/PeerFinderTests.java | 2 +- .../env/NodeRepurposeCommandTests.java | 2 +- .../CoordinationStateTestCluster.java | 4 +- 127 files changed, 683 insertions(+), 629 deletions(-) diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/UnsafeBootstrapAndDetachCommandIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/UnsafeBootstrapAndDetachCommandIT.java index 292469c6e7b79..f976ffdbe8ad5 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/UnsafeBootstrapAndDetachCommandIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/UnsafeBootstrapAndDetachCommandIT.java @@ -111,7 +111,7 @@ private MockTerminal executeCommand( private MockTerminal unsafeBootstrap(Environment environment, boolean abort, Boolean applyClusterReadOnlyBlock) throws Exception { final MockTerminal terminal = executeCommand(new UnsafeBootstrapMasterCommand(), environment, 0, abort, applyClusterReadOnlyBlock); assertThat(terminal.getOutput(), containsString(UnsafeBootstrapMasterCommand.CONFIRMATION_MSG)); - assertThat(terminal.getOutput(), containsString(UnsafeBootstrapMasterCommand.MASTER_NODE_BOOTSTRAPPED_MSG)); + assertThat(terminal.getOutput(), containsString(UnsafeBootstrapMasterCommand.CLUSTER_MANAGER_NODE_BOOTSTRAPPED_MSG)); return terminal; } @@ -171,7 +171,7 @@ public void testBootstrapNotMasterEligible() { final Environment environment = TestEnvironment.newEnvironment( Settings.builder().put(nonMasterNode(internalCluster().getDefaultSettings())).build() ); - expectThrows(() -> unsafeBootstrap(environment), UnsafeBootstrapMasterCommand.NOT_MASTER_NODE_MSG); + expectThrows(() -> unsafeBootstrap(environment), UnsafeBootstrapMasterCommand.NOT_CLUSTER_MANAGER_NODE_MSG); } public void testBootstrapNoDataFolder() { diff --git a/server/src/internalClusterTest/java/org/opensearch/discovery/SnapshotDisruptionIT.java b/server/src/internalClusterTest/java/org/opensearch/discovery/SnapshotDisruptionIT.java index 086aeb695c411..e6ddfd94871ce 100644 --- a/server/src/internalClusterTest/java/org/opensearch/discovery/SnapshotDisruptionIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/discovery/SnapshotDisruptionIT.java @@ -248,7 +248,7 @@ public void testMasterFailOverDuringShardSnapshots() throws Exception { blockDataNode(repoName, dataNode); - logger.info("--> create snapshot via master node client"); + logger.info("--> create snapshot via cluster-manager node client"); final ActionFuture snapshotResponse = internalCluster().masterClient() .admin() .cluster() @@ -272,7 +272,7 @@ public void testMasterFailOverDuringShardSnapshots() throws Exception { SnapshotException.class, () -> snapshotResponse.actionGet(TimeValue.timeValueSeconds(30L)) ); - assertThat(sne.getMessage(), endsWith("no longer master")); + assertThat(sne.getMessage(), endsWith("no longer cluster-manager")); } private void assertSnapshotExists(String repository, String snapshot) { diff --git a/server/src/internalClusterTest/java/org/opensearch/env/NodeRepurposeCommandIT.java b/server/src/internalClusterTest/java/org/opensearch/env/NodeRepurposeCommandIT.java index 2547333490f23..e2bbd0ee13db3 100644 --- a/server/src/internalClusterTest/java/org/opensearch/env/NodeRepurposeCommandIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/env/NodeRepurposeCommandIT.java @@ -136,7 +136,7 @@ private void executeRepurposeCommand(Settings settings, int expectedIndexCount, boolean verbose = randomBoolean(); Settings settingsWithPath = Settings.builder().put(internalCluster().getDefaultSettings()).put(settings).build(); Matcher matcher = allOf( - containsString(NodeRepurposeCommand.noMasterMessage(expectedIndexCount, expectedShardCount, 0)), + containsString(NodeRepurposeCommand.noClusterManagerMessage(expectedIndexCount, expectedShardCount, 0)), NodeRepurposeCommandTests.conditionalNot(containsString("test-repurpose"), verbose == false) ); NodeRepurposeCommandTests.verifySuccess(settingsWithPath, matcher, verbose); diff --git a/server/src/main/java/org/opensearch/OpenSearchException.java b/server/src/main/java/org/opensearch/OpenSearchException.java index 8d3e2569957f1..5a9e5b91982a2 100644 --- a/server/src/main/java/org/opensearch/OpenSearchException.java +++ b/server/src/main/java/org/opensearch/OpenSearchException.java @@ -785,7 +785,7 @@ private enum OpenSearchExceptionHandle { 2, UNKNOWN_VERSION_ADDED ), - MASTER_NOT_DISCOVERED_EXCEPTION( + CLUSTER_MANAGER_NOT_DISCOVERED_EXCEPTION( org.opensearch.discovery.MasterNotDiscoveredException.class, org.opensearch.discovery.MasterNotDiscoveredException::new, 3, @@ -1496,7 +1496,7 @@ private enum OpenSearchExceptionHandle { 143, UNKNOWN_VERSION_ADDED ), - NOT_MASTER_EXCEPTION( + NOT_CLUSTER_MANAGER_EXCEPTION( org.opensearch.cluster.NotMasterException.class, org.opensearch.cluster.NotMasterException::new, 144, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/allocation/TransportClusterAllocationExplainAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/allocation/TransportClusterAllocationExplainAction.java index 95fbe42384238..baa2ce0847501 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/allocation/TransportClusterAllocationExplainAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/allocation/TransportClusterAllocationExplainAction.java @@ -64,7 +64,7 @@ /** * The {@code TransportClusterAllocationExplainAction} is responsible for actually executing the explanation of a shard's allocation on the - * master node in the cluster. + * cluster-manager node in the cluster. */ public class TransportClusterAllocationExplainAction extends TransportMasterNodeAction< ClusterAllocationExplainRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthResponse.java index 841231c971eaa..ce731fd1c8aca 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthResponse.java @@ -90,7 +90,7 @@ public class ClusterHealthResponse extends ActionResponse implements StatusToXCo // ClusterStateHealth fields int numberOfNodes = (int) parsedObjects[i++]; int numberOfDataNodes = (int) parsedObjects[i++]; - boolean hasDiscoveredMaster = Boolean.TRUE.equals(parsedObjects[i++]); + boolean hasDiscoveredClusterManager = Boolean.TRUE.equals(parsedObjects[i++]); int activeShards = (int) parsedObjects[i++]; int relocatingShards = (int) parsedObjects[i++]; int activePrimaryShards = (int) parsedObjects[i++]; @@ -118,7 +118,7 @@ public class ClusterHealthResponse extends ActionResponse implements StatusToXCo unassignedShards, numberOfNodes, numberOfDataNodes, - hasDiscoveredMaster, + hasDiscoveredClusterManager, activeShardsPercent, status, indices diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/health/TransportClusterHealthAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/health/TransportClusterHealthAction.java index 6855803ba6c45..98c264e54a1d0 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/health/TransportClusterHealthAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/health/TransportClusterHealthAction.java @@ -218,11 +218,11 @@ public void clusterStateProcessed(String source, ClusterState oldState, ClusterS @Override public void onNoLongerMaster(String source) { logger.trace( - "stopped being master while waiting for events with priority [{}]. retrying.", + "stopped being cluster-manager while waiting for events with priority [{}]. retrying.", request.waitForEvents() ); // TransportMasterNodeAction implements the retry logic, which is triggered by passing a NotMasterException - listener.onFailure(new NotMasterException("no longer master. source: [" + source + "]")); + listener.onFailure(new NotMasterException("no longer cluster-manager. source: [" + source + "]")); } @Override diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/cleanup/TransportCleanupRepositoryAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/cleanup/TransportCleanupRepositoryAction.java index b7b9da675a385..c56b2fd2b2205 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/cleanup/TransportCleanupRepositoryAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/cleanup/TransportCleanupRepositoryAction.java @@ -73,12 +73,12 @@ *
    *
  1. Check that there are no running repository cleanup, snapshot create, or snapshot delete actions * and add an entry for the repository that is to be cleaned up to {@link RepositoryCleanupInProgress}
  2. - *
  3. Run cleanup actions on the repository. Note, these are executed exclusively on the master node. + *
  4. Run cleanup actions on the repository. Note, these are executed exclusively on the cluster-manager node. * For the precise operations execute see {@link BlobStoreRepository#cleanup}
  5. *
  6. Remove the entry in {@link RepositoryCleanupInProgress} in the first step.
  7. *
* - * On master failover during the cleanup operation it is simply removed from the cluster state. This is safe because the logic in + * On cluster-manager failover during the cleanup operation it is simply removed from the cluster state. This is safe because the logic in * {@link BlobStoreRepository#cleanup} ensures that the repository state id has not changed between creation of the cluster state entry * and any delete/write operations. TODO: This will not work if we also want to clean up at the shard level as those will involve writes * as well as deletes. @@ -119,7 +119,7 @@ public TransportCleanupRepositoryAction( ); this.repositoriesService = repositoriesService; this.snapshotsService = snapshotsService; - // We add a state applier that will remove any dangling repository cleanup actions on master failover. + // We add a state applier that will remove any dangling repository cleanup actions on cluster-manager failover. // This is safe to do since cleanups will increment the repository state id before executing any operations to prevent concurrent // operations from corrupting the repository. This is the same safety mechanism used by snapshot deletes. if (DiscoveryNode.isMasterNode(clusterService.getSettings())) { @@ -136,7 +136,7 @@ private static void addClusterStateApplier(ClusterService clusterService) { return; } clusterService.submitStateUpdateTask( - "clean up repository cleanup task after master failover", + "clean up repository cleanup task after cluster-manager failover", new ClusterStateUpdateTask() { @Override public ClusterState execute(ClusterState currentState) { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/settings/TransportClusterUpdateSettingsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/settings/TransportClusterUpdateSettingsAction.java index 6d479431e1a94..3bfdf2a0cbd5a 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/settings/TransportClusterUpdateSettingsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/settings/TransportClusterUpdateSettingsAction.java @@ -155,11 +155,11 @@ public void onAckTimeout() { } private void reroute(final boolean updateSettingsAcked) { - // We're about to send a second update task, so we need to check if we're still the elected master - // For example the minimum_master_node could have been breached and we're no longer elected master, + // We're about to send a second update task, so we need to check if we're still the elected cluster-manager + // For example the minimum_master_node could have been breached and we're no longer elected cluster-manager, // so we should *not* execute the reroute. if (!clusterService.state().nodes().isLocalNodeElectedMaster()) { - logger.debug("Skipping reroute after cluster update settings, because node is no longer master"); + logger.debug("Skipping reroute after cluster update settings, because node is no longer cluster-manager"); listener.onResponse( new ClusterUpdateSettingsResponse( updateSettingsAcked, @@ -198,7 +198,7 @@ protected ClusterUpdateSettingsResponse newResponse(boolean acknowledged) { @Override public void onNoLongerMaster(String source) { logger.debug( - "failed to preform reroute after cluster settings were updated - current node is no longer a master" + "failed to preform reroute after cluster settings were updated - current node is no longer a cluster-manager" ); listener.onResponse( new ClusterUpdateSettingsResponse( diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreClusterStateListener.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreClusterStateListener.java index e596348127faf..cb6f8493551f6 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreClusterStateListener.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreClusterStateListener.java @@ -69,8 +69,8 @@ public void clusterChanged(ClusterChangedEvent changedEvent) { final RestoreInProgress.Entry prevEntry = restoreInProgress(changedEvent.previousState(), uuid); final RestoreInProgress.Entry newEntry = restoreInProgress(changedEvent.state(), uuid); if (prevEntry == null) { - // When there is a master failure after a restore has been started, this listener might not be registered - // on the current master and as such it might miss some intermediary cluster states due to batching. + // When there is a cluster-manager failure after a restore has been started, this listener might not be registered + // on the current cluster-manager and as such it might miss some intermediary cluster states due to batching. // Clean up listener in that case and acknowledge completion of restore operation to client. clusterService.removeListener(this); listener.onResponse(new RestoreSnapshotResponse((RestoreInfo) null)); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/TransportSnapshotsStatusAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/TransportSnapshotsStatusAction.java index 33d4ac5d50347..1e29a70e1f41f 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/TransportSnapshotsStatusAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/TransportSnapshotsStatusAction.java @@ -221,8 +221,8 @@ private void buildResponse( // Unlikely edge case: // Data node has finished snapshotting the shard but the cluster state has not yet been updated // to reflect this. We adjust the status to show up as snapshot metadata being written because - // technically if the data node failed before successfully reporting DONE state to master, then - // this shards state would jump to a failed state. + // technically if the data node failed before successfully reporting DONE state to cluster-manager, + // then this shards state would jump to a failed state. shardStatus = new SnapshotIndexShardStatus( shardEntry.key, SnapshotIndexShardStage.FINALIZE, @@ -406,7 +406,7 @@ private SnapshotInfo snapshot(SnapshotsInProgress snapshotsInProgress, String re /** * Returns status of shards currently finished snapshots *

- * This method is executed on master node and it's complimentary to the + * This method is executed on cluster-manager node and it's complimentary to the * {@link SnapshotShardsService#currentSnapshotShards(Snapshot)} because it * returns similar information but for already finished snapshots. *

diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/state/ClusterStateResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/state/ClusterStateResponse.java index d2f053137e446..80d1f7022967d 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/state/ClusterStateResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/state/ClusterStateResponse.java @@ -108,20 +108,20 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) return false; ClusterStateResponse response = (ClusterStateResponse) o; return waitForTimedOut == response.waitForTimedOut && Objects.equals(clusterName, response.clusterName) && - // Best effort. Only compare cluster state version and master node id, + // Best effort. Only compare cluster state version and cluster-manager node id, // because cluster state doesn't implement equals() Objects.equals(getVersion(clusterState), getVersion(response.clusterState)) - && Objects.equals(getMasterNodeId(clusterState), getMasterNodeId(response.clusterState)); + && Objects.equals(getClusterManagerNodeId(clusterState), getClusterManagerNodeId(response.clusterState)); } @Override public int hashCode() { - // Best effort. Only use cluster state version and master node id, + // Best effort. Only use cluster state version and cluster-manager node id, // because cluster state doesn't implement hashcode() - return Objects.hash(clusterName, getVersion(clusterState), getMasterNodeId(clusterState), waitForTimedOut); + return Objects.hash(clusterName, getVersion(clusterState), getClusterManagerNodeId(clusterState), waitForTimedOut); } - private static String getMasterNodeId(ClusterState clusterState) { + private static String getClusterManagerNodeId(ClusterState clusterState) { if (clusterState == null) { return null; } diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/state/TransportClusterStateAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/state/TransportClusterStateAction.java index 42497c5244167..595127d83d4bf 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/state/TransportClusterStateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/state/TransportClusterStateAction.java @@ -138,7 +138,7 @@ public void onNewClusterState(ClusterState newState) { } else { listener.onFailure( new NotMasterException( - "master stepped down waiting for metadata version " + request.waitForMetadataVersion() + "cluster-manager stepped down waiting for metadata version " + request.waitForMetadataVersion() ) ); } diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsNodeResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsNodeResponse.java index 7607a2ef70980..01d4d5ac0fb53 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsNodeResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsNodeResponse.java @@ -85,7 +85,7 @@ public NodeStats nodeStats() { } /** - * Cluster Health Status, only populated on master nodes. + * Cluster Health Status, only populated on cluster-manager nodes. */ @Nullable public ClusterHealthStatus clusterStatus() { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsResponse.java index 1470f252756a5..172159a1efe5b 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsResponse.java @@ -60,7 +60,7 @@ public class ClusterStatsResponse extends BaseNodesResponse *
  • A user overflows the index graveyard by deleting more than 500 indices while a node is offline and then the node rejoins the * cluster
  • - *
  • A node (unsafely) moves from one cluster to another, perhaps because the original cluster lost all its master nodes
  • + *
  • A node (unsafely) moves from one cluster to another, perhaps because the original cluster lost all its cluster-manager nodes
  • *
  • A user (unsafely) meddles with the contents of the data path, maybe restoring an old index folder from a backup
  • *
  • A disk partially fails and the user has no replicas and no snapshots and wants to (unsafely) recover whatever they can
  • - *
  • A cluster loses all master nodes and those are (unsafely) restored from backup, but the backup does not contain the index
  • + *
  • A cluster loses all cluster-manager nodes and those are (unsafely) restored from backup, but the backup does not contain the index
  • * * *

    The classes in this package form an API for managing dangling indices, allowing them to be listed, imported or deleted. diff --git a/server/src/main/java/org/opensearch/action/bulk/BulkPrimaryExecutionContext.java b/server/src/main/java/org/opensearch/action/bulk/BulkPrimaryExecutionContext.java index da8833fe49a29..17bfa082295af 100644 --- a/server/src/main/java/org/opensearch/action/bulk/BulkPrimaryExecutionContext.java +++ b/server/src/main/java/org/opensearch/action/bulk/BulkPrimaryExecutionContext.java @@ -61,7 +61,7 @@ enum ItemProcessingState { TRANSLATED, /** * the request can not execute with the current mapping and should wait for a new mapping - * to arrive from the master. A mapping request for the needed changes has already been + * to arrive from the cluster-manager. A mapping request for the needed changes has already been * submitted */ WAIT_FOR_MAPPING_UPDATE, @@ -144,7 +144,7 @@ public boolean isOperationExecuted() { return currentItemState == ItemProcessingState.EXECUTED; } - /** returns true if the request needs to wait for a mapping update to arrive from the master */ + /** returns true if the request needs to wait for a mapping update to arrive from the cluster-manager */ public boolean requiresWaitingForMappingUpdate() { return currentItemState == ItemProcessingState.WAIT_FOR_MAPPING_UPDATE; } @@ -216,7 +216,7 @@ public > T getRequestToExecute() { return (T) requestToExecute; } - /** indicates that the current operation can not be completed and needs to wait for a new mapping from the master */ + /** indicates that the current operation can not be completed and needs to wait for a new mapping from the cluster-manager */ public void markAsRequiringMappingUpdate() { assert assertInvariants(ItemProcessingState.TRANSLATED); currentItemState = ItemProcessingState.WAIT_FOR_MAPPING_UPDATE; diff --git a/server/src/main/java/org/opensearch/action/bulk/MappingUpdatePerformer.java b/server/src/main/java/org/opensearch/action/bulk/MappingUpdatePerformer.java index c0eb29e4c112f..ebfe82eb6ed38 100644 --- a/server/src/main/java/org/opensearch/action/bulk/MappingUpdatePerformer.java +++ b/server/src/main/java/org/opensearch/action/bulk/MappingUpdatePerformer.java @@ -39,7 +39,7 @@ public interface MappingUpdatePerformer { /** - * Update the mappings on the master. + * Update the mappings on the cluster-manager. */ void updateMappings(Mapping update, ShardId shardId, ActionListener listener); diff --git a/server/src/main/java/org/opensearch/action/bulk/TransportShardBulkAction.java b/server/src/main/java/org/opensearch/action/bulk/TransportShardBulkAction.java index cc9f20b7aa256..5311186fee0dc 100644 --- a/server/src/main/java/org/opensearch/action/bulk/TransportShardBulkAction.java +++ b/server/src/main/java/org/opensearch/action/bulk/TransportShardBulkAction.java @@ -621,7 +621,7 @@ private static Engine.Result performOpOnReplica( throw new IllegalStateException("Unexpected request operation type on replica: " + docWriteRequest.opType().getLowercase()); } if (result.getResultType() == Engine.Result.Type.MAPPING_UPDATE_REQUIRED) { - // Even though the primary waits on all nodes to ack the mapping changes to the master + // Even though the primary waits on all nodes to ack the mapping changes to the cluster-manager // (see MappingUpdatedAction.updateMappingOnMaster) we still need to protect against missing mappings // and wait for them. The reason is concurrent requests. Request r1 which has new field f triggers a // mapping update. Assume that that update is first applied on the primary, and only later on the replica diff --git a/server/src/main/java/org/opensearch/action/support/broadcast/node/TransportBroadcastByNodeAction.java b/server/src/main/java/org/opensearch/action/support/broadcast/node/TransportBroadcastByNodeAction.java index 3950f3a9fef77..6eb3c7a0cfe89 100644 --- a/server/src/main/java/org/opensearch/action/support/broadcast/node/TransportBroadcastByNodeAction.java +++ b/server/src/main/java/org/opensearch/action/support/broadcast/node/TransportBroadcastByNodeAction.java @@ -310,9 +310,9 @@ protected AsyncAction(Task task, Request request, ActionListener liste for (ShardRouting shard : shardIt) { // send a request to the shard only if it is assigned to a node that is in the local node's cluster state // a scenario in which a shard can be assigned but to a node that is not in the local node's cluster state - // is when the shard is assigned to the master node, the local node has detected the master as failed - // and a new master has not yet been elected; in this situation the local node will have removed the - // master node from the local cluster state, but the shards assigned to the master will still be in the + // is when the shard is assigned to the cluster-manager node, the local node has detected the cluster-manager as failed + // and a new cluster-manager has not yet been elected; in this situation the local node will have removed the + // cluster-manager node from the local cluster state, but the shards assigned to the cluster-manager will still be in the // routing table as such if (shard.assignedToNode() && nodes.get(shard.currentNodeId()) != null) { String nodeId = shard.currentNodeId(); diff --git a/server/src/main/java/org/opensearch/action/support/master/AcknowledgedRequestBuilder.java b/server/src/main/java/org/opensearch/action/support/master/AcknowledgedRequestBuilder.java index 9337e646cebea..daed5a09bb0f3 100644 --- a/server/src/main/java/org/opensearch/action/support/master/AcknowledgedRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/support/master/AcknowledgedRequestBuilder.java @@ -36,7 +36,7 @@ import org.opensearch.common.unit.TimeValue; /** - * Base request builder for master node operations that support acknowledgements + * Base request builder for cluster-manager node operations that support acknowledgements */ public abstract class AcknowledgedRequestBuilder< Request extends AcknowledgedRequest, diff --git a/server/src/main/java/org/opensearch/action/support/master/MasterNodeOperationRequestBuilder.java b/server/src/main/java/org/opensearch/action/support/master/MasterNodeOperationRequestBuilder.java index b39ec5fe4cc6b..98996e222b30a 100644 --- a/server/src/main/java/org/opensearch/action/support/master/MasterNodeOperationRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/support/master/MasterNodeOperationRequestBuilder.java @@ -39,7 +39,7 @@ import org.opensearch.common.unit.TimeValue; /** - * Base request builder for master node operations + * Base request builder for cluster-manager node operations */ public abstract class MasterNodeOperationRequestBuilder< Request extends MasterNodeRequest, @@ -53,7 +53,7 @@ protected MasterNodeOperationRequestBuilder(OpenSearchClient client, ActionType< } /** - * Sets the master node timeout in case the master has not yet been discovered. + * Sets the cluster-manager node timeout in case the cluster-manager has not yet been discovered. */ @SuppressWarnings("unchecked") public final RequestBuilder setMasterNodeTimeout(TimeValue timeout) { @@ -62,7 +62,7 @@ public final RequestBuilder setMasterNodeTimeout(TimeValue timeout) { } /** - * Sets the master node timeout in case the master has not yet been discovered. + * Sets the cluster-manager node timeout in case the cluster-manager has not yet been discovered. */ @SuppressWarnings("unchecked") public final RequestBuilder setMasterNodeTimeout(String timeout) { diff --git a/server/src/main/java/org/opensearch/action/support/master/MasterNodeReadOperationRequestBuilder.java b/server/src/main/java/org/opensearch/action/support/master/MasterNodeReadOperationRequestBuilder.java index add5c5177df42..99e6b37debd8f 100644 --- a/server/src/main/java/org/opensearch/action/support/master/MasterNodeReadOperationRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/support/master/MasterNodeReadOperationRequestBuilder.java @@ -37,7 +37,7 @@ import org.opensearch.client.OpenSearchClient; /** - * Base request builder for master node read operations that can be executed on the local node as well + * Base request builder for cluster-manager node read operations that can be executed on the local node as well */ public abstract class MasterNodeReadOperationRequestBuilder< Request extends MasterNodeReadRequest, diff --git a/server/src/main/java/org/opensearch/action/support/master/MasterNodeReadRequest.java b/server/src/main/java/org/opensearch/action/support/master/MasterNodeReadRequest.java index eeafa148ca7c3..9842c47652a97 100644 --- a/server/src/main/java/org/opensearch/action/support/master/MasterNodeReadRequest.java +++ b/server/src/main/java/org/opensearch/action/support/master/MasterNodeReadRequest.java @@ -38,7 +38,7 @@ import java.io.IOException; /** - * Base request for master based read operations that allows to read the cluster state from the local node if needed + * Base request for cluster-manager based read operations that allows to read the cluster state from the local node if needed */ public abstract class MasterNodeReadRequest> extends MasterNodeRequest { @@ -64,9 +64,9 @@ public final Request local(boolean local) { } /** - * Return local information, do not retrieve the state from master node (default: false). + * Return local information, do not retrieve the state from cluster-manager node (default: false). * @return true if local information is to be returned; - * false if information is to be retrieved from master node (default). + * false if information is to be retrieved from cluster-manager node (default). */ public final boolean local() { return local; diff --git a/server/src/main/java/org/opensearch/action/support/master/MasterNodeRequest.java b/server/src/main/java/org/opensearch/action/support/master/MasterNodeRequest.java index d5be6c48e23b8..f7ea962f7c4a1 100644 --- a/server/src/main/java/org/opensearch/action/support/master/MasterNodeRequest.java +++ b/server/src/main/java/org/opensearch/action/support/master/MasterNodeRequest.java @@ -40,7 +40,7 @@ import java.io.IOException; /** - * A based request for master based operation. + * A based request for cluster-manager based operation. */ public abstract class MasterNodeRequest> extends ActionRequest { @@ -62,7 +62,7 @@ public void writeTo(StreamOutput out) throws IOException { } /** - * A timeout value in case the master has not been discovered yet or disconnected. + * A timeout value in case the cluster-manager has not been discovered yet or disconnected. */ @SuppressWarnings("unchecked") public final Request masterNodeTimeout(TimeValue timeout) { @@ -71,7 +71,7 @@ public final Request masterNodeTimeout(TimeValue timeout) { } /** - * A timeout value in case the master has not been discovered yet or disconnected. + * A timeout value in case the cluster-manager has not been discovered yet or disconnected. */ public final Request masterNodeTimeout(String timeout) { return masterNodeTimeout(TimeValue.parseTimeValue(timeout, null, getClass().getSimpleName() + ".masterNodeTimeout")); diff --git a/server/src/main/java/org/opensearch/action/support/master/TransportMasterNodeAction.java b/server/src/main/java/org/opensearch/action/support/master/TransportMasterNodeAction.java index 62d08c23534af..083bea079174c 100644 --- a/server/src/main/java/org/opensearch/action/support/master/TransportMasterNodeAction.java +++ b/server/src/main/java/org/opensearch/action/support/master/TransportMasterNodeAction.java @@ -67,7 +67,7 @@ import java.util.function.Predicate; /** - * A base class for operations that needs to be performed on the master node. + * A base class for operations that needs to be performed on the cluster-manager node. */ public abstract class TransportMasterNodeAction, Response extends ActionResponse> extends HandledTransportAction { @@ -198,13 +198,13 @@ protected void doStart(ClusterState clusterState) { } } else { if (nodes.getMasterNode() == null) { - logger.debug("no known master node, scheduling a retry"); + logger.debug("no known cluster-manager node, scheduling a retry"); retryOnMasterChange(clusterState, null); } else { - DiscoveryNode masterNode = nodes.getMasterNode(); - final String actionName = getMasterActionName(masterNode); + DiscoveryNode clusterManagerNode = nodes.getMasterNode(); + final String actionName = getMasterActionName(clusterManagerNode); transportService.sendRequest( - masterNode, + clusterManagerNode, actionName, request, new ActionListenerResponseHandler(listener, TransportMasterNodeAction.this::read) { @@ -213,7 +213,7 @@ public void handleException(final TransportException exp) { Throwable cause = exp.unwrapCause(); if (cause instanceof ConnectTransportException || (exp instanceof RemoteTransportException && cause instanceof NodeClosedException)) { - // we want to retry here a bit to see if a new master is elected + // we want to retry here a bit to see if a new cluster-manager is elected logger.debug( "connection exception while trying to forward request with action name [{}] to " + "master node [{}], scheduling a retry. Error: [{}]", @@ -279,7 +279,7 @@ public void onTimeout(TimeValue timeout) { } /** - * Allows to conditionally return a different master node action name in the case an action gets renamed. + * Allows to conditionally return a different cluster-manager node action name in the case an action gets renamed. * This mainly for backwards compatibility should be used rarely */ protected String getMasterActionName(DiscoveryNode node) { diff --git a/server/src/main/java/org/opensearch/action/support/master/TransportMasterNodeReadAction.java b/server/src/main/java/org/opensearch/action/support/master/TransportMasterNodeReadAction.java index b230901eb456e..b8be63dd6564b 100644 --- a/server/src/main/java/org/opensearch/action/support/master/TransportMasterNodeReadAction.java +++ b/server/src/main/java/org/opensearch/action/support/master/TransportMasterNodeReadAction.java @@ -41,7 +41,7 @@ import org.opensearch.transport.TransportService; /** - * A base class for read operations that needs to be performed on the master node. + * A base class for read operations that needs to be performed on the cluster-manager node. * Can also be executed on the local node if needed. */ public abstract class TransportMasterNodeReadAction, Response extends ActionResponse> extends diff --git a/server/src/main/java/org/opensearch/action/support/nodes/BaseNodeRequest.java b/server/src/main/java/org/opensearch/action/support/nodes/BaseNodeRequest.java index e91a659d331d1..27d9cb8b6c002 100644 --- a/server/src/main/java/org/opensearch/action/support/nodes/BaseNodeRequest.java +++ b/server/src/main/java/org/opensearch/action/support/nodes/BaseNodeRequest.java @@ -39,7 +39,7 @@ import java.io.IOException; -// TODO: this class can be removed in master once 7.x is bumped to 7.4.0 +// TODO: this class can be removed in main once 7.x is bumped to 7.4.0 public abstract class BaseNodeRequest extends TransportRequest { public BaseNodeRequest() {} diff --git a/server/src/main/java/org/opensearch/action/support/replication/ReplicationOperation.java b/server/src/main/java/org/opensearch/action/support/replication/ReplicationOperation.java index 68c5416f3603e..f7fd6acf8be23 100644 --- a/server/src/main/java/org/opensearch/action/support/replication/ReplicationOperation.java +++ b/server/src/main/java/org/opensearch/action/support/replication/ReplicationOperation.java @@ -263,7 +263,8 @@ public void onFailure(Exception replicaException) { ), replicaException ); - // Only report "critical" exceptions - TODO: Reach out to the master node to get the latest shard state then report. + // Only report "critical" exceptions + // TODO: Reach out to the cluster-manager node to get the latest shard state then report. if (TransportActions.isShardNotAvailableException(replicaException) == false) { RestStatus restStatus = ExceptionsHelper.status(replicaException); shardReplicaFailures.add( diff --git a/server/src/main/java/org/opensearch/action/update/TransportUpdateAction.java b/server/src/main/java/org/opensearch/action/update/TransportUpdateAction.java index 387c0d24ed4df..e554ebc0f8414 100644 --- a/server/src/main/java/org/opensearch/action/update/TransportUpdateAction.java +++ b/server/src/main/java/org/opensearch/action/update/TransportUpdateAction.java @@ -154,7 +154,7 @@ protected void doExecute(Task task, final UpdateRequest request, final ActionLis request.index() ); } - // if we don't have a master, we don't have metadata, that's fine, let it find a master using create index API + // if we don't have a master, we don't have metadata, that's fine, let it find a cluster-manager using create index API if (autoCreateIndex.shouldAutoCreate(request.index(), clusterService.state())) { client.admin() .indices() diff --git a/server/src/main/java/org/opensearch/cluster/ClusterChangedEvent.java b/server/src/main/java/org/opensearch/cluster/ClusterChangedEvent.java index db54016a61f6d..387a27da46820 100644 --- a/server/src/main/java/org/opensearch/cluster/ClusterChangedEvent.java +++ b/server/src/main/java/org/opensearch/cluster/ClusterChangedEvent.java @@ -248,7 +248,7 @@ public boolean nodesChanged() { * Determines whether or not the current cluster state represents an entirely * new cluster, either when a node joins a cluster for the first time or when * the node receives a cluster state update from a brand new cluster (different - * UUID from the previous cluster), which will happen when a master node is + * UUID from the previous cluster), which will happen when a cluster-manager node is * elected that has never been part of the cluster before. */ public boolean isNewCluster() { @@ -260,10 +260,10 @@ public boolean isNewCluster() { // Get the deleted indices by comparing the index metadatas in the previous and new cluster states. // If an index exists in the previous cluster state, but not in the new cluster state, it must have been deleted. private List indicesDeletedFromClusterState() { - // If the new cluster state has a new cluster UUID, the likely scenario is that a node was elected - // master that has had its data directory wiped out, in which case we don't want to delete the indices and lose data; + // If the new cluster state has a new cluster UUID, the likely scenario is that a node was elected cluster-manager + // that has had its data directory wiped out, in which case we don't want to delete the indices and lose data; // rather we want to import them as dangling indices instead. So we check here if the cluster UUID differs from the previous - // cluster UUID, in which case, we don't want to delete indices that the master erroneously believes shouldn't exist. + // cluster UUID, in which case, we don't want to delete indices that the cluster-manager erroneously believes shouldn't exist. // See test DiscoveryWithServiceDisruptionsIT.testIndicesDeleted() // See discussion on https://github.com/elastic/elasticsearch/pull/9952 and // https://github.com/elastic/elasticsearch/issues/11665 diff --git a/server/src/main/java/org/opensearch/cluster/ClusterState.java b/server/src/main/java/org/opensearch/cluster/ClusterState.java index 459c0b9502acf..3eaac99bad998 100644 --- a/server/src/main/java/org/opensearch/cluster/ClusterState.java +++ b/server/src/main/java/org/opensearch/cluster/ClusterState.java @@ -81,7 +81,7 @@ *

    * The cluster state object is immutable with the exception of the {@link RoutingNodes} structure, which is * built on demand from the {@link RoutingTable}. - * The cluster state can be updated only on the master node. All updates are performed by on a + * The cluster state can be updated only on the cluster-manager node. All updates are performed by on a * single thread and controlled by the {@link ClusterService}. After every update the * {@link Discovery#publish} method publishes a new version of the cluster state to all other nodes in the * cluster. The actual publishing mechanism is delegated to the {@link Discovery#publish} method and depends on @@ -169,7 +169,7 @@ default boolean isPrivate() { private final boolean wasReadFromDiff; - private final int minimumMasterNodesOnPublishingMaster; + private final int minimumClusterManagerNodesOnPublishingClusterManager; // built on demand private volatile RoutingNodes routingNodes; @@ -198,7 +198,7 @@ public ClusterState( DiscoveryNodes nodes, ClusterBlocks blocks, ImmutableOpenMap customs, - int minimumMasterNodesOnPublishingMaster, + int minimumClusterManagerNodesOnPublishingClusterManager, boolean wasReadFromDiff ) { this.version = version; @@ -209,7 +209,7 @@ public ClusterState( this.nodes = nodes; this.blocks = blocks; this.customs = customs; - this.minimumMasterNodesOnPublishingMaster = minimumMasterNodesOnPublishingMaster; + this.minimumClusterManagerNodesOnPublishingClusterManager = minimumClusterManagerNodesOnPublishingClusterManager; this.wasReadFromDiff = wasReadFromDiff; } @@ -226,8 +226,9 @@ public long getVersion() { } public long getVersionOrMetadataVersion() { - // When following a Zen1 master, the cluster state version is not guaranteed to increase, so instead it is preferable to use the - // metadata version to determine the freshest node. However when following a Zen2 master the cluster state version should be used. + // When following a Zen1 cluster-manager, the cluster state version is not guaranteed to increase, + // so instead it is preferable to use the metadata version to determine the freshest node. + // However when following a Zen2 cluster-manager the cluster state version should be used. return term() == ZEN1_BWC_TERM ? metadata().version() : version(); } @@ -388,7 +389,7 @@ public String toString() { } /** - * a cluster state supersedes another state if they are from the same master and the version of this state is higher than that of the + * a cluster state supersedes another state if they are from the same cluster-manager and the version of this state is higher than that of the * other state. *

    * In essence that means that all the changes from the other cluster state are also reflected by the current one @@ -590,7 +591,7 @@ public static class Builder { private ClusterBlocks blocks = ClusterBlocks.EMPTY_CLUSTER_BLOCK; private final ImmutableOpenMap.Builder customs; private boolean fromDiff; - private int minimumMasterNodesOnPublishingMaster = -1; + private int minimumClusterManagerNodesOnPublishingClusterManager = -1; public Builder(ClusterState state) { this.clusterName = state.clusterName; @@ -601,7 +602,7 @@ public Builder(ClusterState state) { this.metadata = state.metadata(); this.blocks = state.blocks(); this.customs = ImmutableOpenMap.builder(state.customs()); - this.minimumMasterNodesOnPublishingMaster = state.minimumMasterNodesOnPublishingMaster; + this.minimumClusterManagerNodesOnPublishingClusterManager = state.minimumClusterManagerNodesOnPublishingClusterManager; this.fromDiff = false; } @@ -662,8 +663,8 @@ public Builder stateUUID(String uuid) { return this; } - public Builder minimumMasterNodesOnPublishingMaster(int minimumMasterNodesOnPublishingMaster) { - this.minimumMasterNodesOnPublishingMaster = minimumMasterNodesOnPublishingMaster; + public Builder minimumClusterManagerNodesOnPublishingClusterManager(int minimumClusterManagerNodesOnPublishingClusterManager) { + this.minimumClusterManagerNodesOnPublishingClusterManager = minimumClusterManagerNodesOnPublishingClusterManager; return this; } @@ -701,7 +702,7 @@ public ClusterState build() { nodes, blocks, customs.build(), - minimumMasterNodesOnPublishingMaster, + minimumClusterManagerNodesOnPublishingClusterManager, fromDiff ); } @@ -746,7 +747,7 @@ public static ClusterState readFrom(StreamInput in, DiscoveryNode localNode) thr Custom customIndexMetadata = in.readNamedWriteable(Custom.class); builder.putCustom(customIndexMetadata.getWriteableName(), customIndexMetadata); } - builder.minimumMasterNodesOnPublishingMaster = in.readVInt(); + builder.minimumClusterManagerNodesOnPublishingClusterManager = in.readVInt(); return builder.build(); } @@ -772,7 +773,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeNamedWriteable(cursor.value); } } - out.writeVInt(minimumMasterNodesOnPublishingMaster); + out.writeVInt(minimumClusterManagerNodesOnPublishingClusterManager); } private static class ClusterStateDiff implements Diff { @@ -795,7 +796,7 @@ private static class ClusterStateDiff implements Diff { private final Diff> customs; - private final int minimumMasterNodesOnPublishingMaster; + private final int minimumClusterManagerNodesOnPublishingClusterManager; ClusterStateDiff(ClusterState before, ClusterState after) { fromUuid = before.stateUUID; @@ -807,7 +808,7 @@ private static class ClusterStateDiff implements Diff { metadata = after.metadata.diff(before.metadata); blocks = after.blocks.diff(before.blocks); customs = DiffableUtils.diff(before.customs, after.customs, DiffableUtils.getStringKeySerializer(), CUSTOM_VALUE_SERIALIZER); - minimumMasterNodesOnPublishingMaster = after.minimumMasterNodesOnPublishingMaster; + minimumClusterManagerNodesOnPublishingClusterManager = after.minimumClusterManagerNodesOnPublishingClusterManager; } ClusterStateDiff(StreamInput in, DiscoveryNode localNode) throws IOException { @@ -820,7 +821,7 @@ private static class ClusterStateDiff implements Diff { metadata = Metadata.readDiffFrom(in); blocks = ClusterBlocks.readDiffFrom(in); customs = DiffableUtils.readImmutableOpenMapDiff(in, DiffableUtils.getStringKeySerializer(), CUSTOM_VALUE_SERIALIZER); - minimumMasterNodesOnPublishingMaster = in.readVInt(); + minimumClusterManagerNodesOnPublishingClusterManager = in.readVInt(); } @Override @@ -834,7 +835,7 @@ public void writeTo(StreamOutput out) throws IOException { metadata.writeTo(out); blocks.writeTo(out); customs.writeTo(out); - out.writeVInt(minimumMasterNodesOnPublishingMaster); + out.writeVInt(minimumClusterManagerNodesOnPublishingClusterManager); } @Override @@ -854,7 +855,7 @@ public ClusterState apply(ClusterState state) { builder.metadata(metadata.apply(state.metadata)); builder.blocks(blocks.apply(state.blocks)); builder.customs(customs.apply(state.customs)); - builder.minimumMasterNodesOnPublishingMaster(minimumMasterNodesOnPublishingMaster); + builder.minimumClusterManagerNodesOnPublishingClusterManager(minimumClusterManagerNodesOnPublishingClusterManager); builder.fromDiff(true); return builder.build(); } diff --git a/server/src/main/java/org/opensearch/cluster/ClusterStateObserver.java b/server/src/main/java/org/opensearch/cluster/ClusterStateObserver.java index 5d55ce70aec02..4f3372b4e9069 100644 --- a/server/src/main/java/org/opensearch/cluster/ClusterStateObserver.java +++ b/server/src/main/java/org/opensearch/cluster/ClusterStateObserver.java @@ -187,7 +187,7 @@ public void waitForNextChange(Listener listener, Predicate statePr // sample a new state. This state maybe *older* than the supplied state if we are called from an applier, // which wants to wait for something else to happen ClusterState newState = clusterApplierService.state(); - if (lastObservedState.get().isOlderOrDifferentMaster(newState) && statePredicate.test(newState)) { + if (lastObservedState.get().isOlderOrDifferentClusterManager(newState) && statePredicate.test(newState)) { // good enough, let's go. logger.trace("observer: sampled state accepted by predicate ({})", newState); lastObservedState.set(new StoredState(newState)); @@ -241,7 +241,7 @@ public void postAdded() { return; } ClusterState newState = clusterApplierService.state(); - if (lastObservedState.get().isOlderOrDifferentMaster(newState) && context.statePredicate.test(newState)) { + if (lastObservedState.get().isOlderOrDifferentClusterManager(newState) && context.statePredicate.test(newState)) { // double check we're still listening if (observingContext.compareAndSet(context, null)) { logger.trace("observer: post adding listener: accepting current cluster state ({})", newState); @@ -295,22 +295,23 @@ public String toString() { } /** - * The observer considers two cluster states to be the same if they have the same version and master node id (i.e. null or set) + * The observer considers two cluster states to be the same if they have the same version and cluster-manager node id (i.e. null or set) */ private static class StoredState { - private final String masterNodeId; + private final String clusterManagerNodeId; private final long version; StoredState(ClusterState clusterState) { - this.masterNodeId = clusterState.nodes().getMasterNodeId(); + this.clusterManagerNodeId = clusterState.nodes().getMasterNodeId(); this.version = clusterState.version(); } /** - * returns true if stored state is older then given state or they are from a different master, meaning they can't be compared + * returns true if stored state is older then given state or they are from a different cluster-manager, meaning they can't be compared * */ - public boolean isOlderOrDifferentMaster(ClusterState clusterState) { - return version < clusterState.version() || Objects.equals(masterNodeId, clusterState.nodes().getMasterNodeId()) == false; + public boolean isOlderOrDifferentClusterManager(ClusterState clusterState) { + return version < clusterState.version() + || Objects.equals(clusterManagerNodeId, clusterState.nodes().getMasterNodeId()) == false; } } diff --git a/server/src/main/java/org/opensearch/cluster/ClusterStateTaskExecutor.java b/server/src/main/java/org/opensearch/cluster/ClusterStateTaskExecutor.java index 04002b31a8b3e..48d3dd7d03cb5 100644 --- a/server/src/main/java/org/opensearch/cluster/ClusterStateTaskExecutor.java +++ b/server/src/main/java/org/opensearch/cluster/ClusterStateTaskExecutor.java @@ -45,7 +45,7 @@ public interface ClusterStateTaskExecutor { ClusterTasksResult execute(ClusterState currentState, List tasks) throws Exception; /** - * indicates whether this executor should only run if the current node is master + * indicates whether this executor should only run if the current node is cluster-manager */ default boolean runOnlyOnMaster() { return true; diff --git a/server/src/main/java/org/opensearch/cluster/ClusterStateTaskListener.java b/server/src/main/java/org/opensearch/cluster/ClusterStateTaskListener.java index 718df33f8a2d2..d5b9eebbc3b5d 100644 --- a/server/src/main/java/org/opensearch/cluster/ClusterStateTaskListener.java +++ b/server/src/main/java/org/opensearch/cluster/ClusterStateTaskListener.java @@ -43,11 +43,11 @@ public interface ClusterStateTaskListener { void onFailure(String source, Exception e); /** - * called when the task was rejected because the local node is no longer master. + * called when the task was rejected because the local node is no longer cluster-manager. * Used only for tasks submitted to {@link MasterService}. */ default void onNoLongerMaster(String source) { - onFailure(source, new NotMasterException("no longer master. source: [" + source + "]")); + onFailure(source, new NotMasterException("no longer cluster-manager. source: [" + source + "]")); } /** diff --git a/server/src/main/java/org/opensearch/cluster/ClusterStateUpdateTask.java b/server/src/main/java/org/opensearch/cluster/ClusterStateUpdateTask.java index 72d72158a5f0b..9393663b309fc 100644 --- a/server/src/main/java/org/opensearch/cluster/ClusterStateUpdateTask.java +++ b/server/src/main/java/org/opensearch/cluster/ClusterStateUpdateTask.java @@ -101,7 +101,7 @@ public Priority priority() { } /** - * Marked as final as cluster state update tasks should only run on master. + * Marked as final as cluster state update tasks should only run on cluster-manager. * For local requests, use {@link LocalClusterUpdateTask} instead. */ @Override diff --git a/server/src/main/java/org/opensearch/cluster/LocalClusterUpdateTask.java b/server/src/main/java/org/opensearch/cluster/LocalClusterUpdateTask.java index 06ed0c0580e2f..ffcd63b3b57c1 100644 --- a/server/src/main/java/org/opensearch/cluster/LocalClusterUpdateTask.java +++ b/server/src/main/java/org/opensearch/cluster/LocalClusterUpdateTask.java @@ -38,7 +38,7 @@ import java.util.List; /** - * Used to apply state updates on nodes that are not necessarily master + * Used to apply state updates on nodes that are not necessarily cluster-manager */ public abstract class LocalClusterUpdateTask implements diff --git a/server/src/main/java/org/opensearch/cluster/LocalNodeMasterListener.java b/server/src/main/java/org/opensearch/cluster/LocalNodeMasterListener.java index 1c35f7bbbe8a1..d4456b379237c 100644 --- a/server/src/main/java/org/opensearch/cluster/LocalNodeMasterListener.java +++ b/server/src/main/java/org/opensearch/cluster/LocalNodeMasterListener.java @@ -32,29 +32,29 @@ package org.opensearch.cluster; /** - * Enables listening to master changes events of the local node (when the local node becomes the master, and when the local - * node cease being a master). + * Enables listening to cluster-manager changes events of the local node (when the local node becomes the cluster-manager, and when the local + * node cease being a cluster-manager). */ public interface LocalNodeMasterListener extends ClusterStateListener { /** - * Called when local node is elected to be the master + * Called when local node is elected to be the cluster-manager */ - void onMaster(); + void onClusterManager(); /** - * Called when the local node used to be the master, a new master was elected and it's no longer the local node. + * Called when the local node used to be the cluster-manager, a new cluster-manager was elected and it's no longer the local node. */ - void offMaster(); + void offClusterManager(); @Override default void clusterChanged(ClusterChangedEvent event) { - final boolean wasMaster = event.previousState().nodes().isLocalNodeElectedMaster(); - final boolean isMaster = event.localNodeMaster(); - if (wasMaster == false && isMaster) { - onMaster(); - } else if (wasMaster && isMaster == false) { - offMaster(); + final boolean wasClusterManager = event.previousState().nodes().isLocalNodeElectedMaster(); + final boolean isClusterManager = event.localNodeMaster(); + if (wasClusterManager == false && isClusterManager) { + onClusterManager(); + } else if (wasClusterManager && isClusterManager == false) { + offClusterManager(); } } } diff --git a/server/src/main/java/org/opensearch/cluster/MasterNodeChangePredicate.java b/server/src/main/java/org/opensearch/cluster/MasterNodeChangePredicate.java index 9d11fb84af801..8eeaedd83cb26 100644 --- a/server/src/main/java/org/opensearch/cluster/MasterNodeChangePredicate.java +++ b/server/src/main/java/org/opensearch/cluster/MasterNodeChangePredicate.java @@ -48,14 +48,14 @@ private MasterNodeChangePredicate() { */ public static Predicate build(ClusterState currentState) { final long currentVersion = currentState.version(); - final DiscoveryNode masterNode = currentState.nodes().getMasterNode(); - final String currentMasterId = masterNode == null ? null : masterNode.getEphemeralId(); + final DiscoveryNode clusterManagerNode = currentState.nodes().getMasterNode(); + final String currentMasterId = clusterManagerNode == null ? null : clusterManagerNode.getEphemeralId(); return newState -> { - final DiscoveryNode newMaster = newState.nodes().getMasterNode(); + final DiscoveryNode newClusterManager = newState.nodes().getMasterNode(); final boolean accept; - if (newMaster == null) { + if (newClusterManager == null) { accept = false; - } else if (newMaster.getEphemeralId().equals(currentMasterId) == false) { + } else if (newClusterManager.getEphemeralId().equals(currentMasterId) == false) { accept = true; } else { accept = newState.version() > currentVersion; diff --git a/server/src/main/java/org/opensearch/cluster/NodeConnectionsService.java b/server/src/main/java/org/opensearch/cluster/NodeConnectionsService.java index 02139ea21b483..696df6278dbb6 100644 --- a/server/src/main/java/org/opensearch/cluster/NodeConnectionsService.java +++ b/server/src/main/java/org/opensearch/cluster/NodeConnectionsService.java @@ -69,7 +69,7 @@ * This component is responsible for maintaining connections from this node to all the nodes listed in the cluster state, and for * disconnecting from nodes once they are removed from the cluster state. It periodically checks that all connections are still open and * restores them if needed. Note that this component is *not* responsible for removing nodes from the cluster state if they disconnect or - * are unresponsive: this is the job of the master's fault detection components, particularly {@link FollowersChecker}. + * are unresponsive: this is the job of the cluster-manager's fault detection components, particularly {@link FollowersChecker}. *

    * The {@link NodeConnectionsService#connectToNodes(DiscoveryNodes, Runnable)} and {@link * NodeConnectionsService#disconnectFromNodesExcept(DiscoveryNodes)} methods are called on the {@link ClusterApplier} thread. This component diff --git a/server/src/main/java/org/opensearch/cluster/NotMasterException.java b/server/src/main/java/org/opensearch/cluster/NotMasterException.java index 61772aa13233b..c8ec32ed77eb9 100644 --- a/server/src/main/java/org/opensearch/cluster/NotMasterException.java +++ b/server/src/main/java/org/opensearch/cluster/NotMasterException.java @@ -37,9 +37,9 @@ import java.io.IOException; /** - * Thrown when a node join request or a master ping reaches a node which is not - * currently acting as a master or when a cluster state update task is to be executed - * on a node that is no longer master. + * Thrown when a node join request or a cluster-manager ping reaches a node which is not + * currently acting as a cluster-manager or when a cluster state update task is to be executed + * on a node that is no longer cluster-manager. */ public class NotMasterException extends OpenSearchException { diff --git a/server/src/main/java/org/opensearch/cluster/SnapshotsInProgress.java b/server/src/main/java/org/opensearch/cluster/SnapshotsInProgress.java index 2c001833f46ce..d0d5aea9d036b 100644 --- a/server/src/main/java/org/opensearch/cluster/SnapshotsInProgress.java +++ b/server/src/main/java/org/opensearch/cluster/SnapshotsInProgress.java @@ -297,9 +297,9 @@ private Entry(StreamInput in) throws IOException { if (in.getVersion().onOrAfter(VERSION_IN_SNAPSHOT_VERSION)) { version = Version.readVersion(in); } else if (in.getVersion().onOrAfter(SnapshotsService.SHARD_GEN_IN_REPO_DATA_VERSION)) { - // If an older master informs us that shard generations are supported we use the minimum shard generation compatible - // version. If shard generations are not supported yet we use a placeholder for a version that does not use shard - // generations. + // If an older cluster-manager informs us that shard generations are supported + // we use the minimum shard generation compatible version. + // If shard generations are not supported yet we use a placeholder for a version that does not use shard generations. version = in.readBoolean() ? SnapshotsService.SHARD_GEN_IN_REPO_DATA_VERSION : SnapshotsService.OLD_SNAPSHOT_FORMAT; } else { version = SnapshotsService.OLD_SNAPSHOT_FORMAT; diff --git a/server/src/main/java/org/opensearch/cluster/ack/AckedRequest.java b/server/src/main/java/org/opensearch/cluster/ack/AckedRequest.java index 23a9ed16e35d2..97d628e3231c9 100644 --- a/server/src/main/java/org/opensearch/cluster/ack/AckedRequest.java +++ b/server/src/main/java/org/opensearch/cluster/ack/AckedRequest.java @@ -45,7 +45,7 @@ public interface AckedRequest { TimeValue ackTimeout(); /** - * Returns the timeout for the request to be completed on the master node + * Returns the timeout for the request to be completed on the cluster-manager node */ TimeValue masterNodeTimeout(); } diff --git a/server/src/main/java/org/opensearch/cluster/ack/ClusterStateUpdateRequest.java b/server/src/main/java/org/opensearch/cluster/ack/ClusterStateUpdateRequest.java index d142c28086f70..0931086ab3ff0 100644 --- a/server/src/main/java/org/opensearch/cluster/ack/ClusterStateUpdateRequest.java +++ b/server/src/main/java/org/opensearch/cluster/ack/ClusterStateUpdateRequest.java @@ -62,7 +62,7 @@ public T ackTimeout(TimeValue ackTimeout) { /** * Returns the maximum time interval to wait for the request to - * be completed on the master node + * be completed on the cluster-manager node */ @Override public TimeValue masterNodeTimeout() { @@ -70,7 +70,7 @@ public TimeValue masterNodeTimeout() { } /** - * Sets the master node timeout + * Sets the cluster-manager node timeout */ @SuppressWarnings("unchecked") public T masterNodeTimeout(TimeValue masterNodeTimeout) { diff --git a/server/src/main/java/org/opensearch/cluster/action/index/MappingUpdatedAction.java b/server/src/main/java/org/opensearch/cluster/action/index/MappingUpdatedAction.java index f22d489ec6fd7..cf1f2d3141ccd 100644 --- a/server/src/main/java/org/opensearch/cluster/action/index/MappingUpdatedAction.java +++ b/server/src/main/java/org/opensearch/cluster/action/index/MappingUpdatedAction.java @@ -104,10 +104,10 @@ public void setClient(Client client) { } /** - * Update mappings on the master node, waiting for the change to be committed, + * Update mappings on the cluster-manager node, waiting for the change to be committed, * but not for the mapping update to be applied on all nodes. The timeout specified by - * {@code timeout} is the master node timeout ({@link MasterNodeRequest#masterNodeTimeout()}), - * potentially waiting for a master node to be available. + * {@code timeout} is the cluster-manager node timeout ({@link MasterNodeRequest#masterNodeTimeout()}), + * potentially waiting for a cluster-manager node to be available. */ public void updateMappingOnMaster(Index index, Mapping mappingUpdate, ActionListener listener) { diff --git a/server/src/main/java/org/opensearch/cluster/action/index/NodeMappingRefreshAction.java b/server/src/main/java/org/opensearch/cluster/action/index/NodeMappingRefreshAction.java index 23ce218904d21..b40665a1bcf1b 100644 --- a/server/src/main/java/org/opensearch/cluster/action/index/NodeMappingRefreshAction.java +++ b/server/src/main/java/org/opensearch/cluster/action/index/NodeMappingRefreshAction.java @@ -74,12 +74,12 @@ public NodeMappingRefreshAction(TransportService transportService, MetadataMappi ); } - public void nodeMappingRefresh(final DiscoveryNode masterNode, final NodeMappingRefreshRequest request) { - if (masterNode == null) { - logger.warn("can't send mapping refresh for [{}], no master known.", request.index()); + public void nodeMappingRefresh(final DiscoveryNode clusterManagerNode, final NodeMappingRefreshRequest request) { + if (clusterManagerNode == null) { + logger.warn("can't send mapping refresh for [{}], no cluster-manager known.", request.index()); return; } - transportService.sendRequest(masterNode, ACTION_NAME, request, EmptyTransportResponseHandler.INSTANCE_SAME); + transportService.sendRequest(clusterManagerNode, ACTION_NAME, request, EmptyTransportResponseHandler.INSTANCE_SAME); } private class NodeMappingRefreshTransportHandler implements TransportRequestHandler { diff --git a/server/src/main/java/org/opensearch/cluster/action/shard/ShardStateAction.java b/server/src/main/java/org/opensearch/cluster/action/shard/ShardStateAction.java index 300067587b78b..fd6a5367146a4 100644 --- a/server/src/main/java/org/opensearch/cluster/action/shard/ShardStateAction.java +++ b/server/src/main/java/org/opensearch/cluster/action/shard/ShardStateAction.java @@ -177,14 +177,14 @@ private void sendShardAction( final ActionListener listener ) { ClusterStateObserver observer = new ClusterStateObserver(currentState, clusterService, null, logger, threadPool.getThreadContext()); - DiscoveryNode masterNode = currentState.nodes().getMasterNode(); + DiscoveryNode clusterManagerNode = currentState.nodes().getMasterNode(); Predicate changePredicate = MasterNodeChangePredicate.build(currentState); - if (masterNode == null) { - logger.warn("no master known for action [{}] for shard entry [{}]", actionName, request); - waitForNewMasterAndRetry(actionName, observer, request, listener, changePredicate); + if (clusterManagerNode == null) { + logger.warn("no cluster-manager known for action [{}] for shard entry [{}]", actionName, request); + waitForNewClusterManagerAndRetry(actionName, observer, request, listener, changePredicate); } else { - logger.debug("sending [{}] to [{}] for shard entry [{}]", actionName, masterNode.getId(), request); - transportService.sendRequest(masterNode, actionName, request, new EmptyTransportResponseHandler(ThreadPool.Names.SAME) { + logger.debug("sending [{}] to [{}] for shard entry [{}]", actionName, clusterManagerNode.getId(), request); + transportService.sendRequest(clusterManagerNode, actionName, request, new EmptyTransportResponseHandler(ThreadPool.Names.SAME) { @Override public void handleResponse(TransportResponse.Empty response) { listener.onResponse(null); @@ -192,14 +192,14 @@ public void handleResponse(TransportResponse.Empty response) { @Override public void handleException(TransportException exp) { - if (isMasterChannelException(exp)) { - waitForNewMasterAndRetry(actionName, observer, request, listener, changePredicate); + if (isClusterManagerChannelException(exp)) { + waitForNewClusterManagerAndRetry(actionName, observer, request, listener, changePredicate); } else { logger.warn( new ParameterizedMessage( "unexpected failure while sending request [{}]" + " to [{}] for shard entry [{}]", actionName, - masterNode, + clusterManagerNode, request ), exp @@ -217,17 +217,17 @@ public void handleException(TransportException exp) { } } - private static Class[] MASTER_CHANNEL_EXCEPTIONS = new Class[] { + private static Class[] CLUSTER_MANAGER_CHANNEL_EXCEPTIONS = new Class[] { NotMasterException.class, ConnectTransportException.class, FailedToCommitClusterStateException.class }; - private static boolean isMasterChannelException(TransportException exp) { - return ExceptionsHelper.unwrap(exp, MASTER_CHANNEL_EXCEPTIONS) != null; + private static boolean isClusterManagerChannelException(TransportException exp) { + return ExceptionsHelper.unwrap(exp, CLUSTER_MANAGER_CHANNEL_EXCEPTIONS) != null; } /** - * Send a shard failed request to the master node to update the cluster state with the failure of a shard on another node. This means + * Send a shard failed request to the cluster-manager node to update the cluster state with the failure of a shard on another node. This means * that the shard should be failed because a write made it into the primary but was not replicated to this shard copy. If the shard * does not exist anymore but still has an entry in the in-sync set, remove its allocation id from the in-sync set. * @@ -261,7 +261,7 @@ int remoteShardFailedCacheSize() { } /** - * Send a shard failed request to the master node to update the cluster state when a shard on the local node failed. + * Send a shard failed request to the cluster-manager node to update the cluster state when a shard on the local node failed. */ public void localShardFailed( final ShardRouting shardRouting, @@ -273,7 +273,7 @@ public void localShardFailed( } /** - * Send a shard failed request to the master node to update the cluster state when a shard on the local node failed. + * Send a shard failed request to the cluster-manager node to update the cluster state when a shard on the local node failed. */ public void localShardFailed( final ShardRouting shardRouting, @@ -294,7 +294,7 @@ public void localShardFailed( } // visible for testing - protected void waitForNewMasterAndRetry( + protected void waitForNewClusterManagerAndRetry( String actionName, ClusterStateObserver observer, TransportRequest request, @@ -305,7 +305,7 @@ protected void waitForNewMasterAndRetry( @Override public void onNewClusterState(ClusterState state) { if (logger.isTraceEnabled()) { - logger.trace("new cluster state [{}] after waiting for master election for shard entry [{}]", state, request); + logger.trace("new cluster state [{}] after waiting for cluster-manager election for shard entry [{}]", state, request); } sendShardAction(actionName, state, request, listener); } @@ -318,7 +318,7 @@ public void onClusterServiceClose() { @Override public void onTimeout(TimeValue timeout) { - // we wait indefinitely for a new master + // we wait indefinitely for a new cluster-manager assert false; } }, changePredicate); @@ -376,13 +376,13 @@ public void onFailure(String source, Exception e) { @Override public void onNoLongerMaster(String source) { - logger.error("{} no longer master while failing shard [{}]", request.shardId, request); + logger.error("{} no longer cluster-manager while failing shard [{}]", request.shardId, request); try { channel.sendResponse(new NotMasterException(source)); } catch (Exception channelException) { logger.warn( () -> new ParameterizedMessage( - "{} failed to send no longer master while failing shard [{}]", + "{} failed to send no longer cluster-manager while failing shard [{}]", request.shardId, request ), @@ -714,7 +714,8 @@ public ClusterTasksResult execute(ClusterState currentState, if (matched == null) { // tasks that correspond to non-existent shards are marked as successful. The reason is that we resend shard started // events on every cluster state publishing that does not contain the shard as started yet. This means that old stale - // requests might still be in flight even after the shard has already been started or failed on the master. We just + // requests might still be in flight even after the shard has already been started or failed on the cluster-manager. We + // just // ignore these requests for now. logger.debug("{} ignoring shard started task [{}] (shard does not exist anymore)", task.shardId, task); builder.success(task); diff --git a/server/src/main/java/org/opensearch/cluster/coordination/ApplyCommitRequest.java b/server/src/main/java/org/opensearch/cluster/coordination/ApplyCommitRequest.java index 40d6375d8d916..2ace3e86b31de 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/ApplyCommitRequest.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/ApplyCommitRequest.java @@ -38,7 +38,7 @@ import java.io.IOException; /** - * A master node sends this request to its peers to inform them that it could commit the + * A cluster-manager node sends this request to its peers to inform them that it could commit the * cluster state with the given term and version. Peers that have accepted the given cluster * state will then consider it as committed and proceed to apply the state locally. */ diff --git a/server/src/main/java/org/opensearch/cluster/coordination/ClusterBootstrapService.java b/server/src/main/java/org/opensearch/cluster/coordination/ClusterBootstrapService.java index c7708a54f9031..979b36110b6a3 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/ClusterBootstrapService.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/ClusterBootstrapService.java @@ -141,11 +141,11 @@ public ClusterBootstrapService( bootstrapRequirements = Collections.singleton(Node.NODE_NAME_SETTING.get(settings)); unconfiguredBootstrapTimeout = null; } else { - final List initialMasterNodes = INITIAL_CLUSTER_MANAGER_NODES_SETTING.get(settings); - bootstrapRequirements = unmodifiableSet(new LinkedHashSet<>(initialMasterNodes)); - if (bootstrapRequirements.size() != initialMasterNodes.size()) { + final List initialClusterManagerNodes = INITIAL_CLUSTER_MANAGER_NODES_SETTING.get(settings); + bootstrapRequirements = unmodifiableSet(new LinkedHashSet<>(initialClusterManagerNodes)); + if (bootstrapRequirements.size() != initialClusterManagerNodes.size()) { throw new IllegalArgumentException( - "setting [" + initialClusterManagerSettingName + "] contains duplicates: " + initialMasterNodes + "setting [" + initialClusterManagerSettingName + "] contains duplicates: " + initialClusterManagerNodes ); } unconfiguredBootstrapTimeout = discoveryIsConfigured(settings) ? null : UNCONFIGURED_BOOTSTRAP_TIMEOUT_SETTING.get(settings); diff --git a/server/src/main/java/org/opensearch/cluster/coordination/ClusterStatePublisher.java b/server/src/main/java/org/opensearch/cluster/coordination/ClusterStatePublisher.java index 47a18d5be1ec4..ef35c6f8b3249 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/ClusterStatePublisher.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/ClusterStatePublisher.java @@ -39,8 +39,8 @@ public interface ClusterStatePublisher { /** - * Publish all the changes to the cluster from the master (can be called just by the master). The publish - * process should apply this state to the master as well! + * Publish all the changes to the cluster from the cluster-manager (can be called just by the cluster-manager). The publish + * process should apply this state to the cluster-manager as well! * * The publishListener allows to wait for the publication to complete, which can be either successful completion, timing out or failing. * The method is guaranteed to pass back a {@link FailedToCommitClusterStateException} to the publishListener if the change is not diff --git a/server/src/main/java/org/opensearch/cluster/coordination/CoordinationState.java b/server/src/main/java/org/opensearch/cluster/coordination/CoordinationState.java index b28fde5d9cc16..9713c841caaf7 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/CoordinationState.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/CoordinationState.java @@ -610,7 +610,8 @@ default void markLastAcceptedStateAsCommitted() { metadataBuilder = Metadata.builder(lastAcceptedState.metadata()); metadataBuilder.coordinationMetadata(coordinationMetadata); } - // if we receive a commit from a Zen1 master that has not recovered its state yet, the cluster uuid might not been known yet. + // if we receive a commit from a Zen1 cluster-manager that has not recovered its state yet, + // the cluster uuid might not been known yet. assert lastAcceptedState.metadata().clusterUUID().equals(Metadata.UNKNOWN_CLUSTER_UUID) == false || lastAcceptedState.term() == ZEN1_BWC_TERM : "received cluster state with empty cluster uuid but not Zen1 BWC term: " + lastAcceptedState; @@ -622,7 +623,8 @@ default void markLastAcceptedStateAsCommitted() { metadataBuilder.clusterUUIDCommitted(true); if (lastAcceptedState.term() != ZEN1_BWC_TERM) { - // Zen1 masters never publish a committed cluster UUID so if we logged this it'd happen on on every update. Let's just + // Zen1 cluster-managers never publish a committed cluster UUID so if we logged this it'd happen on on every update. + // Let's just // not log it at all in a 6.8/7.x rolling upgrade. logger.info("cluster UUID set to [{}]", lastAcceptedState.metadata().clusterUUID()); } diff --git a/server/src/main/java/org/opensearch/cluster/coordination/Coordinator.java b/server/src/main/java/org/opensearch/cluster/coordination/Coordinator.java index 89e5b9b4cfbcc..ef578300cdbe2 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/Coordinator.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/Coordinator.java @@ -136,12 +136,12 @@ public class Coordinator extends AbstractLifecycleComponent implements Discovery private final boolean singleNodeDiscovery; private final ElectionStrategy electionStrategy; private final TransportService transportService; - private final MasterService masterService; + private final MasterService clusterManagerService; private final AllocationService allocationService; private final JoinHelper joinHelper; private final NodeRemovalClusterStateTaskExecutor nodeRemovalExecutor; private final Supplier persistedStateSupplier; - private final NoMasterBlockService noMasterBlockService; + private final NoMasterBlockService noClusterManagerBlockService; final Object mutex = new Object(); // package-private to allow tests to call methods that assert that the mutex is held private final SetOnce coordinationState = new SetOnce<>(); // initialized on start-up (see doStart) private volatile ClusterState applierState; // the state that should be exposed to the cluster state applier @@ -186,7 +186,7 @@ public Coordinator( TransportService transportService, NamedWriteableRegistry namedWriteableRegistry, AllocationService allocationService, - MasterService masterService, + MasterService clusterManagerService, Supplier persistedStateSupplier, SeedHostsProvider seedHostsProvider, ClusterApplier clusterApplier, @@ -198,7 +198,7 @@ public Coordinator( ) { this.settings = settings; this.transportService = transportService; - this.masterService = masterService; + this.clusterManagerService = clusterManagerService; this.allocationService = allocationService; this.onJoinValidators = JoinTaskExecutor.addBuiltInJoinValidators(onJoinValidators); this.singleNodeDiscovery = DiscoveryModule.isSingleNodeDiscovery(settings); @@ -206,10 +206,10 @@ public Coordinator( this.joinHelper = new JoinHelper( settings, allocationService, - masterService, + clusterManagerService, transportService, this::getCurrentTerm, - this::getStateForMasterService, + this::getStateForClusterManagerService, this::handleJoinRequest, this::joinLeaderInTerm, this.onJoinValidators, @@ -217,7 +217,7 @@ public Coordinator( nodeHealthService ); this.persistedStateSupplier = persistedStateSupplier; - this.noMasterBlockService = new NoMasterBlockService(settings, clusterSettings); + this.noClusterManagerBlockService = new NoMasterBlockService(settings, clusterSettings); this.lastKnownLeader = Optional.empty(); this.lastJoin = Optional.empty(); this.joinAccumulator = new InitialJoinAccumulator(); @@ -255,7 +255,7 @@ public Coordinator( ); this.nodeRemovalExecutor = new NodeRemovalClusterStateTaskExecutor(allocationService, logger); this.clusterApplier = clusterApplier; - masterService.setClusterStateSupplier(this::getStateForMasterService); + clusterManagerService.setClusterStateSupplier(this::getStateForClusterManagerService); this.reconfigurator = new Reconfigurator(settings, clusterSettings); this.clusterBootstrapService = new ClusterBootstrapService( settings, @@ -282,7 +282,7 @@ public Coordinator( private ClusterFormationState getClusterFormationState() { return new ClusterFormationState( settings, - getStateForMasterService(), + getStateForClusterManagerService(), peerFinder.getLastResolvedAddresses(), Stream.concat(Stream.of(getLocalNode()), StreamSupport.stream(peerFinder.getFoundPeers().spliterator(), false)) .collect(Collectors.toList()), @@ -296,7 +296,7 @@ private void onLeaderFailure(Exception e) { synchronized (mutex) { if (mode != Mode.CANDIDATE) { assert lastKnownLeader.isPresent(); - logger.info(new ParameterizedMessage("master node [{}] failed, restarting discovery", lastKnownLeader.get()), e); + logger.info(new ParameterizedMessage("cluster-manager node [{}] failed, restarting discovery", lastKnownLeader.get()), e); } becomeCandidate("onLeaderFailure"); } @@ -305,7 +305,7 @@ private void onLeaderFailure(Exception e) { private void removeNode(DiscoveryNode discoveryNode, String reason) { synchronized (mutex) { if (mode == Mode.LEADER) { - masterService.submitStateUpdateTask( + clusterManagerService.submitStateUpdateTask( "node-left", new NodeRemovalClusterStateTaskExecutor.Task(discoveryNode, reason), ClusterStateTaskConfig.build(Priority.IMMEDIATE), @@ -336,11 +336,11 @@ void onFollowerCheckRequest(FollowerCheckRequest followerCheckRequest) { } else if (mode == Mode.FOLLOWER) { logger.trace("onFollowerCheckRequest: responding successfully to {}", followerCheckRequest); } else if (joinHelper.isJoinPending()) { - logger.trace("onFollowerCheckRequest: rejoining master, responding successfully to {}", followerCheckRequest); + logger.trace("onFollowerCheckRequest: rejoining cluster-manager, responding successfully to {}", followerCheckRequest); } else { - logger.trace("onFollowerCheckRequest: received check from faulty master, rejecting {}", followerCheckRequest); + logger.trace("onFollowerCheckRequest: received check from faulty cluster-manager, rejecting {}", followerCheckRequest); throw new CoordinationStateRejectedException( - "onFollowerCheckRequest: received check from faulty master, rejecting " + followerCheckRequest + "onFollowerCheckRequest: received check from faulty cluster-manager, rejecting " + followerCheckRequest ); } } @@ -352,9 +352,9 @@ private void handleApplyCommit(ApplyCommitRequest applyCommitRequest, ActionList coordinationState.get().handleCommit(applyCommitRequest); final ClusterState committedState = hideStateIfNotRecovered(coordinationState.get().getLastAcceptedState()); - applierState = mode == Mode.CANDIDATE ? clusterStateWithNoMasterBlock(committedState) : committedState; + applierState = mode == Mode.CANDIDATE ? clusterStateWithNoClusterManagerBlock(committedState) : committedState; if (applyCommitRequest.getSourceNode().equals(getLocalNode())) { - // master node applies the committed state at the end of the publication process, not here. + // cluster-manager node applies the committed state at the end of the publication process, not here. applyListener.onResponse(null); } else { clusterApplier.onNewClusterState(applyCommitRequest.toString(), () -> applierState, new ClusterApplyListener() { @@ -423,7 +423,7 @@ && getCurrentTerm() == ZEN1_BWC_TERM } if (publishRequest.getAcceptedState().term() > localState.term()) { - // only do join validation if we have not accepted state from this master yet + // only do join validation if we have not accepted state from this cluster manager yet onJoinValidators.forEach(a -> a.accept(getLocalNode(), publishRequest.getAcceptedState())); } @@ -507,12 +507,12 @@ private void startElection() { } } - private void abdicateTo(DiscoveryNode newMaster) { + private void abdicateTo(DiscoveryNode newClusterManager) { assert Thread.holdsLock(mutex); assert mode == Mode.LEADER : "expected to be leader on abdication but was " + mode; - assert newMaster.isMasterNode() : "should only abdicate to cluster-manager-eligible node but was " + newMaster; - final StartJoinRequest startJoinRequest = new StartJoinRequest(newMaster, Math.max(getCurrentTerm(), maxTermSeen) + 1); - logger.info("abdicating to {} with term {}", newMaster, startJoinRequest.getTerm()); + assert newClusterManager.isMasterNode() : "should only abdicate to cluster-manager-eligible node but was " + newClusterManager; + final StartJoinRequest startJoinRequest = new StartJoinRequest(newClusterManager, Math.max(getCurrentTerm(), maxTermSeen) + 1); + logger.info("abdicating to {} with term {}", newClusterManager, startJoinRequest.getTerm()); getLastAcceptedState().nodes().mastersFirstStream().forEach(node -> { if (isZen1Node(node) == false) { joinHelper.sendStartJoinRequest(startJoinRequest, node); @@ -521,7 +521,7 @@ private void abdicateTo(DiscoveryNode newMaster) { // handling of start join messages on the local node will be dispatched to the generic thread-pool assert mode == Mode.LEADER : "should still be leader after sending abdication messages " + mode; // explicitly move node to candidate state so that the next cluster state update task yields an onNoLongerMaster event - becomeCandidate("after abdicating to " + newMaster); + becomeCandidate("after abdicating to " + newClusterManager); } private static boolean localNodeMayWinElection(ClusterState lastAcceptedState) { @@ -580,7 +580,7 @@ private void handleJoinRequest(JoinRequest joinRequest, JoinHelper.JoinCallback } transportService.connectToNode(joinRequest.getSourceNode(), ActionListener.wrap(ignore -> { - final ClusterState stateForJoinValidation = getStateForMasterService(); + final ClusterState stateForJoinValidation = getStateForClusterManagerService(); if (stateForJoinValidation.nodes().isLocalNodeElectedMaster()) { onJoinValidators.forEach(a -> a.accept(joinRequest.getSourceNode(), stateForJoinValidation)); @@ -668,11 +668,11 @@ void becomeCandidate(String method) { lagDetector.clearTrackedNodes(); if (prevMode == Mode.LEADER) { - cleanMasterService(); + cleanClusterManagerService(); } if (applierState.nodes().getMasterNodeId() != null) { - applierState = clusterStateWithNoMasterBlock(applierState); + applierState = clusterStateWithNoClusterManagerBlock(applierState); clusterApplier.onNewClusterState("becoming candidate: " + method, () -> applierState, (source, e) -> {}); } } @@ -750,8 +750,8 @@ void becomeFollower(String method, DiscoveryNode leaderNode) { lagDetector.clearTrackedNodes(); } - private void cleanMasterService() { - masterService.submitStateUpdateTask("clean-up after stepping down as cluster-manager", new LocalClusterUpdateTask() { + private void cleanClusterManagerService() { + clusterManagerService.submitStateUpdateTask("clean-up after stepping down as cluster-manager", new LocalClusterUpdateTask() { @Override public void onFailure(String source, Exception e) { // ignore @@ -833,7 +833,7 @@ protected void doStart() { .blocks( ClusterBlocks.builder() .addGlobalBlock(STATE_NOT_RECOVERED_BLOCK) - .addGlobalBlock(noMasterBlockService.getNoMasterBlock()) + .addGlobalBlock(noClusterManagerBlockService.getNoMasterBlock()) ) .nodes(DiscoveryNodes.builder().add(getLocalNode()).localNodeId(getLocalNode().getId())) .build(); @@ -888,7 +888,7 @@ public void invariant() { + lagDetector.getTrackedNodes(); if (mode == Mode.LEADER) { - final boolean becomingMaster = getStateForMasterService().term() != getCurrentTerm(); + final boolean becomingClusterManager = getStateForClusterManagerService().term() != getCurrentTerm(); assert coordinationState.get().electionWon(); assert lastKnownLeader.isPresent() && lastKnownLeader.get().equals(getLocalNode()); @@ -896,7 +896,8 @@ public void invariant() { assert peerFinderLeader.equals(lastKnownLeader) : peerFinderLeader; assert electionScheduler == null : electionScheduler; assert prevotingRound == null : prevotingRound; - assert becomingMaster || getStateForMasterService().nodes().getMasterNodeId() != null : getStateForMasterService(); + assert becomingClusterManager || getStateForClusterManagerService().nodes().getMasterNodeId() != null + : getStateForClusterManagerService(); assert leaderChecker.leader() == null : leaderChecker.leader(); assert getLocalNode().equals(applierState.nodes().getMasterNode()) || (applierState.nodes().getMasterNodeId() == null && applierState.term() < getCurrentTerm()); @@ -904,8 +905,9 @@ assert getLocalNode().equals(applierState.nodes().getMasterNode()) assert clusterFormationFailureHelper.isRunning() == false; final boolean activePublication = currentPublication.map(CoordinatorPublication::isActiveForCurrentLeader).orElse(false); - if (becomingMaster && activePublication == false) { - // cluster state update task to become master is submitted to MasterService, but publication has not started yet + if (becomingClusterManager && activePublication == false) { + // cluster state update task to become cluster-manager is submitted to MasterService, + // but publication has not started yet assert followersChecker.getKnownFollowers().isEmpty() : followersChecker.getKnownFollowers(); } else { final ClusterState lastPublishedState; @@ -924,7 +926,7 @@ assert getLocalNode().equals(applierState.nodes().getMasterNode()) + followersChecker.getKnownFollowers(); } - assert becomingMaster + assert becomingClusterManager || activePublication || coordinationState.get() .getLastAcceptedConfiguration() @@ -939,8 +941,8 @@ assert getLocalNode().equals(applierState.nodes().getMasterNode()) assert peerFinderLeader.equals(lastKnownLeader) : peerFinderLeader; assert electionScheduler == null : electionScheduler; assert prevotingRound == null : prevotingRound; - assert getStateForMasterService().nodes().getMasterNodeId() == null : getStateForMasterService(); - assert leaderChecker.currentNodeIsMaster() == false; + assert getStateForClusterManagerService().nodes().getMasterNodeId() == null : getStateForClusterManagerService(); + assert leaderChecker.currentNodeIsClusterManager() == false; assert lastKnownLeader.equals(Optional.of(leaderChecker.leader())); assert followersChecker.getKnownFollowers().isEmpty(); assert lastKnownLeader.get().equals(applierState.nodes().getMasterNode()) @@ -954,8 +956,8 @@ assert getLocalNode().equals(applierState.nodes().getMasterNode()) assert joinAccumulator instanceof JoinHelper.CandidateJoinAccumulator; assert peerFinderLeader.isPresent() == false : peerFinderLeader; assert prevotingRound == null || electionScheduler != null; - assert getStateForMasterService().nodes().getMasterNodeId() == null : getStateForMasterService(); - assert leaderChecker.currentNodeIsMaster() == false; + assert getStateForClusterManagerService().nodes().getMasterNodeId() == null : getStateForClusterManagerService(); + assert leaderChecker.currentNodeIsClusterManager() == false; assert leaderChecker.leader() == null : leaderChecker.leader(); assert followersChecker.getKnownFollowers().isEmpty(); assert applierState.nodes().getMasterNodeId() == null; @@ -967,7 +969,7 @@ assert getLocalNode().equals(applierState.nodes().getMasterNode()) } public boolean isInitialConfigurationSet() { - return getStateForMasterService().getLastAcceptedConfiguration().isEmpty() == false; + return getStateForClusterManagerService().getLastAcceptedConfiguration().isEmpty() == false; } /** @@ -979,7 +981,7 @@ public boolean isInitialConfigurationSet() { */ public boolean setInitialConfiguration(final VotingConfiguration votingConfiguration) { synchronized (mutex) { - final ClusterState currentState = getStateForMasterService(); + final ClusterState currentState = getStateForClusterManagerService(); if (isInitialConfigurationSet()) { logger.debug("initial configuration already set, ignoring {}", votingConfiguration); @@ -1051,7 +1053,7 @@ ClusterState improveConfiguration(ClusterState clusterState) { // the voting config. We could exclude all the cluster-manager-ineligible nodes here, but there could be quite a few of them and // that makes // the logging much harder to follow. - final Stream masterIneligibleNodeIdsInVotingConfig = StreamSupport.stream(clusterState.nodes().spliterator(), false) + final Stream clusterManagerIneligibleNodeIdsInVotingConfig = StreamSupport.stream(clusterState.nodes().spliterator(), false) .filter( n -> n.isMasterNode() == false && (clusterState.getLastAcceptedConfiguration().getNodeIds().contains(n.getId()) @@ -1066,7 +1068,7 @@ ClusterState improveConfiguration(ClusterState clusterState) { .collect(Collectors.toSet()); final VotingConfiguration newConfig = reconfigurator.reconfigure( liveNodes, - Stream.concat(masterIneligibleNodeIdsInVotingConfig, excludedNodeIds).collect(Collectors.toSet()), + Stream.concat(clusterManagerIneligibleNodeIdsInVotingConfig, excludedNodeIds).collect(Collectors.toSet()), getLocalNode(), clusterState.getLastAcceptedConfiguration() ); @@ -1119,7 +1121,7 @@ private void scheduleReconfigurationIfNeeded() { final ClusterState state = getLastAcceptedState(); if (improveConfiguration(state) != state && reconfigurationTaskScheduled.compareAndSet(false, true)) { logger.trace("scheduling reconfiguration"); - masterService.submitStateUpdateTask("reconfigure", new ClusterStateUpdateTask(Priority.URGENT) { + clusterManagerService.submitStateUpdateTask("reconfigure", new ClusterStateUpdateTask(Priority.URGENT) { @Override public ClusterState execute(ClusterState currentState) { reconfigurationTaskScheduled.set(false); @@ -1148,13 +1150,14 @@ private void handleJoin(Join join) { if (coordinationState.get().electionWon()) { // If we have already won the election then the actual join does not matter for election purposes, so swallow any exception - final boolean isNewJoinFromMasterEligibleNode = handleJoinIgnoringExceptions(join); + final boolean isNewJoinFromClusterManagerEligibleNode = handleJoinIgnoringExceptions(join); - // If we haven't completely finished becoming master then there's already a publication scheduled which will, in turn, + // If we haven't completely finished becoming cluster-manager then there's already a publication scheduled which will, in + // turn, // schedule a reconfiguration if needed. It's benign to schedule a reconfiguration anyway, but it might fail if it wins the // race against the election-winning publication and log a big error message, which we can prevent by checking this here: - final boolean establishedAsMaster = mode == Mode.LEADER && getLastAcceptedState().term() == getCurrentTerm(); - if (isNewJoinFromMasterEligibleNode && establishedAsMaster && publicationInProgress() == false) { + final boolean establishedAsClusterManager = mode == Mode.LEADER && getLastAcceptedState().term() == getCurrentTerm(); + if (isNewJoinFromClusterManagerEligibleNode && establishedAsClusterManager && publicationInProgress() == false) { scheduleReconfigurationIfNeeded(); } } else { @@ -1193,27 +1196,28 @@ private List getDiscoveredNodes() { return nodes; } - ClusterState getStateForMasterService() { + ClusterState getStateForClusterManagerService() { synchronized (mutex) { - // expose last accepted cluster state as base state upon which the master service + // expose last accepted cluster state as base state upon which the cluster_manager service // speculatively calculates the next cluster state update final ClusterState clusterState = coordinationState.get().getLastAcceptedState(); if (mode != Mode.LEADER || clusterState.term() != getCurrentTerm()) { - // the master service checks if the local node is the master node in order to fail execution of the state update early - return clusterStateWithNoMasterBlock(clusterState); + // the cluster-manager service checks if the local node is the cluster-manager node in order to fail execution of the state + // update early + return clusterStateWithNoClusterManagerBlock(clusterState); } return clusterState; } } - private ClusterState clusterStateWithNoMasterBlock(ClusterState clusterState) { + private ClusterState clusterStateWithNoClusterManagerBlock(ClusterState clusterState) { if (clusterState.nodes().getMasterNodeId() != null) { // remove block if it already exists before adding new one assert clusterState.blocks().hasGlobalBlockWithId(NO_MASTER_BLOCK_ID) == false : "NO_MASTER_BLOCK should only be added by Coordinator"; final ClusterBlocks clusterBlocks = ClusterBlocks.builder() .blocks(clusterState.blocks()) - .addGlobalBlock(noMasterBlockService.getNoMasterBlock()) + .addGlobalBlock(noClusterManagerBlockService.getNoMasterBlock()) .build(); final DiscoveryNodes discoveryNodes = new DiscoveryNodes.Builder(clusterState.nodes()).masterNodeId(null).build(); return ClusterState.builder(clusterState).blocks(clusterBlocks).nodes(discoveryNodes).build(); @@ -1233,14 +1237,16 @@ public void publish( if (mode != Mode.LEADER || getCurrentTerm() != clusterChangedEvent.state().term()) { logger.debug( () -> new ParameterizedMessage( - "[{}] failed publication as node is no longer master for term {}", + "[{}] failed publication as node is no longer cluster-manager for term {}", clusterChangedEvent.source(), clusterChangedEvent.state().term() ) ); publishListener.onFailure( new FailedToCommitClusterStateException( - "node is no longer master for term " + clusterChangedEvent.state().term() + " while handling publication" + "node is no longer cluster-manager for term " + + clusterChangedEvent.state().term() + + " while handling publication" ) ); return; @@ -1302,12 +1308,12 @@ private boolean assertPreviousStateConsistency(ClusterChangedEvent event) { .equals( XContentHelper.convertToMap( JsonXContent.jsonXContent, - Strings.toString(clusterStateWithNoMasterBlock(coordinationState.get().getLastAcceptedState())), + Strings.toString(clusterStateWithNoClusterManagerBlock(coordinationState.get().getLastAcceptedState())), false ) ) : Strings.toString(event.previousState()) + " vs " - + Strings.toString(clusterStateWithNoMasterBlock(coordinationState.get().getLastAcceptedState())); + + Strings.toString(clusterStateWithNoClusterManagerBlock(coordinationState.get().getLastAcceptedState())); return true; } @@ -1363,10 +1369,10 @@ private class CoordinatorPeerFinder extends PeerFinder { } @Override - protected void onActiveMasterFound(DiscoveryNode masterNode, long term) { + protected void onActiveClusterManagerFound(DiscoveryNode clusterManagerNode, long term) { synchronized (mutex) { - ensureTermAtLeast(masterNode, term); - joinHelper.sendJoinRequest(masterNode, getCurrentTerm(), joinWithDestination(lastJoin, masterNode, term)); + ensureTermAtLeast(clusterManagerNode, term); + joinHelper.sendJoinRequest(clusterManagerNode, getCurrentTerm(), joinWithDestination(lastJoin, clusterManagerNode, term)); } } @@ -1613,12 +1619,12 @@ public void onSuccess(String source) { boolean attemptReconfiguration = true; final ClusterState state = getLastAcceptedState(); // committed state if (localNodeMayWinElection(state) == false) { - final List masterCandidates = completedNodes().stream() + final List clusterManagerCandidates = completedNodes().stream() .filter(DiscoveryNode::isMasterNode) .filter(node -> nodeMayWinElection(state, node)) .filter(node -> { - // check if master candidate would be able to get an election quorum if we were to - // abdicate to it. Assume that every node that completed the publication can provide + // check if cluster_manager candidate would be able to get an election quorum if we were + // to abdicate to it. Assume that every node that completed the publication can provide // a vote in that next election and has the latest state. final long futureElectionTerm = state.term() + 1; final VoteCollection futureVoteCollection = new VoteCollection(); @@ -1638,8 +1644,8 @@ public void onSuccess(String source) { ); }) .collect(Collectors.toList()); - if (masterCandidates.isEmpty() == false) { - abdicateTo(masterCandidates.get(random.nextInt(masterCandidates.size()))); + if (clusterManagerCandidates.isEmpty() == false) { + abdicateTo(clusterManagerCandidates.get(random.nextInt(clusterManagerCandidates.size()))); attemptReconfiguration = false; } } @@ -1665,7 +1671,7 @@ public void onFailure(Exception e) { cancelTimeoutHandlers(); final FailedToCommitClusterStateException exception = new FailedToCommitClusterStateException("publication failed", e); - ackListener.onNodeAck(getLocalNode(), exception); // other nodes have acked, but not the master. + ackListener.onNodeAck(getLocalNode(), exception); // other nodes have acked, but not the cluster manager. publishListener.onFailure(exception); } }, OpenSearchExecutors.newDirectExecutorService(), transportService.getThreadPool().getThreadContext()); diff --git a/server/src/main/java/org/opensearch/cluster/coordination/JoinHelper.java b/server/src/main/java/org/opensearch/cluster/coordination/JoinHelper.java index 5975e5b64214f..693a997d318cd 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/JoinHelper.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/JoinHelper.java @@ -138,23 +138,28 @@ public class JoinHelper { @Override public ClusterTasksResult execute(ClusterState currentState, List joiningTasks) throws Exception { - // The current state that MasterService uses might have been updated by a (different) master in a higher term already + // The current state that MasterService uses might have been updated by a (different) cluster-manager in a higher term + // already // Stop processing the current cluster state update, as there's no point in continuing to compute it as // it will later be rejected by Coordinator.publish(...) anyhow if (currentState.term() > term) { - logger.trace("encountered higher term {} than current {}, there is a newer master", currentState.term(), term); + logger.trace("encountered higher term {} than current {}, there is a newer cluster-manager", currentState.term(), term); throw new NotMasterException( - "Higher term encountered (current: " + currentState.term() + " > used: " + term + "), there is a newer master" + "Higher term encountered (current: " + + currentState.term() + + " > used: " + + term + + "), there is a newer cluster-manager" ); } else if (currentState.nodes().getMasterNodeId() == null && joiningTasks.stream().anyMatch(Task::isBecomeMasterTask)) { - assert currentState.term() < term : "there should be at most one become master task per election (= by term)"; + assert currentState.term() < term : "there should be at most one become cluster-manager task per election (= by term)"; final CoordinationMetadata coordinationMetadata = CoordinationMetadata.builder(currentState.coordinationMetadata()) .term(term) .build(); final Metadata metadata = Metadata.builder(currentState.metadata()).coordinationMetadata(coordinationMetadata).build(); currentState = ClusterState.builder(currentState).metadata(metadata).build(); } else if (currentState.nodes().isLocalNodeElectedMaster()) { - assert currentState.term() == term : "term should be stable for the same master"; + assert currentState.term() == term : "term should be stable for the same cluster-manager"; } return super.execute(currentState, joiningTasks); } @@ -297,7 +302,7 @@ void logLastFailedJoinAttempt() { } public void sendJoinRequest(DiscoveryNode destination, long term, Optional optionalJoin, Runnable onCompletion) { - assert destination.isMasterNode() : "trying to join master-ineligible " + destination; + assert destination.isMasterNode() : "trying to join cluster-manager-ineligible " + destination; final StatusInfo statusInfo = nodeHealthService.getHealth(); if (statusInfo.getStatus() == UNHEALTHY) { logger.debug("dropping join request to [{}]: [{}]", destination, statusInfo.getInfo()); @@ -348,7 +353,7 @@ public String executor() { } public void sendStartJoinRequest(final StartJoinRequest startJoinRequest, final DiscoveryNode destination) { - assert startJoinRequest.getSourceNode().isMasterNode() : "sending start-join request for master-ineligible " + assert startJoinRequest.getSourceNode().isMasterNode() : "sending start-join request for cluster-manager-ineligible " + startJoinRequest.getSourceNode(); transportService.sendRequest(destination, START_JOIN_ACTION_NAME, startJoinRequest, new TransportResponseHandler() { @Override diff --git a/server/src/main/java/org/opensearch/cluster/coordination/JoinRequest.java b/server/src/main/java/org/opensearch/cluster/coordination/JoinRequest.java index f18396e78fbf9..84adf834d85e8 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/JoinRequest.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/JoinRequest.java @@ -50,15 +50,15 @@ public class JoinRequest extends TransportRequest { /** * The minimum term for which the joining node will accept any cluster state publications. If the joining node is in a strictly greater - * term than the master it wants to join then the master must enter a new term and hold another election. Doesn't necessarily match + * term than the cluster-manager it wants to join then the cluster-manager must enter a new term and hold another election. Doesn't necessarily match * {@link JoinRequest#optionalJoin} and may be zero in join requests sent prior to {@link LegacyESVersion#V_7_7_0}. */ private final long minimumTerm; /** - * A vote for the receiving node. This vote is optional since the sending node may have voted for a different master in this term. - * That's ok, the sender likely discovered that the master we voted for lost the election and now we're trying to join the winner. Once - * the sender has successfully joined the master, the lack of a vote in its term causes another election (see + * A vote for the receiving node. This vote is optional since the sending node may have voted for a different cluster-manager in this term. + * That's ok, the sender likely discovered that the cluster-manager we voted for lost the election and now we're trying to join the winner. Once + * the sender has successfully joined the cluster-manager, the lack of a vote in its term causes another election (see * {@link Publication#onMissingJoin(DiscoveryNode)}). */ private final Optional optionalJoin; diff --git a/server/src/main/java/org/opensearch/cluster/coordination/JoinTaskExecutor.java b/server/src/main/java/org/opensearch/cluster/coordination/JoinTaskExecutor.java index ea5c33b4300a5..b8f7dfd116b7e 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/JoinTaskExecutor.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/JoinTaskExecutor.java @@ -129,16 +129,19 @@ public ClusterTasksResult execute(ClusterState currentState, List jo if (joiningNodes.size() == 1 && joiningNodes.get(0).isFinishElectionTask()) { return results.successes(joiningNodes).build(currentState); } else if (currentNodes.getMasterNode() == null && joiningNodes.stream().anyMatch(Task::isBecomeMasterTask)) { - assert joiningNodes.stream().anyMatch(Task::isFinishElectionTask) : "becoming a master but election is not finished " + assert joiningNodes.stream().anyMatch(Task::isFinishElectionTask) : "becoming a cluster-manager but election is not finished " + joiningNodes; - // use these joins to try and become the master. + // use these joins to try and become the cluster-manager. // Note that we don't have to do any validation of the amount of joining nodes - the commit // during the cluster state publishing guarantees that we have enough - newState = becomeMasterAndTrimConflictingNodes(currentState, joiningNodes); + newState = becomeClusterManagerAndTrimConflictingNodes(currentState, joiningNodes); nodesChanged = true; } else if (currentNodes.isLocalNodeElectedMaster() == false) { - logger.trace("processing node joins, but we are not the master. current master: {}", currentNodes.getMasterNode()); - throw new NotMasterException("Node [" + currentNodes.getLocalNode() + "] not master for join request"); + logger.trace( + "processing node joins, but we are not the cluster-manager. current cluster-manager: {}", + currentNodes.getMasterNode() + ); + throw new NotMasterException("Node [" + currentNodes.getLocalNode() + "] not cluster-manager for join request"); } else { newState = ClusterState.builder(currentState); } @@ -221,12 +224,12 @@ public ClusterTasksResult execute(ClusterState currentState, List jo return results.build(allocationService.adaptAutoExpandReplicas(newState.nodes(nodesBuilder).build())); } else { // we must return a new cluster state instance to force publishing. This is important - // for the joining node to finalize its join and set us as a master + // for the joining node to finalize its join and set us as a cluster-manager return results.build(newState.build()); } } - protected ClusterState.Builder becomeMasterAndTrimConflictingNodes(ClusterState currentState, List joiningNodes) { + protected ClusterState.Builder becomeClusterManagerAndTrimConflictingNodes(ClusterState currentState, List joiningNodes) { assert currentState.nodes().getMasterNodeId() == null : currentState; DiscoveryNodes currentNodes = currentState.nodes(); DiscoveryNodes.Builder nodesBuilder = DiscoveryNodes.builder(currentNodes); @@ -256,13 +259,13 @@ protected ClusterState.Builder becomeMasterAndTrimConflictingNodes(ClusterState } } - // now trim any left over dead nodes - either left there when the previous master stepped down + // now trim any left over dead nodes - either left there when the previous cluster-manager stepped down // or removed by us above ClusterState tmpState = ClusterState.builder(currentState) .nodes(nodesBuilder) .blocks(ClusterBlocks.builder().blocks(currentState.blocks()).removeGlobalBlock(NoMasterBlockService.NO_MASTER_BLOCK_ID)) .build(); - logger.trace("becomeMasterAndTrimConflictingNodes: {}", tmpState.nodes()); + logger.trace("becomeClusterManagerAndTrimConflictingNodes: {}", tmpState.nodes()); allocationService.cleanCaches(); tmpState = PersistentTasksCustomMetadata.disassociateDeadNodes(tmpState); return ClusterState.builder(allocationService.disassociateDeadNodes(tmpState, false, "removed dead nodes on election")); @@ -277,7 +280,7 @@ private void refreshDiscoveryNodeVersionAfterUpgrade(DiscoveryNodes currentNodes // updating the version of those node which have connection with the new master. // Note: This should get deprecated with BWC mode logic if (null == transportService) { - // this logic is only applicable when OpenSearch node is master and is noop for zen discovery node + // this logic is only applicable when OpenSearch node is cluster-manager and is noop for zen discovery node return; } if (currentNodes.getMinNodeVersion().before(Version.V_1_0_0)) { @@ -310,7 +313,7 @@ private void refreshDiscoveryNodeVersionAfterUpgrade(DiscoveryNodes currentNodes } } else { // in case existing OpenSearch node is present in the cluster and but there is no connection to that node yet, - // either that node will send new JoinRequest to the master with version >=1.0, then no issue or + // either that node will send new JoinRequest to the cluster-manager/master with version >=1.0, then no issue or // there is an edge case if doesn't send JoinRequest and connection is established, // then it can continue to report version as 7.10.2 instead of actual OpenSearch version. So, // removing the node from cluster state to prevent stale version reporting and let it reconnect. @@ -409,7 +412,7 @@ public static void ensureNodesCompatibility(Version joiningNodeVersion, Version /** * ensures that the joining node's major version is equal or higher to the minClusterNodeVersion. This is needed - * to ensure that if the master is already fully operating under the new major version, it doesn't go back to mixed + * to ensure that if the cluster-manager/master is already fully operating under the new major version, it doesn't go back to mixed * version mode **/ public static void ensureMajorVersionBarrier(Version joiningNodeVersion, Version minClusterNodeVersion) { diff --git a/server/src/main/java/org/opensearch/cluster/coordination/LagDetector.java b/server/src/main/java/org/opensearch/cluster/coordination/LagDetector.java index e599fffa68ff1..70a1c4f3ec220 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/LagDetector.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/LagDetector.java @@ -102,7 +102,7 @@ public void clearTrackedNodes() { public void setAppliedVersion(final DiscoveryNode discoveryNode, final long appliedVersion) { final NodeAppliedStateTracker nodeAppliedStateTracker = appliedStateTrackersByNode.get(discoveryNode); if (nodeAppliedStateTracker == null) { - // Received an ack from a node that a later publication has removed (or we are no longer master). No big deal. + // Received an ack from a node that a later publication has removed (or we are no longer cluster-manager). No big deal. logger.trace("node {} applied version {} but this node's version is not being tracked", discoveryNode, appliedVersion); } else { nodeAppliedStateTracker.increaseAppliedVersion(appliedVersion); diff --git a/server/src/main/java/org/opensearch/cluster/coordination/LeaderChecker.java b/server/src/main/java/org/opensearch/cluster/coordination/LeaderChecker.java index b4edc9401234d..fcf54aff7f478 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/LeaderChecker.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/LeaderChecker.java @@ -190,7 +190,7 @@ void setCurrentNodes(DiscoveryNodes discoveryNodes) { } // For assertions - boolean currentNodeIsMaster() { + boolean currentNodeIsClusterManager() { return discoveryNodes.isLocalNodeElectedMaster(); } @@ -208,9 +208,9 @@ private void handleLeaderCheck(LeaderCheckRequest request) { logger.debug(message); throw new NodeHealthCheckFailureException(message); } else if (discoveryNodes.isLocalNodeElectedMaster() == false) { - logger.debug("rejecting leader check on non-master {}", request); + logger.debug("rejecting leader check on non-cluster-manager {}", request); throw new CoordinationStateRejectedException( - "rejecting leader check from [" + request.getSender() + "] sent to a node that is no longer the master" + "rejecting leader check from [" + request.getSender() + "] sent to a node that is no longer the cluster-manager" ); } else if (discoveryNodes.nodeExists(request.getSender()) == false) { logger.debug("rejecting leader check from removed node: {}", request); diff --git a/server/src/main/java/org/opensearch/cluster/coordination/NoMasterBlockService.java b/server/src/main/java/org/opensearch/cluster/coordination/NoMasterBlockService.java index e346d3f20112d..f020ae4081f06 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/NoMasterBlockService.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/NoMasterBlockService.java @@ -74,7 +74,7 @@ public class NoMasterBlockService { public static final Setting NO_MASTER_BLOCK_SETTING = new Setting<>( "cluster.no_master_block", "write", - NoMasterBlockService::parseNoMasterBlock, + NoMasterBlockService::parseNoClusterManagerBlock, Property.Dynamic, Property.NodeScope, Property.Deprecated @@ -84,19 +84,19 @@ public class NoMasterBlockService { public static final Setting NO_CLUSTER_MANAGER_BLOCK_SETTING = new Setting<>( "cluster.no_cluster_manager_block", NO_MASTER_BLOCK_SETTING, - NoMasterBlockService::parseNoMasterBlock, + NoMasterBlockService::parseNoClusterManagerBlock, Property.Dynamic, Property.NodeScope ); - private volatile ClusterBlock noMasterBlock; + private volatile ClusterBlock noClusterManagerBlock; public NoMasterBlockService(Settings settings, ClusterSettings clusterSettings) { - this.noMasterBlock = NO_CLUSTER_MANAGER_BLOCK_SETTING.get(settings); + this.noClusterManagerBlock = NO_CLUSTER_MANAGER_BLOCK_SETTING.get(settings); clusterSettings.addSettingsUpdateConsumer(NO_CLUSTER_MANAGER_BLOCK_SETTING, this::setNoMasterBlock); } - private static ClusterBlock parseNoMasterBlock(String value) { + private static ClusterBlock parseNoClusterManagerBlock(String value) { switch (value) { case "all": return NO_MASTER_BLOCK_ALL; @@ -105,15 +105,17 @@ private static ClusterBlock parseNoMasterBlock(String value) { case "metadata_write": return NO_MASTER_BLOCK_METADATA_WRITES; default: - throw new IllegalArgumentException("invalid no-master block [" + value + "], must be one of [all, write, metadata_write]"); + throw new IllegalArgumentException( + "invalid no-cluster-manager block [" + value + "], must be one of [all, write, metadata_write]" + ); } } public ClusterBlock getNoMasterBlock() { - return noMasterBlock; + return noClusterManagerBlock; } - private void setNoMasterBlock(ClusterBlock noMasterBlock) { - this.noMasterBlock = noMasterBlock; + private void setNoMasterBlock(ClusterBlock noClusterManagerBlock) { + this.noClusterManagerBlock = noClusterManagerBlock; } } diff --git a/server/src/main/java/org/opensearch/cluster/coordination/NodeRemovalClusterStateTaskExecutor.java b/server/src/main/java/org/opensearch/cluster/coordination/NodeRemovalClusterStateTaskExecutor.java index 02bdb65c7edf2..e8ab2f8d53d3f 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/NodeRemovalClusterStateTaskExecutor.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/NodeRemovalClusterStateTaskExecutor.java @@ -127,7 +127,7 @@ public void onFailure(final String source, final Exception e) { @Override public void onNoLongerMaster(String source) { - logger.debug("no longer master while processing node removal [{}]", source); + logger.debug("no longer cluster-manager while processing node removal [{}]", source); } } diff --git a/server/src/main/java/org/opensearch/cluster/coordination/PeersResponse.java b/server/src/main/java/org/opensearch/cluster/coordination/PeersResponse.java index 76be3ebd3a374..e667052ca5fdd 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/PeersResponse.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/PeersResponse.java @@ -43,27 +43,27 @@ import java.util.Optional; public class PeersResponse extends TransportResponse { - private final Optional masterNode; + private final Optional clusterManagerNode; private final List knownPeers; private final long term; - public PeersResponse(Optional masterNode, List knownPeers, long term) { - assert masterNode.isPresent() == false || knownPeers.isEmpty(); - this.masterNode = masterNode; + public PeersResponse(Optional clusterManagerNode, List knownPeers, long term) { + assert clusterManagerNode.isPresent() == false || knownPeers.isEmpty(); + this.clusterManagerNode = clusterManagerNode; this.knownPeers = knownPeers; this.term = term; } public PeersResponse(StreamInput in) throws IOException { - masterNode = Optional.ofNullable(in.readOptionalWriteable(DiscoveryNode::new)); + clusterManagerNode = Optional.ofNullable(in.readOptionalWriteable(DiscoveryNode::new)); knownPeers = in.readList(DiscoveryNode::new); term = in.readLong(); - assert masterNode.isPresent() == false || knownPeers.isEmpty(); + assert clusterManagerNode.isPresent() == false || knownPeers.isEmpty(); } @Override public void writeTo(StreamOutput out) throws IOException { - out.writeOptionalWriteable(masterNode.orElse(null)); + out.writeOptionalWriteable(clusterManagerNode.orElse(null)); out.writeList(knownPeers); out.writeLong(term); } @@ -72,7 +72,7 @@ public void writeTo(StreamOutput out) throws IOException { * @return the node that is currently leading, according to the responding node. */ public Optional getMasterNode() { - return masterNode; + return clusterManagerNode; } /** @@ -93,7 +93,7 @@ public long getTerm() { @Override public String toString() { - return "PeersResponse{" + "masterNode=" + masterNode + ", knownPeers=" + knownPeers + ", term=" + term + '}'; + return "PeersResponse{" + "clusterManagerNode=" + clusterManagerNode + ", knownPeers=" + knownPeers + ", term=" + term + '}'; } @Override @@ -101,11 +101,13 @@ public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PeersResponse that = (PeersResponse) o; - return term == that.term && Objects.equals(masterNode, that.masterNode) && Objects.equals(knownPeers, that.knownPeers); + return term == that.term + && Objects.equals(clusterManagerNode, that.clusterManagerNode) + && Objects.equals(knownPeers, that.knownPeers); } @Override public int hashCode() { - return Objects.hash(masterNode, knownPeers, term); + return Objects.hash(clusterManagerNode, knownPeers, term); } } diff --git a/server/src/main/java/org/opensearch/cluster/coordination/PublicationTransportHandler.java b/server/src/main/java/org/opensearch/cluster/coordination/PublicationTransportHandler.java index ee97c0e07eb48..9a1a392348660 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/PublicationTransportHandler.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/PublicationTransportHandler.java @@ -85,7 +85,7 @@ public class PublicationTransportHandler { private final AtomicReference lastSeenClusterState = new AtomicReference<>(); - // the master needs the original non-serialized state as the cluster state contains some volatile information that we + // the cluster-manager needs the original non-serialized state as the cluster state contains some volatile information that we // don't want to be replicated because it's not usable on another node (e.g. UnassignedInfo.unassignedTimeNanos) or // because it's mostly just debugging info that would unnecessarily blow up CS updates (I think there was one in // snapshot code). @@ -337,8 +337,9 @@ public void sendPublishRequest( if (destination.equals(discoveryNodes.getLocalNode())) { // if publishing to self, use original request instead (see currentPublishRequestToSelf for explanation) final PublishRequest previousRequest = currentPublishRequestToSelf.getAndSet(publishRequest); - // we might override an in-flight publication to self in case where we failed as master and became master again, - // and the new publication started before the previous one completed (which fails anyhow because of higher current term) + // we might override an in-flight publication to self in case where we failed as cluster-manager and + // became cluster-manager again, and the new publication started before the previous one completed + // (which fails anyhow because of higher current term) assert previousRequest == null || previousRequest.getAcceptedState().term() < publishRequest.getAcceptedState().term(); responseActionListener = new ActionListener() { @Override diff --git a/server/src/main/java/org/opensearch/cluster/coordination/PublishClusterStateStats.java b/server/src/main/java/org/opensearch/cluster/coordination/PublishClusterStateStats.java index 77320810eba4c..b4adad898271e 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/PublishClusterStateStats.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/PublishClusterStateStats.java @@ -50,8 +50,8 @@ public class PublishClusterStateStats implements Writeable, ToXContentObject { private final long compatibleClusterStateDiffReceivedCount; /** - * @param fullClusterStateReceivedCount the number of times this node has received a full copy of the cluster state from the master. - * @param incompatibleClusterStateDiffReceivedCount the number of times this node has received a cluster-state diff from the master. + * @param fullClusterStateReceivedCount the number of times this node has received a full copy of the cluster state from the cluster-manager. + * @param incompatibleClusterStateDiffReceivedCount the number of times this node has received a cluster-state diff from the cluster-manager. * @param compatibleClusterStateDiffReceivedCount the number of times that received cluster-state diffs were compatible with */ public PublishClusterStateStats( diff --git a/server/src/main/java/org/opensearch/cluster/coordination/PublishRequest.java b/server/src/main/java/org/opensearch/cluster/coordination/PublishRequest.java index 76517573115fd..86ae9ce8bc081 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/PublishRequest.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/PublishRequest.java @@ -36,7 +36,7 @@ import java.util.Objects; /** - * Request which is used by the master node to publish cluster state changes. + * Request which is used by the cluster-manager node to publish cluster state changes. * Actual serialization of this request is done by {@link PublicationTransportHandler} */ public class PublishRequest { diff --git a/server/src/main/java/org/opensearch/cluster/coordination/Reconfigurator.java b/server/src/main/java/org/opensearch/cluster/coordination/Reconfigurator.java index b38b0cf0f4693..1c26dff45775f 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/Reconfigurator.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/Reconfigurator.java @@ -53,8 +53,8 @@ public class Reconfigurator { private static final Logger logger = LogManager.getLogger(Reconfigurator.class); /** - * The cluster usually requires a vote from at least half of the master nodes in order to commit a cluster state update, and to achieve - * the best resilience it makes automatic adjustments to the voting configuration as master nodes join or leave the cluster. Adjustments + * The cluster usually requires a vote from at least half of the cluster-manager nodes in order to commit a cluster state update, and to achieve + * the best resilience it makes automatic adjustments to the voting configuration as cluster-manager nodes join or leave the cluster. Adjustments * that fix or increase the size of the voting configuration are always a good idea, but the wisdom of reducing the voting configuration * size is less clear. For instance, automatically reducing the voting configuration down to a single node means the cluster requires * this node to operate, which is not resilient: if it broke we could restore every other cluster-manager-eligible node in the cluster to health @@ -102,24 +102,24 @@ public String toString() { * @param retiredNodeIds Nodes that are leaving the cluster and which should not appear in the configuration if possible. Nodes that are * retired and not in the current configuration will never appear in the resulting configuration; this is useful * for shifting the vote in a 2-node cluster so one of the nodes can be restarted without harming availability. - * @param currentMaster The current master. Unless retired, we prefer to keep the current master in the config. + * @param currentClusterManager The current cluster-manager. Unless retired, we prefer to keep the current cluster-manager in the config. * @param currentConfig The current configuration. As far as possible, we prefer to keep the current config as-is. * @return An optimal configuration, or leave the current configuration unchanged if the optimal configuration has no live quorum. */ public VotingConfiguration reconfigure( Set liveNodes, Set retiredNodeIds, - DiscoveryNode currentMaster, + DiscoveryNode currentClusterManager, VotingConfiguration currentConfig ) { - assert liveNodes.contains(currentMaster) : "liveNodes = " + liveNodes + " master = " + currentMaster; + assert liveNodes.contains(currentClusterManager) : "liveNodes = " + liveNodes + " cluster-manager = " + currentClusterManager; logger.trace( - "{} reconfiguring {} based on liveNodes={}, retiredNodeIds={}, currentMaster={}", + "{} reconfiguring {} based on liveNodes={}, retiredNodeIds={}, currentClusterManager={}", this, currentConfig, liveNodes, retiredNodeIds, - currentMaster + currentClusterManager ); final Set liveNodeIds = liveNodes.stream() @@ -134,7 +134,12 @@ public VotingConfiguration reconfigure( .filter(n -> retiredNodeIds.contains(n.getId()) == false) .forEach( n -> orderedCandidateNodes.add( - new VotingConfigNode(n.getId(), true, n.getId().equals(currentMaster.getId()), currentConfigNodeIds.contains(n.getId())) + new VotingConfigNode( + n.getId(), + true, + n.getId().equals(currentClusterManager.getId()), + currentConfigNodeIds.contains(n.getId()) + ) ) ); currentConfigNodeIds.stream() @@ -166,22 +171,22 @@ public VotingConfiguration reconfigure( static class VotingConfigNode implements Comparable { final String id; final boolean live; - final boolean currentMaster; + final boolean currentClusterManager; final boolean inCurrentConfig; - VotingConfigNode(String id, boolean live, boolean currentMaster, boolean inCurrentConfig) { + VotingConfigNode(String id, boolean live, boolean currentClusterManager, boolean inCurrentConfig) { this.id = id; this.live = live; - this.currentMaster = currentMaster; + this.currentClusterManager = currentClusterManager; this.inCurrentConfig = inCurrentConfig; } @Override public int compareTo(VotingConfigNode other) { - // prefer current master - final int currentMasterComp = Boolean.compare(other.currentMaster, currentMaster); - if (currentMasterComp != 0) { - return currentMasterComp; + // prefer current cluster-manager + final int currentClusterManagerComp = Boolean.compare(other.currentClusterManager, currentClusterManager); + if (currentClusterManagerComp != 0) { + return currentClusterManagerComp; } // prefer nodes that are live final int liveComp = Boolean.compare(other.live, live); @@ -205,8 +210,8 @@ public String toString() { + '\'' + ", live=" + live - + ", currentMaster=" - + currentMaster + + ", currentClusterManager=" + + currentClusterManager + ", inCurrentConfig=" + inCurrentConfig + '}'; diff --git a/server/src/main/java/org/opensearch/cluster/coordination/UnsafeBootstrapMasterCommand.java b/server/src/main/java/org/opensearch/cluster/coordination/UnsafeBootstrapMasterCommand.java index c6c7e75497e29..6b31c39d71eb3 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/UnsafeBootstrapMasterCommand.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/UnsafeBootstrapMasterCommand.java @@ -68,12 +68,12 @@ public class UnsafeBootstrapMasterCommand extends OpenSearchNodeCommand { + "\n" + "Do you want to proceed?\n"; - static final String NOT_MASTER_NODE_MSG = "unsafe-bootstrap tool can only be run on cluster-manager eligible node"; + static final String NOT_CLUSTER_MANAGER_NODE_MSG = "unsafe-bootstrap tool can only be run on cluster-manager eligible node"; static final String EMPTY_LAST_COMMITTED_VOTING_CONFIG_MSG = "last committed voting voting configuration is empty, cluster has never been bootstrapped?"; - static final String MASTER_NODE_BOOTSTRAPPED_MSG = "Master node was successfully bootstrapped"; + static final String CLUSTER_MANAGER_NODE_BOOTSTRAPPED_MSG = "Cluster-manager node was successfully bootstrapped"; static final Setting UNSAFE_BOOTSTRAP = ClusterService.USER_DEFINED_METADATA.getConcreteSetting( "cluster.metadata.unsafe-bootstrap" ); @@ -92,10 +92,10 @@ public class UnsafeBootstrapMasterCommand extends OpenSearchNodeCommand { @Override protected boolean validateBeforeLock(Terminal terminal, Environment env) { Settings settings = env.settings(); - terminal.println(Terminal.Verbosity.VERBOSE, "Checking node.master setting"); - Boolean master = DiscoveryNode.isMasterNode(settings); - if (master == false) { - throw new OpenSearchException(NOT_MASTER_NODE_MSG); + terminal.println(Terminal.Verbosity.VERBOSE, "Checking node.roles setting"); + Boolean clusterManager = DiscoveryNode.isMasterNode(settings); + if (clusterManager == false) { + throw new OpenSearchException(NOT_CLUSTER_MANAGER_NODE_MSG); } return true; @@ -171,6 +171,6 @@ protected void processNodePaths(Terminal terminal, Path[] dataPaths, int nodeLoc writer.writeFullStateAndCommit(state.v1(), newClusterState); } - terminal.println(MASTER_NODE_BOOTSTRAPPED_MSG); + terminal.println(CLUSTER_MANAGER_NODE_BOOTSTRAPPED_MSG); } } diff --git a/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexUpgradeService.java b/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexUpgradeService.java index eb2126bddf7a6..49743678bb168 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexUpgradeService.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexUpgradeService.java @@ -94,7 +94,7 @@ public MetadataIndexUpgradeService( } /** - * Checks that the index can be upgraded to the current version of the master node. + * Checks that the index can be upgraded to the current version of the cluster-manager node. * *

    * If the index does not need upgrade it returns the index metadata unchanged, otherwise it returns a modified index metadata. If index diff --git a/server/src/main/java/org/opensearch/cluster/metadata/SystemIndexMetadataUpgradeService.java b/server/src/main/java/org/opensearch/cluster/metadata/SystemIndexMetadataUpgradeService.java index 51a2557ef80bb..f07b74575950c 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/SystemIndexMetadataUpgradeService.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/SystemIndexMetadataUpgradeService.java @@ -56,7 +56,7 @@ public class SystemIndexMetadataUpgradeService implements ClusterStateListener { private final SystemIndices systemIndices; private final ClusterService clusterService; - private boolean master = false; + private boolean clusterManager = false; private volatile ImmutableOpenMap lastIndexMetadataMap = ImmutableOpenMap.of(); private volatile boolean updateTaskPending = false; @@ -68,11 +68,11 @@ public SystemIndexMetadataUpgradeService(SystemIndices systemIndices, ClusterSer @Override public void clusterChanged(ClusterChangedEvent event) { - if (event.localNodeMaster() != master) { - this.master = event.localNodeMaster(); + if (event.localNodeMaster() != clusterManager) { + this.clusterManager = event.localNodeMaster(); } - if (master && updateTaskPending == false) { + if (clusterManager && updateTaskPending == false) { final ImmutableOpenMap indexMetadataMap = event.state().metadata().indices(); if (lastIndexMetadataMap != indexMetadataMap) { diff --git a/server/src/main/java/org/opensearch/cluster/node/DiscoveryNode.java b/server/src/main/java/org/opensearch/cluster/node/DiscoveryNode.java index 6bd943c5e1d0d..740b7a80dd1d9 100644 --- a/server/src/main/java/org/opensearch/cluster/node/DiscoveryNode.java +++ b/server/src/main/java/org/opensearch/cluster/node/DiscoveryNode.java @@ -73,7 +73,7 @@ public static boolean nodeRequiresLocalStorage(Settings settings) { boolean localStorageEnable = Node.NODE_LOCAL_STORAGE_SETTING.get(settings); if (localStorageEnable == false && (isDataNode(settings) || isMasterNode(settings))) { // TODO: make this a proper setting validation logic, requiring multi-settings validation - throw new IllegalArgumentException("storage can not be disabled for master and data nodes"); + throw new IllegalArgumentException("storage can not be disabled for cluster-manager and data nodes"); } return localStorageEnable; } @@ -453,7 +453,7 @@ public boolean isDataNode() { } /** - * Can this node become master or not. + * Can this node become cluster-manager or not. */ public boolean isMasterNode() { return roles.contains(DiscoveryNodeRole.MASTER_ROLE) || roles.contains(DiscoveryNodeRole.CLUSTER_MANAGER_ROLE); diff --git a/server/src/main/java/org/opensearch/cluster/node/DiscoveryNodes.java b/server/src/main/java/org/opensearch/cluster/node/DiscoveryNodes.java index 8d84869bc8bec..9d79157ad5b22 100644 --- a/server/src/main/java/org/opensearch/cluster/node/DiscoveryNodes.java +++ b/server/src/main/java/org/opensearch/cluster/node/DiscoveryNodes.java @@ -70,10 +70,10 @@ public class DiscoveryNodes extends AbstractDiffable implements private final ImmutableOpenMap nodes; private final ImmutableOpenMap dataNodes; - private final ImmutableOpenMap masterNodes; + private final ImmutableOpenMap clusterManagerNodes; private final ImmutableOpenMap ingestNodes; - private final String masterNodeId; + private final String clusterManagerNodeId; private final String localNodeId; private final Version minNonClientNodeVersion; private final Version maxNonClientNodeVersion; @@ -83,9 +83,9 @@ public class DiscoveryNodes extends AbstractDiffable implements private DiscoveryNodes( ImmutableOpenMap nodes, ImmutableOpenMap dataNodes, - ImmutableOpenMap masterNodes, + ImmutableOpenMap clusterManagerNodes, ImmutableOpenMap ingestNodes, - String masterNodeId, + String clusterManagerNodeId, String localNodeId, Version minNonClientNodeVersion, Version maxNonClientNodeVersion, @@ -94,9 +94,9 @@ private DiscoveryNodes( ) { this.nodes = nodes; this.dataNodes = dataNodes; - this.masterNodes = masterNodes; + this.clusterManagerNodes = clusterManagerNodes; this.ingestNodes = ingestNodes; - this.masterNodeId = masterNodeId; + this.clusterManagerNodeId = clusterManagerNodeId; this.localNodeId = localNodeId; this.minNonClientNodeVersion = minNonClientNodeVersion; this.maxNonClientNodeVersion = maxNonClientNodeVersion; @@ -110,14 +110,14 @@ public Iterator iterator() { } /** - * Returns {@code true} if the local node is the elected master node. + * Returns {@code true} if the local node is the elected cluster-manager node. */ public boolean isLocalNodeElectedMaster() { if (localNodeId == null) { // we don't know yet the local node id, return false return false; } - return localNodeId.equals(masterNodeId); + return localNodeId.equals(clusterManagerNodeId); } /** @@ -148,12 +148,12 @@ public ImmutableOpenMap getDataNodes() { } /** - * Get a {@link Map} of the discovered master nodes arranged by their ids + * Get a {@link Map} of the discovered cluster-manager nodes arranged by their ids * - * @return {@link Map} of the discovered master nodes arranged by their ids + * @return {@link Map} of the discovered cluster-manager nodes arranged by their ids */ public ImmutableOpenMap getMasterNodes() { - return this.masterNodes; + return this.clusterManagerNodes; } /** @@ -164,35 +164,35 @@ public ImmutableOpenMap getIngestNodes() { } /** - * Get a {@link Map} of the discovered master and data nodes arranged by their ids + * Get a {@link Map} of the discovered cluster-manager and data nodes arranged by their ids * - * @return {@link Map} of the discovered master and data nodes arranged by their ids + * @return {@link Map} of the discovered cluster-manager and data nodes arranged by their ids */ public ImmutableOpenMap getMasterAndDataNodes() { ImmutableOpenMap.Builder nodes = ImmutableOpenMap.builder(dataNodes); - nodes.putAll(masterNodes); + nodes.putAll(clusterManagerNodes); return nodes.build(); } /** - * Get a {@link Map} of the coordinating only nodes (nodes which are neither master, nor data, nor ingest nodes) arranged by their ids + * Get a {@link Map} of the coordinating only nodes (nodes which are neither cluster-manager, nor data, nor ingest nodes) arranged by their ids * * @return {@link Map} of the coordinating only nodes arranged by their ids */ public ImmutableOpenMap getCoordinatingOnlyNodes() { ImmutableOpenMap.Builder nodes = ImmutableOpenMap.builder(this.nodes); - nodes.removeAll(masterNodes.keys()); + nodes.removeAll(clusterManagerNodes.keys()); nodes.removeAll(dataNodes.keys()); nodes.removeAll(ingestNodes.keys()); return nodes.build(); } /** - * Returns a stream of all nodes, with master nodes at the front + * Returns a stream of all nodes, with cluster-manager nodes at the front */ public Stream mastersFirstStream() { return Stream.concat( - StreamSupport.stream(masterNodes.spliterator(), false).map(cur -> cur.value), + StreamSupport.stream(clusterManagerNodes.spliterator(), false).map(cur -> cur.value), StreamSupport.stream(this.spliterator(), false).filter(n -> n.isMasterNode() == false) ); } @@ -230,7 +230,7 @@ public boolean nodeExists(DiscoveryNode node) { /** * Determine if the given node exists and has the right roles. Supported roles vary by version, and our local cluster state might - * have come via an older master, so the roles may differ even if the node is otherwise identical. + * have come via an older cluster-manager, so the roles may differ even if the node is otherwise identical. */ public boolean nodeExistsWithSameRoles(DiscoveryNode discoveryNode) { final DiscoveryNode existing = nodes.get(discoveryNode.getId()); @@ -239,7 +239,7 @@ public boolean nodeExistsWithSameRoles(DiscoveryNode discoveryNode) { /** * Determine if the given node exists and has the right version. During upgrade from Elasticsearch version as OpenSearch node run in - * BWC mode and can have the version as 7.10.2 in cluster state from older master to OpenSearch master. + * BWC mode and can have the version as 7.10.2 in cluster state from older cluster-manager to OpenSearch cluster-manager. */ public boolean nodeExistsWithBWCVersion(DiscoveryNode discoveryNode) { final DiscoveryNode existing = nodes.get(discoveryNode.getId()); @@ -250,12 +250,12 @@ public boolean nodeExistsWithBWCVersion(DiscoveryNode discoveryNode) { } /** - * Get the id of the master node + * Get the id of the cluster-manager node * - * @return id of the master + * @return id of the cluster-manager */ public String getMasterNodeId() { - return this.masterNodeId; + return this.clusterManagerNodeId; } /** @@ -277,12 +277,12 @@ public DiscoveryNode getLocalNode() { } /** - * Returns the master node, or {@code null} if there is no master node + * Returns the cluster-manager node, or {@code null} if there is no cluster-manager node */ @Nullable public DiscoveryNode getMasterNode() { - if (masterNodeId != null) { - return nodes.get(masterNodeId); + if (clusterManagerNodeId != null) { + return nodes.get(clusterManagerNodeId); } return null; } @@ -394,9 +394,9 @@ public String[] resolveNodes(String... nodes) { resolvedNodesIds.add(localNodeId); } } else if (nodeId.equals("_master") || nodeId.equals("_cluster_manager")) { - String masterNodeId = getMasterNodeId(); - if (masterNodeId != null) { - resolvedNodesIds.add(masterNodeId); + String clusterManagerNodeId = getMasterNodeId(); + if (clusterManagerNodeId != null) { + resolvedNodesIds.add(clusterManagerNodeId); } } else if (nodeExists(nodeId)) { resolvedNodesIds.add(nodeId); @@ -421,9 +421,9 @@ public String[] resolveNodes(String... nodes) { } } else if (roleNameIsClusterManager(matchAttrName)) { if (Booleans.parseBoolean(matchAttrValue, true)) { - resolvedNodesIds.addAll(masterNodes.keys()); + resolvedNodesIds.addAll(clusterManagerNodes.keys()); } else { - resolvedNodesIds.removeAll(masterNodes.keys()); + resolvedNodesIds.removeAll(clusterManagerNodes.keys()); } } else if (DiscoveryNodeRole.INGEST_ROLE.roleName().equals(matchAttrName)) { if (Booleans.parseBoolean(matchAttrValue, true)) { @@ -506,7 +506,7 @@ public String toString() { sb.append(", local"); } if (node == getMasterNode()) { - sb.append(", master"); + sb.append(", cluster-manager"); } sb.append("\n"); } @@ -517,21 +517,21 @@ public static class Delta { private final String localNodeId; @Nullable - private final DiscoveryNode previousMasterNode; + private final DiscoveryNode previousClusterManagerNode; @Nullable - private final DiscoveryNode newMasterNode; + private final DiscoveryNode newClusterManagerNode; private final List removed; private final List added; private Delta( - @Nullable DiscoveryNode previousMasterNode, - @Nullable DiscoveryNode newMasterNode, + @Nullable DiscoveryNode previousClusterManagerNode, + @Nullable DiscoveryNode newClusterManagerNode, String localNodeId, List removed, List added ) { - this.previousMasterNode = previousMasterNode; - this.newMasterNode = newMasterNode; + this.previousClusterManagerNode = previousClusterManagerNode; + this.newClusterManagerNode = newClusterManagerNode; this.localNodeId = localNodeId; this.removed = removed; this.added = added; @@ -542,17 +542,17 @@ public boolean hasChanges() { } public boolean masterNodeChanged() { - return Objects.equals(newMasterNode, previousMasterNode) == false; + return Objects.equals(newClusterManagerNode, previousClusterManagerNode) == false; } @Nullable - public DiscoveryNode previousMasterNode() { - return previousMasterNode; + public DiscoveryNode previousClusterManagerNode() { + return previousClusterManagerNode; } @Nullable public DiscoveryNode newMasterNode() { - return newMasterNode; + return newClusterManagerNode; } public boolean removed() { @@ -575,8 +575,8 @@ public String shortSummary() { final StringBuilder summary = new StringBuilder(); if (masterNodeChanged()) { summary.append("cluster-manager node changed {previous ["); - if (previousMasterNode() != null) { - summary.append(previousMasterNode()); + if (previousClusterManagerNode() != null) { + summary.append(previousClusterManagerNode()); } summary.append("], current ["); if (newMasterNode() != null) { @@ -609,11 +609,11 @@ public String shortSummary() { @Override public void writeTo(StreamOutput out) throws IOException { - if (masterNodeId == null) { + if (clusterManagerNodeId == null) { out.writeBoolean(false); } else { out.writeBoolean(true); - out.writeString(masterNodeId); + out.writeString(clusterManagerNodeId); } out.writeVInt(nodes.size()); for (DiscoveryNode node : this) { @@ -659,7 +659,7 @@ public static Builder builder(DiscoveryNodes nodes) { public static class Builder { private final ImmutableOpenMap.Builder nodes; - private String masterNodeId; + private String clusterManagerNodeId; private String localNodeId; public Builder() { @@ -667,7 +667,7 @@ public Builder() { } public Builder(DiscoveryNodes nodes) { - this.masterNodeId = nodes.getMasterNodeId(); + this.clusterManagerNodeId = nodes.getMasterNodeId(); this.localNodeId = nodes.getLocalNodeId(); this.nodes = ImmutableOpenMap.builder(nodes.getNodes()); } @@ -712,8 +712,8 @@ public Builder remove(DiscoveryNode node) { return this; } - public Builder masterNodeId(String masterNodeId) { - this.masterNodeId = masterNodeId; + public Builder masterNodeId(String clusterManagerNodeId) { + this.clusterManagerNodeId = clusterManagerNodeId; return this; } @@ -784,7 +784,7 @@ public DiscoveryNodes build() { dataNodesBuilder.build(), masterNodesBuilder.build(), ingestNodesBuilder.build(), - masterNodeId, + clusterManagerNodeId, localNodeId, minNonClientNodeVersion == null ? Version.CURRENT : minNonClientNodeVersion, maxNonClientNodeVersion == null ? Version.CURRENT : maxNonClientNodeVersion, @@ -794,7 +794,7 @@ public DiscoveryNodes build() { } public boolean isLocalNodeElectedMaster() { - return masterNodeId != null && masterNodeId.equals(localNodeId); + return clusterManagerNodeId != null && clusterManagerNodeId.equals(localNodeId); } } diff --git a/server/src/main/java/org/opensearch/cluster/routing/BatchedRerouteService.java b/server/src/main/java/org/opensearch/cluster/routing/BatchedRerouteService.java index 05c11e112364a..9139c72577c9f 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/BatchedRerouteService.java +++ b/server/src/main/java/org/opensearch/cluster/routing/BatchedRerouteService.java @@ -50,7 +50,7 @@ /** * A {@link BatchedRerouteService} is a {@link RerouteService} that batches together reroute requests to avoid unnecessary extra reroutes. - * This component only does meaningful work on the elected master node. Reroute requests will fail with a {@link NotMasterException} on + * This component only does meaningful work on the elected cluster-manager node. Reroute requests will fail with a {@link NotMasterException} on * other nodes. */ public class BatchedRerouteService implements RerouteService { @@ -146,7 +146,7 @@ public void onNoLongerMaster(String source) { } } ActionListener.onFailure(currentListeners, new NotMasterException("delayed reroute [" + reason + "] cancelled")); - // no big deal, the new master will reroute again + // no big deal, the new cluster-manager will reroute again } @Override diff --git a/server/src/main/java/org/opensearch/cluster/routing/RecoverySource.java b/server/src/main/java/org/opensearch/cluster/routing/RecoverySource.java index 543a6cba2e91b..1b0639bc98306 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/RecoverySource.java +++ b/server/src/main/java/org/opensearch/cluster/routing/RecoverySource.java @@ -268,7 +268,7 @@ public Snapshot snapshot() { /** * Gets the {@link IndexId} of the recovery source. May contain {@link IndexMetadata#INDEX_UUID_NA_VALUE} as the index uuid if it - * was created by an older version master in a mixed version cluster. + * was created by an older version cluster-manager in a mixed version cluster. * * @return IndexId */ diff --git a/server/src/main/java/org/opensearch/cluster/routing/UnassignedInfo.java b/server/src/main/java/org/opensearch/cluster/routing/UnassignedInfo.java index 09f1708b01307..8f82d6dcee318 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/UnassignedInfo.java +++ b/server/src/main/java/org/opensearch/cluster/routing/UnassignedInfo.java @@ -301,7 +301,7 @@ public UnassignedInfo(StreamInput in) throws IOException { this.reason = Reason.values()[(int) in.readByte()]; this.unassignedTimeMillis = in.readLong(); // As System.nanoTime() cannot be compared across different JVMs, reset it to now. - // This means that in master fail-over situations, elapsed delay time is forgotten. + // This means that in cluster-manager fail-over situations, elapsed delay time is forgotten. this.unassignedTimeNanos = System.nanoTime(); this.delayed = in.readBoolean(); this.message = in.readOptionalString(); diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/ExistingShardsAllocator.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/ExistingShardsAllocator.java index ca0744f099f84..9286ca3dd533d 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/allocation/ExistingShardsAllocator.java +++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/ExistingShardsAllocator.java @@ -84,7 +84,7 @@ void allocateUnassigned( AllocateUnassignedDecision explainUnassignedShardAllocation(ShardRouting unassignedShard, RoutingAllocation routingAllocation); /** - * Called when this node becomes the elected master and when it stops being the elected master, so that implementations can clean up any + * Called when this node becomes the elected cluster-manager and when it stops being the elected cluster-manager, so that implementations can clean up any * in-flight activity from an earlier mastership. */ void cleanCaches(); diff --git a/server/src/main/java/org/opensearch/cluster/service/ClusterApplierService.java b/server/src/main/java/org/opensearch/cluster/service/ClusterApplierService.java index 20f8c0a00e32b..221dd3ee55b21 100644 --- a/server/src/main/java/org/opensearch/cluster/service/ClusterApplierService.java +++ b/server/src/main/java/org/opensearch/cluster/service/ClusterApplierService.java @@ -270,7 +270,7 @@ public void removeTimeoutListener(TimeoutClusterStateListener listener) { } /** - * Add a listener for on/off local node master events + * Add a listener for on/off local node cluster-manager events */ public void addLocalNodeMasterListener(LocalNodeMasterListener listener) { addListener(listener); diff --git a/server/src/main/java/org/opensearch/cluster/service/ClusterService.java b/server/src/main/java/org/opensearch/cluster/service/ClusterService.java index 46d65f310a427..27b8e6d29ee49 100644 --- a/server/src/main/java/org/opensearch/cluster/service/ClusterService.java +++ b/server/src/main/java/org/opensearch/cluster/service/ClusterService.java @@ -207,7 +207,7 @@ public void removeListener(ClusterStateListener listener) { } /** - * Add a listener for on/off local node master events + * Add a listener for on/off local node cluster-manager events */ public void addLocalNodeMasterListener(LocalNodeMasterListener listener) { clusterApplierService.addLocalNodeMasterListener(listener); diff --git a/server/src/main/java/org/opensearch/cluster/service/MasterService.java b/server/src/main/java/org/opensearch/cluster/service/MasterService.java index ad0bc599420f1..1aa2ea921e4b0 100644 --- a/server/src/main/java/org/opensearch/cluster/service/MasterService.java +++ b/server/src/main/java/org/opensearch/cluster/service/MasterService.java @@ -228,14 +228,14 @@ private static boolean isMasterUpdateThread() { } public static boolean assertMasterUpdateThread() { - assert isMasterUpdateThread() : "not called from the master service thread"; + assert isMasterUpdateThread() : "not called from the cluster-manager service thread"; return true; } public static boolean assertNotMasterUpdateThread(String reason) { assert isMasterUpdateThread() == false : "Expected current thread [" + Thread.currentThread() - + "] to not be the master service thread. Reason: [" + + "] to not be the cluster-maanger service thread. Reason: [" + reason + "]"; return true; @@ -244,16 +244,16 @@ assert isMasterUpdateThread() == false : "Expected current thread [" private void runTasks(TaskInputs taskInputs) { final String summary = taskInputs.summary; if (!lifecycle.started()) { - logger.debug("processing [{}]: ignoring, master service not started", summary); + logger.debug("processing [{}]: ignoring, cluster-manager service not started", summary); return; } logger.debug("executing cluster state update for [{}]", summary); final ClusterState previousClusterState = state(); - if (!previousClusterState.nodes().isLocalNodeElectedMaster() && taskInputs.runOnlyWhenMaster()) { - logger.debug("failing [{}]: local node is no longer master", summary); - taskInputs.onNoLongerMaster(); + if (!previousClusterState.nodes().isLocalNodeElectedMaster() && taskInputs.runOnlyWhenClusterManager()) { + logger.debug("failing [{}]: local node is no longer cluster-manager", summary); + taskInputs.onNoLongerClusterManager(); return; } @@ -402,7 +402,7 @@ private ClusterState patchVersions(ClusterState previousClusterState, ClusterTas ClusterState newClusterState = executionResult.resultingState; if (previousClusterState != newClusterState) { - // only the master controls the version numbers + // only the cluster-manager controls the version numbers Builder builder = incrementVersion(newClusterState); if (previousClusterState.routingTable() != newClusterState.routingTable()) { builder.routingTable( @@ -616,7 +616,10 @@ public void onNoLongerMaster(String source) { listener.onNoLongerMaster(source); } catch (Exception e) { logger.error( - () -> new ParameterizedMessage("exception thrown by listener while notifying no longer master from [{}]", source), + () -> new ParameterizedMessage( + "exception thrown by listener while notifying no longer cluster-manager from [{}]", + source + ), e ); } @@ -722,7 +725,7 @@ private static class AckCountDownListener implements Discovery.AckListener { private final AckedClusterStateTaskListener ackedTaskListener; private final CountDown countDown; - private final DiscoveryNode masterNode; + private final DiscoveryNode clusterManagerNode; private final ThreadPool threadPool; private final long clusterStateVersion; private volatile Scheduler.Cancellable ackTimeoutCallback; @@ -737,11 +740,11 @@ private static class AckCountDownListener implements Discovery.AckListener { this.ackedTaskListener = ackedTaskListener; this.clusterStateVersion = clusterStateVersion; this.threadPool = threadPool; - this.masterNode = nodes.getMasterNode(); + this.clusterManagerNode = nodes.getMasterNode(); int countDown = 0; for (DiscoveryNode node : nodes) { - // we always wait for at least the master node - if (node.equals(masterNode) || ackedTaskListener.mustAck(node)) { + // we always wait for at least the cluster-manager node + if (node.equals(clusterManagerNode) || ackedTaskListener.mustAck(node)) { countDown++; } } @@ -771,7 +774,7 @@ public void onCommit(TimeValue commitTime) { @Override public void onNodeAck(DiscoveryNode node, @Nullable Exception e) { - if (node.equals(masterNode) == false && ackedTaskListener.mustAck(node) == false) { + if (node.equals(clusterManagerNode) == false && ackedTaskListener.mustAck(node) == false) { return; } if (e == null) { @@ -879,11 +882,11 @@ private class TaskInputs { this.updateTasks = updateTasks; } - boolean runOnlyWhenMaster() { + boolean runOnlyWhenClusterManager() { return executor.runOnlyOnMaster(); } - void onNoLongerMaster() { + void onNoLongerClusterManager() { updateTasks.forEach(task -> task.listener.onNoLongerMaster(task.source())); } } diff --git a/server/src/main/java/org/opensearch/common/settings/ConsistentSettingsService.java b/server/src/main/java/org/opensearch/common/settings/ConsistentSettingsService.java index fbb37651198d4..2dbc8327eca1e 100644 --- a/server/src/main/java/org/opensearch/common/settings/ConsistentSettingsService.java +++ b/server/src/main/java/org/opensearch/common/settings/ConsistentSettingsService.java @@ -87,7 +87,7 @@ public ConsistentSettingsService(Settings settings, ClusterService clusterServic /** * Returns a {@link LocalNodeMasterListener} that will publish hashes of all the settings passed in the constructor. These hashes are - * published by the master node only. Note that this is not designed for {@link SecureSettings} implementations that are mutable. + * published by the cluster-manager node only. Note that this is not designed for {@link SecureSettings} implementations that are mutable. */ public LocalNodeMasterListener newHashPublisher() { // eagerly compute hashes to be published @@ -116,7 +116,7 @@ public boolean areAllConsistent() { concreteSecureSetting.getKey() ); } else if (publishedSaltAndHash == null && localHash != null) { - // setting missing on master but present locally + // setting missing on cluster-manager but present locally logger.warn( "no published hash for the consistent secure setting [{}] but it exists on the local node", concreteSecureSetting.getKey() @@ -256,7 +256,7 @@ static final class HashesPublisher implements LocalNodeMasterListener { } @Override - public void onMaster() { + public void onClusterManager() { clusterService.submitStateUpdateTask("publish-secure-settings-hashes", new ClusterStateUpdateTask(Priority.URGENT) { @Override public ClusterState execute(ClusterState currentState) { @@ -282,8 +282,8 @@ public void onFailure(String source, Exception e) { } @Override - public void offMaster() { - logger.trace("I am no longer master, nothing to do"); + public void offClusterManager() { + logger.trace("I am no longer cluster-manager, nothing to do"); } } diff --git a/server/src/main/java/org/opensearch/discovery/AckClusterStatePublishResponseHandler.java b/server/src/main/java/org/opensearch/discovery/AckClusterStatePublishResponseHandler.java index 161450308b384..e281bbbfacba1 100644 --- a/server/src/main/java/org/opensearch/discovery/AckClusterStatePublishResponseHandler.java +++ b/server/src/main/java/org/opensearch/discovery/AckClusterStatePublishResponseHandler.java @@ -53,11 +53,11 @@ public class AckClusterStatePublishResponseHandler extends BlockingClusterStateP * Creates a new AckClusterStatePublishResponseHandler * @param publishingToNodes the set of nodes to which the cluster state will be published and should respond * @param ackListener the {@link org.opensearch.discovery.Discovery.AckListener} to notify for each response - * gotten from non master nodes + * gotten from non cluster-manager nodes */ public AckClusterStatePublishResponseHandler(Set publishingToNodes, Discovery.AckListener ackListener) { - // Don't count the master as acknowledged, because it's not done yet - // otherwise we might end up with all the nodes but the master holding the latest cluster state + // Don't count the cluster-manager as acknowledged, because it's not done yet + // otherwise we might end up with all the nodes but the cluster-manager holding the latest cluster state super(publishingToNodes); this.ackListener = ackListener; } diff --git a/server/src/main/java/org/opensearch/discovery/BlockingClusterStatePublishResponseHandler.java b/server/src/main/java/org/opensearch/discovery/BlockingClusterStatePublishResponseHandler.java index c0cd390b66f78..6ee01d055be04 100644 --- a/server/src/main/java/org/opensearch/discovery/BlockingClusterStatePublishResponseHandler.java +++ b/server/src/main/java/org/opensearch/discovery/BlockingClusterStatePublishResponseHandler.java @@ -41,8 +41,8 @@ import java.util.concurrent.TimeUnit; /** - * Handles responses obtained when publishing a new cluster state from master to all non master nodes. - * Allows to await a reply from all non master nodes, up to a timeout + * Handles responses obtained when publishing a new cluster state from cluster-manager to all non cluster-manager nodes. + * Allows to await a reply from all non cluster-manager nodes, up to a timeout */ public class BlockingClusterStatePublishResponseHandler { @@ -62,7 +62,7 @@ public BlockingClusterStatePublishResponseHandler(Set publishingT } /** - * Called for each response obtained from non master nodes + * Called for each response obtained from non cluster-manager nodes * * @param node the node that replied to the publish event */ @@ -73,7 +73,7 @@ public void onResponse(DiscoveryNode node) { } /** - * Called for each failure obtained from non master nodes + * Called for each failure obtained from non cluster-manager nodes * @param node the node that replied to the publish event */ public void onFailure(DiscoveryNode node, Exception e) { @@ -85,7 +85,7 @@ public void onFailure(DiscoveryNode node, Exception e) { } /** - * Allows to wait for all non master nodes to reply to the publish event up to a timeout + * Allows to wait for all non cluster-manager nodes to reply to the publish event up to a timeout * @param timeout the timeout * @return true if the timeout expired or not, false otherwise */ diff --git a/server/src/main/java/org/opensearch/discovery/Discovery.java b/server/src/main/java/org/opensearch/discovery/Discovery.java index ac5028f6dfc51..25d136d8a2563 100644 --- a/server/src/main/java/org/opensearch/discovery/Discovery.java +++ b/server/src/main/java/org/opensearch/discovery/Discovery.java @@ -37,7 +37,7 @@ /** * A pluggable module allowing to implement discovery of other nodes, publishing of the cluster - * state to all nodes, electing a master of the cluster that raises cluster state change + * state to all nodes, electing a cluster-manager of the cluster that raises cluster state change * events. */ public interface Discovery extends LifecycleComponent, ClusterStatePublisher { diff --git a/server/src/main/java/org/opensearch/discovery/DiscoveryModule.java b/server/src/main/java/org/opensearch/discovery/DiscoveryModule.java index 427615da7e4d0..af3d07a1b12d5 100644 --- a/server/src/main/java/org/opensearch/discovery/DiscoveryModule.java +++ b/server/src/main/java/org/opensearch/discovery/DiscoveryModule.java @@ -119,7 +119,7 @@ public DiscoveryModule( TransportService transportService, NamedWriteableRegistry namedWriteableRegistry, NetworkService networkService, - MasterService masterService, + MasterService clusterManagerService, ClusterApplier clusterApplier, ClusterSettings clusterSettings, List plugins, @@ -195,7 +195,7 @@ public DiscoveryModule( transportService, namedWriteableRegistry, allocationService, - masterService, + clusterManagerService, gatewayMetaState::getPersistedState, seedHostsProvider, clusterApplier, diff --git a/server/src/main/java/org/opensearch/discovery/PeerFinder.java b/server/src/main/java/org/opensearch/discovery/PeerFinder.java index fe669e7b6d073..c174016925696 100644 --- a/server/src/main/java/org/opensearch/discovery/PeerFinder.java +++ b/server/src/main/java/org/opensearch/discovery/PeerFinder.java @@ -208,7 +208,7 @@ private DiscoveryNode getLocalNode() { * Invoked on receipt of a PeersResponse from a node that believes it's an active leader, which this node should therefore try and join. * Note that invocations of this method are not synchronised. By the time it is called we may have been deactivated. */ - protected abstract void onActiveMasterFound(DiscoveryNode masterNode, long term); + protected abstract void onActiveClusterManagerFound(DiscoveryNode clusterManagerNode, long term); /** * Invoked when the set of found peers changes. Note that invocations of this method are not fully synchronised, so we only guarantee @@ -449,7 +449,7 @@ public void handleResponse(PeersResponse response) { if (response.getMasterNode().equals(Optional.of(discoveryNode))) { // Must not hold lock here to avoid deadlock assert holdsLock() == false : "PeerFinder mutex is held in error"; - onActiveMasterFound(discoveryNode, response.getTerm()); + onActiveClusterManagerFound(discoveryNode, response.getTerm()); } } diff --git a/server/src/main/java/org/opensearch/env/NodeRepurposeCommand.java b/server/src/main/java/org/opensearch/env/NodeRepurposeCommand.java index cb431a6a5d0de..dd4819f5804ac 100644 --- a/server/src/main/java/org/opensearch/env/NodeRepurposeCommand.java +++ b/server/src/main/java/org/opensearch/env/NodeRepurposeCommand.java @@ -92,13 +92,13 @@ protected void processNodePaths(Terminal terminal, Path[] dataPaths, int nodeLoc assert DiscoveryNode.isDataNode(env.settings()) == false; if (DiscoveryNode.isMasterNode(env.settings()) == false) { - processNoMasterNoDataNode(terminal, dataPaths, env); + processNoClusterManagerNoDataNode(terminal, dataPaths, env); } else { - processMasterNoDataNode(terminal, dataPaths, env); + processClusterManagerNoDataNode(terminal, dataPaths, env); } } - private void processNoMasterNoDataNode(Terminal terminal, Path[] dataPaths, Environment env) throws IOException { + private void processNoClusterManagerNoDataNode(Terminal terminal, Path[] dataPaths, Environment env) throws IOException { NodeEnvironment.NodePath[] nodePaths = toNodePaths(dataPaths); terminal.println(Terminal.Verbosity.VERBOSE, "Collecting shard data paths"); @@ -126,7 +126,7 @@ private void processNoMasterNoDataNode(Terminal terminal, Path[] dataPaths, Envi outputVerboseInformation(terminal, indexPaths, indexUUIDs, metadata); - terminal.println(noMasterMessage(indexUUIDs.size(), shardDataPaths.size(), indexMetadataPaths.size())); + terminal.println(noClusterManagerMessage(indexUUIDs.size(), shardDataPaths.size(), indexMetadataPaths.size())); outputHowToSeeVerboseInformation(terminal); terminal.println("Node is being re-purposed as no-cluster-manager and no-data. Clean-up of index data will be performed."); @@ -140,7 +140,7 @@ private void processNoMasterNoDataNode(Terminal terminal, Path[] dataPaths, Envi terminal.println("Node successfully repurposed to no-cluster-manager and no-data."); } - private void processMasterNoDataNode(Terminal terminal, Path[] dataPaths, Environment env) throws IOException { + private void processClusterManagerNoDataNode(Terminal terminal, Path[] dataPaths, Environment env) throws IOException { NodeEnvironment.NodePath[] nodePaths = toNodePaths(dataPaths); terminal.println(Terminal.Verbosity.VERBOSE, "Collecting shard data paths"); @@ -205,7 +205,7 @@ private Set indexUUIDsFor(Set indexPaths) { return indexPaths.stream().map(Path::getFileName).map(Path::toString).collect(Collectors.toSet()); } - static String noMasterMessage(int indexes, int shards, int indexMetadata) { + static String noClusterManagerMessage(int indexes, int shards, int indexMetadata) { return "Found " + indexes + " indices (" + shards + " shards and " + indexMetadata + " index meta data) to clean up"; } diff --git a/server/src/main/java/org/opensearch/gateway/DanglingIndicesState.java b/server/src/main/java/org/opensearch/gateway/DanglingIndicesState.java index 3baa5bfb9e410..25a1096919939 100644 --- a/server/src/main/java/org/opensearch/gateway/DanglingIndicesState.java +++ b/server/src/main/java/org/opensearch/gateway/DanglingIndicesState.java @@ -261,7 +261,7 @@ private IndexMetadata stripAliases(IndexMetadata indexMetadata) { } /** - * Allocates the detected list of dangling indices by sending them to the master node + * Allocates the detected list of dangling indices by sending them to the cluster-manager node * for allocation, provided auto-import is enabled via the * {@link #AUTO_IMPORT_DANGLING_INDICES_SETTING} setting. * @param metadata the current cluster metadata, used to filter out dangling indices that cannot be allocated diff --git a/server/src/main/java/org/opensearch/gateway/GatewayMetaState.java b/server/src/main/java/org/opensearch/gateway/GatewayMetaState.java index 3081c4da8f7a7..0ca70f37afa83 100644 --- a/server/src/main/java/org/opensearch/gateway/GatewayMetaState.java +++ b/server/src/main/java/org/opensearch/gateway/GatewayMetaState.java @@ -90,12 +90,12 @@ * When started, ensures that this version is compatible with the state stored on disk, and performs a state upgrade if necessary. Note that * the state being loaded when constructing the instance of this class is not necessarily the state that will be used as {@link * ClusterState#metadata()} because it might be stale or incomplete. Cluster-manager-eligible nodes must perform an election to find a complete and - * non-stale state, and master-ineligible nodes receive the real cluster state from the elected master after joining the cluster. + * non-stale state, and cluster-manager-ineligible nodes receive the real cluster state from the elected cluster-manager after joining the cluster. */ public class GatewayMetaState implements Closeable { /** - * Fake node ID for a voting configuration written by a master-ineligible data node to indicate that its on-disk state is potentially + * Fake node ID for a voting configuration written by a cluster-manager-ineligible data node to indicate that its on-disk state is potentially * stale (since it is written asynchronously after application, rather than before acceptance). This node ID means that if the node is * restarted as a cluster-manager-eligible node then it does not win any elections until it has received a fresh cluster state. */ @@ -502,8 +502,8 @@ static class LucenePersistedState implements PersistedState { // (2) the index is currently empty since it was opened with IndexWriterConfig.OpenMode.CREATE // In the common case it's actually sufficient to commit() the existing state and not do any indexing. For instance, - // this is true if there's only one data path on this master node, and the commit we just loaded was already written out - // by this version of OpenSearch. TODO TBD should we avoid indexing when possible? + // this is true if there's only one data path on this cluster-manager node, and the commit we just loaded was already written + // out by this version of OpenSearch. TODO TBD should we avoid indexing when possible? final PersistedClusterStateService.Writer writer = persistedClusterStateService.createWriter(); try { writer.writeFullStateAndCommit(currentTerm, lastAcceptedState); diff --git a/server/src/main/java/org/opensearch/gateway/GatewayService.java b/server/src/main/java/org/opensearch/gateway/GatewayService.java index 47347cea50e27..1a0efbcdf5bfb 100644 --- a/server/src/main/java/org/opensearch/gateway/GatewayService.java +++ b/server/src/main/java/org/opensearch/gateway/GatewayService.java @@ -132,8 +132,8 @@ public class GatewayService extends AbstractLifecycleComponent implements Cluste private final int expectedNodes; private final int recoverAfterDataNodes; private final int expectedDataNodes; - private final int recoverAfterMasterNodes; - private final int expectedMasterNodes; + private final int recoverAfterClusterManagerNodes; + private final int expectedClusterManagerNodes; private final Runnable recoveryRunnable; @@ -155,22 +155,22 @@ public GatewayService( // allow to control a delay of when indices will get created this.expectedNodes = EXPECTED_NODES_SETTING.get(settings); this.expectedDataNodes = EXPECTED_DATA_NODES_SETTING.get(settings); - this.expectedMasterNodes = EXPECTED_MASTER_NODES_SETTING.get(settings); + this.expectedClusterManagerNodes = EXPECTED_MASTER_NODES_SETTING.get(settings); if (RECOVER_AFTER_TIME_SETTING.exists(settings)) { recoverAfterTime = RECOVER_AFTER_TIME_SETTING.get(settings); - } else if (expectedNodes >= 0 || expectedDataNodes >= 0 || expectedMasterNodes >= 0) { + } else if (expectedNodes >= 0 || expectedDataNodes >= 0 || expectedClusterManagerNodes >= 0) { recoverAfterTime = DEFAULT_RECOVER_AFTER_TIME_IF_EXPECTED_NODES_IS_SET; } else { recoverAfterTime = null; } this.recoverAfterNodes = RECOVER_AFTER_NODES_SETTING.get(settings); this.recoverAfterDataNodes = RECOVER_AFTER_DATA_NODES_SETTING.get(settings); - // default the recover after master nodes to the minimum master nodes in the discovery + // default the recover after cluster-manager nodes to the minimum cluster-manager nodes in the discovery if (RECOVER_AFTER_MASTER_NODES_SETTING.exists(settings)) { - recoverAfterMasterNodes = RECOVER_AFTER_MASTER_NODES_SETTING.get(settings); + recoverAfterClusterManagerNodes = RECOVER_AFTER_MASTER_NODES_SETTING.get(settings); } else { - recoverAfterMasterNodes = -1; + recoverAfterClusterManagerNodes = -1; } if (discovery instanceof Coordinator) { @@ -216,7 +216,7 @@ public void clusterChanged(final ClusterChangedEvent event) { final DiscoveryNodes nodes = state.nodes(); if (state.nodes().getMasterNodeId() == null) { - logger.debug("not recovering from gateway, no master elected yet"); + logger.debug("not recovering from gateway, no cluster-manager elected yet"); } else if (recoverAfterNodes != -1 && (nodes.getMasterAndDataNodes().size()) < recoverAfterNodes) { logger.debug( "not recovering from gateway, nodes_size (data+master) [{}] < recover_after_nodes [{}]", @@ -229,16 +229,16 @@ public void clusterChanged(final ClusterChangedEvent event) { nodes.getDataNodes().size(), recoverAfterDataNodes ); - } else if (recoverAfterMasterNodes != -1 && nodes.getMasterNodes().size() < recoverAfterMasterNodes) { + } else if (recoverAfterClusterManagerNodes != -1 && nodes.getMasterNodes().size() < recoverAfterClusterManagerNodes) { logger.debug( "not recovering from gateway, nodes_size (master) [{}] < recover_after_master_nodes [{}]", nodes.getMasterNodes().size(), - recoverAfterMasterNodes + recoverAfterClusterManagerNodes ); } else { boolean enforceRecoverAfterTime; String reason; - if (expectedNodes == -1 && expectedMasterNodes == -1 && expectedDataNodes == -1) { + if (expectedNodes == -1 && expectedClusterManagerNodes == -1 && expectedDataNodes == -1) { // no expected is set, honor the setting if they are there enforceRecoverAfterTime = true; reason = "recover_after_time was set to [" + recoverAfterTime + "]"; @@ -252,10 +252,14 @@ public void clusterChanged(final ClusterChangedEvent event) { } else if (expectedDataNodes != -1 && (nodes.getDataNodes().size() < expectedDataNodes)) { // does not meet the expected... enforceRecoverAfterTime = true; reason = "expecting [" + expectedDataNodes + "] data nodes, but only have [" + nodes.getDataNodes().size() + "]"; - } else if (expectedMasterNodes != -1 && (nodes.getMasterNodes().size() < expectedMasterNodes)) { + } else if (expectedClusterManagerNodes != -1 && (nodes.getMasterNodes().size() < expectedClusterManagerNodes)) { // does not meet the expected... enforceRecoverAfterTime = true; - reason = "expecting [" + expectedMasterNodes + "] master nodes, but only have [" + nodes.getMasterNodes().size() + "]"; + reason = "expecting [" + + expectedClusterManagerNodes + + "] cluster-manager nodes, but only have [" + + nodes.getMasterNodes().size() + + "]"; } } performStateRecovery(enforceRecoverAfterTime, reason); @@ -333,7 +337,7 @@ public void clusterStateProcessed(final String source, final ClusterState oldSta @Override public void onNoLongerMaster(String source) { - logger.debug("stepped down as master before recovering state [{}]", source); + logger.debug("stepped down as cluster-manager before recovering state [{}]", source); resetRecoveredFlags(); } diff --git a/server/src/main/java/org/opensearch/gateway/LocalAllocateDangledIndices.java b/server/src/main/java/org/opensearch/gateway/LocalAllocateDangledIndices.java index c8ace3d218864..4c29bc6f2692f 100644 --- a/server/src/main/java/org/opensearch/gateway/LocalAllocateDangledIndices.java +++ b/server/src/main/java/org/opensearch/gateway/LocalAllocateDangledIndices.java @@ -103,9 +103,9 @@ public LocalAllocateDangledIndices( public void allocateDangled(Collection indices, ActionListener listener) { ClusterState clusterState = clusterService.state(); - DiscoveryNode masterNode = clusterState.nodes().getMasterNode(); - if (masterNode == null) { - listener.onFailure(new MasterNotDiscoveredException("no master to send allocate dangled request")); + DiscoveryNode clusterManagerNode = clusterState.nodes().getMasterNode(); + if (clusterManagerNode == null) { + listener.onFailure(new MasterNotDiscoveredException("no cluster-manager to send allocate dangled request")); return; } AllocateDangledRequest request = new AllocateDangledRequest( @@ -113,7 +113,7 @@ public void allocateDangled(Collection indices, ActionListener(listener, AllocateDangledResponse::new, ThreadPool.Names.SAME) diff --git a/server/src/main/java/org/opensearch/index/mapper/DocumentParser.java b/server/src/main/java/org/opensearch/index/mapper/DocumentParser.java index f9d6187d60eb8..df8eb8f38cfcb 100644 --- a/server/src/main/java/org/opensearch/index/mapper/DocumentParser.java +++ b/server/src/main/java/org/opensearch/index/mapper/DocumentParser.java @@ -461,7 +461,7 @@ private static void nested(ParseContext context, ObjectMapper.Nested nested) { } if (nested.isIncludeInRoot()) { ParseContext.Document rootDoc = context.rootDoc(); - // don't add it twice, if its included in parent, and we are handling the master doc... + // don't add it twice, if its included in parent, and we are handling the cluster-manager doc... if (!nested.isIncludeInParent() || parentDoc != rootDoc) { addFields(indexVersion, nestedDoc, rootDoc); } diff --git a/server/src/main/java/org/opensearch/index/mapper/MapperService.java b/server/src/main/java/org/opensearch/index/mapper/MapperService.java index 819df4a6f396e..33c6ff2bc4391 100644 --- a/server/src/main/java/org/opensearch/index/mapper/MapperService.java +++ b/server/src/main/java/org/opensearch/index/mapper/MapperService.java @@ -94,7 +94,7 @@ public class MapperService extends AbstractIndexComponent implements Closeable { */ public enum MergeReason { /** - * Pre-flight check before sending a mapping update to the master + * Pre-flight check before sending a mapping update to the cluster-manager */ MAPPING_UPDATE_PREFLIGHT, /** @@ -303,7 +303,7 @@ public boolean updateMapping(final IndexMetadata currentIndexMetadata, final Ind } // refresh mapping can happen when the parsing/merging of the mapping from the metadata doesn't result in the same - // mapping, in this case, we send to the master to refresh its own version of the mappings (to conform with the + // mapping, in this case, we send to the cluster-manager to refresh its own version of the mappings (to conform with the // merge version of it, which it does when refreshing the mappings), and warn log it. if (documentMapper().mappingSource().equals(incomingMappingSource) == false) { logger.debug( diff --git a/server/src/main/java/org/opensearch/index/seqno/ReplicationTracker.java b/server/src/main/java/org/opensearch/index/seqno/ReplicationTracker.java index 52e858bfdaa92..99509ad5d1da9 100644 --- a/server/src/main/java/org/opensearch/index/seqno/ReplicationTracker.java +++ b/server/src/main/java/org/opensearch/index/seqno/ReplicationTracker.java @@ -84,7 +84,7 @@ * This class is responsible for tracking the replication group with its progress and safety markers (local and global checkpoints). * * The global checkpoint is the highest sequence number for which all lower (or equal) sequence number have been processed - * on all shards that are currently active. Since shards count as "active" when the master starts + * on all shards that are currently active. Since shards count as "active" when the cluster-manager starts * them, and before this primary shard has been notified of this fact, we also include shards that have completed recovery. These shards * have received all old operations via the recovery mechanism and are kept up to date by the various replications actions. The set of * shards that are taken into account for the global checkpoint calculation are called the "in-sync shards". @@ -137,7 +137,7 @@ public class ReplicationTracker extends AbstractIndexShardComponent implements L * The reason for this is that the handoff might fail and can be aborted (using {@link #abortRelocationHandoff}), in which case * it is important that the global checkpoint tracker does not miss any state updates that might happened during the handoff attempt. * This means, however, that the global checkpoint can still advance after the primary relocation handoff has been initiated, but only - * because the master could have failed some of the in-sync shard copies and marked them as stale. That is ok though, as this + * because the cluster-manager could have failed some of the in-sync shard copies and marked them as stale. That is ok though, as this * information is conveyed through cluster state updates, and the new primary relocation target will also eventually learn about those. */ boolean handoffInProgress; @@ -1165,7 +1165,7 @@ private void addPeerRecoveryRetentionLeaseForSolePrimary() { /** * Notifies the tracker of the current allocation IDs in the cluster state. - * @param applyingClusterStateVersion the cluster state version being applied when updating the allocation IDs from the master + * @param applyingClusterStateVersion the cluster state version being applied when updating the allocation IDs from the cluster-manager * @param inSyncAllocationIds the allocation IDs of the currently in-sync shard copies * @param routingTable the shard routing table */ @@ -1176,14 +1176,14 @@ public synchronized void updateFromMaster( ) { assert invariant(); if (applyingClusterStateVersion > appliedClusterStateVersion) { - // check that the master does not fabricate new in-sync entries out of thin air once we are in primary mode + // check that the cluster-manager does not fabricate new in-sync entries out of thin air once we are in primary mode assert !primaryMode || inSyncAllocationIds.stream().allMatch(inSyncId -> checkpoints.containsKey(inSyncId) && checkpoints.get(inSyncId).inSync) - : "update from master in primary mode contains in-sync ids " + : "update from cluster-manager in primary mode contains in-sync ids " + inSyncAllocationIds + " that have no matching entries in " + checkpoints; - // remove entries which don't exist on master + // remove entries which don't exist on cluster-manager Set initializingAllocationIds = routingTable.getAllInitializingShards() .stream() .map(ShardRouting::allocationId) @@ -1197,7 +1197,7 @@ public synchronized void updateFromMaster( for (String initializingId : initializingAllocationIds) { if (checkpoints.containsKey(initializingId) == false) { final boolean inSync = inSyncAllocationIds.contains(initializingId); - assert inSync == false : "update from master in primary mode has " + assert inSync == false : "update from cluster-manager in primary mode has " + initializingId + " as in-sync but it does not exist locally"; final long localCheckpoint = SequenceNumbers.UNASSIGNED_SEQ_NO; @@ -1475,7 +1475,7 @@ public synchronized void activateWithPrimaryContext(PrimaryContext primaryContex assert indexSettings.getIndexVersionCreated().before(LegacyESVersion.V_7_3_0); throw new IllegalStateException("primary context [" + primaryContext + "] does not contain " + shardAllocationId); } - final Runnable runAfter = getMasterUpdateOperationFromCurrentState(); + final Runnable runAfter = getClusterManagerUpdateOperationFromCurrentState(); primaryMode = true; // capture current state to possibly replay missed cluster state update appliedClusterStateVersion = primaryContext.clusterStateVersion(); @@ -1541,7 +1541,7 @@ public synchronized void createMissingPeerRecoveryRetentionLeases(ActionListener } } - private Runnable getMasterUpdateOperationFromCurrentState() { + private Runnable getClusterManagerUpdateOperationFromCurrentState() { assert primaryMode == false; final long lastAppliedClusterStateVersion = appliedClusterStateVersion; final Set inSyncAllocationIds = new HashSet<>(); diff --git a/server/src/main/java/org/opensearch/index/shard/IndexEventListener.java b/server/src/main/java/org/opensearch/index/shard/IndexEventListener.java index 69f283a53ca79..c07798202144b 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexEventListener.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexEventListener.java @@ -161,7 +161,7 @@ default void beforeIndexShardDeleted(ShardId shardId, Settings indexSettings) {} default void afterIndexShardDeleted(ShardId shardId, Settings indexSettings) {} /** - * Called on the Master node only before the {@link IndexService} instances is created to simulate an index creation. + * Called on the cluster-manager node only before the {@link IndexService} instances is created to simulate an index creation. * This happens right before the index and it's metadata is registered in the cluster state */ default void beforeIndexAddedToCluster(Index index, Settings indexSettings) {} diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShard.java b/server/src/main/java/org/opensearch/index/shard/IndexShard.java index ed851808f5023..f02b7047899ce 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShard.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShard.java @@ -516,7 +516,7 @@ public void updateShardState( assert currentRouting.isRelocationTarget() == false || currentRouting.primary() == false || replicationTracker.isPrimaryMode() - : "a primary relocation is completed by the master, but primary mode is not active " + currentRouting; + : "a primary relocation is completed by the cluster-managerr, but primary mode is not active " + currentRouting; changeState(IndexShardState.STARTED, "global state is [" + newRouting.state() + "]"); } else if (currentRouting.primary() @@ -539,7 +539,7 @@ public void updateShardState( if (newRouting.primary()) { if (newPrimaryTerm == pendingPrimaryTerm) { if (currentRouting.initializing() && currentRouting.isRelocationTarget() == false && newRouting.active()) { - // the master started a recovering primary, activate primary mode. + // the cluster-manager started a recovering primary, activate primary mode. replicationTracker.activatePrimaryMode(getLocalCheckpoint()); ensurePeerRecoveryRetentionLeasesExist(); } @@ -549,10 +549,10 @@ public void updateShardState( * in one state causing it's term to be incremented. Note that if both current shard state and new * shard state are initializing, we could replace the current shard and reinitialize it. It is however * possible that this shard is being started. This can happen if: - * 1) Shard is post recovery and sends shard started to the master + * 1) Shard is post recovery and sends shard started to the cluster-manager * 2) Node gets disconnected and rejoins - * 3) Master assigns the shard back to the node - * 4) Master processes the shard started and starts the shard + * 3) Cluster-manager assigns the shard back to the node + * 4) Cluster-manager processes the shard started and starts the shard * 5) The node process the cluster state where the shard is both started and primary term is incremented. * * We could fail the shard in that case, but this will cause it to be removed from the insync allocations list @@ -757,7 +757,7 @@ private void verifyRelocatingState() { throw new IndexShardNotStartedException(shardId, state); } /* - * If the master cancelled recovery, the target will be removed and the recovery will be cancelled. However, it is still possible + * If the cluster-manager cancelled recovery, the target will be removed and the recovery will be cancelled. However, it is still possible * that we concurrently end up here and therefore have to protect that we do not mark the shard as relocated when its shard routing * says otherwise. */ @@ -3410,7 +3410,7 @@ private void innerAcquireReplicaOperationPermit( final IndexShardState shardState = state(); // only roll translog and update primary term if shard has made it past recovery // Having a new primary term here means that the old primary failed and that there is a new primary, which again - // means that the master will fail this shard as all initializing shards are failed when a primary is selected + // means that the cluster-manager will fail this shard as all initializing shards are failed when a primary is selected // We abort early here to prevent an ongoing recovery from the failed primary to mess with the global / local checkpoint if (shardState != IndexShardState.POST_RECOVERY && shardState != IndexShardState.STARTED) { throw new IndexShardNotStartedException(shardId, shardState); diff --git a/server/src/main/java/org/opensearch/index/shard/StoreRecovery.java b/server/src/main/java/org/opensearch/index/shard/StoreRecovery.java index 387f77a839d35..6eb7a29984e1c 100644 --- a/server/src/main/java/org/opensearch/index/shard/StoreRecovery.java +++ b/server/src/main/java/org/opensearch/index/shard/StoreRecovery.java @@ -561,7 +561,7 @@ private void restore( final StepListener indexIdListener = new StepListener<>(); // If the index UUID was not found in the recovery source we will have to load RepositoryData and resolve it by index name if (indexId.getId().equals(IndexMetadata.INDEX_UUID_NA_VALUE)) { - // BwC path, running against an old version master that did not add the IndexId to the recovery source + // BwC path, running against an old version cluster-manager that did not add the IndexId to the recovery source repository.getRepositoryData( ActionListener.map(indexIdListener, repositoryData -> repositoryData.resolveIndexId(indexId.getName())) ); diff --git a/server/src/main/java/org/opensearch/indices/cluster/IndicesClusterStateService.java b/server/src/main/java/org/opensearch/indices/cluster/IndicesClusterStateService.java index 9463b51ca3792..b7f8bc5a4e502 100644 --- a/server/src/main/java/org/opensearch/indices/cluster/IndicesClusterStateService.java +++ b/server/src/main/java/org/opensearch/indices/cluster/IndicesClusterStateService.java @@ -226,7 +226,7 @@ public synchronized void applyClusterState(final ClusterChangedEvent event) { final ClusterState state = event.state(); // we need to clean the shards and indices we have on this node, since we - // are going to recover them again once state persistence is disabled (no master / not recovered) + // are going to recover them again once state persistence is disabled (no cluster-manager / not recovered) // TODO: feels hacky, a block disables state persistence, and then we clean the allocated shards, maybe another flag in blocks? if (state.blocks().disableStatePersistence()) { for (AllocatedIndex indexService : indicesService) { @@ -244,7 +244,7 @@ public synchronized void applyClusterState(final ClusterChangedEvent event) { failMissingShards(state); - removeShards(state); // removes any local shards that doesn't match what the master expects + removeShards(state); // removes any local shards that doesn't match what the cluster-manager expects updateIndices(event); // can also fail shards, but these are then guaranteed to be in failedShardsCache @@ -267,17 +267,21 @@ private void updateFailedShardsCache(final ClusterState state) { return; } - DiscoveryNode masterNode = state.nodes().getMasterNode(); + DiscoveryNode clusterManagerNode = state.nodes().getMasterNode(); - // remove items from cache which are not in our routing table anymore and resend failures that have not executed on master yet + // remove items from cache which are not in our routing table anymore and + // resend failures that have not executed on cluster-manager yet for (Iterator> iterator = failedShardsCache.entrySet().iterator(); iterator.hasNext();) { ShardRouting failedShardRouting = iterator.next().getValue(); ShardRouting matchedRouting = localRoutingNode.getByShardId(failedShardRouting.shardId()); if (matchedRouting == null || matchedRouting.isSameAllocation(failedShardRouting) == false) { iterator.remove(); } else { - if (masterNode != null) { // TODO: can we remove this? Is resending shard failures the responsibility of shardStateAction? - String message = "master " + masterNode + " has not removed previously failed shard. resending shard failure"; + // TODO: can we remove this? Is resending shard failures the responsibility of shardStateAction? + if (clusterManagerNode != null) { + String message = "cluster-manager " + + clusterManagerNode + + " has not removed previously failed shard. resending shard failure"; logger.trace("[{}] re-sending failed shard [{}], reason [{}]", matchedRouting.shardId(), matchedRouting, message); shardStateAction.localShardFailed(matchedRouting, message, null, SHARD_STATE_ACTION_LISTENER, state); } @@ -401,7 +405,7 @@ private void removeIndices(final ClusterChangedEvent event) { } /** - * Notifies master about shards that don't exist but are supposed to be active on this node. + * Notifies cluster-manager about shards that don't exist but are supposed to be active on this node. * * @param state new cluster state */ @@ -415,7 +419,7 @@ private void failMissingShards(final ClusterState state) { if (shardRouting.initializing() == false && failedShardsCache.containsKey(shardId) == false && indicesService.getShardOrNull(shardId) == null) { - // the master thinks we are active, but we don't have this shard at all, mark it as failed + // the cluster-manager thinks we are active, but we don't have this shard at all, mark it as failed sendFailShard( shardRouting, "master marked shard as active, but shard has not been created, mark shard as failed", @@ -664,12 +668,12 @@ private void updateShard( final IndexShardState state = shard.state(); if (shardRouting.initializing() && (state == IndexShardState.STARTED || state == IndexShardState.POST_RECOVERY)) { - // the master thinks we are initializing, but we are already started or on POST_RECOVERY and waiting - // for master to confirm a shard started message (either master failover, or a cluster event before - // we managed to tell the master we started), mark us as started + // the cluster-manager thinks we are initializing, but we are already started or on POST_RECOVERY and waiting + // for cluster-manager to confirm a shard started message (either cluster-manager failover, or a cluster event before + // we managed to tell the cluster-manager we started), mark us as started if (logger.isTraceEnabled()) { logger.trace( - "{} master marked shard as initializing, but shard has state [{}], resending shard started to {}", + "{} cluster-manager marked shard as initializing, but shard has state [{}], resending shard started to {}", shardRouting.shardId(), state, nodes.getMasterNode() @@ -679,7 +683,7 @@ private void updateShard( shardStateAction.shardStarted( shardRouting, primaryTerm, - "master " + "cluster-manager " + nodes.getMasterNode() + " marked shard as initializing, but shard state is [" + state diff --git a/server/src/main/java/org/opensearch/indices/recovery/RecoverySettings.java b/server/src/main/java/org/opensearch/indices/recovery/RecoverySettings.java index 127127f5feace..8d9eab24f6027 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RecoverySettings.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RecoverySettings.java @@ -159,7 +159,7 @@ public RecoverySettings(Settings settings, ClusterSettings clusterSettings) { this.maxConcurrentFileChunks = INDICES_RECOVERY_MAX_CONCURRENT_FILE_CHUNKS_SETTING.get(settings); this.maxConcurrentOperations = INDICES_RECOVERY_MAX_CONCURRENT_OPERATIONS_SETTING.get(settings); // doesn't have to be fast as nodes are reconnected every 10s by default (see InternalClusterService.ReconnectToNodes) - // and we want to give the master time to remove a faulty node + // and we want to give the cluster-manager time to remove a faulty node this.retryDelayNetwork = INDICES_RECOVERY_RETRY_DELAY_NETWORK_SETTING.get(settings); this.internalActionTimeout = INDICES_RECOVERY_INTERNAL_ACTION_TIMEOUT_SETTING.get(settings); diff --git a/server/src/main/java/org/opensearch/indices/recovery/RecoveryTarget.java b/server/src/main/java/org/opensearch/indices/recovery/RecoveryTarget.java index 394b093059385..6dbbf21eb9360 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RecoveryTarget.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RecoveryTarget.java @@ -242,7 +242,7 @@ public void cancel(String reason) { * fail the recovery and call listener * * @param e exception that encapsulating the failure - * @param sendShardFailure indicates whether to notify the master of the shard failure + * @param sendShardFailure indicates whether to notify the cluster-manager of the shard failure */ public void fail(RecoveryFailedException e, boolean sendShardFailure) { if (finished.compareAndSet(false, true)) { diff --git a/server/src/main/java/org/opensearch/indices/store/TransportNodesListShardStoreMetadata.java b/server/src/main/java/org/opensearch/indices/store/TransportNodesListShardStoreMetadata.java index d385b2e6aa74e..538a8c871cb5f 100644 --- a/server/src/main/java/org/opensearch/indices/store/TransportNodesListShardStoreMetadata.java +++ b/server/src/main/java/org/opensearch/indices/store/TransportNodesListShardStoreMetadata.java @@ -203,8 +203,8 @@ private StoreFilesMetadata listStoreMetadata(NodeRequest request) throws IOExcep return new StoreFilesMetadata(shardId, Store.MetadataSnapshot.EMPTY, Collections.emptyList()); } // note that this may fail if it can't get access to the shard lock. Since we check above there is an active shard, this means: - // 1) a shard is being constructed, which means the master will not use a copy of this replica - // 2) A shard is shutting down and has not cleared it's content within lock timeout. In this case the master may not + // 1) a shard is being constructed, which means the cluster-manager will not use a copy of this replica + // 2) A shard is shutting down and has not cleared it's content within lock timeout. In this case the cluster-manager may not // reuse local resources. final Store.MetadataSnapshot metadataSnapshot = Store.readMetadataSnapshot( shardPath.resolveIndex(), diff --git a/server/src/main/java/org/opensearch/node/Node.java b/server/src/main/java/org/opensearch/node/Node.java index dc51af0fcfcfb..b01e9cbaa2b66 100644 --- a/server/src/main/java/org/opensearch/node/Node.java +++ b/server/src/main/java/org/opensearch/node/Node.java @@ -1182,7 +1182,7 @@ private Node stop() { // stop any changes happening as a result of cluster state changes injector.getInstance(IndicesClusterStateService.class).stop(); // close discovery early to not react to pings anymore. - // This can confuse other nodes and delay things - mostly if we're the master and we're running tests. + // This can confuse other nodes and delay things - mostly if we're the cluster manager and we're running tests. injector.getInstance(Discovery.class).stop(); // we close indices first, so operations won't be allowed on it injector.getInstance(ClusterService.class).stop(); @@ -1458,7 +1458,7 @@ protected ClusterInfoService newClusterInfoService( ) { final InternalClusterInfoService service = new InternalClusterInfoService(settings, clusterService, threadPool, client); if (DiscoveryNode.isMasterNode(settings)) { - // listen for state changes (this node starts/stops being the elected master, or new nodes are added) + // listen for state changes (this node starts/stops being the elected cluster manager, or new nodes are added) clusterService.addListener(service); } return service; diff --git a/server/src/main/java/org/opensearch/persistent/PersistentTasksClusterService.java b/server/src/main/java/org/opensearch/persistent/PersistentTasksClusterService.java index eaa623b53ac1c..e6a9ae673211f 100644 --- a/server/src/main/java/org/opensearch/persistent/PersistentTasksClusterService.java +++ b/server/src/main/java/org/opensearch/persistent/PersistentTasksClusterService.java @@ -60,7 +60,7 @@ import java.util.Objects; /** - * Component that runs only on the master node and is responsible for assigning running tasks to nodes + * Component that runs only on the cluster-manager node and is responsible for assigning running tasks to nodes */ public class PersistentTasksClusterService implements ClusterStateListener, Closeable { @@ -114,7 +114,7 @@ public void close() { } /** - * Creates a new persistent task on master node + * Creates a new persistent task on cluster-manager node * * @param taskId the task's id * @param taskName the task's name diff --git a/server/src/main/java/org/opensearch/persistent/PersistentTasksNodeService.java b/server/src/main/java/org/opensearch/persistent/PersistentTasksNodeService.java index 4a12208d675e9..0a88204c7cfe9 100644 --- a/server/src/main/java/org/opensearch/persistent/PersistentTasksNodeService.java +++ b/server/src/main/java/org/opensearch/persistent/PersistentTasksNodeService.java @@ -87,7 +87,7 @@ public PersistentTasksNodeService( @Override public void clusterChanged(ClusterChangedEvent event) { if (event.state().blocks().hasGlobalBlock(GatewayService.STATE_NOT_RECOVERED_BLOCK)) { - // wait until the gateway has recovered from disk, otherwise if the only master restarts + // wait until the gateway has recovered from disk, otherwise if the only cluster-manager restarts // we start cancelling all local tasks before cluster has a chance to recover. return; } @@ -103,18 +103,18 @@ public void clusterChanged(ClusterChangedEvent event) { // NULL STARTED Remove locally, Mark as PENDING_CANCEL, Cancel // NULL COMPLETED Remove locally - // Master states: + // Cluster-manager states: // NULL - doesn't exist in the cluster state // STARTED - exist in the cluster state // Local state: // NULL - we don't have task registered locally in runningTasks - // STARTED - registered in TaskManager, requires master notification when finishes - // PENDING_CANCEL - registered in TaskManager, doesn't require master notification when finishes - // COMPLETED - not registered in TaskManager, notified, waiting for master to remove it from CS so we can remove locally + // STARTED - registered in TaskManager, requires cluster-manager notification when finishes + // PENDING_CANCEL - registered in TaskManager, doesn't require cluster-manager notification when finishes + // COMPLETED - not registered in TaskManager, notified, waiting for cluster-manager to remove it from CS so we can remove locally // When task finishes if it is marked as STARTED or PENDING_CANCEL it is marked as COMPLETED and unregistered, - // If the task was STARTED, the master notification is also triggered (this is handled by unregisterTask() method, which is + // If the task was STARTED, the cluster-manager notification is also triggered (this is handled by unregisterTask() method, which is // triggered by PersistentTaskListener if (Objects.equals(tasks, previousTasks) == false || event.nodesChanged()) { @@ -162,7 +162,7 @@ public void clusterChanged(ClusterChangedEvent event) { ); runningTasks.remove(id); } else { - // task is running locally, but master doesn't know about it - that means that the persistent task was removed + // task is running locally, but cluster-manager doesn't know about it - that means that the persistent task was removed // cancel the task without notifying master logger.trace( "Found unregistered persistent task [{}] with id [{}] and allocation id [{}] - cancelling", @@ -286,7 +286,7 @@ public void onFailure(Exception notificationException) { } /** - * Unregisters and then cancels the locally running task using the task manager. No notification to master will be send upon + * Unregisters and then cancels the locally running task using the task manager. No notification to cluster-manager will be send upon * cancellation. */ private void cancelTask(Long allocationId) { diff --git a/server/src/main/java/org/opensearch/persistent/PersistentTasksService.java b/server/src/main/java/org/opensearch/persistent/PersistentTasksService.java index a52b623a7a843..c3d78bb614200 100644 --- a/server/src/main/java/org/opensearch/persistent/PersistentTasksService.java +++ b/server/src/main/java/org/opensearch/persistent/PersistentTasksService.java @@ -54,7 +54,7 @@ /** * This service is used by persistent tasks and allocated persistent tasks to communicate changes - * to the master node so that the master can update the cluster state and can track of the states + * to the cluster-manager node so that the cluster-manager can update the cluster state and can track of the states * of the persistent tasks. */ public class PersistentTasksService { @@ -74,7 +74,7 @@ public PersistentTasksService(ClusterService clusterService, ThreadPool threadPo } /** - * Notifies the master node to create new persistent task and to assign it to a node. + * Notifies the cluster-manager node to create new persistent task and to assign it to a node. */ public void sendStartRequest( final String taskId, @@ -89,7 +89,7 @@ public void sendStartRequest( } /** - * Notifies the master node about the completion of a persistent task. + * Notifies the cluster-manager node about the completion of a persistent task. *

    * When {@code failure} is {@code null}, the persistent task is considered as successfully completed. */ @@ -118,7 +118,7 @@ void sendCancelRequest(final long taskId, final String reason, final ActionListe } /** - * Notifies the master node that the state of a persistent task has changed. + * Notifies the cluster-manager node that the state of a persistent task has changed. *

    * Persistent task implementers shouldn't call this method directly and use * {@link AllocatedPersistentTask#updatePersistentTaskState} instead @@ -138,7 +138,7 @@ void sendUpdateStateRequest( } /** - * Notifies the master node to remove a persistent task from the cluster state + * Notifies the cluster-manager node to remove a persistent task from the cluster state */ public void sendRemoveRequest(final String taskId, final ActionListener> listener) { RemovePersistentTaskAction.Request request = new RemovePersistentTaskAction.Request(taskId); diff --git a/server/src/main/java/org/opensearch/persistent/package-info.java b/server/src/main/java/org/opensearch/persistent/package-info.java index 00260b56d2ddb..3eff441642c90 100644 --- a/server/src/main/java/org/opensearch/persistent/package-info.java +++ b/server/src/main/java/org/opensearch/persistent/package-info.java @@ -32,12 +32,12 @@ * In order to be resilient to node restarts, the persistent tasks are using the cluster state instead of a transport service to send * requests and responses. The execution is done in six phases: *

    - * 1. The coordinating node sends an ordinary transport request to the master node to start a new persistent task. This task is handled + * 1. The coordinating node sends an ordinary transport request to the cluster-manager node to start a new persistent task. This task is handled * by the {@link org.opensearch.persistent.PersistentTasksService}, which is using * {@link org.opensearch.persistent.PersistentTasksClusterService} to update cluster state with the record about running persistent * task. *

    - * 2. The master node updates the {@link org.opensearch.persistent.PersistentTasksCustomMetadata} in the cluster state to indicate + * 2. The cluster-manager node updates the {@link org.opensearch.persistent.PersistentTasksCustomMetadata} in the cluster state to indicate * that there is a new persistent task running in the system. *

    * 3. The {@link org.opensearch.persistent.PersistentTasksNodeService} running on every node in the cluster monitors changes in diff --git a/server/src/main/java/org/opensearch/repositories/RepositoriesService.java b/server/src/main/java/org/opensearch/repositories/RepositoriesService.java index e7c5804f458a0..b521da8453bb2 100644 --- a/server/src/main/java/org/opensearch/repositories/RepositoriesService.java +++ b/server/src/main/java/org/opensearch/repositories/RepositoriesService.java @@ -140,7 +140,7 @@ public RepositoriesService( /** * Registers new repository in the cluster *

    - * This method can be only called on the master node. It tries to create a new repository on the master + * This method can be only called on the cluster-manager node. It tries to create a new repository on the master * and if it was successful it adds new repository to cluster metadata. * * @param request register repository request @@ -172,7 +172,7 @@ public void registerRepository(final PutRepositoryRequest request, final ActionL registrationListener = listener; } - // Trying to create the new repository on master to make sure it works + // Trying to create the new repository on cluster-manager to make sure it works try { closeRepository(createRepository(newRepositoryMetadata, typesRegistry)); } catch (Exception e) { @@ -235,7 +235,7 @@ public void onFailure(String source, Exception e) { @Override public boolean mustAck(DiscoveryNode discoveryNode) { - // repository is created on both master and data nodes + // repository is created on both cluster-manager and data nodes return discoveryNode.isMasterNode() || discoveryNode.isDataNode(); } } @@ -245,7 +245,7 @@ public boolean mustAck(DiscoveryNode discoveryNode) { /** * Unregisters repository in the cluster *

    - * This method can be only called on the master node. It removes repository information from cluster metadata. + * This method can be only called on the cluster-manager node. It removes repository information from cluster metadata. * * @param request unregister repository request * @param listener unregister repository listener @@ -290,7 +290,7 @@ public ClusterState execute(ClusterState currentState) { @Override public boolean mustAck(DiscoveryNode discoveryNode) { - // repository was created on both master and data nodes + // repository was created on both cluster-manager and data nodes return discoveryNode.isMasterNode() || discoveryNode.isDataNode(); } } @@ -457,7 +457,7 @@ public void getRepositoryData(final String repositoryName, final ActionListener< /** * Returns registered repository *

    - * This method is called only on the master node + * This method is called only on the cluster-manager node * * @param repositoryName repository name * @return registered repository diff --git a/server/src/main/java/org/opensearch/repositories/Repository.java b/server/src/main/java/org/opensearch/repositories/Repository.java index c8907393824c2..18ad02bab48f9 100644 --- a/server/src/main/java/org/opensearch/repositories/Repository.java +++ b/server/src/main/java/org/opensearch/repositories/Repository.java @@ -68,7 +68,7 @@ *

      *
    • Data nodes call {@link Repository#snapshotShard} * for each shard
    • - *
    • When all shard calls return master calls {@link #finalizeSnapshot} with possible list of failures
    • + *
    • When all shard calls return cluster-manager calls {@link #finalizeSnapshot} with possible list of failures
    • *
    */ public interface Repository extends LifecycleComponent { @@ -134,7 +134,7 @@ default Repository create(RepositoryMetadata metadata, Function - * This method is called on master after all shards are snapshotted. + * This method is called on cluster-manager after all shards are snapshotted. * * @param shardGenerations updated shard generations * @param repositoryStateId the unique id identifying the state of the repository when the snapshot began @@ -197,7 +197,7 @@ default RepositoryStats stats() { } /** - * Verifies repository on the master node and returns the verification token. + * Verifies repository on the cluster-manager node and returns the verification token. *

    * If the verification token is not null, it's passed to all data nodes for verification. If it's null - no * additional verification is required diff --git a/server/src/main/java/org/opensearch/repositories/blobstore/BlobStoreRepository.java b/server/src/main/java/org/opensearch/repositories/blobstore/BlobStoreRepository.java index 7d6cdef76198f..d95612e31ca38 100644 --- a/server/src/main/java/org/opensearch/repositories/blobstore/BlobStoreRepository.java +++ b/server/src/main/java/org/opensearch/repositories/blobstore/BlobStoreRepository.java @@ -318,7 +318,7 @@ public abstract class BlobStoreRepository extends AbstractLifecycleComponent imp *

  • All repositories that are read-only, i.e. for which {@link #isReadOnly()} returns {@code true} because there are no * guarantees that another cluster is not writing to the repository at the same time
  • *
  • The node finds itself in a mixed-version cluster containing nodes older than - * {@link RepositoryMetadata#REPO_GEN_IN_CS_VERSION} where the master node does not update the value of + * {@link RepositoryMetadata#REPO_GEN_IN_CS_VERSION} where the cluster-manager node does not update the value of * {@link RepositoryMetadata#generation()} when writing a new {@code index-N} blob
  • *
  • The value of {@link RepositoryMetadata#generation()} for this repository is {@link RepositoryData#UNKNOWN_REPO_GEN} * indicating that no consistent repository generation is tracked in the cluster state yet.
  • @@ -726,8 +726,8 @@ public void deleteSnapshots( protected void doRun() throws Exception { final Map rootBlobs = blobContainer().listBlobs(); final RepositoryData repositoryData = safeRepositoryData(repositoryStateId, rootBlobs); - // Cache the indices that were found before writing out the new index-N blob so that a stuck master will never - // delete an index that was created by another master node after writing this index-N blob. + // Cache the indices that were found before writing out the new index-N blob so that a stuck cluster-manager will never + // delete an index that was created by another cluster-manager node after writing this index-N blob. final Map foundIndices = blobStore().blobContainer(indicesPath()).children(); doDeleteShardSnapshots( snapshotIds, @@ -1371,9 +1371,9 @@ public void finalizeSnapshot( ); }, onUpdateFailure), 2 + indices.size()); - // We ignore all FileAlreadyExistsException when writing metadata since otherwise a master failover while in this method will - // mean that no snap-${uuid}.dat blob is ever written for this snapshot. This is safe because any updated version of the - // index or global metadata will be compatible with the segments written in this snapshot as well. + // We ignore all FileAlreadyExistsException when writing metadata since otherwise a cluster-manager failover + // while in this method will mean that no snap-${uuid}.dat blob is ever written for this snapshot. This is safe because + // any updated version of the index or global metadata will be compatible with the segments written in this snapshot as well. // Failing on an already existing index-${repoGeneration} below ensures that the index.latest blob is not updated in a way // that decrements the generation it points at @@ -1546,7 +1546,11 @@ public String startVerification() { return seed; } } catch (Exception exp) { - throw new RepositoryVerificationException(metadata.name(), "path " + basePath() + " is not accessible on master node", exp); + throw new RepositoryVerificationException( + metadata.name(), + "path " + basePath() + " is not accessible on cluster-manager node", + exp + ); } } @@ -2782,15 +2786,15 @@ public void verify(String seed, DiscoveryNode localNode) { } catch (NoSuchFileException e) { throw new RepositoryVerificationException( metadata.name(), - "a file written by master to the store [" + "a file written by cluster-manager to the store [" + blobStore() + "] cannot be accessed on the node [" + localNode + "]. " + "This might indicate that the store [" + blobStore() - + "] is not shared between this node and the master node or " - + "that permissions on the store don't allow reading files written by the master node", + + "] is not shared between this node and the cluster-manager node or " + + "that permissions on the store don't allow reading files written by the cluster-manager node", e ); } catch (Exception e) { diff --git a/server/src/main/java/org/opensearch/repositories/blobstore/package-info.java b/server/src/main/java/org/opensearch/repositories/blobstore/package-info.java index a960cfe70aee7..aacd386cd4bd7 100644 --- a/server/src/main/java/org/opensearch/repositories/blobstore/package-info.java +++ b/server/src/main/java/org/opensearch/repositories/blobstore/package-info.java @@ -39,7 +39,7 @@ * {@link org.opensearch.repositories.blobstore.BlobStoreRepository#getBlobContainer()}.

    * *

    The blob store is written to and read from by cluster-manager-eligible nodes and data nodes. All metadata related to a snapshot's - * scope and health is written by the master node.

    + * scope and health is written by the cluster-manager node.

    *

    The data-nodes on the other hand, write the data for each individual shard but do not write any blobs outside of shard directories for * shards that they hold the primary of. For each shard, the data-node holding the shard's primary writes the actual data in form of * the shard's segment files to the repository as well as metadata about all the segment files that the repository stores for the shard.

    @@ -131,19 +131,19 @@ *

    Writing Updated RepositoryData to the Repository

    * *

    Writing an updated {@link org.opensearch.repositories.RepositoryData} to a blob store repository is an operation that uses - * the cluster state to ensure that a specific {@code index-N} blob is never accidentally overwritten in a master failover scenario. + * the cluster state to ensure that a specific {@code index-N} blob is never accidentally overwritten in a cluster-manager failover scenario. * The specific steps to writing a new {@code index-N} blob and thus making changes from a snapshot-create or delete operation visible - * to read operations on the repository are as follows and all run on the master node:

    + * to read operations on the repository are as follows and all run on the cluster-manager node:

    * *
      *
    1. Write an updated value of {@link org.opensearch.cluster.metadata.RepositoryMetadata} for the repository that has the same * {@link org.opensearch.cluster.metadata.RepositoryMetadata#generation()} as the existing entry and has a value of * {@link org.opensearch.cluster.metadata.RepositoryMetadata#pendingGeneration()} one greater than the {@code pendingGeneration} of the * existing entry.
    2. - *
    3. On the same master node, after the cluster state has been updated in the first step, write the new {@code index-N} blob and + *
    4. On the same cluster-manager node, after the cluster state has been updated in the first step, write the new {@code index-N} blob and * also update the contents of the {@code index.latest} blob. Note that updating the index.latest blob is done on a best effort - * basis and that there is a chance for a stuck master-node to overwrite the contents of the {@code index.latest} blob after a newer - * {@code index-N} has been written by another master node. This is acceptable since the contents of {@code index.latest} are not used + * basis and that there is a chance for a stuck cluster-manager node to overwrite the contents of the {@code index.latest} blob after a newer + * {@code index-N} has been written by another cluster-manager node. This is acceptable since the contents of {@code index.latest} are not used * during normal operation of the repository and must only be correct for purposes of mounting the contents of a * {@link org.opensearch.repositories.blobstore.BlobStoreRepository} as a read-only url repository.
    5. *
    6. After the write has finished, set the value of {@code RepositoriesState.State#generation} to the value used for @@ -152,7 +152,7 @@ * last valid {@code index-N} blob in the repository.
    7. *
    * - *

    If either of the last two steps in the above fails or master fails over to a new node at any point, then a subsequent operation + *

    If either of the last two steps in the above fails or cluster-manager fails over to a new node at any point, then a subsequent operation * trying to write a new {@code index-N} blob will never use the same value of {@code N} used by a previous attempt. It will always start * over at the first of the above three steps, incrementing the {@code pendingGeneration} generation before attempting a write, thus * ensuring no overwriting of a {@code index-N} blob ever to occur. The use of the cluster state to track the latest repository generation @@ -208,7 +208,7 @@ * *

    Finalizing the Snapshot

    * - *

    After all primaries have finished writing the necessary segment files to the blob store in the previous step, the master node moves on + *

    After all primaries have finished writing the necessary segment files to the blob store in the previous step, the cluster-manager node moves on * to finalizing the snapshot by invoking {@link org.opensearch.repositories.Repository#finalizeSnapshot}. This method executes the * following actions in order:

    *
      @@ -222,7 +222,7 @@ * *

      Deleting a Snapshot

      * - *

      Deleting a snapshot is an operation that is exclusively executed on the master node that runs through the following sequence of + *

      Deleting a snapshot is an operation that is exclusively executed on the cluster-manager node that runs through the following sequence of * action when {@link org.opensearch.repositories.blobstore.BlobStoreRepository#deleteSnapshots} is invoked:

      * *
        diff --git a/server/src/main/java/org/opensearch/repositories/fs/FsRepository.java b/server/src/main/java/org/opensearch/repositories/fs/FsRepository.java index e57246265bb66..51417733ebe61 100644 --- a/server/src/main/java/org/opensearch/repositories/fs/FsRepository.java +++ b/server/src/main/java/org/opensearch/repositories/fs/FsRepository.java @@ -118,7 +118,7 @@ public FsRepository( if (location.isEmpty()) { logger.warn( "the repository location is missing, it should point to a shared file system location" - + " that is available on all master and data nodes" + + " that is available on all cluster-manager and data nodes" ); throw new RepositoryException(metadata.name(), "missing location"); } diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetAliasesAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetAliasesAction.java index 4ff519e81f9cd..44e2ace0f7cf4 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetAliasesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetAliasesAction.java @@ -187,7 +187,7 @@ static RestResponse buildRestResponse( public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { // The TransportGetAliasesAction was improved do the same post processing as is happening here. // We can't remove this logic yet to support mixed clusters. We should be able to remove this logic here - // in when 8.0 becomes the new version in the master branch. + // in when 8.0 becomes the new version in the main branch. final boolean namesProvided = request.hasParam("name"); final String[] aliases = request.paramAsStringArrayOrEmptyIfAll("name"); diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestIndicesAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestIndicesAction.java index 8d3a6e8b93916..ed075d2ce7908 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestIndicesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestIndicesAction.java @@ -204,7 +204,7 @@ private void sendGetSettingsRequest( final String[] indices, final IndicesOptions indicesOptions, final boolean local, - final TimeValue masterNodeTimeout, + final TimeValue clusterManagerNodeTimeout, final NodeClient client, final ActionListener listener ) { @@ -212,7 +212,7 @@ private void sendGetSettingsRequest( request.indices(indices); request.indicesOptions(indicesOptions); request.local(local); - request.masterNodeTimeout(masterNodeTimeout); + request.masterNodeTimeout(clusterManagerNodeTimeout); request.names(IndexSettings.INDEX_SEARCH_THROTTLED.getKey()); client.admin().indices().getSettings(request, listener); @@ -222,7 +222,7 @@ private void sendClusterStateRequest( final String[] indices, final IndicesOptions indicesOptions, final boolean local, - final TimeValue masterNodeTimeout, + final TimeValue clusterManagerNodeTimeout, final NodeClient client, final ActionListener listener ) { @@ -231,7 +231,7 @@ private void sendClusterStateRequest( request.indices(indices); request.indicesOptions(indicesOptions); request.local(local); - request.masterNodeTimeout(masterNodeTimeout); + request.masterNodeTimeout(clusterManagerNodeTimeout); client.admin().cluster().state(request, listener); } @@ -240,7 +240,7 @@ private void sendClusterHealthRequest( final String[] indices, final IndicesOptions indicesOptions, final boolean local, - final TimeValue masterNodeTimeout, + final TimeValue clusterManagerNodeTimeout, final NodeClient client, final ActionListener listener ) { @@ -249,7 +249,7 @@ private void sendClusterHealthRequest( request.indices(indices); request.indicesOptions(indicesOptions); request.local(local); - request.masterNodeTimeout(masterNodeTimeout); + request.masterNodeTimeout(clusterManagerNodeTimeout); client.admin().cluster().health(request, listener); } diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java index 6abadc00181b7..0826aa2cabb8d 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java @@ -106,17 +106,17 @@ private Table buildTable(RestRequest request, ClusterStateResponse state) { DiscoveryNodes nodes = state.getState().nodes(); table.startRow(); - DiscoveryNode master = nodes.get(nodes.getMasterNodeId()); - if (master == null) { + DiscoveryNode clusterManager = nodes.get(nodes.getMasterNodeId()); + if (clusterManager == null) { table.addCell("-"); table.addCell("-"); table.addCell("-"); table.addCell("-"); } else { - table.addCell(master.getId()); - table.addCell(master.getHostName()); - table.addCell(master.getHostAddress()); - table.addCell(master.getName()); + table.addCell(clusterManager.getId()); + table.addCell(clusterManager.getHostName()); + table.addCell(clusterManager.getHostAddress()); + table.addCell(clusterManager.getName()); } table.endRow(); diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestNodesAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestNodesAction.java index 751ce9f8bb57a..39e9c445c1e38 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestNodesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestNodesAction.java @@ -334,7 +334,7 @@ Table buildTable( ) { DiscoveryNodes nodes = state.getState().nodes(); - String masterId = nodes.getMasterNodeId(); + String clusterManagerId = nodes.getMasterNodeId(); Table table = getTableWithHeader(req); for (DiscoveryNode node : nodes) { @@ -424,7 +424,7 @@ Table buildTable( roles = node.getRoles().stream().map(DiscoveryNodeRole::roleNameAbbreviation).sorted().collect(Collectors.joining()); } table.addCell(roles); - table.addCell(masterId == null ? "x" : masterId.equals(node.getId()) ? "*" : "-"); + table.addCell(clusterManagerId == null ? "x" : clusterManagerId.equals(node.getId()) ? "*" : "-"); table.addCell(node.getName()); CompletionStats completionStats = indicesStats == null ? null : stats.getIndices().getCompletion(); diff --git a/server/src/main/java/org/opensearch/snapshots/InternalSnapshotsInfoService.java b/server/src/main/java/org/opensearch/snapshots/InternalSnapshotsInfoService.java index 5b44b435042e5..2314cbd11dfdd 100644 --- a/server/src/main/java/org/opensearch/snapshots/InternalSnapshotsInfoService.java +++ b/server/src/main/java/org/opensearch/snapshots/InternalSnapshotsInfoService.java @@ -176,8 +176,8 @@ public void clusterChanged(ClusterChangedEvent event) { } } else if (event.previousState().nodes().isLocalNodeElectedMaster()) { - // TODO Maybe just clear out non-ongoing snapshot recoveries is the node is master eligible, so that we don't - // have to repopulate the data over and over in an unstable master situation? + // TODO Maybe just clear out non-ongoing snapshot recoveries is the node is cluster-manager eligible, so that we don't + // have to repopulate the data over and over in an unstable cluster-manager situation? synchronized (mutex) { // information only needed on current master knownSnapshotShards = ImmutableOpenMap.of(); diff --git a/server/src/main/java/org/opensearch/snapshots/RestoreService.java b/server/src/main/java/org/opensearch/snapshots/RestoreService.java index e1b143b5f5274..4e9f13408e547 100644 --- a/server/src/main/java/org/opensearch/snapshots/RestoreService.java +++ b/server/src/main/java/org/opensearch/snapshots/RestoreService.java @@ -958,7 +958,7 @@ public void onFailure(final String source, final Exception e) { @Override public void onNoLongerMaster(String source) { - logger.debug("no longer master while processing restore state update [{}]", source); + logger.debug("no longer cluster-manager while processing restore state update [{}]", source); } } diff --git a/server/src/main/java/org/opensearch/snapshots/SnapshotShardsService.java b/server/src/main/java/org/opensearch/snapshots/SnapshotShardsService.java index b6c0b63efe3d3..385f3eda2170b 100644 --- a/server/src/main/java/org/opensearch/snapshots/SnapshotShardsService.java +++ b/server/src/main/java/org/opensearch/snapshots/SnapshotShardsService.java @@ -103,7 +103,7 @@ public class SnapshotShardsService extends AbstractLifecycleComponent implements private final Map> shardSnapshots = new HashMap<>(); - // A map of snapshots to the shardIds that we already reported to the master as failed + // A map of snapshots to the shardIds that we already reported to the cluster-manager as failed private final TransportRequestDeduplicator remoteFailedRequestDeduplicator = new TransportRequestDeduplicator<>(); @@ -148,9 +148,9 @@ public void clusterChanged(ClusterChangedEvent event) { } } - String previousMasterNodeId = event.previousState().nodes().getMasterNodeId(); + String previousClusterManagerNodeId = event.previousState().nodes().getMasterNodeId(); String currentMasterNodeId = event.state().nodes().getMasterNodeId(); - if (currentMasterNodeId != null && currentMasterNodeId.equals(previousMasterNodeId) == false) { + if (currentMasterNodeId != null && currentMasterNodeId.equals(previousClusterManagerNodeId) == false) { syncShardStatsOnNewMaster(event); } @@ -251,7 +251,7 @@ private void startNewSnapshots(SnapshotsInProgress snapshotsInProgress) { final IndexShardSnapshotStatus snapshotStatus = snapshotShards.get(shard.key); if (snapshotStatus == null) { // due to CS batching we might have missed the INIT state and straight went into ABORTED - // notify master that abort has completed by moving to FAILED + // notify cluster-manager that abort has completed by moving to FAILED if (shard.value.state() == ShardState.ABORTED && localNodeId.equals(shard.value.nodeId())) { notifyFailedSnapshotShard(snapshot, shard.key, shard.value.reason()); } @@ -424,7 +424,7 @@ private static String getShardStateId(IndexShard indexShard, IndexCommit snapsho } /** - * Checks if any shards were processed that the new master doesn't know about + * Checks if any shards were processed that the new cluster-manager doesn't know about */ private void syncShardStatsOnNewMaster(ClusterChangedEvent event) { SnapshotsInProgress snapshotsInProgress = event.state().custom(SnapshotsInProgress.TYPE); @@ -433,7 +433,7 @@ private void syncShardStatsOnNewMaster(ClusterChangedEvent event) { } // Clear request deduplicator since we need to send all requests that were potentially not handled by the previous - // master again + // cluster-manager again remoteFailedRequestDeduplicator.clear(); for (SnapshotsInProgress.Entry snapshot : snapshotsInProgress.entries()) { if (snapshot.state() == State.STARTED || snapshot.state() == State.ABORTED) { @@ -446,22 +446,22 @@ private void syncShardStatsOnNewMaster(ClusterChangedEvent event) { if (masterShard != null && masterShard.state().completed() == false) { final IndexShardSnapshotStatus.Copy indexShardSnapshotStatus = localShard.getValue().asCopy(); final Stage stage = indexShardSnapshotStatus.getStage(); - // Master knows about the shard and thinks it has not completed + // cluster-manager knows about the shard and thinks it has not completed if (stage == Stage.DONE) { - // but we think the shard is done - we need to make new master know that the shard is done + // but we think the shard is done - we need to make new cluster-manager know that the shard is done logger.debug( - "[{}] new master thinks the shard [{}] is not completed but the shard is done locally, " - + "updating status on the master", + "[{}] new cluster-manager thinks the shard [{}] is not completed but the shard is done locally, " + + "updating status on the cluster-manager", snapshot.snapshot(), shardId ); notifySuccessfulSnapshotShard(snapshot.snapshot(), shardId, localShard.getValue().generation()); } else if (stage == Stage.FAILURE) { - // but we think the shard failed - we need to make new master know that the shard failed + // but we think the shard failed - we need to make new cluster-manager know that the shard failed logger.debug( - "[{}] new master thinks the shard [{}] is not completed but the shard failed locally, " - + "updating status on master", + "[{}] new cluster-manager thinks the shard [{}] is not completed but the shard failed locally, " + + "updating status on cluster-manager", snapshot.snapshot(), shardId ); @@ -474,7 +474,7 @@ private void syncShardStatsOnNewMaster(ClusterChangedEvent event) { } } - /** Notify the master node that the given shard has been successfully snapshotted **/ + /** Notify the cluster-manager node that the given shard has been successfully snapshotted **/ private void notifySuccessfulSnapshotShard(final Snapshot snapshot, final ShardId shardId, String generation) { assert generation != null; sendSnapshotShardUpdate( @@ -484,7 +484,7 @@ private void notifySuccessfulSnapshotShard(final Snapshot snapshot, final ShardI ); } - /** Notify the master node that the given shard failed to be snapshotted **/ + /** Notify the cluster-manager node that the given shard failed to be snapshotted **/ private void notifyFailedSnapshotShard(final Snapshot snapshot, final ShardId shardId, final String failure) { sendSnapshotShardUpdate( snapshot, @@ -493,7 +493,7 @@ private void notifyFailedSnapshotShard(final Snapshot snapshot, final ShardId sh ); } - /** Updates the shard snapshot status by sending a {@link UpdateIndexShardSnapshotStatusRequest} to the master node */ + /** Updates the shard snapshot status by sending a {@link UpdateIndexShardSnapshotStatusRequest} to the cluster-manager node */ private void sendSnapshotShardUpdate(final Snapshot snapshot, final ShardId shardId, final ShardSnapshotStatus status) { remoteFailedRequestDeduplicator.executeOnce( new UpdateIndexShardSnapshotStatusRequest(snapshot, shardId, status), diff --git a/server/src/main/java/org/opensearch/snapshots/SnapshotsService.java b/server/src/main/java/org/opensearch/snapshots/SnapshotsService.java index 122c13337fa70..746cccef8e596 100644 --- a/server/src/main/java/org/opensearch/snapshots/SnapshotsService.java +++ b/server/src/main/java/org/opensearch/snapshots/SnapshotsService.java @@ -134,7 +134,7 @@ import static org.opensearch.cluster.SnapshotsInProgress.completed; /** - * Service responsible for creating snapshots. This service runs all the steps executed on the master node during snapshot creation and + * Service responsible for creating snapshots. This service runs all the steps executed on the cluster-manager node during snapshot creation and * deletion. * See package level documentation of {@link org.opensearch.snapshots} for details. */ @@ -303,8 +303,8 @@ public ClusterState execute(ClusterState currentState) { } SnapshotsInProgress snapshots = currentState.custom(SnapshotsInProgress.TYPE); // Fail if there are any concurrently running snapshots. The only exception to this being a snapshot in INIT state from a - // previous master that we can simply ignore and remove from the cluster state because we would clean it up from the - // cluster state anyway in #applyClusterState. + // previous cluster-manager that we can simply ignore and remove from the cluster state because we would clean it up from + // the cluster state anyway in #applyClusterState. if (snapshots != null && snapshots.entries() .stream() @@ -452,7 +452,8 @@ public ClusterState execute(ClusterState currentState) { ); } // Fail if there are any concurrently running snapshots. The only exception to this being a snapshot in INIT state from a - // previous master that we can simply ignore and remove from the cluster state because we would clean it up from the + // previous cluster-manager that we can simply ignore and remove from the cluster state because we would clean it up from + // the // cluster state anyway in #applyClusterState. if (concurrentOperationsAllowed == false && runningSnapshots.stream().anyMatch(entry -> entry.state() != State.INIT)) { throw new ConcurrentSnapshotExecutionException(repositoryName, snapshotName, " a snapshot is already running"); @@ -807,7 +808,7 @@ public void clusterStateProcessed(String source, ClusterState oldState, ClusterS runReadyClone(target, sourceSnapshot, shardStatusBefore, repoShardId, repository); } } else { - // Extremely unlikely corner case of master failing over between between starting the clone and + // Extremely unlikely corner case of cluster-manager failing over between between starting the clone and // starting shard clones. logger.warn("Did not find expected entry [{}] in the cluster state", cloneEntry); } @@ -986,8 +987,10 @@ protected void doRun() { ); } if (clusterState.nodes().getMinNodeVersion().onOrAfter(NO_REPO_INITIALIZE_VERSION) == false) { - // In mixed version clusters we initialize the snapshot in the repository so that in case of a master failover to an - // older version master node snapshot finalization (that assumes initializeSnapshot was called) produces a valid + // In mixed version clusters we initialize the snapshot in the repository so that in case of a cluster-manager + // failover to an + // older version cluster-manager node snapshot finalization (that assumes initializeSnapshot was called) produces a + // valid // snapshot. repository.initializeSnapshot( snapshot.snapshot().getSnapshotId(), @@ -1116,11 +1119,14 @@ public void onFailure(String source, Exception e) { @Override public void onNoLongerMaster(String source) { - // We are not longer a master - we shouldn't try to do any cleanup - // The new master will take care of it - logger.warn("[{}] failed to create snapshot - no longer a master", snapshot.snapshot().getSnapshotId()); + // We are not longer a cluster-manager - we shouldn't try to do any cleanup + // The new cluster-manager will take care of it + logger.warn( + "[{}] failed to create snapshot - no longer a cluster-manager", + snapshot.snapshot().getSnapshotId() + ); userCreateSnapshotListener.onFailure( - new SnapshotException(snapshot.snapshot(), "master changed during snapshot initialization") + new SnapshotException(snapshot.snapshot(), "cluster-manager changed during snapshot initialization") ); } @@ -1238,7 +1244,7 @@ private static Metadata metadataForSnapshot(SnapshotsInProgress.Entry snapshot, /** * Returns status of the currently running snapshots *

        - * This method is executed on master node + * This method is executed on cluster-manager node *

        * * @param snapshotsInProgress snapshots in progress in the cluster state @@ -1298,20 +1304,22 @@ public static List currentSnapshots( public void applyClusterState(ClusterChangedEvent event) { try { if (event.localNodeMaster()) { - // We don't remove old master when master flips anymore. So, we need to check for change in master + // We don't remove old cluster-manager when cluster-manager flips anymore. So, we need to check for change in + // cluster-manager SnapshotsInProgress snapshotsInProgress = event.state().custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY); - final boolean newMaster = event.previousState().nodes().isLocalNodeElectedMaster() == false; + final boolean newClusterManager = event.previousState().nodes().isLocalNodeElectedMaster() == false; processExternalChanges( - newMaster || removedNodesCleanupNeeded(snapshotsInProgress, event.nodesDelta().removedNodes()), + newClusterManager || removedNodesCleanupNeeded(snapshotsInProgress, event.nodesDelta().removedNodes()), event.routingTableChanged() && waitingShardsStartedOrUnassigned(snapshotsInProgress, event) ); } else if (snapshotCompletionListeners.isEmpty() == false) { - // We have snapshot listeners but are not the master any more. Fail all waiting listeners except for those that already + // We have snapshot listeners but are not the cluster-manager any more. Fail all waiting listeners except for those that + // already // have their snapshots finalizing (those that are already finalizing will fail on their own from to update the cluster // state). for (Snapshot snapshot : new HashSet<>(snapshotCompletionListeners.keySet())) { if (endingSnapshots.add(snapshot)) { - failSnapshotCompletionListeners(snapshot, new SnapshotException(snapshot, "no longer master")); + failSnapshotCompletionListeners(snapshot, new SnapshotException(snapshot, "no longer cluster-manager")); } } } @@ -1326,7 +1334,7 @@ public void applyClusterState(ClusterChangedEvent event) { /** * Cleanup all snapshots found in the given cluster state that have no more work left: * 1. Completed snapshots - * 2. Snapshots in state INIT that a previous master of an older version failed to start + * 2. Snapshots in state INIT that a previous cluster-manager of an older version failed to start * 3. Snapshots in any other state that have all their shard tasks completed */ private void endCompletedSnapshots(ClusterState state) { @@ -1402,11 +1410,11 @@ private static boolean assertNoDanglingSnapshots(ClusterState state) { } /** - * Updates the state of in-progress snapshots in reaction to a change in the configuration of the cluster nodes (master fail-over or + * Updates the state of in-progress snapshots in reaction to a change in the configuration of the cluster nodes (cluster-manager fail-over or * disconnect of a data node that was executing a snapshot) or a routing change that started shards whose snapshot state is * {@link SnapshotsInProgress.ShardState#WAITING}. * - * @param changedNodes true iff either a master fail-over occurred or a data node that was doing snapshot work got removed from the + * @param changedNodes true iff either a cluster-manager fail-over occurred or a data node that was doing snapshot work got removed from the * cluster * @param startShards true iff any waiting shards were started due to a routing change */ @@ -1863,7 +1871,7 @@ private List>> endAndGetListe /** * Handles failure to finalize a snapshot. If the exception indicates that this node was unable to publish a cluster state and stopped - * being the master node, then fail all snapshot create and delete listeners executing on this node by delegating to + * being the cluster-manager node, then fail all snapshot create and delete listeners executing on this node by delegating to * {@link #failAllListenersOnMasterFailOver}. Otherwise, i.e. as a result of failing to write to the snapshot repository for some * reason, remove the snapshot's {@link SnapshotsInProgress.Entry} from the cluster state and move on with other queued snapshot * operations if there are any. @@ -1875,7 +1883,7 @@ private List>> endAndGetListe private void handleFinalizationFailure(Exception e, SnapshotsInProgress.Entry entry, RepositoryData repositoryData) { Snapshot snapshot = entry.snapshot(); if (ExceptionsHelper.unwrap(e, NotMasterException.class, FailedToCommitClusterStateException.class) != null) { - // Failure due to not being master any more, don't try to remove snapshot from cluster state the next master + // Failure due to not being cluster-manager any more, don't try to remove snapshot from cluster state the next cluster-manager // will try ending this snapshot again logger.debug(() -> new ParameterizedMessage("[{}] failed to update cluster state during snapshot finalization", snapshot), e); failSnapshotCompletionListeners( @@ -2082,7 +2090,7 @@ public void onFailure(String source, Exception e) { @Override public void onNoLongerMaster(String source) { - failure.addSuppressed(new SnapshotException(snapshot, "no longer master")); + failure.addSuppressed(new SnapshotException(snapshot, "no longer cluster-manager")); failSnapshotCompletionListeners(snapshot, failure); failAllListenersOnMasterFailOver(new NotMasterException(source)); if (listener != null) { @@ -2249,7 +2257,7 @@ public ClusterState execute(ClusterState currentState) throws Exception { SnapshotsInProgress.of( snapshots.entries() .stream() - // remove init state snapshot we found from a previous master if there was one + // remove init state snapshot we found from a previous cluster-manager if there was one .filter(existing -> abortedDuringInit == false || existing.equals(snapshotEntry) == false) .map(existing -> { if (existing.equals(snapshotEntry)) { @@ -2297,8 +2305,8 @@ public void clusterStateProcessed(String source, ClusterState oldState, ClusterS ); }, e -> { if (ExceptionsHelper.unwrap(e, NotMasterException.class, FailedToCommitClusterStateException.class) != null) { - logger.warn("master failover before deleted snapshot could complete", e); - // Just pass the exception to the transport handler as is so it is retried on the new master + logger.warn("cluster-manager failover before deleted snapshot could complete", e); + // Just pass the exception to the transport handler as is so it is retried on the new cluster-manager listener.onFailure(e); } else { logger.warn("deleted snapshot failed", e); @@ -2588,7 +2596,7 @@ public void clusterStateProcessed(String source, ClusterState oldState, ClusterS */ private static boolean isWritingToRepository(SnapshotsInProgress.Entry entry) { if (entry.state().completed()) { - // Entry is writing to the repo because it's finalizing on master + // Entry is writing to the repo because it's finalizing on cluster-manager return true; } for (ObjectCursor value : entry.shards().values()) { @@ -2769,19 +2777,19 @@ protected void handleListeners(List> deleteListeners) { } /** - * Handle snapshot or delete failure due to not being master any more so we don't try to do run additional cluster state updates. - * The next master will try handling the missing operations. All we can do is fail all the listeners on this master node so that + * Handle snapshot or delete failure due to not being cluster-manager any more so we don't try to do run additional cluster state updates. + * The next cluster-manager will try handling the missing operations. All we can do is fail all the listeners on this cluster-manager node so that * transport requests return and we don't leak listeners. * - * @param e exception that caused us to realize we are not master any longer + * @param e exception that caused us to realize we are not cluster-manager any longer */ private void failAllListenersOnMasterFailOver(Exception e) { - logger.debug("Failing all snapshot operation listeners because this node is not master any longer", e); + logger.debug("Failing all snapshot operation listeners because this node is not cluster-manager any longer", e); synchronized (currentlyFinalizing) { if (ExceptionsHelper.unwrap(e, NotMasterException.class, FailedToCommitClusterStateException.class) != null) { repositoryOperations.clear(); for (Snapshot snapshot : new HashSet<>(snapshotCompletionListeners.keySet())) { - failSnapshotCompletionListeners(snapshot, new SnapshotException(snapshot, "no longer master")); + failSnapshotCompletionListeners(snapshot, new SnapshotException(snapshot, "no longer cluster-manager")); } final Exception wrapped = new RepositoryException("_all", "Failed to update cluster state during repository operation", e); for (Iterator>> iterator = snapshotDeletionListeners.values().iterator(); iterator.hasNext();) { @@ -3213,7 +3221,7 @@ public boolean assertAllListenersResolved() { * * If the inner loop finds that a shard update task applies to a given snapshot and either a shard-snapshot or shard-clone operation in * it then it will update the state of the snapshot entry accordingly. If that update was a noop, then the task is removed from the - * iteration as it was already applied before and likely just arrived on the master node again due to retries upstream. + * iteration as it was already applied before and likely just arrived on the cluster-manager node again due to retries upstream. * If the update was not a noop, then it means that the shard it applied to is now available for another snapshot or clone operation * to be re-assigned if there is another snapshot operation that is waiting for the shard to become available. We therefore record the * fact that a task was executed by adding it to a collection of executed tasks. If a subsequent execution of the outer loop finds that @@ -3267,7 +3275,8 @@ public boolean assertAllListenersResolved() { updateSnapshotState, entry ); - assert false : "This should never happen, master will not submit a state update for a non-existing clone"; + assert false + : "This should never happen, cluster-manager will not submit a state update for a non-existing clone"; continue; } if (existing.state().completed()) { @@ -3810,8 +3819,8 @@ synchronized void addFinalization(SnapshotsInProgress.Entry entry, Metadata meta } /** - * Clear all state associated with running snapshots. To be used on master-failover if the current node stops - * being master. + * Clear all state associated with running snapshots. To be used on cluster-manager-failover if the current node stops + * being cluster-manager. */ synchronized void clear() { snapshotsToFinalize.clear(); diff --git a/server/src/main/java/org/opensearch/snapshots/package-info.java b/server/src/main/java/org/opensearch/snapshots/package-info.java index 82d7a0d88ff00..f43509cf671f9 100644 --- a/server/src/main/java/org/opensearch/snapshots/package-info.java +++ b/server/src/main/java/org/opensearch/snapshots/package-info.java @@ -30,13 +30,13 @@ * *

        Preliminaries

        * - *

        There are two communication channels between all nodes and master in the snapshot functionality:

        + *

        There are two communication channels between all nodes and cluster-manager in the snapshot functionality:

        *
          - *
        • The master updates the cluster state by adding, removing or altering the contents of its custom entry + *
        • The cluster-manager updates the cluster state by adding, removing or altering the contents of its custom entry * {@link org.opensearch.cluster.SnapshotsInProgress}. All nodes consume the state of the {@code SnapshotsInProgress} and will start or * abort relevant shard snapshot tasks accordingly.
        • *
        • Nodes that are executing shard snapshot tasks report either success or failure of their snapshot task by submitting a - * {@link org.opensearch.snapshots.UpdateIndexShardSnapshotStatusRequest} to the master node that will update the + * {@link org.opensearch.snapshots.UpdateIndexShardSnapshotStatusRequest} to the cluster-manager node that will update the * snapshot's entry in the cluster state accordingly.
        • *
        * @@ -57,8 +57,8 @@ * the {@code SnapshotShardsService} will check if any local primary shards are to be snapshotted (signaled by the shard's snapshot state * being {@code INIT}). For those local primary shards found in state {@code INIT}) the snapshot process of writing the shard's data files * to the snapshot's {@link org.opensearch.repositories.Repository} is executed. Once the snapshot execution finishes for a shard an - * {@code UpdateIndexShardSnapshotStatusRequest} is sent to the master node signaling either status {@code SUCCESS} or {@code FAILED}. - * The master node will then update a shard's state in the snapshots {@code SnapshotsInProgress.Entry} whenever it receives such a + * {@code UpdateIndexShardSnapshotStatusRequest} is sent to the cluster-manager node signaling either status {@code SUCCESS} or {@code FAILED}. + * The cluster-manager node will then update a shard's state in the snapshots {@code SnapshotsInProgress.Entry} whenever it receives such a * {@code UpdateIndexShardSnapshotStatusRequest}. * *
      1. If as a result of the received status update requests, all shards in the cluster state are in a completed state, i.e are marked as @@ -82,12 +82,12 @@ *
      2. Aborting a snapshot starts by updating the state of the snapshot's {@code SnapshotsInProgress.Entry} to {@code ABORTED}.
      3. * *
      4. The snapshot's state change to {@code ABORTED} in cluster state is then picked up by the {@code SnapshotShardsService} on all nodes. - * Those nodes that have shard snapshot actions for the snapshot assigned to them, will abort them and notify master about the shards + * Those nodes that have shard snapshot actions for the snapshot assigned to them, will abort them and notify cluster-manager about the shards * snapshot status accordingly. If the shard snapshot action completed or was in state {@code FINALIZE} when the abort was registered by - * the {@code SnapshotShardsService}, then the shard's state will be reported to master as {@code SUCCESS}. + * the {@code SnapshotShardsService}, then the shard's state will be reported to cluster-manager as {@code SUCCESS}. * Otherwise, it will be reported as {@code FAILED}.
      5. * - *
      6. Once all the shards are reported to master as either {@code SUCCESS} or {@code FAILED} the {@code SnapshotsService} on the master + *
      7. Once all the shards are reported to cluster-manager as either {@code SUCCESS} or {@code FAILED} the {@code SnapshotsService} on the master * will finish the snapshot process as all shard's states are now completed and hence the snapshot can be completed as explained in point 4 * of the snapshot creation section above.
      8. *
      @@ -109,7 +109,7 @@ * *

      Cloning a Snapshot

      * - *

      Cloning part of a snapshot is a process executed entirely on the master node. On a high level, the process of cloning a snapshot is + *

      Cloning part of a snapshot is a process executed entirely on the cluster-manager node. On a high level, the process of cloning a snapshot is * analogous to that of creating a snapshot from data in the cluster except that the source of data files is the snapshot repository * instead of the data nodes. It begins with cloning all shards and then finalizes the cloned snapshot the same way a normal snapshot would * be finalized. Concretely, it is executed as follows:

      @@ -132,7 +132,7 @@ * failures of the relevant indices. *
    1. Once all shard counts are known and the health of all source indices data has been verified, we populate the * {@code SnapshotsInProgress.Entry#clones} map for the clone operation with the the relevant shard clone tasks.
    2. - *
    3. After the clone tasks have been added to the {@code SnapshotsInProgress.Entry}, master executes them on its snapshot thread-pool + *
    4. After the clone tasks have been added to the {@code SnapshotsInProgress.Entry}, cluster-manager executes them on its snapshot thread-pool * by invoking {@link org.opensearch.repositories.Repository#cloneShardSnapshot} for each shard that is to be cloned. Each completed * shard snapshot triggers a call to the {@link org.opensearch.snapshots.SnapshotsService#SHARD_STATE_EXECUTOR} which updates the * clone's {@code SnapshotsInProgress.Entry} to mark the shard clone operation completed.
    5. @@ -151,7 +151,7 @@ * * If multiple snapshot creation jobs are started at the same time, the data-node operations of multiple snapshots may run in parallel * across different shards. If multiple snapshots want to snapshot a certain shard, then the shard snapshots for that shard will be - * executed one by one. This is enforced by the master node setting the shard's snapshot state to + * executed one by one. This is enforced by the cluster-manager node setting the shard's snapshot state to * {@link org.opensearch.cluster.SnapshotsInProgress.ShardSnapshotStatus#UNASSIGNED_QUEUED} for all but one snapshot. The order of * operations on a single shard is given by the order in which the snapshots were started. * As soon as all shards for a given snapshot have finished, it will be finalized as explained above. Finalization will happen one snapshot diff --git a/server/src/main/java/org/opensearch/transport/ConnectionProfile.java b/server/src/main/java/org/opensearch/transport/ConnectionProfile.java index 8ef42436546f1..61129565b23f3 100644 --- a/server/src/main/java/org/opensearch/transport/ConnectionProfile.java +++ b/server/src/main/java/org/opensearch/transport/ConnectionProfile.java @@ -100,7 +100,7 @@ public static ConnectionProfile buildDefaultConnectionProfile(Settings settings) builder.setCompressionEnabled(TransportSettings.TRANSPORT_COMPRESS.get(settings)); builder.addConnections(connectionsPerNodeBulk, TransportRequestOptions.Type.BULK); builder.addConnections(connectionsPerNodePing, TransportRequestOptions.Type.PING); - // if we are not master eligible we don't need a dedicated channel to publish the state + // if we are not cluster-manager eligible we don't need a dedicated channel to publish the state builder.addConnections(DiscoveryNode.isMasterNode(settings) ? connectionsPerNodeState : 0, TransportRequestOptions.Type.STATE); // if we are not a data-node we don't need any dedicated channels for recovery builder.addConnections(DiscoveryNode.isDataNode(settings) ? connectionsPerNodeRecovery : 0, TransportRequestOptions.Type.RECOVERY); diff --git a/server/src/main/java/org/opensearch/transport/TransportRequestDeduplicator.java b/server/src/main/java/org/opensearch/transport/TransportRequestDeduplicator.java index 4d33f071328c1..ba58bb37d8d48 100644 --- a/server/src/main/java/org/opensearch/transport/TransportRequestDeduplicator.java +++ b/server/src/main/java/org/opensearch/transport/TransportRequestDeduplicator.java @@ -68,7 +68,7 @@ public void executeOnce(T request, ActionListener listener, BiConsumer changePredicate ) { onBeforeWaitForNewMasterAndRetry.run(); - super.waitForNewMasterAndRetry(actionName, observer, request, listener, changePredicate); + super.waitForNewClusterManagerAndRetry(actionName, observer, request, listener, changePredicate); onAfterWaitForNewMasterAndRetry.run(); } } diff --git a/server/src/test/java/org/opensearch/cluster/coordination/LeaderCheckerTests.java b/server/src/test/java/org/opensearch/cluster/coordination/LeaderCheckerTests.java index 69dc332e2bd29..b06799312d99a 100644 --- a/server/src/test/java/org/opensearch/cluster/coordination/LeaderCheckerTests.java +++ b/server/src/test/java/org/opensearch/cluster/coordination/LeaderCheckerTests.java @@ -509,7 +509,7 @@ public void testLeaderBehaviour() { CoordinationStateRejectedException cause = (CoordinationStateRejectedException) handler.transportException.getRootCause(); assertThat( cause.getMessage(), - equalTo("rejecting leader check from [" + otherNode + "] sent to a node that is no longer the master") + equalTo("rejecting leader check from [" + otherNode + "] sent to a node that is no longer the cluster-manager") ); } } diff --git a/server/src/test/java/org/opensearch/cluster/coordination/NodeJoinTests.java b/server/src/test/java/org/opensearch/cluster/coordination/NodeJoinTests.java index 3b309908a1df0..f00361160f2d7 100644 --- a/server/src/test/java/org/opensearch/cluster/coordination/NodeJoinTests.java +++ b/server/src/test/java/org/opensearch/cluster/coordination/NodeJoinTests.java @@ -329,17 +329,17 @@ public void testJoinWithHigherTermElectsLeader() { () -> new StatusInfo(HEALTHY, "healthy-info") ); assertFalse(isLocalNodeElectedMaster()); - assertNull(coordinator.getStateForMasterService().nodes().getMasterNodeId()); + assertNull(coordinator.getStateForClusterManagerService().nodes().getMasterNodeId()); long newTerm = initialTerm + randomLongBetween(1, 10); SimpleFuture fut = joinNodeAsync( new JoinRequest(node1, newTerm, Optional.of(new Join(node1, node0, newTerm, initialTerm, initialVersion))) ); assertEquals(Coordinator.Mode.LEADER, coordinator.getMode()); - assertNull(coordinator.getStateForMasterService().nodes().getMasterNodeId()); + assertNull(coordinator.getStateForClusterManagerService().nodes().getMasterNodeId()); deterministicTaskQueue.runAllRunnableTasks(); assertTrue(fut.isDone()); assertTrue(isLocalNodeElectedMaster()); - assertTrue(coordinator.getStateForMasterService().nodes().isLocalNodeElectedMaster()); + assertTrue(coordinator.getStateForClusterManagerService().nodes().isLocalNodeElectedMaster()); } public void testJoinWithHigherTermButBetterStateGetsRejected() { diff --git a/server/src/test/java/org/opensearch/cluster/node/DiscoveryNodesTests.java b/server/src/test/java/org/opensearch/cluster/node/DiscoveryNodesTests.java index aff9e1cfe7a8c..bc36a57fed125 100644 --- a/server/src/test/java/org/opensearch/cluster/node/DiscoveryNodesTests.java +++ b/server/src/test/java/org/opensearch/cluster/node/DiscoveryNodesTests.java @@ -277,9 +277,9 @@ public void testDeltas() { DiscoveryNodes.Delta delta = discoNodesB.delta(discoNodesA); if (masterA == null) { - assertThat(delta.previousMasterNode(), nullValue()); + assertThat(delta.previousClusterManagerNode(), nullValue()); } else { - assertThat(delta.previousMasterNode().getId(), equalTo(masterAId)); + assertThat(delta.previousClusterManagerNode().getId(), equalTo(masterAId)); } if (masterB == null) { assertThat(delta.newMasterNode(), nullValue()); diff --git a/server/src/test/java/org/opensearch/cluster/service/ClusterApplierServiceTests.java b/server/src/test/java/org/opensearch/cluster/service/ClusterApplierServiceTests.java index b3c24ef55c3ba..04b4044864dbd 100644 --- a/server/src/test/java/org/opensearch/cluster/service/ClusterApplierServiceTests.java +++ b/server/src/test/java/org/opensearch/cluster/service/ClusterApplierServiceTests.java @@ -298,12 +298,12 @@ public void testLocalNodeMasterListenerCallbacks() { AtomicBoolean isMaster = new AtomicBoolean(); timedClusterApplierService.addLocalNodeMasterListener(new LocalNodeMasterListener() { @Override - public void onMaster() { + public void onClusterManager() { isMaster.set(true); } @Override - public void offMaster() { + public void offClusterManager() { isMaster.set(false); } }); diff --git a/server/src/test/java/org/opensearch/common/settings/ConsistentSettingsServiceTests.java b/server/src/test/java/org/opensearch/common/settings/ConsistentSettingsServiceTests.java index e7873723bec22..8a872bc50aeb0 100644 --- a/server/src/test/java/org/opensearch/common/settings/ConsistentSettingsServiceTests.java +++ b/server/src/test/java/org/opensearch/common/settings/ConsistentSettingsServiceTests.java @@ -75,7 +75,7 @@ public void testSingleStringSetting() throws Exception { // hashes not yet published assertThat(new ConsistentSettingsService(settings, clusterService, Arrays.asList(stringSetting)).areAllConsistent(), is(false)); // publish - new ConsistentSettingsService(settings, clusterService, Arrays.asList(stringSetting)).newHashPublisher().onMaster(); + new ConsistentSettingsService(settings, clusterService, Arrays.asList(stringSetting)).newHashPublisher().onClusterManager(); ConsistentSettingsService consistentService = new ConsistentSettingsService(settings, clusterService, Arrays.asList(stringSetting)); assertThat(consistentService.areAllConsistent(), is(true)); // change value @@ -83,7 +83,7 @@ public void testSingleStringSetting() throws Exception { assertThat(consistentService.areAllConsistent(), is(false)); assertThat(new ConsistentSettingsService(settings, clusterService, Arrays.asList(stringSetting)).areAllConsistent(), is(false)); // publish change - new ConsistentSettingsService(settings, clusterService, Arrays.asList(stringSetting)).newHashPublisher().onMaster(); + new ConsistentSettingsService(settings, clusterService, Arrays.asList(stringSetting)).newHashPublisher().onClusterManager(); assertThat(consistentService.areAllConsistent(), is(true)); assertThat(new ConsistentSettingsService(settings, clusterService, Arrays.asList(stringSetting)).areAllConsistent(), is(true)); } @@ -108,7 +108,7 @@ public void testSingleAffixSetting() throws Exception { is(false) ); // publish - new ConsistentSettingsService(settings, clusterService, Arrays.asList(affixStringSetting)).newHashPublisher().onMaster(); + new ConsistentSettingsService(settings, clusterService, Arrays.asList(affixStringSetting)).newHashPublisher().onClusterManager(); ConsistentSettingsService consistentService = new ConsistentSettingsService( settings, clusterService, @@ -123,7 +123,7 @@ public void testSingleAffixSetting() throws Exception { is(false) ); // publish change - new ConsistentSettingsService(settings, clusterService, Arrays.asList(affixStringSetting)).newHashPublisher().onMaster(); + new ConsistentSettingsService(settings, clusterService, Arrays.asList(affixStringSetting)).newHashPublisher().onClusterManager(); assertThat(consistentService.areAllConsistent(), is(true)); assertThat(new ConsistentSettingsService(settings, clusterService, Arrays.asList(affixStringSetting)).areAllConsistent(), is(true)); // add value @@ -136,7 +136,7 @@ public void testSingleAffixSetting() throws Exception { is(false) ); // publish - new ConsistentSettingsService(settings, clusterService, Arrays.asList(affixStringSetting)).newHashPublisher().onMaster(); + new ConsistentSettingsService(settings, clusterService, Arrays.asList(affixStringSetting)).newHashPublisher().onClusterManager(); assertThat(new ConsistentSettingsService(settings, clusterService, Arrays.asList(affixStringSetting)).areAllConsistent(), is(true)); // remove value secureSettings = new MockSecureSettings(); @@ -173,7 +173,7 @@ public void testStringAndAffixSettings() throws Exception { is(false) ); // publish only the simple string setting - new ConsistentSettingsService(settings, clusterService, Arrays.asList(stringSetting)).newHashPublisher().onMaster(); + new ConsistentSettingsService(settings, clusterService, Arrays.asList(stringSetting)).newHashPublisher().onClusterManager(); assertThat(new ConsistentSettingsService(settings, clusterService, Arrays.asList(stringSetting)).areAllConsistent(), is(true)); assertThat( new ConsistentSettingsService(settings, clusterService, Arrays.asList(affixStringSetting)).areAllConsistent(), @@ -184,7 +184,7 @@ public void testStringAndAffixSettings() throws Exception { is(false) ); // publish only the affix string setting - new ConsistentSettingsService(settings, clusterService, Arrays.asList(affixStringSetting)).newHashPublisher().onMaster(); + new ConsistentSettingsService(settings, clusterService, Arrays.asList(affixStringSetting)).newHashPublisher().onClusterManager(); assertThat(new ConsistentSettingsService(settings, clusterService, Arrays.asList(stringSetting)).areAllConsistent(), is(false)); assertThat(new ConsistentSettingsService(settings, clusterService, Arrays.asList(affixStringSetting)).areAllConsistent(), is(true)); assertThat( @@ -193,7 +193,7 @@ public void testStringAndAffixSettings() throws Exception { ); // publish both settings new ConsistentSettingsService(settings, clusterService, Arrays.asList(stringSetting, affixStringSetting)).newHashPublisher() - .onMaster(); + .onClusterManager(); assertThat(new ConsistentSettingsService(settings, clusterService, Arrays.asList(stringSetting)).areAllConsistent(), is(true)); assertThat(new ConsistentSettingsService(settings, clusterService, Arrays.asList(affixStringSetting)).areAllConsistent(), is(true)); assertThat( diff --git a/server/src/test/java/org/opensearch/discovery/PeerFinderTests.java b/server/src/test/java/org/opensearch/discovery/PeerFinderTests.java index 6558f9d06c2f7..d6cafb3421f7d 100644 --- a/server/src/test/java/org/opensearch/discovery/PeerFinderTests.java +++ b/server/src/test/java/org/opensearch/discovery/PeerFinderTests.java @@ -173,7 +173,7 @@ class TestPeerFinder extends PeerFinder { } @Override - protected void onActiveMasterFound(DiscoveryNode masterNode, long term) { + protected void onActiveClusterManagerFound(DiscoveryNode masterNode, long term) { assert holdsLock() == false : "PeerFinder lock held in error"; assertThat(discoveredMasterNode, nullValue()); assertFalse(discoveredMasterTerm.isPresent()); diff --git a/server/src/test/java/org/opensearch/env/NodeRepurposeCommandTests.java b/server/src/test/java/org/opensearch/env/NodeRepurposeCommandTests.java index 9897ad1a3650b..7a346d4cf9fc5 100644 --- a/server/src/test/java/org/opensearch/env/NodeRepurposeCommandTests.java +++ b/server/src/test/java/org/opensearch/env/NodeRepurposeCommandTests.java @@ -160,7 +160,7 @@ public void testCleanupAll() throws Exception { boolean hasClusterState = randomBoolean(); createIndexDataFiles(dataMasterSettings, shardCount, hasClusterState); - String messageText = NodeRepurposeCommand.noMasterMessage(1, environment.dataFiles().length * shardCount, 0); + String messageText = NodeRepurposeCommand.noClusterManagerMessage(1, environment.dataFiles().length * shardCount, 0); Matcher outputMatcher = allOf( containsString(messageText), diff --git a/test/framework/src/main/java/org/opensearch/cluster/coordination/CoordinationStateTestCluster.java b/test/framework/src/main/java/org/opensearch/cluster/coordination/CoordinationStateTestCluster.java index 471b9043281e9..1e7456e03ce6f 100644 --- a/test/framework/src/main/java/org/opensearch/cluster/coordination/CoordinationStateTestCluster.java +++ b/test/framework/src/main/java/org/opensearch/cluster/coordination/CoordinationStateTestCluster.java @@ -149,8 +149,8 @@ static class ClusterNode { void reboot() { if (localNode.isMasterNode() == false && rarely()) { - // master-ineligible nodes can't be trusted to persist the cluster state properly, but will not lose the fact that they - // were bootstrapped + // cluster-manager-ineligible nodes can't be trusted to persist the cluster state properly, + // but will not lose the fact that they were bootstrapped final CoordinationMetadata.VotingConfiguration votingConfiguration = persistedState.getLastAcceptedState() .getLastAcceptedConfiguration() .isEmpty() From 79edbcf3ec5e6c0c1cd0a976dfe87d5465b17c82 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 4 May 2022 14:56:32 -0500 Subject: [PATCH 122/514] [Javadocs] Add to remaining o.o.action classes (#3182) (#3184) Adds javadocs to remaining undocumented classes in o.o.action package. Signed-off-by: Nicholas Walter Knize (cherry picked from commit 6ca3278f96ab60312e5e039922ac5206341a3393) --- .../src/main/java/org/opensearch/action/ActionFuture.java | 2 +- .../main/java/org/opensearch/action/ActionListener.java | 2 ++ .../opensearch/action/ActionListenerResponseHandler.java | 2 ++ .../src/main/java/org/opensearch/action/ActionModule.java | 2 ++ .../main/java/org/opensearch/action/ActionRequest.java | 5 +++++ .../java/org/opensearch/action/ActionRequestBuilder.java | 5 +++++ .../action/ActionRequestValidationException.java | 5 +++++ .../main/java/org/opensearch/action/ActionResponse.java | 2 ++ .../main/java/org/opensearch/action/ActionRunnable.java | 2 ++ .../src/main/java/org/opensearch/action/ActionType.java | 2 ++ .../main/java/org/opensearch/action/AliasesRequest.java | 2 ++ .../org/opensearch/action/CompositeIndicesRequest.java | 2 ++ .../main/java/org/opensearch/action/DocWriteRequest.java | 2 ++ .../main/java/org/opensearch/action/DocWriteResponse.java | 2 ++ .../java/org/opensearch/action/FailedNodeException.java | 5 +++++ .../main/java/org/opensearch/action/IndicesRequest.java | 2 ++ .../java/org/opensearch/action/LatchedActionListener.java | 2 ++ .../org/opensearch/action/ListenableActionFuture.java | 2 +- .../action/NoShardAvailableActionException.java | 5 +++++ .../java/org/opensearch/action/NoSuchNodeException.java | 5 +++++ .../java/org/opensearch/action/NotifyOnceListener.java | 2 ++ .../main/java/org/opensearch/action/OriginalIndices.java | 2 ++ .../opensearch/action/PrimaryMissingActionException.java | 5 +++++ .../main/java/org/opensearch/action/RealtimeRequest.java | 2 ++ .../java/org/opensearch/action/RequestValidators.java | 5 +++++ .../org/opensearch/action/RoutingMissingException.java | 5 +++++ .../opensearch/action/ShardOperationFailedException.java | 1 + .../src/main/java/org/opensearch/action/StepListener.java | 2 ++ .../java/org/opensearch/action/TaskOperationFailure.java | 2 ++ .../main/java/org/opensearch/action/ThreadingModel.java | 5 +++++ .../org/opensearch/action/TimestampParsingException.java | 5 +++++ .../org/opensearch/action/TransportActionNodeProxy.java | 2 ++ .../org/opensearch/action/UnavailableShardsException.java | 5 +++++ .../main/java/org/opensearch/action/ValidateActions.java | 5 +++++ .../java/org/opensearch/action/bulk/BackoffPolicy.java | 2 ++ .../main/java/org/opensearch/action/bulk/BulkAction.java | 5 +++++ .../java/org/opensearch/action/bulk/BulkItemRequest.java | 5 +++++ .../java/org/opensearch/action/bulk/BulkItemResponse.java | 2 ++ .../action/bulk/BulkPrimaryExecutionContext.java | 2 ++ .../java/org/opensearch/action/bulk/BulkProcessor.java | 2 ++ .../main/java/org/opensearch/action/bulk/BulkRequest.java | 2 ++ .../org/opensearch/action/bulk/BulkRequestBuilder.java | 2 ++ .../org/opensearch/action/bulk/BulkRequestHandler.java | 2 ++ .../org/opensearch/action/bulk/BulkRequestParser.java | 2 ++ .../java/org/opensearch/action/bulk/BulkResponse.java | 2 ++ .../java/org/opensearch/action/bulk/BulkShardRequest.java | 5 +++++ .../org/opensearch/action/bulk/BulkShardResponse.java | 5 +++++ .../opensearch/action/bulk/MappingUpdatePerformer.java | 5 +++++ .../src/main/java/org/opensearch/action/bulk/Retry.java | 2 ++ .../org/opensearch/action/bulk/TransportBulkAction.java | 2 ++ .../opensearch/action/bulk/TransportShardBulkAction.java | 6 +++++- .../action/bulk/TransportSingleItemBulkWriteAction.java | 6 +++++- .../java/org/opensearch/action/delete/DeleteAction.java | 5 +++++ .../java/org/opensearch/action/delete/DeleteRequest.java | 2 ++ .../opensearch/action/delete/DeleteRequestBuilder.java | 2 ++ .../java/org/opensearch/action/delete/DeleteResponse.java | 2 ++ .../opensearch/action/delete/TransportDeleteAction.java | 2 ++ .../java/org/opensearch/action/explain/ExplainAction.java | 2 ++ .../org/opensearch/action/explain/ExplainRequest.java | 2 ++ .../opensearch/action/explain/ExplainRequestBuilder.java | 2 ++ .../org/opensearch/action/explain/ExplainResponse.java | 2 ++ .../opensearch/action/explain/TransportExplainAction.java | 2 ++ .../opensearch/action/fieldcaps/FieldCapabilities.java | 2 ++ .../action/fieldcaps/FieldCapabilitiesAction.java | 5 +++++ .../action/fieldcaps/FieldCapabilitiesIndexRequest.java | 5 +++++ .../action/fieldcaps/FieldCapabilitiesIndexResponse.java | 2 ++ .../action/fieldcaps/FieldCapabilitiesRequest.java | 3 +++ .../action/fieldcaps/FieldCapabilitiesRequestBuilder.java | 5 +++++ .../action/fieldcaps/FieldCapabilitiesResponse.java | 2 ++ .../action/fieldcaps/IndexFieldCapabilities.java | 2 ++ .../fieldcaps/TransportFieldCapabilitiesAction.java | 5 +++++ .../fieldcaps/TransportFieldCapabilitiesIndexAction.java | 5 +++++ .../main/java/org/opensearch/action/get/GetAction.java | 5 +++++ .../main/java/org/opensearch/action/get/GetRequest.java | 2 ++ .../java/org/opensearch/action/get/GetRequestBuilder.java | 2 ++ .../main/java/org/opensearch/action/get/GetResponse.java | 2 ++ .../java/org/opensearch/action/get/MultiGetAction.java | 5 +++++ .../org/opensearch/action/get/MultiGetItemResponse.java | 2 ++ .../java/org/opensearch/action/get/MultiGetRequest.java | 5 +++++ .../org/opensearch/action/get/MultiGetRequestBuilder.java | 2 ++ .../java/org/opensearch/action/get/MultiGetResponse.java | 5 +++++ .../org/opensearch/action/get/MultiGetShardRequest.java | 5 +++++ .../org/opensearch/action/get/MultiGetShardResponse.java | 5 +++++ .../org/opensearch/action/get/TransportGetAction.java | 2 ++ .../opensearch/action/get/TransportMultiGetAction.java | 5 +++++ .../action/get/TransportShardMultiGetAction.java | 5 +++++ .../java/org/opensearch/action/index/IndexAction.java | 5 +++++ .../java/org/opensearch/action/index/IndexRequest.java | 2 ++ .../org/opensearch/action/index/IndexRequestBuilder.java | 2 ++ .../java/org/opensearch/action/index/IndexResponse.java | 2 ++ .../org/opensearch/action/index/TransportIndexAction.java | 2 ++ .../opensearch/action/ingest/DeletePipelineAction.java | 5 +++++ .../opensearch/action/ingest/DeletePipelineRequest.java | 5 +++++ .../action/ingest/DeletePipelineRequestBuilder.java | 5 +++++ .../action/ingest/DeletePipelineTransportAction.java | 5 +++++ .../org/opensearch/action/ingest/GetPipelineAction.java | 5 +++++ .../org/opensearch/action/ingest/GetPipelineRequest.java | 5 +++++ .../action/ingest/GetPipelineRequestBuilder.java | 5 +++++ .../org/opensearch/action/ingest/GetPipelineResponse.java | 5 +++++ .../action/ingest/GetPipelineTransportAction.java | 5 +++++ .../opensearch/action/ingest/IngestActionForwarder.java | 2 ++ .../org/opensearch/action/ingest/PutPipelineAction.java | 5 +++++ .../org/opensearch/action/ingest/PutPipelineRequest.java | 5 +++++ .../action/ingest/PutPipelineRequestBuilder.java | 5 +++++ .../action/ingest/PutPipelineTransportAction.java | 5 +++++ .../action/ingest/SimulateDocumentBaseResult.java | 2 ++ .../opensearch/action/ingest/SimulateDocumentResult.java | 5 +++++ .../action/ingest/SimulateDocumentVerboseResult.java | 2 ++ .../action/ingest/SimulateExecutionService.java | 5 +++++ .../opensearch/action/ingest/SimulatePipelineAction.java | 5 +++++ .../opensearch/action/ingest/SimulatePipelineRequest.java | 5 +++++ .../action/ingest/SimulatePipelineRequestBuilder.java | 5 +++++ .../action/ingest/SimulatePipelineResponse.java | 5 +++++ .../action/ingest/SimulatePipelineTransportAction.java | 5 +++++ .../opensearch/action/ingest/SimulateProcessorResult.java | 5 +++++ .../opensearch/action/ingest/WriteableIngestDocument.java | 5 +++++ .../main/java/org/opensearch/action/main/MainAction.java | 5 +++++ .../main/java/org/opensearch/action/main/MainRequest.java | 5 +++++ .../org/opensearch/action/main/MainRequestBuilder.java | 5 +++++ .../java/org/opensearch/action/main/MainResponse.java | 5 +++++ .../org/opensearch/action/main/TransportMainAction.java | 5 +++++ .../action/resync/ResyncReplicationRequest.java | 1 + .../action/resync/ResyncReplicationResponse.java | 5 +++++ .../action/resync/TransportResyncReplicationAction.java | 5 +++++ .../action/search/AbstractSearchAsyncAction.java | 2 ++ .../opensearch/action/search/ArraySearchPhaseResults.java | 2 ++ .../action/search/BottomSortValuesCollector.java | 2 ++ .../action/search/CanMatchPreFilterSearchPhase.java | 2 ++ .../org/opensearch/action/search/ClearScrollAction.java | 5 +++++ .../opensearch/action/search/ClearScrollController.java | 5 +++++ .../org/opensearch/action/search/ClearScrollRequest.java | 5 +++++ .../action/search/ClearScrollRequestBuilder.java | 5 +++++ .../org/opensearch/action/search/ClearScrollResponse.java | 5 +++++ .../org/opensearch/action/search/CountedCollector.java | 2 ++ .../java/org/opensearch/action/search/DfsQueryPhase.java | 2 ++ .../org/opensearch/action/search/ExpandSearchPhase.java | 2 ++ .../org/opensearch/action/search/FetchSearchPhase.java | 2 ++ .../org/opensearch/action/search/MaxScoreCollector.java | 2 ++ .../org/opensearch/action/search/MultiSearchAction.java | 5 +++++ .../org/opensearch/action/search/MultiSearchRequest.java | 2 ++ .../action/search/MultiSearchRequestBuilder.java | 2 ++ .../org/opensearch/action/search/MultiSearchResponse.java | 2 ++ .../java/org/opensearch/action/search/ParsedScrollId.java | 5 +++++ .../action/search/QueryPhaseResultConsumer.java | 2 ++ .../action/search/ReduceSearchPhaseException.java | 2 +- .../java/org/opensearch/action/search/SearchAction.java | 5 +++++ .../opensearch/action/search/SearchActionListener.java | 2 ++ .../org/opensearch/action/search/SearchContextId.java | 5 +++++ .../opensearch/action/search/SearchContextIdForNode.java | 5 +++++ .../action/search/SearchDfsQueryThenFetchAsyncAction.java | 5 +++++ .../action/search/SearchExecutionStatsCollector.java | 2 ++ .../java/org/opensearch/action/search/SearchPhase.java | 2 ++ .../org/opensearch/action/search/SearchPhaseContext.java | 2 ++ .../opensearch/action/search/SearchPhaseController.java | 5 +++++ .../action/search/SearchPhaseExecutionException.java | 5 +++++ .../org/opensearch/action/search/SearchPhaseResults.java | 2 ++ .../action/search/SearchProgressActionListener.java | 2 ++ .../opensearch/action/search/SearchProgressListener.java | 2 ++ .../action/search/SearchQueryThenFetchAsyncAction.java | 5 +++++ .../java/org/opensearch/action/search/SearchRequest.java | 2 ++ .../opensearch/action/search/SearchRequestBuilder.java | 2 ++ .../java/org/opensearch/action/search/SearchResponse.java | 2 ++ .../opensearch/action/search/SearchResponseMerger.java | 2 ++ .../opensearch/action/search/SearchResponseSections.java | 2 ++ .../org/opensearch/action/search/SearchScrollAction.java | 5 +++++ .../opensearch/action/search/SearchScrollAsyncAction.java | 2 ++ .../search/SearchScrollQueryAndFetchAsyncAction.java | 5 +++++ .../search/SearchScrollQueryThenFetchAsyncAction.java | 5 +++++ .../org/opensearch/action/search/SearchScrollRequest.java | 5 +++++ .../action/search/SearchScrollRequestBuilder.java | 2 ++ .../java/org/opensearch/action/search/SearchShard.java | 2 ++ .../org/opensearch/action/search/SearchShardIterator.java | 2 ++ .../org/opensearch/action/search/SearchShardTask.java | 2 ++ .../java/org/opensearch/action/search/SearchTask.java | 2 ++ .../opensearch/action/search/SearchTransportService.java | 2 ++ .../java/org/opensearch/action/search/SearchType.java | 2 +- .../org/opensearch/action/search/ShardSearchFailure.java | 2 ++ .../action/search/TransportClearScrollAction.java | 5 +++++ .../action/search/TransportMultiSearchAction.java | 5 +++++ .../opensearch/action/search/TransportSearchAction.java | 5 +++++ .../opensearch/action/search/TransportSearchHelper.java | 5 +++++ .../action/search/TransportSearchScrollAction.java | 5 +++++ .../java/org/opensearch/action/support/ActionFilter.java | 2 ++ .../org/opensearch/action/support/ActionFilterChain.java | 2 ++ .../java/org/opensearch/action/support/ActionFilters.java | 2 ++ .../org/opensearch/action/support/ActiveShardCount.java | 2 ++ .../opensearch/action/support/ActiveShardsObserver.java | 2 ++ .../opensearch/action/support/AdapterActionFuture.java | 5 +++++ .../org/opensearch/action/support/AutoCreateIndex.java | 2 ++ .../opensearch/action/support/ChannelActionListener.java | 5 +++++ .../action/support/ContextPreservingActionListener.java | 2 ++ .../support/DefaultShardOperationFailedException.java | 5 +++++ .../opensearch/action/support/DestructiveOperations.java | 2 ++ .../opensearch/action/support/GroupedActionListener.java | 2 ++ .../opensearch/action/support/HandledTransportAction.java | 2 ++ .../org/opensearch/action/support/IndicesOptions.java | 2 ++ .../org/opensearch/action/support/ListenerTimeouts.java | 5 +++++ .../org/opensearch/action/support/PlainActionFuture.java | 5 +++++ .../action/support/PlainListenableActionFuture.java | 5 +++++ .../org/opensearch/action/support/RetryableAction.java | 2 ++ .../opensearch/action/support/ThreadedActionListener.java | 2 ++ .../action/support/TimeoutTaskCancellationUtility.java | 5 +++++ .../org/opensearch/action/support/TransportAction.java | 5 +++++ .../org/opensearch/action/support/TransportActions.java | 5 +++++ .../java/org/opensearch/action/support/WriteRequest.java | 2 ++ .../opensearch/action/support/WriteRequestBuilder.java | 5 +++++ .../java/org/opensearch/action/support/WriteResponse.java | 2 ++ .../broadcast/BroadcastOperationRequestBuilder.java | 5 +++++ .../action/support/broadcast/BroadcastRequest.java | 5 +++++ .../action/support/broadcast/BroadcastResponse.java | 2 ++ .../broadcast/BroadcastShardOperationFailedException.java | 2 +- .../action/support/broadcast/BroadcastShardRequest.java | 5 +++++ .../action/support/broadcast/BroadcastShardResponse.java | 5 +++++ .../support/broadcast/TransportBroadcastAction.java | 5 +++++ .../broadcast/node/TransportBroadcastByNodeAction.java | 2 ++ .../action/support/master/AcknowledgedRequest.java | 2 ++ .../action/support/master/AcknowledgedRequestBuilder.java | 2 ++ .../action/support/master/AcknowledgedResponse.java | 2 ++ .../support/master/MasterNodeOperationRequestBuilder.java | 2 ++ .../master/MasterNodeReadOperationRequestBuilder.java | 2 ++ .../action/support/master/MasterNodeReadRequest.java | 2 ++ .../action/support/master/MasterNodeRequest.java | 2 ++ .../action/support/master/ShardsAcknowledgedResponse.java | 5 +++++ .../action/support/master/TransportMasterNodeAction.java | 2 ++ .../support/master/TransportMasterNodeReadAction.java | 2 ++ .../action/support/master/info/ClusterInfoRequest.java | 5 +++++ .../support/master/info/ClusterInfoRequestBuilder.java | 5 +++++ .../support/master/info/TransportClusterInfoAction.java | 5 +++++ .../opensearch/action/support/nodes/BaseNodeRequest.java | 8 ++++++++ .../opensearch/action/support/nodes/BaseNodeResponse.java | 2 ++ .../opensearch/action/support/nodes/BaseNodesRequest.java | 5 +++++ .../action/support/nodes/BaseNodesResponse.java | 5 +++++ .../support/nodes/NodesOperationRequestBuilder.java | 5 +++++ .../action/support/nodes/TransportNodesAction.java | 5 +++++ .../support/replication/BasicReplicationRequest.java | 2 ++ .../support/replication/PendingReplicationActions.java | 5 +++++ .../support/replication/ReplicatedWriteRequest.java | 2 ++ .../action/support/replication/ReplicationOperation.java | 5 +++++ .../action/support/replication/ReplicationRequest.java | 2 ++ .../support/replication/ReplicationRequestBuilder.java | 5 +++++ .../action/support/replication/ReplicationResponse.java | 2 ++ .../action/support/replication/ReplicationTask.java | 2 ++ .../replication/TransportBroadcastReplicationAction.java | 2 ++ .../support/replication/TransportReplicationAction.java | 2 ++ .../action/support/replication/TransportWriteAction.java | 2 ++ .../single/instance/InstanceShardOperationRequest.java | 7 ++++++- .../instance/InstanceShardOperationRequestBuilder.java | 5 +++++ .../instance/TransportInstanceSingleOperationAction.java | 5 +++++ .../single/shard/SingleShardOperationRequestBuilder.java | 5 +++++ .../action/support/single/shard/SingleShardRequest.java | 5 +++++ .../support/single/shard/TransportSingleShardAction.java | 2 ++ .../opensearch/action/support/tasks/BaseTasksRequest.java | 2 ++ .../action/support/tasks/BaseTasksResponse.java | 2 ++ .../action/support/tasks/TasksRequestBuilder.java | 2 ++ .../action/support/tasks/TransportTasksAction.java | 2 ++ .../action/termvectors/MultiTermVectorsAction.java | 5 +++++ .../action/termvectors/MultiTermVectorsItemResponse.java | 4 +++- .../action/termvectors/MultiTermVectorsRequest.java | 5 +++++ .../termvectors/MultiTermVectorsRequestBuilder.java | 5 +++++ .../action/termvectors/MultiTermVectorsResponse.java | 5 +++++ .../action/termvectors/MultiTermVectorsShardRequest.java | 5 +++++ .../action/termvectors/MultiTermVectorsShardResponse.java | 5 +++++ .../opensearch/action/termvectors/TermVectorsAction.java | 6 ++++++ .../opensearch/action/termvectors/TermVectorsFields.java | 3 ++- .../opensearch/action/termvectors/TermVectorsFilter.java | 6 ++++++ .../opensearch/action/termvectors/TermVectorsRequest.java | 2 ++ .../action/termvectors/TermVectorsRequestBuilder.java | 2 ++ .../action/termvectors/TermVectorsResponse.java | 6 ++++++ .../opensearch/action/termvectors/TermVectorsWriter.java | 6 ++++++ .../termvectors/TransportMultiTermVectorsAction.java | 5 +++++ .../termvectors/TransportShardMultiTermsVectorAction.java | 5 +++++ .../action/termvectors/TransportTermVectorsAction.java | 2 ++ .../opensearch/action/update/TransportUpdateAction.java | 5 +++++ .../java/org/opensearch/action/update/UpdateAction.java | 5 +++++ .../java/org/opensearch/action/update/UpdateHelper.java | 2 ++ .../java/org/opensearch/action/update/UpdateRequest.java | 5 +++++ .../opensearch/action/update/UpdateRequestBuilder.java | 5 +++++ .../java/org/opensearch/action/update/UpdateResponse.java | 5 +++++ 278 files changed, 967 insertions(+), 10 deletions(-) diff --git a/server/src/main/java/org/opensearch/action/ActionFuture.java b/server/src/main/java/org/opensearch/action/ActionFuture.java index b1795ecf30b11..77b748f50bfbf 100644 --- a/server/src/main/java/org/opensearch/action/ActionFuture.java +++ b/server/src/main/java/org/opensearch/action/ActionFuture.java @@ -40,7 +40,7 @@ /** * An extension to {@link Future} allowing for simplified "get" operations. * - * + * @opensearch.internal */ public interface ActionFuture extends Future { diff --git a/server/src/main/java/org/opensearch/action/ActionListener.java b/server/src/main/java/org/opensearch/action/ActionListener.java index 13c6aa96ceee6..8f632449c7d91 100644 --- a/server/src/main/java/org/opensearch/action/ActionListener.java +++ b/server/src/main/java/org/opensearch/action/ActionListener.java @@ -45,6 +45,8 @@ /** * A listener for action responses or failures. + * + * @opensearch.internal */ public interface ActionListener { /** diff --git a/server/src/main/java/org/opensearch/action/ActionListenerResponseHandler.java b/server/src/main/java/org/opensearch/action/ActionListenerResponseHandler.java index 83ac650bf48af..26e9ba8621c53 100644 --- a/server/src/main/java/org/opensearch/action/ActionListenerResponseHandler.java +++ b/server/src/main/java/org/opensearch/action/ActionListenerResponseHandler.java @@ -45,6 +45,8 @@ /** * A simple base class for action response listeners, defaulting to using the SAME executor (as its * very common on response handlers). + * + * @opensearch.internal */ public class ActionListenerResponseHandler implements TransportResponseHandler { diff --git a/server/src/main/java/org/opensearch/action/ActionModule.java b/server/src/main/java/org/opensearch/action/ActionModule.java index 9d1926f0d5ae5..790f8f6cbdc36 100644 --- a/server/src/main/java/org/opensearch/action/ActionModule.java +++ b/server/src/main/java/org/opensearch/action/ActionModule.java @@ -419,6 +419,8 @@ /** * Builds and binds the generic action map, all {@link TransportAction}s, and {@link ActionFilters}. + * + * @opensearch.internal */ public class ActionModule extends AbstractModule { diff --git a/server/src/main/java/org/opensearch/action/ActionRequest.java b/server/src/main/java/org/opensearch/action/ActionRequest.java index d000155c55b7d..c6d8eb9f273d6 100644 --- a/server/src/main/java/org/opensearch/action/ActionRequest.java +++ b/server/src/main/java/org/opensearch/action/ActionRequest.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Base action request + * + * @opensearch.internal + */ public abstract class ActionRequest extends TransportRequest { public ActionRequest() { diff --git a/server/src/main/java/org/opensearch/action/ActionRequestBuilder.java b/server/src/main/java/org/opensearch/action/ActionRequestBuilder.java index 7a81d07c6927a..d1fddb076b350 100644 --- a/server/src/main/java/org/opensearch/action/ActionRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/ActionRequestBuilder.java @@ -37,6 +37,11 @@ import java.util.Objects; +/** + * Base Action Request Builder + * + * @opensearch.internal + */ public abstract class ActionRequestBuilder { protected final ActionType action; diff --git a/server/src/main/java/org/opensearch/action/ActionRequestValidationException.java b/server/src/main/java/org/opensearch/action/ActionRequestValidationException.java index 7ada8cdc77f14..d7da932c4dfc2 100644 --- a/server/src/main/java/org/opensearch/action/ActionRequestValidationException.java +++ b/server/src/main/java/org/opensearch/action/ActionRequestValidationException.java @@ -34,4 +34,9 @@ import org.opensearch.common.ValidationException; +/** + * Base exception for an action request validation + * + * @opensearch.internal + */ public class ActionRequestValidationException extends ValidationException {} diff --git a/server/src/main/java/org/opensearch/action/ActionResponse.java b/server/src/main/java/org/opensearch/action/ActionResponse.java index 65008e7e0e279..c72fc87ccfaf8 100644 --- a/server/src/main/java/org/opensearch/action/ActionResponse.java +++ b/server/src/main/java/org/opensearch/action/ActionResponse.java @@ -39,6 +39,8 @@ /** * Base class for responses to action requests. + * + * @opensearch.internal */ public abstract class ActionResponse extends TransportResponse { diff --git a/server/src/main/java/org/opensearch/action/ActionRunnable.java b/server/src/main/java/org/opensearch/action/ActionRunnable.java index 84b04214e79ee..c718b33bd404a 100644 --- a/server/src/main/java/org/opensearch/action/ActionRunnable.java +++ b/server/src/main/java/org/opensearch/action/ActionRunnable.java @@ -40,6 +40,8 @@ /** * Base class for {@link Runnable}s that need to call {@link ActionListener#onFailure(Exception)} in case an uncaught * exception or error is thrown while the actual action is run. + * + * @opensearch.internal */ public abstract class ActionRunnable extends AbstractRunnable { diff --git a/server/src/main/java/org/opensearch/action/ActionType.java b/server/src/main/java/org/opensearch/action/ActionType.java index fbc9524ce4e52..9c17061990abe 100644 --- a/server/src/main/java/org/opensearch/action/ActionType.java +++ b/server/src/main/java/org/opensearch/action/ActionType.java @@ -38,6 +38,8 @@ /** * A generic action. Should strive to make it a singleton. + * + * @opensearch.internal */ public class ActionType { diff --git a/server/src/main/java/org/opensearch/action/AliasesRequest.java b/server/src/main/java/org/opensearch/action/AliasesRequest.java index a33db646cebba..4c5d5628b1aac 100644 --- a/server/src/main/java/org/opensearch/action/AliasesRequest.java +++ b/server/src/main/java/org/opensearch/action/AliasesRequest.java @@ -37,6 +37,8 @@ * one or more indices and one or more aliases. Meant to be used for aliases management requests (e.g. add/remove alias, * get aliases) that hold aliases and indices in separate fields. * Allows to retrieve which indices and aliases the action relates to. + * + * @opensearch.internal */ public interface AliasesRequest extends IndicesRequest.Replaceable { diff --git a/server/src/main/java/org/opensearch/action/CompositeIndicesRequest.java b/server/src/main/java/org/opensearch/action/CompositeIndicesRequest.java index 25ef0d220beec..1ec2350e713df 100644 --- a/server/src/main/java/org/opensearch/action/CompositeIndicesRequest.java +++ b/server/src/main/java/org/opensearch/action/CompositeIndicesRequest.java @@ -37,5 +37,7 @@ * multiple sub-requests which relate to one or more indices. A composite request is executed by its own transport action class * (e.g. {@link org.opensearch.action.search.TransportMultiSearchAction}), which goes through all sub-requests and delegates their * execution to the appropriate transport action (e.g. {@link org.opensearch.action.search.TransportSearchAction}) for each single item. + * + * @opensearch.internal */ public interface CompositeIndicesRequest {} diff --git a/server/src/main/java/org/opensearch/action/DocWriteRequest.java b/server/src/main/java/org/opensearch/action/DocWriteRequest.java index 11d645435c71c..a789189f9227e 100644 --- a/server/src/main/java/org/opensearch/action/DocWriteRequest.java +++ b/server/src/main/java/org/opensearch/action/DocWriteRequest.java @@ -53,6 +53,8 @@ /** * Generic interface to group ActionRequest, which perform writes to a single document * Action requests implementing this can be part of {@link org.opensearch.action.bulk.BulkRequest} + * + * @opensearch.internal */ public interface DocWriteRequest extends IndicesRequest, Accountable { diff --git a/server/src/main/java/org/opensearch/action/DocWriteResponse.java b/server/src/main/java/org/opensearch/action/DocWriteResponse.java index 587f93ed09f52..5247b0264064a 100644 --- a/server/src/main/java/org/opensearch/action/DocWriteResponse.java +++ b/server/src/main/java/org/opensearch/action/DocWriteResponse.java @@ -63,6 +63,8 @@ /** * A base class for the response of a write operation that involves a single doc + * + * @opensearch.internal */ public abstract class DocWriteResponse extends ReplicationResponse implements WriteResponse, StatusToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/FailedNodeException.java b/server/src/main/java/org/opensearch/action/FailedNodeException.java index b4927d0b40a6a..268a8e370a155 100644 --- a/server/src/main/java/org/opensearch/action/FailedNodeException.java +++ b/server/src/main/java/org/opensearch/action/FailedNodeException.java @@ -39,6 +39,11 @@ import java.io.IOException; +/** + * Base exception for a failed node + * + * @opensearch.internal + */ public class FailedNodeException extends OpenSearchException { private final String nodeId; diff --git a/server/src/main/java/org/opensearch/action/IndicesRequest.java b/server/src/main/java/org/opensearch/action/IndicesRequest.java index 18da6ed0f62b2..d2e4504dd7db1 100644 --- a/server/src/main/java/org/opensearch/action/IndicesRequest.java +++ b/server/src/main/java/org/opensearch/action/IndicesRequest.java @@ -39,6 +39,8 @@ * one or more indices. Allows to retrieve which indices the action relates to. * In case of internal requests originated during the distributed execution of an external request, * they will still return the indices that the original request related to. + * + * @opensearch.internal */ public interface IndicesRequest { diff --git a/server/src/main/java/org/opensearch/action/LatchedActionListener.java b/server/src/main/java/org/opensearch/action/LatchedActionListener.java index 4a79cfd898a85..57d5c9282465f 100644 --- a/server/src/main/java/org/opensearch/action/LatchedActionListener.java +++ b/server/src/main/java/org/opensearch/action/LatchedActionListener.java @@ -37,6 +37,8 @@ /** * An action listener that allows passing in a {@link CountDownLatch} that * will be counted down after onResponse or onFailure is called + * + * @opensearch.internal */ public class LatchedActionListener implements ActionListener { diff --git a/server/src/main/java/org/opensearch/action/ListenableActionFuture.java b/server/src/main/java/org/opensearch/action/ListenableActionFuture.java index 9c8510a06173c..95bf3a2ae1384 100644 --- a/server/src/main/java/org/opensearch/action/ListenableActionFuture.java +++ b/server/src/main/java/org/opensearch/action/ListenableActionFuture.java @@ -35,7 +35,7 @@ /** * An {@link ActionFuture} that listeners can be added to. * - * + * @opensearch.internal */ public interface ListenableActionFuture extends ActionFuture { diff --git a/server/src/main/java/org/opensearch/action/NoShardAvailableActionException.java b/server/src/main/java/org/opensearch/action/NoShardAvailableActionException.java index 4e1571d8007f6..8cb6ff5c9de81 100644 --- a/server/src/main/java/org/opensearch/action/NoShardAvailableActionException.java +++ b/server/src/main/java/org/opensearch/action/NoShardAvailableActionException.java @@ -39,6 +39,11 @@ import java.io.IOException; +/** + * Base exception for no shard available + * + * @opensearch.internal + */ public class NoShardAvailableActionException extends OpenSearchException { public NoShardAvailableActionException(ShardId shardId) { diff --git a/server/src/main/java/org/opensearch/action/NoSuchNodeException.java b/server/src/main/java/org/opensearch/action/NoSuchNodeException.java index 898a3d124111c..3889809b7f186 100644 --- a/server/src/main/java/org/opensearch/action/NoSuchNodeException.java +++ b/server/src/main/java/org/opensearch/action/NoSuchNodeException.java @@ -36,6 +36,11 @@ import java.io.IOException; +/** + * Base exception for no node found + * + * @opensearch.internal + */ public class NoSuchNodeException extends FailedNodeException { public NoSuchNodeException(String nodeId) { diff --git a/server/src/main/java/org/opensearch/action/NotifyOnceListener.java b/server/src/main/java/org/opensearch/action/NotifyOnceListener.java index 4935c34daa284..cc625962e54f6 100644 --- a/server/src/main/java/org/opensearch/action/NotifyOnceListener.java +++ b/server/src/main/java/org/opensearch/action/NotifyOnceListener.java @@ -38,6 +38,8 @@ * A listener that ensures that only one of onResponse or onFailure is called. And the method * the is called is only called once. Subclasses should implement notification logic with * innerOnResponse and innerOnFailure. + * + * @opensearch.internal */ public abstract class NotifyOnceListener implements ActionListener { diff --git a/server/src/main/java/org/opensearch/action/OriginalIndices.java b/server/src/main/java/org/opensearch/action/OriginalIndices.java index 759585fb499a0..96103b1eab0e2 100644 --- a/server/src/main/java/org/opensearch/action/OriginalIndices.java +++ b/server/src/main/java/org/opensearch/action/OriginalIndices.java @@ -41,6 +41,8 @@ /** * Used to keep track of original indices within internal (e.g. shard level) requests + * + * @opensearch.internal */ public final class OriginalIndices implements IndicesRequest { diff --git a/server/src/main/java/org/opensearch/action/PrimaryMissingActionException.java b/server/src/main/java/org/opensearch/action/PrimaryMissingActionException.java index 57ae5056d6cd9..95d82d1f43c7b 100644 --- a/server/src/main/java/org/opensearch/action/PrimaryMissingActionException.java +++ b/server/src/main/java/org/opensearch/action/PrimaryMissingActionException.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Base exception for a missing action on a primary + * + * @opensearch.internal + */ public class PrimaryMissingActionException extends OpenSearchException { public PrimaryMissingActionException(String message) { diff --git a/server/src/main/java/org/opensearch/action/RealtimeRequest.java b/server/src/main/java/org/opensearch/action/RealtimeRequest.java index 37865a6cbff8d..0ceb79ec903d9 100644 --- a/server/src/main/java/org/opensearch/action/RealtimeRequest.java +++ b/server/src/main/java/org/opensearch/action/RealtimeRequest.java @@ -35,6 +35,8 @@ /** * Indicates that a request can execute in realtime (reads from the translog). * All {@link ActionRequest} that are realtime should implement this interface. + * + * @opensearch.internal */ public interface RealtimeRequest { diff --git a/server/src/main/java/org/opensearch/action/RequestValidators.java b/server/src/main/java/org/opensearch/action/RequestValidators.java index 44245c0906882..d3ec4ba2f0017 100644 --- a/server/src/main/java/org/opensearch/action/RequestValidators.java +++ b/server/src/main/java/org/opensearch/action/RequestValidators.java @@ -38,6 +38,11 @@ import java.util.Collection; import java.util.Optional; +/** + * Validates transport requests + * + * @opensearch.internal + */ public class RequestValidators { private final Collection> validators; diff --git a/server/src/main/java/org/opensearch/action/RoutingMissingException.java b/server/src/main/java/org/opensearch/action/RoutingMissingException.java index 4f34a7847da4d..18b2dfb89b381 100644 --- a/server/src/main/java/org/opensearch/action/RoutingMissingException.java +++ b/server/src/main/java/org/opensearch/action/RoutingMissingException.java @@ -41,6 +41,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Base exception for a missing routing + * + * @opensearch.internal + */ public class RoutingMissingException extends OpenSearchException { private final String type; diff --git a/server/src/main/java/org/opensearch/action/ShardOperationFailedException.java b/server/src/main/java/org/opensearch/action/ShardOperationFailedException.java index f1f134c19115d..f1d1afc46105e 100644 --- a/server/src/main/java/org/opensearch/action/ShardOperationFailedException.java +++ b/server/src/main/java/org/opensearch/action/ShardOperationFailedException.java @@ -42,6 +42,7 @@ /** * An exception indicating that a failure occurred performing an operation on the shard. * + * @opensearch.internal */ public abstract class ShardOperationFailedException implements Writeable, ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/StepListener.java b/server/src/main/java/org/opensearch/action/StepListener.java index 9547494c753c2..b99fe20a46ed8 100644 --- a/server/src/main/java/org/opensearch/action/StepListener.java +++ b/server/src/main/java/org/opensearch/action/StepListener.java @@ -61,6 +61,8 @@ * }, flowListener::onFailure); * } * } + * + * @opensearch.internal */ public final class StepListener extends NotifyOnceListener { diff --git a/server/src/main/java/org/opensearch/action/TaskOperationFailure.java b/server/src/main/java/org/opensearch/action/TaskOperationFailure.java index 09895e5f46db4..b2601d9693d83 100644 --- a/server/src/main/java/org/opensearch/action/TaskOperationFailure.java +++ b/server/src/main/java/org/opensearch/action/TaskOperationFailure.java @@ -52,6 +52,8 @@ * Information about task operation failures * * The class is final due to serialization limitations + * + * @opensearch.internal */ public final class TaskOperationFailure implements Writeable, ToXContentFragment { private static final String TASK_ID = "task_id"; diff --git a/server/src/main/java/org/opensearch/action/ThreadingModel.java b/server/src/main/java/org/opensearch/action/ThreadingModel.java index 93e96836941e4..11c61152e5107 100644 --- a/server/src/main/java/org/opensearch/action/ThreadingModel.java +++ b/server/src/main/java/org/opensearch/action/ThreadingModel.java @@ -32,6 +32,11 @@ package org.opensearch.action; +/** + * Threading model + * + * @opensearch.internal + */ public enum ThreadingModel { NONE((byte) 0), OPERATION((byte) 1), diff --git a/server/src/main/java/org/opensearch/action/TimestampParsingException.java b/server/src/main/java/org/opensearch/action/TimestampParsingException.java index f6a0207f22db7..7cebdccdbef34 100644 --- a/server/src/main/java/org/opensearch/action/TimestampParsingException.java +++ b/server/src/main/java/org/opensearch/action/TimestampParsingException.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Base exception for a failed timestamp parse + * + * @opensearch.internal + */ public class TimestampParsingException extends OpenSearchException { private final String timestamp; diff --git a/server/src/main/java/org/opensearch/action/TransportActionNodeProxy.java b/server/src/main/java/org/opensearch/action/TransportActionNodeProxy.java index 8c6838b186fca..a04e89d9a1f8f 100644 --- a/server/src/main/java/org/opensearch/action/TransportActionNodeProxy.java +++ b/server/src/main/java/org/opensearch/action/TransportActionNodeProxy.java @@ -39,6 +39,8 @@ /** * A generic proxy that will execute the given action against a specific node. + * + * @opensearch.internal */ public class TransportActionNodeProxy { diff --git a/server/src/main/java/org/opensearch/action/UnavailableShardsException.java b/server/src/main/java/org/opensearch/action/UnavailableShardsException.java index a6050ae9a3c75..75fde3828e904 100644 --- a/server/src/main/java/org/opensearch/action/UnavailableShardsException.java +++ b/server/src/main/java/org/opensearch/action/UnavailableShardsException.java @@ -40,6 +40,11 @@ import java.io.IOException; +/** + * Base exception for shards unavailable + * + * @opensearch.internal + */ public class UnavailableShardsException extends OpenSearchException { public UnavailableShardsException(@Nullable ShardId shardId, String message, Object... args) { diff --git a/server/src/main/java/org/opensearch/action/ValidateActions.java b/server/src/main/java/org/opensearch/action/ValidateActions.java index 134a880c7a972..1d1591ae3049b 100644 --- a/server/src/main/java/org/opensearch/action/ValidateActions.java +++ b/server/src/main/java/org/opensearch/action/ValidateActions.java @@ -32,6 +32,11 @@ package org.opensearch.action; +/** + * Validates transport actions + * + * @opensearch.internal + */ public class ValidateActions { public static ActionRequestValidationException addValidationError(String error, ActionRequestValidationException validationException) { diff --git a/server/src/main/java/org/opensearch/action/bulk/BackoffPolicy.java b/server/src/main/java/org/opensearch/action/bulk/BackoffPolicy.java index 50acd82ae9002..0b20979c9673e 100644 --- a/server/src/main/java/org/opensearch/action/bulk/BackoffPolicy.java +++ b/server/src/main/java/org/opensearch/action/bulk/BackoffPolicy.java @@ -53,6 +53,8 @@ * * * Note that backoff policies are exposed as Iterables in order to be consumed multiple times. + * + * @opensearch.internal */ public abstract class BackoffPolicy implements Iterable { private static final BackoffPolicy NO_BACKOFF = new NoBackoff(); diff --git a/server/src/main/java/org/opensearch/action/bulk/BulkAction.java b/server/src/main/java/org/opensearch/action/bulk/BulkAction.java index 031c8efa8cb84..f80ec32628b8a 100644 --- a/server/src/main/java/org/opensearch/action/bulk/BulkAction.java +++ b/server/src/main/java/org/opensearch/action/bulk/BulkAction.java @@ -36,6 +36,11 @@ import org.opensearch.common.settings.Settings; import org.opensearch.transport.TransportRequestOptions; +/** + * Transport action for bulk indexing + * + * @opensearch.internal + */ public class BulkAction extends ActionType { public static final BulkAction INSTANCE = new BulkAction(); diff --git a/server/src/main/java/org/opensearch/action/bulk/BulkItemRequest.java b/server/src/main/java/org/opensearch/action/bulk/BulkItemRequest.java index 2002d5864e966..f39ba589a3019 100644 --- a/server/src/main/java/org/opensearch/action/bulk/BulkItemRequest.java +++ b/server/src/main/java/org/opensearch/action/bulk/BulkItemRequest.java @@ -45,6 +45,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Transport request for a Single bulk item + * + * @opensearch.internal + */ public class BulkItemRequest implements Writeable, Accountable { private static final long SHALLOW_SIZE = RamUsageEstimator.shallowSizeOfInstance(BulkItemRequest.class); diff --git a/server/src/main/java/org/opensearch/action/bulk/BulkItemResponse.java b/server/src/main/java/org/opensearch/action/bulk/BulkItemResponse.java index fdb27a00bac2d..e3252988c3b35 100644 --- a/server/src/main/java/org/opensearch/action/bulk/BulkItemResponse.java +++ b/server/src/main/java/org/opensearch/action/bulk/BulkItemResponse.java @@ -67,6 +67,8 @@ /** * Represents a single item response for an action executed as part of the bulk API. Holds the index/type/id * of the relevant action, and if it has failed or not (with the failure message in case it failed). + * + * @opensearch.internal */ public class BulkItemResponse implements Writeable, StatusToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/bulk/BulkPrimaryExecutionContext.java b/server/src/main/java/org/opensearch/action/bulk/BulkPrimaryExecutionContext.java index 17bfa082295af..896456089ee3e 100644 --- a/server/src/main/java/org/opensearch/action/bulk/BulkPrimaryExecutionContext.java +++ b/server/src/main/java/org/opensearch/action/bulk/BulkPrimaryExecutionContext.java @@ -48,6 +48,8 @@ * This is a utility class that holds the per request state needed to perform bulk operations on the primary. * More specifically, it maintains an index to the current executing bulk item, which allows execution * to stop and wait for external events such as mapping updates. + * + * @opensearch.internal */ class BulkPrimaryExecutionContext { diff --git a/server/src/main/java/org/opensearch/action/bulk/BulkProcessor.java b/server/src/main/java/org/opensearch/action/bulk/BulkProcessor.java index 90a177119cfd8..166c4a535aaad 100644 --- a/server/src/main/java/org/opensearch/action/bulk/BulkProcessor.java +++ b/server/src/main/java/org/opensearch/action/bulk/BulkProcessor.java @@ -63,6 +63,8 @@ * requests allowed to be executed in parallel. *

      * In order to create a new bulk processor, use the {@link Builder}. + * + * @opensearch.internal */ public class BulkProcessor implements Closeable { diff --git a/server/src/main/java/org/opensearch/action/bulk/BulkRequest.java b/server/src/main/java/org/opensearch/action/bulk/BulkRequest.java index e3bf5bced5072..25b335eae0bf1 100644 --- a/server/src/main/java/org/opensearch/action/bulk/BulkRequest.java +++ b/server/src/main/java/org/opensearch/action/bulk/BulkRequest.java @@ -70,6 +70,8 @@ * * Note that we only support refresh on the bulk request not per item. * @see org.opensearch.client.Client#bulk(BulkRequest) + * + * @opensearch.internal */ public class BulkRequest extends ActionRequest implements CompositeIndicesRequest, WriteRequest, Accountable { diff --git a/server/src/main/java/org/opensearch/action/bulk/BulkRequestBuilder.java b/server/src/main/java/org/opensearch/action/bulk/BulkRequestBuilder.java index c58877e48a7eb..d2e0d558fcc1b 100644 --- a/server/src/main/java/org/opensearch/action/bulk/BulkRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/bulk/BulkRequestBuilder.java @@ -50,6 +50,8 @@ /** * A bulk request holds an ordered {@link IndexRequest}s and {@link DeleteRequest}s and allows to executes * it in a single batch. + * + * @opensearch.internal */ public class BulkRequestBuilder extends ActionRequestBuilder implements WriteRequestBuilder { diff --git a/server/src/main/java/org/opensearch/action/bulk/BulkRequestHandler.java b/server/src/main/java/org/opensearch/action/bulk/BulkRequestHandler.java index 5b4ec5cf8679a..541d29102ecd2 100644 --- a/server/src/main/java/org/opensearch/action/bulk/BulkRequestHandler.java +++ b/server/src/main/java/org/opensearch/action/bulk/BulkRequestHandler.java @@ -44,6 +44,8 @@ /** * Implements the low-level details of bulk request handling + * + * @opensearch.internal */ public final class BulkRequestHandler { private final Logger logger; diff --git a/server/src/main/java/org/opensearch/action/bulk/BulkRequestParser.java b/server/src/main/java/org/opensearch/action/bulk/BulkRequestParser.java index 042e104f70c7f..675905cc60e75 100644 --- a/server/src/main/java/org/opensearch/action/bulk/BulkRequestParser.java +++ b/server/src/main/java/org/opensearch/action/bulk/BulkRequestParser.java @@ -61,6 +61,8 @@ /** * Helper to parse bulk requests. This should be considered an internal class. + * + * @opensearch.internal */ public final class BulkRequestParser { diff --git a/server/src/main/java/org/opensearch/action/bulk/BulkResponse.java b/server/src/main/java/org/opensearch/action/bulk/BulkResponse.java index 751ad567c8639..6dec144f2ccf0 100644 --- a/server/src/main/java/org/opensearch/action/bulk/BulkResponse.java +++ b/server/src/main/java/org/opensearch/action/bulk/BulkResponse.java @@ -55,6 +55,8 @@ * A response of a bulk execution. Holding a response for each item responding (in order) of the * bulk requests. Each item holds the index/type/id is operated on, and if it failed or not (with the * failure message). + * + * @opensearch.internal */ public class BulkResponse extends ActionResponse implements Iterable, StatusToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/bulk/BulkShardRequest.java b/server/src/main/java/org/opensearch/action/bulk/BulkShardRequest.java index b082395263875..a7d0de98981ba 100644 --- a/server/src/main/java/org/opensearch/action/bulk/BulkShardRequest.java +++ b/server/src/main/java/org/opensearch/action/bulk/BulkShardRequest.java @@ -47,6 +47,11 @@ import java.util.Set; import java.util.stream.Stream; +/** + * A bulk shard request targeting a specific shard ID + * + * @opensearch.internal + */ public class BulkShardRequest extends ReplicatedWriteRequest implements Accountable { public static final Version COMPACT_SHARD_ID_VERSION = LegacyESVersion.V_7_9_0; diff --git a/server/src/main/java/org/opensearch/action/bulk/BulkShardResponse.java b/server/src/main/java/org/opensearch/action/bulk/BulkShardResponse.java index 18d954a4feb23..b96ebcb3a3c0a 100644 --- a/server/src/main/java/org/opensearch/action/bulk/BulkShardResponse.java +++ b/server/src/main/java/org/opensearch/action/bulk/BulkShardResponse.java @@ -43,6 +43,11 @@ import java.io.IOException; +/** + * Transport response for a bulk shard request + * + * @opensearch.internal + */ public class BulkShardResponse extends ReplicationResponse implements WriteResponse { private static final Version COMPACT_SHARD_ID_VERSION = LegacyESVersion.V_7_9_0; diff --git a/server/src/main/java/org/opensearch/action/bulk/MappingUpdatePerformer.java b/server/src/main/java/org/opensearch/action/bulk/MappingUpdatePerformer.java index ebfe82eb6ed38..688912afe0537 100644 --- a/server/src/main/java/org/opensearch/action/bulk/MappingUpdatePerformer.java +++ b/server/src/main/java/org/opensearch/action/bulk/MappingUpdatePerformer.java @@ -36,6 +36,11 @@ import org.opensearch.index.mapper.Mapping; import org.opensearch.index.shard.ShardId; +/** + * Updates the mappings on the cluster manager + * + * @opensearch.internal + */ public interface MappingUpdatePerformer { /** diff --git a/server/src/main/java/org/opensearch/action/bulk/Retry.java b/server/src/main/java/org/opensearch/action/bulk/Retry.java index bb1197699d894..9c7e8cd685b28 100644 --- a/server/src/main/java/org/opensearch/action/bulk/Retry.java +++ b/server/src/main/java/org/opensearch/action/bulk/Retry.java @@ -49,6 +49,8 @@ /** * Encapsulates synchronous and asynchronous retry logic. + * + * @opensearch.internal */ public class Retry { private final BackoffPolicy backoffPolicy; diff --git a/server/src/main/java/org/opensearch/action/bulk/TransportBulkAction.java b/server/src/main/java/org/opensearch/action/bulk/TransportBulkAction.java index 560fd1d8a45b3..e557b6c8e897e 100644 --- a/server/src/main/java/org/opensearch/action/bulk/TransportBulkAction.java +++ b/server/src/main/java/org/opensearch/action/bulk/TransportBulkAction.java @@ -112,6 +112,8 @@ /** * Groups bulk request items by shard, optionally creating non-existent indices and * delegates to {@link TransportShardBulkAction} for shard-level bulk execution + * + * @opensearch.internal */ public class TransportBulkAction extends HandledTransportAction { diff --git a/server/src/main/java/org/opensearch/action/bulk/TransportShardBulkAction.java b/server/src/main/java/org/opensearch/action/bulk/TransportShardBulkAction.java index 5311186fee0dc..f1c3e56b02eca 100644 --- a/server/src/main/java/org/opensearch/action/bulk/TransportShardBulkAction.java +++ b/server/src/main/java/org/opensearch/action/bulk/TransportShardBulkAction.java @@ -94,7 +94,11 @@ import java.util.function.Function; import java.util.function.LongSupplier; -/** Performs shard-level bulk (index, delete or update) operations */ +/** + * Performs shard-level bulk (index, delete or update) operations + * + * @opensearch.internal + */ public class TransportShardBulkAction extends TransportWriteAction { public static final String ACTION_NAME = BulkAction.NAME + "[s]"; diff --git a/server/src/main/java/org/opensearch/action/bulk/TransportSingleItemBulkWriteAction.java b/server/src/main/java/org/opensearch/action/bulk/TransportSingleItemBulkWriteAction.java index a833687d591de..e5f96fdab9c96 100644 --- a/server/src/main/java/org/opensearch/action/bulk/TransportSingleItemBulkWriteAction.java +++ b/server/src/main/java/org/opensearch/action/bulk/TransportSingleItemBulkWriteAction.java @@ -45,7 +45,11 @@ import org.opensearch.tasks.Task; import org.opensearch.transport.TransportService; -/** use transport bulk action directly */ +/** + * use transport bulk action directly + * + * @opensearch.internal + */ @Deprecated public abstract class TransportSingleItemBulkWriteAction< Request extends ReplicatedWriteRequest, diff --git a/server/src/main/java/org/opensearch/action/delete/DeleteAction.java b/server/src/main/java/org/opensearch/action/delete/DeleteAction.java index dc58ebee6c356..b93867ca12efe 100644 --- a/server/src/main/java/org/opensearch/action/delete/DeleteAction.java +++ b/server/src/main/java/org/opensearch/action/delete/DeleteAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action to delete a document from an index + * + * @opensearch.internal + */ public class DeleteAction extends ActionType { public static final DeleteAction INSTANCE = new DeleteAction(); diff --git a/server/src/main/java/org/opensearch/action/delete/DeleteRequest.java b/server/src/main/java/org/opensearch/action/delete/DeleteRequest.java index c40933ba9c92e..ce723df0c383a 100644 --- a/server/src/main/java/org/opensearch/action/delete/DeleteRequest.java +++ b/server/src/main/java/org/opensearch/action/delete/DeleteRequest.java @@ -64,6 +64,8 @@ * @see DeleteResponse * @see org.opensearch.client.Client#delete(DeleteRequest) * @see org.opensearch.client.Requests#deleteRequest(String) + * + * @opensearch.internal */ public class DeleteRequest extends ReplicatedWriteRequest implements diff --git a/server/src/main/java/org/opensearch/action/delete/DeleteRequestBuilder.java b/server/src/main/java/org/opensearch/action/delete/DeleteRequestBuilder.java index f6ee0f4a7b278..0436962ce01d2 100644 --- a/server/src/main/java/org/opensearch/action/delete/DeleteRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/delete/DeleteRequestBuilder.java @@ -40,6 +40,8 @@ /** * A delete document action request builder. + * + * @opensearch.internal */ public class DeleteRequestBuilder extends ReplicationRequestBuilder implements diff --git a/server/src/main/java/org/opensearch/action/delete/DeleteResponse.java b/server/src/main/java/org/opensearch/action/delete/DeleteResponse.java index 6b000561ad282..1d53524cd6c63 100644 --- a/server/src/main/java/org/opensearch/action/delete/DeleteResponse.java +++ b/server/src/main/java/org/opensearch/action/delete/DeleteResponse.java @@ -47,6 +47,8 @@ * * @see org.opensearch.action.delete.DeleteRequest * @see org.opensearch.client.Client#delete(DeleteRequest) + * + * @opensearch.internal */ public class DeleteResponse extends DocWriteResponse { diff --git a/server/src/main/java/org/opensearch/action/delete/TransportDeleteAction.java b/server/src/main/java/org/opensearch/action/delete/TransportDeleteAction.java index adeebcba28a89..039214459ac21 100644 --- a/server/src/main/java/org/opensearch/action/delete/TransportDeleteAction.java +++ b/server/src/main/java/org/opensearch/action/delete/TransportDeleteAction.java @@ -42,6 +42,8 @@ * Performs the delete operation. * * Deprecated use TransportBulkAction with a single item instead + * + * @opensearch.internal */ @Deprecated public class TransportDeleteAction extends TransportSingleItemBulkWriteAction { diff --git a/server/src/main/java/org/opensearch/action/explain/ExplainAction.java b/server/src/main/java/org/opensearch/action/explain/ExplainAction.java index ff534dbf82f6d..e955ecc8a1e45 100644 --- a/server/src/main/java/org/opensearch/action/explain/ExplainAction.java +++ b/server/src/main/java/org/opensearch/action/explain/ExplainAction.java @@ -36,6 +36,8 @@ /** * Entry point for the explain feature. + * + * @opensearch.internal */ public class ExplainAction extends ActionType { diff --git a/server/src/main/java/org/opensearch/action/explain/ExplainRequest.java b/server/src/main/java/org/opensearch/action/explain/ExplainRequest.java index 1543c2c95b269..8abdff55a82cc 100644 --- a/server/src/main/java/org/opensearch/action/explain/ExplainRequest.java +++ b/server/src/main/java/org/opensearch/action/explain/ExplainRequest.java @@ -53,6 +53,8 @@ /** * Explain request encapsulating the explain query and document identifier to get an explanation for. + * + * @opensearch.internal */ public class ExplainRequest extends SingleShardRequest implements ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/explain/ExplainRequestBuilder.java b/server/src/main/java/org/opensearch/action/explain/ExplainRequestBuilder.java index 6839479079845..a582b29346665 100644 --- a/server/src/main/java/org/opensearch/action/explain/ExplainRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/explain/ExplainRequestBuilder.java @@ -41,6 +41,8 @@ /** * A builder for {@link ExplainRequest}. + * + * @opensearch.internal */ public class ExplainRequestBuilder extends SingleShardOperationRequestBuilder { diff --git a/server/src/main/java/org/opensearch/action/explain/ExplainResponse.java b/server/src/main/java/org/opensearch/action/explain/ExplainResponse.java index 6dd1945a38ffc..eca7add66047c 100644 --- a/server/src/main/java/org/opensearch/action/explain/ExplainResponse.java +++ b/server/src/main/java/org/opensearch/action/explain/ExplainResponse.java @@ -55,6 +55,8 @@ /** * Response containing the score explanation. + * + * @opensearch.internal */ public class ExplainResponse extends ActionResponse implements StatusToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/explain/TransportExplainAction.java b/server/src/main/java/org/opensearch/action/explain/TransportExplainAction.java index 9fb16eec7d36b..5752860af4f16 100644 --- a/server/src/main/java/org/opensearch/action/explain/TransportExplainAction.java +++ b/server/src/main/java/org/opensearch/action/explain/TransportExplainAction.java @@ -68,6 +68,8 @@ /** * Explain transport action. Computes the explain on the targeted shard. + * + * @opensearch.internal */ // TODO: AggregatedDfs. Currently the idf can be different then when executing a normal search with explain. public class TransportExplainAction extends TransportSingleShardAction { diff --git a/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilities.java b/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilities.java index ffc059f08c70f..67fab82949c24 100644 --- a/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilities.java +++ b/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilities.java @@ -59,6 +59,8 @@ /** * Describes the capabilities of a field optionally merged across multiple indices. + * + * @opensearch.internal */ public class FieldCapabilities implements Writeable, ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilitiesAction.java b/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilitiesAction.java index d10fa5ee69811..e8585e60c8ffd 100644 --- a/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilitiesAction.java +++ b/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilitiesAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for a field capabilities request + * + * @opensearch.internal + */ public class FieldCapabilitiesAction extends ActionType { public static final FieldCapabilitiesAction INSTANCE = new FieldCapabilitiesAction(); diff --git a/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilitiesIndexRequest.java b/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilitiesIndexRequest.java index b349d8e2ca26f..3cfd21087582d 100644 --- a/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilitiesIndexRequest.java +++ b/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilitiesIndexRequest.java @@ -46,6 +46,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Transport Request for Retrieving Field Capabilities for an Index + * + * @opensearch.internal + */ public class FieldCapabilitiesIndexRequest extends ActionRequest implements IndicesRequest { public static final IndicesOptions INDICES_OPTIONS = IndicesOptions.strictSingleIndexNoExpandForbidClosed(); diff --git a/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilitiesIndexResponse.java b/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilitiesIndexResponse.java index 0d7fd91a6bfd8..9225e0cdc6571 100644 --- a/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilitiesIndexResponse.java +++ b/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilitiesIndexResponse.java @@ -44,6 +44,8 @@ /** * Response for {@link TransportFieldCapabilitiesIndexAction}. + * + * @opensearch.internal */ public class FieldCapabilitiesIndexResponse extends ActionResponse implements Writeable { private final String indexName; diff --git a/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilitiesRequest.java b/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilitiesRequest.java index c8391fddf564d..688568ba9a6d6 100644 --- a/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilitiesRequest.java +++ b/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilitiesRequest.java @@ -51,6 +51,9 @@ import java.util.Objects; import java.util.Set; +/** + * Transport request for retrieving field capabilities for an explicit list of fields + */ public final class FieldCapabilitiesRequest extends ActionRequest implements IndicesRequest.Replaceable, ToXContentObject { public static final String NAME = "field_caps_request"; diff --git a/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilitiesRequestBuilder.java b/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilitiesRequestBuilder.java index 3c1f11c047ef4..70a90b98bdf25 100644 --- a/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilitiesRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilitiesRequestBuilder.java @@ -36,6 +36,11 @@ import org.opensearch.client.OpenSearchClient; import org.opensearch.index.query.QueryBuilder; +/** + * Transport request builder for retrieving field capabilities + * + * @opensearch.internal + */ public class FieldCapabilitiesRequestBuilder extends ActionRequestBuilder { public FieldCapabilitiesRequestBuilder(OpenSearchClient client, FieldCapabilitiesAction action, String... indices) { super(client, action, new FieldCapabilitiesRequest().indices(indices)); diff --git a/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilitiesResponse.java b/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilitiesResponse.java index 90b35d6e14e4e..e5f644987182c 100644 --- a/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilitiesResponse.java +++ b/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilitiesResponse.java @@ -56,6 +56,8 @@ /** * Response for {@link FieldCapabilitiesRequest} requests. + * + * @opensearch.internal */ public class FieldCapabilitiesResponse extends ActionResponse implements ToXContentObject { private static final ParseField INDICES_FIELD = new ParseField("indices"); diff --git a/server/src/main/java/org/opensearch/action/fieldcaps/IndexFieldCapabilities.java b/server/src/main/java/org/opensearch/action/fieldcaps/IndexFieldCapabilities.java index d0629a46c9d4a..062e5bc1af7e5 100644 --- a/server/src/main/java/org/opensearch/action/fieldcaps/IndexFieldCapabilities.java +++ b/server/src/main/java/org/opensearch/action/fieldcaps/IndexFieldCapabilities.java @@ -46,6 +46,8 @@ /** * Describes the capabilities of a field in a single index. + * + * @opensearch.internal */ public class IndexFieldCapabilities implements Writeable { diff --git a/server/src/main/java/org/opensearch/action/fieldcaps/TransportFieldCapabilitiesAction.java b/server/src/main/java/org/opensearch/action/fieldcaps/TransportFieldCapabilitiesAction.java index 07254db46d567..2d669a5f1aad9 100644 --- a/server/src/main/java/org/opensearch/action/fieldcaps/TransportFieldCapabilitiesAction.java +++ b/server/src/main/java/org/opensearch/action/fieldcaps/TransportFieldCapabilitiesAction.java @@ -58,6 +58,11 @@ import java.util.Map; import java.util.Set; +/** + * Transport action for field capabilities requests + * + * @opensearch.internal + */ public class TransportFieldCapabilitiesAction extends HandledTransportAction { private final ThreadPool threadPool; private final ClusterService clusterService; diff --git a/server/src/main/java/org/opensearch/action/fieldcaps/TransportFieldCapabilitiesIndexAction.java b/server/src/main/java/org/opensearch/action/fieldcaps/TransportFieldCapabilitiesIndexAction.java index a4807eff1acb4..9b42bc12f82a7 100644 --- a/server/src/main/java/org/opensearch/action/fieldcaps/TransportFieldCapabilitiesIndexAction.java +++ b/server/src/main/java/org/opensearch/action/fieldcaps/TransportFieldCapabilitiesIndexAction.java @@ -85,6 +85,11 @@ import static org.opensearch.action.support.TransportActions.isShardNotAvailableException; +/** + * Transport action for field capabilities request in an index + * + * @opensearch.internal + */ public class TransportFieldCapabilitiesIndexAction extends HandledTransportAction< FieldCapabilitiesIndexRequest, FieldCapabilitiesIndexResponse> { diff --git a/server/src/main/java/org/opensearch/action/get/GetAction.java b/server/src/main/java/org/opensearch/action/get/GetAction.java index f90fbc9b3be1c..05544591f030e 100644 --- a/server/src/main/java/org/opensearch/action/get/GetAction.java +++ b/server/src/main/java/org/opensearch/action/get/GetAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action to get a document + * + * @opensearch.internal + */ public class GetAction extends ActionType { public static final GetAction INSTANCE = new GetAction(); diff --git a/server/src/main/java/org/opensearch/action/get/GetRequest.java b/server/src/main/java/org/opensearch/action/get/GetRequest.java index 9badf2db92f67..5f740ba789bb2 100644 --- a/server/src/main/java/org/opensearch/action/get/GetRequest.java +++ b/server/src/main/java/org/opensearch/action/get/GetRequest.java @@ -60,6 +60,8 @@ * @see GetResponse * @see org.opensearch.client.Requests#getRequest(String) * @see org.opensearch.client.Client#get(GetRequest) + * + * @opensearch.internal */ public class GetRequest extends SingleShardRequest implements RealtimeRequest { diff --git a/server/src/main/java/org/opensearch/action/get/GetRequestBuilder.java b/server/src/main/java/org/opensearch/action/get/GetRequestBuilder.java index 492a88b9d3821..078c32adeb7c9 100644 --- a/server/src/main/java/org/opensearch/action/get/GetRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/get/GetRequestBuilder.java @@ -41,6 +41,8 @@ /** * A get document action request builder. + * + * @opensearch.internal */ public class GetRequestBuilder extends SingleShardOperationRequestBuilder { diff --git a/server/src/main/java/org/opensearch/action/get/GetResponse.java b/server/src/main/java/org/opensearch/action/get/GetResponse.java index a15607d696195..1118c3bb64f95 100644 --- a/server/src/main/java/org/opensearch/action/get/GetResponse.java +++ b/server/src/main/java/org/opensearch/action/get/GetResponse.java @@ -56,6 +56,8 @@ * * @see GetRequest * @see org.opensearch.client.Client#get(GetRequest) + * + * @opensearch.internal */ public class GetResponse extends ActionResponse implements Iterable, ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/get/MultiGetAction.java b/server/src/main/java/org/opensearch/action/get/MultiGetAction.java index f7df277585250..bed5d0bd9e55e 100644 --- a/server/src/main/java/org/opensearch/action/get/MultiGetAction.java +++ b/server/src/main/java/org/opensearch/action/get/MultiGetAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for a multi get + * + * @opensearch.internal + */ public class MultiGetAction extends ActionType { public static final MultiGetAction INSTANCE = new MultiGetAction(); diff --git a/server/src/main/java/org/opensearch/action/get/MultiGetItemResponse.java b/server/src/main/java/org/opensearch/action/get/MultiGetItemResponse.java index 1ff684fcc5872..dcc296c4b6e0b 100644 --- a/server/src/main/java/org/opensearch/action/get/MultiGetItemResponse.java +++ b/server/src/main/java/org/opensearch/action/get/MultiGetItemResponse.java @@ -40,6 +40,8 @@ /** * A single multi get response. + * + * @opensearch.internal */ public class MultiGetItemResponse implements Writeable { diff --git a/server/src/main/java/org/opensearch/action/get/MultiGetRequest.java b/server/src/main/java/org/opensearch/action/get/MultiGetRequest.java index 974799dd7bf4c..1196b2f065312 100644 --- a/server/src/main/java/org/opensearch/action/get/MultiGetRequest.java +++ b/server/src/main/java/org/opensearch/action/get/MultiGetRequest.java @@ -66,6 +66,11 @@ import java.util.List; import java.util.Locale; +/** + * Transport request for a multi get. + * + * @opensearch.internal + */ public class MultiGetRequest extends ActionRequest implements Iterable, diff --git a/server/src/main/java/org/opensearch/action/get/MultiGetRequestBuilder.java b/server/src/main/java/org/opensearch/action/get/MultiGetRequestBuilder.java index 56ac6cbd1b8c9..c317edc07da8b 100644 --- a/server/src/main/java/org/opensearch/action/get/MultiGetRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/get/MultiGetRequestBuilder.java @@ -37,6 +37,8 @@ /** * A multi get document action request builder. + * + * @opensearch.internal */ public class MultiGetRequestBuilder extends ActionRequestBuilder { diff --git a/server/src/main/java/org/opensearch/action/get/MultiGetResponse.java b/server/src/main/java/org/opensearch/action/get/MultiGetResponse.java index ca6249861dd50..674fd73650da1 100644 --- a/server/src/main/java/org/opensearch/action/get/MultiGetResponse.java +++ b/server/src/main/java/org/opensearch/action/get/MultiGetResponse.java @@ -52,6 +52,11 @@ import java.util.Iterator; import java.util.List; +/** + * Transport response for a multi get. + * + * @opensearch.internal + */ public class MultiGetResponse extends ActionResponse implements Iterable, ToXContentObject { private static final ParseField INDEX = new ParseField("_index"); diff --git a/server/src/main/java/org/opensearch/action/get/MultiGetShardRequest.java b/server/src/main/java/org/opensearch/action/get/MultiGetShardRequest.java index 3f678d6db2407..9f137b9fdedf2 100644 --- a/server/src/main/java/org/opensearch/action/get/MultiGetShardRequest.java +++ b/server/src/main/java/org/opensearch/action/get/MultiGetShardRequest.java @@ -42,6 +42,11 @@ import java.util.ArrayList; import java.util.List; +/** + * Multi get shards. + * + * @opensearch.internal + */ public class MultiGetShardRequest extends SingleShardRequest { private int shardId; diff --git a/server/src/main/java/org/opensearch/action/get/MultiGetShardResponse.java b/server/src/main/java/org/opensearch/action/get/MultiGetShardResponse.java index 2393fa4749876..069f9875185f8 100644 --- a/server/src/main/java/org/opensearch/action/get/MultiGetShardResponse.java +++ b/server/src/main/java/org/opensearch/action/get/MultiGetShardResponse.java @@ -41,6 +41,11 @@ import java.util.ArrayList; import java.util.List; +/** + * Transport response for multi get shards. + * + * @opensearch.internal + */ public class MultiGetShardResponse extends ActionResponse { final IntArrayList locations; diff --git a/server/src/main/java/org/opensearch/action/get/TransportGetAction.java b/server/src/main/java/org/opensearch/action/get/TransportGetAction.java index 999cc8c12190b..6d6798fb64178 100644 --- a/server/src/main/java/org/opensearch/action/get/TransportGetAction.java +++ b/server/src/main/java/org/opensearch/action/get/TransportGetAction.java @@ -54,6 +54,8 @@ /** * Performs the get operation. + * + * @opensearch.internal */ public class TransportGetAction extends TransportSingleShardAction { diff --git a/server/src/main/java/org/opensearch/action/get/TransportMultiGetAction.java b/server/src/main/java/org/opensearch/action/get/TransportMultiGetAction.java index 33f1e559a072c..1e0566e23fff4 100644 --- a/server/src/main/java/org/opensearch/action/get/TransportMultiGetAction.java +++ b/server/src/main/java/org/opensearch/action/get/TransportMultiGetAction.java @@ -50,6 +50,11 @@ import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; +/** + * Perform the multi get action. + * + * @opensearch.internal + */ public class TransportMultiGetAction extends HandledTransportAction { private final ClusterService clusterService; diff --git a/server/src/main/java/org/opensearch/action/get/TransportShardMultiGetAction.java b/server/src/main/java/org/opensearch/action/get/TransportShardMultiGetAction.java index db35af9c3e20f..e882ffdc8c344 100644 --- a/server/src/main/java/org/opensearch/action/get/TransportShardMultiGetAction.java +++ b/server/src/main/java/org/opensearch/action/get/TransportShardMultiGetAction.java @@ -53,6 +53,11 @@ import java.io.IOException; +/** + * Perform the shard multi get action + * + * @opensearch.internal + */ public class TransportShardMultiGetAction extends TransportSingleShardAction { private static final String ACTION_NAME = MultiGetAction.NAME + "[shard]"; diff --git a/server/src/main/java/org/opensearch/action/index/IndexAction.java b/server/src/main/java/org/opensearch/action/index/IndexAction.java index 3f28af9b39d8a..0383cafba2958 100644 --- a/server/src/main/java/org/opensearch/action/index/IndexAction.java +++ b/server/src/main/java/org/opensearch/action/index/IndexAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for indexing a document. + * + * @opensearch.internal + */ public class IndexAction extends ActionType { public static final IndexAction INSTANCE = new IndexAction(); diff --git a/server/src/main/java/org/opensearch/action/index/IndexRequest.java b/server/src/main/java/org/opensearch/action/index/IndexRequest.java index 7bf6b876fa652..f863c4a11340e 100644 --- a/server/src/main/java/org/opensearch/action/index/IndexRequest.java +++ b/server/src/main/java/org/opensearch/action/index/IndexRequest.java @@ -88,6 +88,8 @@ * @see IndexResponse * @see org.opensearch.client.Requests#indexRequest(String) * @see org.opensearch.client.Client#index(IndexRequest) + * + * @opensearch.internal */ public class IndexRequest extends ReplicatedWriteRequest implements DocWriteRequest, CompositeIndicesRequest { diff --git a/server/src/main/java/org/opensearch/action/index/IndexRequestBuilder.java b/server/src/main/java/org/opensearch/action/index/IndexRequestBuilder.java index cef5ef0f85c62..2902ffd347c6a 100644 --- a/server/src/main/java/org/opensearch/action/index/IndexRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/index/IndexRequestBuilder.java @@ -46,6 +46,8 @@ /** * An index document action request builder. + * + * @opensearch.internal */ public class IndexRequestBuilder extends ReplicationRequestBuilder implements diff --git a/server/src/main/java/org/opensearch/action/index/IndexResponse.java b/server/src/main/java/org/opensearch/action/index/IndexResponse.java index be0826ce84f96..3ac8246d0c017 100644 --- a/server/src/main/java/org/opensearch/action/index/IndexResponse.java +++ b/server/src/main/java/org/opensearch/action/index/IndexResponse.java @@ -48,6 +48,8 @@ * * @see IndexRequest * @see org.opensearch.client.Client#index(IndexRequest) + * + * @opensearch.internal */ public class IndexResponse extends DocWriteResponse { diff --git a/server/src/main/java/org/opensearch/action/index/TransportIndexAction.java b/server/src/main/java/org/opensearch/action/index/TransportIndexAction.java index dcee695620498..fe4f80bf0c065 100644 --- a/server/src/main/java/org/opensearch/action/index/TransportIndexAction.java +++ b/server/src/main/java/org/opensearch/action/index/TransportIndexAction.java @@ -49,6 +49,8 @@ * * * Deprecated use TransportBulkAction with a single item instead + * + * @opensearch.internal */ @Deprecated public class TransportIndexAction extends TransportSingleItemBulkWriteAction { diff --git a/server/src/main/java/org/opensearch/action/ingest/DeletePipelineAction.java b/server/src/main/java/org/opensearch/action/ingest/DeletePipelineAction.java index 5ea978db3d5d4..6017be9747912 100644 --- a/server/src/main/java/org/opensearch/action/ingest/DeletePipelineAction.java +++ b/server/src/main/java/org/opensearch/action/ingest/DeletePipelineAction.java @@ -35,6 +35,11 @@ import org.opensearch.action.ActionType; import org.opensearch.action.support.master.AcknowledgedResponse; +/** + * Transport action to delete a pipeline + * + * @opensearch.internal + */ public class DeletePipelineAction extends ActionType { public static final DeletePipelineAction INSTANCE = new DeletePipelineAction(); diff --git a/server/src/main/java/org/opensearch/action/ingest/DeletePipelineRequest.java b/server/src/main/java/org/opensearch/action/ingest/DeletePipelineRequest.java index 98bc125ce40dc..0bd102849eee8 100644 --- a/server/src/main/java/org/opensearch/action/ingest/DeletePipelineRequest.java +++ b/server/src/main/java/org/opensearch/action/ingest/DeletePipelineRequest.java @@ -40,6 +40,11 @@ import java.io.IOException; import java.util.Objects; +/** + * transport request to delete a pipeline + * + * @opensearch.internal + */ public class DeletePipelineRequest extends AcknowledgedRequest { private String id; diff --git a/server/src/main/java/org/opensearch/action/ingest/DeletePipelineRequestBuilder.java b/server/src/main/java/org/opensearch/action/ingest/DeletePipelineRequestBuilder.java index 53b5080f414e0..6a2eb494e8d3f 100644 --- a/server/src/main/java/org/opensearch/action/ingest/DeletePipelineRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/ingest/DeletePipelineRequestBuilder.java @@ -36,6 +36,11 @@ import org.opensearch.action.support.master.AcknowledgedResponse; import org.opensearch.client.OpenSearchClient; +/** + * Transport request builder to delete a pipeline + * + * @opensearch.internal + */ public class DeletePipelineRequestBuilder extends ActionRequestBuilder { public DeletePipelineRequestBuilder(OpenSearchClient client, DeletePipelineAction action) { diff --git a/server/src/main/java/org/opensearch/action/ingest/DeletePipelineTransportAction.java b/server/src/main/java/org/opensearch/action/ingest/DeletePipelineTransportAction.java index de2cf1ca74254..62fa2cbc595a6 100644 --- a/server/src/main/java/org/opensearch/action/ingest/DeletePipelineTransportAction.java +++ b/server/src/main/java/org/opensearch/action/ingest/DeletePipelineTransportAction.java @@ -48,6 +48,11 @@ import java.io.IOException; +/** + * Perform the action of deleting a pipeline + * + * @opensearch.internal + */ public class DeletePipelineTransportAction extends TransportMasterNodeAction { private final IngestService ingestService; diff --git a/server/src/main/java/org/opensearch/action/ingest/GetPipelineAction.java b/server/src/main/java/org/opensearch/action/ingest/GetPipelineAction.java index 33b9d8f09d053..8371d82b8911e 100644 --- a/server/src/main/java/org/opensearch/action/ingest/GetPipelineAction.java +++ b/server/src/main/java/org/opensearch/action/ingest/GetPipelineAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action to get a pipeline + * + * @opensearch.internal + */ public class GetPipelineAction extends ActionType { public static final GetPipelineAction INSTANCE = new GetPipelineAction(); diff --git a/server/src/main/java/org/opensearch/action/ingest/GetPipelineRequest.java b/server/src/main/java/org/opensearch/action/ingest/GetPipelineRequest.java index 322fd1b8e1a52..f6ae98a5ea193 100644 --- a/server/src/main/java/org/opensearch/action/ingest/GetPipelineRequest.java +++ b/server/src/main/java/org/opensearch/action/ingest/GetPipelineRequest.java @@ -40,6 +40,11 @@ import java.io.IOException; +/** + * transport request to get a pipeline + * + * @opensearch.internal + */ public class GetPipelineRequest extends MasterNodeReadRequest { private String[] ids; diff --git a/server/src/main/java/org/opensearch/action/ingest/GetPipelineRequestBuilder.java b/server/src/main/java/org/opensearch/action/ingest/GetPipelineRequestBuilder.java index 45d9abc6b0adc..6ba0d4fbfe2f7 100644 --- a/server/src/main/java/org/opensearch/action/ingest/GetPipelineRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/ingest/GetPipelineRequestBuilder.java @@ -35,6 +35,11 @@ import org.opensearch.action.support.master.MasterNodeReadOperationRequestBuilder; import org.opensearch.client.OpenSearchClient; +/** + * Transport request builder to get a pipeline + * + * @opensearch.internal + */ public class GetPipelineRequestBuilder extends MasterNodeReadOperationRequestBuilder< GetPipelineRequest, GetPipelineResponse, diff --git a/server/src/main/java/org/opensearch/action/ingest/GetPipelineResponse.java b/server/src/main/java/org/opensearch/action/ingest/GetPipelineResponse.java index bf7dd909e390b..9e1895fc01857 100644 --- a/server/src/main/java/org/opensearch/action/ingest/GetPipelineResponse.java +++ b/server/src/main/java/org/opensearch/action/ingest/GetPipelineResponse.java @@ -53,6 +53,11 @@ import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +/** + * transport response for getting a pipeline + * + * @opensearch.internal + */ public class GetPipelineResponse extends ActionResponse implements StatusToXContentObject { private List pipelines; diff --git a/server/src/main/java/org/opensearch/action/ingest/GetPipelineTransportAction.java b/server/src/main/java/org/opensearch/action/ingest/GetPipelineTransportAction.java index a62201d097d12..9c7af1cfe3419 100644 --- a/server/src/main/java/org/opensearch/action/ingest/GetPipelineTransportAction.java +++ b/server/src/main/java/org/opensearch/action/ingest/GetPipelineTransportAction.java @@ -48,6 +48,11 @@ import java.io.IOException; +/** + * Perform the action of getting a pipeline + * + * @opensearch.internal + */ public class GetPipelineTransportAction extends TransportMasterNodeReadAction { @Inject diff --git a/server/src/main/java/org/opensearch/action/ingest/IngestActionForwarder.java b/server/src/main/java/org/opensearch/action/ingest/IngestActionForwarder.java index 3ab3e3367fc6d..9df82c474c498 100644 --- a/server/src/main/java/org/opensearch/action/ingest/IngestActionForwarder.java +++ b/server/src/main/java/org/opensearch/action/ingest/IngestActionForwarder.java @@ -48,6 +48,8 @@ * A utility for forwarding ingest requests to ingest nodes in a round-robin fashion. * * TODO: move this into IngestService and make index/bulk actions call that + * + * @opensearch.internal */ public final class IngestActionForwarder implements ClusterStateApplier { diff --git a/server/src/main/java/org/opensearch/action/ingest/PutPipelineAction.java b/server/src/main/java/org/opensearch/action/ingest/PutPipelineAction.java index d61a1ae1041cb..1fcbd783d246b 100644 --- a/server/src/main/java/org/opensearch/action/ingest/PutPipelineAction.java +++ b/server/src/main/java/org/opensearch/action/ingest/PutPipelineAction.java @@ -35,6 +35,11 @@ import org.opensearch.action.ActionType; import org.opensearch.action.support.master.AcknowledgedResponse; +/** + * Transport action to put a new pipeline + * + * @opensearch.internal + */ public class PutPipelineAction extends ActionType { public static final PutPipelineAction INSTANCE = new PutPipelineAction(); diff --git a/server/src/main/java/org/opensearch/action/ingest/PutPipelineRequest.java b/server/src/main/java/org/opensearch/action/ingest/PutPipelineRequest.java index 526da7c4a74dc..d5fbaa46810f7 100644 --- a/server/src/main/java/org/opensearch/action/ingest/PutPipelineRequest.java +++ b/server/src/main/java/org/opensearch/action/ingest/PutPipelineRequest.java @@ -44,6 +44,11 @@ import java.io.IOException; import java.util.Objects; +/** + * transport request to put a pipeline + * + * @opensearch.internal + */ public class PutPipelineRequest extends AcknowledgedRequest implements ToXContentObject { private String id; diff --git a/server/src/main/java/org/opensearch/action/ingest/PutPipelineRequestBuilder.java b/server/src/main/java/org/opensearch/action/ingest/PutPipelineRequestBuilder.java index 8279e2f3756e9..fec2cdef089e4 100644 --- a/server/src/main/java/org/opensearch/action/ingest/PutPipelineRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/ingest/PutPipelineRequestBuilder.java @@ -38,6 +38,11 @@ import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.xcontent.XContentType; +/** + * Transport request builder to put a pipeline + * + * @opensearch.internal + */ public class PutPipelineRequestBuilder extends ActionRequestBuilder { public PutPipelineRequestBuilder(OpenSearchClient client, PutPipelineAction action) { diff --git a/server/src/main/java/org/opensearch/action/ingest/PutPipelineTransportAction.java b/server/src/main/java/org/opensearch/action/ingest/PutPipelineTransportAction.java index 89d1c1efed8a6..6f21744e5df08 100644 --- a/server/src/main/java/org/opensearch/action/ingest/PutPipelineTransportAction.java +++ b/server/src/main/java/org/opensearch/action/ingest/PutPipelineTransportAction.java @@ -58,6 +58,11 @@ import static org.opensearch.ingest.IngestService.INGEST_ORIGIN; +/** + * Perform the action of putting a pipeline + * + * @opensearch.internal + */ public class PutPipelineTransportAction extends TransportMasterNodeAction { private final IngestService ingestService; diff --git a/server/src/main/java/org/opensearch/action/ingest/SimulateDocumentBaseResult.java b/server/src/main/java/org/opensearch/action/ingest/SimulateDocumentBaseResult.java index 10ccb2003969d..2440a1802912b 100644 --- a/server/src/main/java/org/opensearch/action/ingest/SimulateDocumentBaseResult.java +++ b/server/src/main/java/org/opensearch/action/ingest/SimulateDocumentBaseResult.java @@ -47,6 +47,8 @@ /** * Holds the end result of what a pipeline did to sample document provided via the simulate api. + * + * */ public final class SimulateDocumentBaseResult implements SimulateDocumentResult { private final WriteableIngestDocument ingestDocument; diff --git a/server/src/main/java/org/opensearch/action/ingest/SimulateDocumentResult.java b/server/src/main/java/org/opensearch/action/ingest/SimulateDocumentResult.java index 3beaf43d2a1ae..77ee75fcb9663 100644 --- a/server/src/main/java/org/opensearch/action/ingest/SimulateDocumentResult.java +++ b/server/src/main/java/org/opensearch/action/ingest/SimulateDocumentResult.java @@ -34,6 +34,11 @@ import org.opensearch.common.io.stream.Writeable; import org.opensearch.common.xcontent.ToXContentObject; +/** + * Interface to simulate a document result + * + * @opensearch.internal + */ public interface SimulateDocumentResult extends Writeable, ToXContentObject { } diff --git a/server/src/main/java/org/opensearch/action/ingest/SimulateDocumentVerboseResult.java b/server/src/main/java/org/opensearch/action/ingest/SimulateDocumentVerboseResult.java index 07d9b628fe35d..591a3e103fccf 100644 --- a/server/src/main/java/org/opensearch/action/ingest/SimulateDocumentVerboseResult.java +++ b/server/src/main/java/org/opensearch/action/ingest/SimulateDocumentVerboseResult.java @@ -47,6 +47,8 @@ /** * Holds the result of what a pipeline did to a sample document via the simulate api, but instead of {@link SimulateDocumentBaseResult} * this result class holds the intermediate result each processor did to the sample document. + * + * @opensearch.internal */ public final class SimulateDocumentVerboseResult implements SimulateDocumentResult { public static final String PROCESSOR_RESULT_FIELD = "processor_results"; diff --git a/server/src/main/java/org/opensearch/action/ingest/SimulateExecutionService.java b/server/src/main/java/org/opensearch/action/ingest/SimulateExecutionService.java index 8c620c707b3ac..ae66dafc954f9 100644 --- a/server/src/main/java/org/opensearch/action/ingest/SimulateExecutionService.java +++ b/server/src/main/java/org/opensearch/action/ingest/SimulateExecutionService.java @@ -46,6 +46,11 @@ import static org.opensearch.ingest.TrackingResultProcessor.decorate; +/** + * Service to simulate pipeline execution + * + * @opensearch.internal + */ class SimulateExecutionService { private static final String THREAD_POOL_NAME = ThreadPool.Names.MANAGEMENT; diff --git a/server/src/main/java/org/opensearch/action/ingest/SimulatePipelineAction.java b/server/src/main/java/org/opensearch/action/ingest/SimulatePipelineAction.java index 8039a83b5953e..df2cfda778d06 100644 --- a/server/src/main/java/org/opensearch/action/ingest/SimulatePipelineAction.java +++ b/server/src/main/java/org/opensearch/action/ingest/SimulatePipelineAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action to simulate a pipeline + * + * @opensearch.internal + */ public class SimulatePipelineAction extends ActionType { public static final SimulatePipelineAction INSTANCE = new SimulatePipelineAction(); diff --git a/server/src/main/java/org/opensearch/action/ingest/SimulatePipelineRequest.java b/server/src/main/java/org/opensearch/action/ingest/SimulatePipelineRequest.java index bc0317e076319..2766e3fb1a038 100644 --- a/server/src/main/java/org/opensearch/action/ingest/SimulatePipelineRequest.java +++ b/server/src/main/java/org/opensearch/action/ingest/SimulatePipelineRequest.java @@ -55,6 +55,11 @@ import java.util.Map; import java.util.Objects; +/** + * transport request to simulate a pipeline + * + * @opensearch.internal + */ public class SimulatePipelineRequest extends ActionRequest implements ToXContentObject { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(SimulatePipelineRequest.class); diff --git a/server/src/main/java/org/opensearch/action/ingest/SimulatePipelineRequestBuilder.java b/server/src/main/java/org/opensearch/action/ingest/SimulatePipelineRequestBuilder.java index 6befbea774685..0cf71b66fe936 100644 --- a/server/src/main/java/org/opensearch/action/ingest/SimulatePipelineRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/ingest/SimulatePipelineRequestBuilder.java @@ -37,6 +37,11 @@ import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.xcontent.XContentType; +/** + * Transport request builder to simulate a pipeline + * + * @opensearch.internal + */ public class SimulatePipelineRequestBuilder extends ActionRequestBuilder { /** diff --git a/server/src/main/java/org/opensearch/action/ingest/SimulatePipelineResponse.java b/server/src/main/java/org/opensearch/action/ingest/SimulatePipelineResponse.java index c3540e4e9b8fd..1b1b93ffde98b 100644 --- a/server/src/main/java/org/opensearch/action/ingest/SimulatePipelineResponse.java +++ b/server/src/main/java/org/opensearch/action/ingest/SimulatePipelineResponse.java @@ -51,6 +51,11 @@ import static org.opensearch.common.xcontent.ConstructingObjectParser.constructorArg; import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +/** + * transport response for simulating a pipeline + * + * @opensearch.internal + */ public class SimulatePipelineResponse extends ActionResponse implements ToXContentObject { private String pipelineId; private boolean verbose; diff --git a/server/src/main/java/org/opensearch/action/ingest/SimulatePipelineTransportAction.java b/server/src/main/java/org/opensearch/action/ingest/SimulatePipelineTransportAction.java index 7348035deaafe..daffbbf61a1bb 100644 --- a/server/src/main/java/org/opensearch/action/ingest/SimulatePipelineTransportAction.java +++ b/server/src/main/java/org/opensearch/action/ingest/SimulatePipelineTransportAction.java @@ -45,6 +45,11 @@ import java.util.Map; +/** + * Perform the action of simulating a pipeline + * + * @opensearch.internal + */ public class SimulatePipelineTransportAction extends HandledTransportAction { private final IngestService ingestService; diff --git a/server/src/main/java/org/opensearch/action/ingest/SimulateProcessorResult.java b/server/src/main/java/org/opensearch/action/ingest/SimulateProcessorResult.java index eae36cc4efd7c..e971aca855c30 100644 --- a/server/src/main/java/org/opensearch/action/ingest/SimulateProcessorResult.java +++ b/server/src/main/java/org/opensearch/action/ingest/SimulateProcessorResult.java @@ -51,6 +51,11 @@ import static org.opensearch.common.xcontent.ConstructingObjectParser.constructorArg; import static org.opensearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +/** + * Simulates an ingest processor result + * + * @opensearch.internal + */ public class SimulateProcessorResult implements Writeable, ToXContentObject { private static final String IGNORED_ERROR_FIELD = "ignored_error"; diff --git a/server/src/main/java/org/opensearch/action/ingest/WriteableIngestDocument.java b/server/src/main/java/org/opensearch/action/ingest/WriteableIngestDocument.java index 2f8c65486c22f..9ceb1d7e3f890 100644 --- a/server/src/main/java/org/opensearch/action/ingest/WriteableIngestDocument.java +++ b/server/src/main/java/org/opensearch/action/ingest/WriteableIngestDocument.java @@ -52,6 +52,11 @@ import static org.opensearch.common.xcontent.ConstructingObjectParser.constructorArg; import static org.opensearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +/** + * An ingest document that implements writeable + * + * @opensearch.internal + */ final class WriteableIngestDocument implements Writeable, ToXContentFragment { static final String SOURCE_FIELD = "_source"; diff --git a/server/src/main/java/org/opensearch/action/main/MainAction.java b/server/src/main/java/org/opensearch/action/main/MainAction.java index 46de6f9e2b0f0..c5cbac824ec83 100644 --- a/server/src/main/java/org/opensearch/action/main/MainAction.java +++ b/server/src/main/java/org/opensearch/action/main/MainAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * The main OpenSearch Action + * + * @opensearch.internal + */ public class MainAction extends ActionType { public static final String NAME = "cluster:monitor/main"; diff --git a/server/src/main/java/org/opensearch/action/main/MainRequest.java b/server/src/main/java/org/opensearch/action/main/MainRequest.java index f5cafecb87375..e1c1844f9d4dc 100644 --- a/server/src/main/java/org/opensearch/action/main/MainRequest.java +++ b/server/src/main/java/org/opensearch/action/main/MainRequest.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Transport request for main action + * + * @opensearch.internal + */ public class MainRequest extends ActionRequest { public MainRequest() {} diff --git a/server/src/main/java/org/opensearch/action/main/MainRequestBuilder.java b/server/src/main/java/org/opensearch/action/main/MainRequestBuilder.java index 8f73f316194ba..bd62882551c44 100644 --- a/server/src/main/java/org/opensearch/action/main/MainRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/main/MainRequestBuilder.java @@ -35,6 +35,11 @@ import org.opensearch.action.ActionRequestBuilder; import org.opensearch.client.OpenSearchClient; +/** + * Transport request builder for the main opensearch action + * + * @opensearch.internal + */ public class MainRequestBuilder extends ActionRequestBuilder { public MainRequestBuilder(OpenSearchClient client, MainAction action) { diff --git a/server/src/main/java/org/opensearch/action/main/MainResponse.java b/server/src/main/java/org/opensearch/action/main/MainResponse.java index 1f460e5dfb019..691bbda512275 100644 --- a/server/src/main/java/org/opensearch/action/main/MainResponse.java +++ b/server/src/main/java/org/opensearch/action/main/MainResponse.java @@ -48,6 +48,11 @@ import java.io.IOException; import java.util.Objects; +/** + * The main response of opensearch + * + * @opensearch.internal + */ public class MainResponse extends ActionResponse implements ToXContentObject { private String nodeName; diff --git a/server/src/main/java/org/opensearch/action/main/TransportMainAction.java b/server/src/main/java/org/opensearch/action/main/TransportMainAction.java index 5170b23977b1e..2916c3dd88d49 100644 --- a/server/src/main/java/org/opensearch/action/main/TransportMainAction.java +++ b/server/src/main/java/org/opensearch/action/main/TransportMainAction.java @@ -45,6 +45,11 @@ import org.opensearch.tasks.Task; import org.opensearch.transport.TransportService; +/** + * Performs the main action + * + * @opensearch.internal + */ public class TransportMainAction extends HandledTransportAction { private final String nodeName; diff --git a/server/src/main/java/org/opensearch/action/resync/ResyncReplicationRequest.java b/server/src/main/java/org/opensearch/action/resync/ResyncReplicationRequest.java index 2ecbc49384fe5..d87b5b05118e3 100644 --- a/server/src/main/java/org/opensearch/action/resync/ResyncReplicationRequest.java +++ b/server/src/main/java/org/opensearch/action/resync/ResyncReplicationRequest.java @@ -43,6 +43,7 @@ /** * Represents a batch of operations sent from the primary to its replicas during the primary-replica resync. + * @opensearch.internal */ public final class ResyncReplicationRequest extends ReplicatedWriteRequest { diff --git a/server/src/main/java/org/opensearch/action/resync/ResyncReplicationResponse.java b/server/src/main/java/org/opensearch/action/resync/ResyncReplicationResponse.java index 1e052c5d80e80..22507ee717a1c 100644 --- a/server/src/main/java/org/opensearch/action/resync/ResyncReplicationResponse.java +++ b/server/src/main/java/org/opensearch/action/resync/ResyncReplicationResponse.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Transport response for resyncing replication + * + * @opensearch.internal + */ public final class ResyncReplicationResponse extends ReplicationResponse implements WriteResponse { public ResyncReplicationResponse() {} diff --git a/server/src/main/java/org/opensearch/action/resync/TransportResyncReplicationAction.java b/server/src/main/java/org/opensearch/action/resync/TransportResyncReplicationAction.java index ea596b12f262f..f022e325dceb0 100644 --- a/server/src/main/java/org/opensearch/action/resync/TransportResyncReplicationAction.java +++ b/server/src/main/java/org/opensearch/action/resync/TransportResyncReplicationAction.java @@ -64,6 +64,11 @@ import java.util.function.Function; import java.util.stream.Stream; +/** + * Perform replication resync + * + * @opensearch.internal + */ public class TransportResyncReplicationAction extends TransportWriteAction< ResyncReplicationRequest, ResyncReplicationRequest, diff --git a/server/src/main/java/org/opensearch/action/search/AbstractSearchAsyncAction.java b/server/src/main/java/org/opensearch/action/search/AbstractSearchAsyncAction.java index 190904145b091..fd93d5f17fdef 100644 --- a/server/src/main/java/org/opensearch/action/search/AbstractSearchAsyncAction.java +++ b/server/src/main/java/org/opensearch/action/search/AbstractSearchAsyncAction.java @@ -78,6 +78,8 @@ * referred to as the {@code shardIndex}. * The fan out and collect algorithm is traditionally used as the initial phase which can either be a query execution or collection of * distributed frequencies + * + * @opensearch.internal */ abstract class AbstractSearchAsyncAction extends SearchPhase implements SearchPhaseContext { private static final float DEFAULT_INDEX_BOOST = 1.0f; diff --git a/server/src/main/java/org/opensearch/action/search/ArraySearchPhaseResults.java b/server/src/main/java/org/opensearch/action/search/ArraySearchPhaseResults.java index 58cffe2ed5b8c..61c81e6cda97a 100644 --- a/server/src/main/java/org/opensearch/action/search/ArraySearchPhaseResults.java +++ b/server/src/main/java/org/opensearch/action/search/ArraySearchPhaseResults.java @@ -39,6 +39,8 @@ /** * This class acts as a basic result collection that can be extended to do on-the-fly reduction or result processing + * + * @opensearch.internal */ class ArraySearchPhaseResults extends SearchPhaseResults { final AtomicArray results; diff --git a/server/src/main/java/org/opensearch/action/search/BottomSortValuesCollector.java b/server/src/main/java/org/opensearch/action/search/BottomSortValuesCollector.java index 64f50d2f37cdb..c831c80b6455c 100644 --- a/server/src/main/java/org/opensearch/action/search/BottomSortValuesCollector.java +++ b/server/src/main/java/org/opensearch/action/search/BottomSortValuesCollector.java @@ -41,6 +41,8 @@ /** * Utility class to keep track of the bottom doc's sort values in a distributed search. + * + * @opensearch.internal */ class BottomSortValuesCollector { private final int topNSize; diff --git a/server/src/main/java/org/opensearch/action/search/CanMatchPreFilterSearchPhase.java b/server/src/main/java/org/opensearch/action/search/CanMatchPreFilterSearchPhase.java index 2e67e6aa93a72..816ca45d13c10 100644 --- a/server/src/main/java/org/opensearch/action/search/CanMatchPreFilterSearchPhase.java +++ b/server/src/main/java/org/opensearch/action/search/CanMatchPreFilterSearchPhase.java @@ -67,6 +67,8 @@ * When the query primary sort is perform on a field, this phase extracts the min/max value in each shard and * sort them according to the provided order. This can be useful for instance to ensure that shards that contain recent * data are executed first when sorting by descending timestamp. + * + * @opensearch.internal */ final class CanMatchPreFilterSearchPhase extends AbstractSearchAsyncAction { diff --git a/server/src/main/java/org/opensearch/action/search/ClearScrollAction.java b/server/src/main/java/org/opensearch/action/search/ClearScrollAction.java index 91ae4b2109ae1..70072e5ec9156 100644 --- a/server/src/main/java/org/opensearch/action/search/ClearScrollAction.java +++ b/server/src/main/java/org/opensearch/action/search/ClearScrollAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport Action for clearing a scroll + * + * @opensearch.internal + */ public class ClearScrollAction extends ActionType { public static final ClearScrollAction INSTANCE = new ClearScrollAction(); diff --git a/server/src/main/java/org/opensearch/action/search/ClearScrollController.java b/server/src/main/java/org/opensearch/action/search/ClearScrollController.java index 390f5e2b99e63..4bb3cbb88ba01 100644 --- a/server/src/main/java/org/opensearch/action/search/ClearScrollController.java +++ b/server/src/main/java/org/opensearch/action/search/ClearScrollController.java @@ -53,6 +53,11 @@ import java.util.function.BiFunction; import java.util.stream.Collectors; +/** + * Main controller for clearing a scroll + * + * @opensearch.internal + */ public final class ClearScrollController implements Runnable { private final DiscoveryNodes nodes; private final SearchTransportService searchTransportService; diff --git a/server/src/main/java/org/opensearch/action/search/ClearScrollRequest.java b/server/src/main/java/org/opensearch/action/search/ClearScrollRequest.java index 3fb1ebcd6fcc2..4105f5ece5221 100644 --- a/server/src/main/java/org/opensearch/action/search/ClearScrollRequest.java +++ b/server/src/main/java/org/opensearch/action/search/ClearScrollRequest.java @@ -47,6 +47,11 @@ import static org.opensearch.action.ValidateActions.addValidationError; +/** + * Transport request for clearing a search scroll + * + * @opensearch.internal + */ public class ClearScrollRequest extends ActionRequest implements ToXContentObject { private List scrollIds; diff --git a/server/src/main/java/org/opensearch/action/search/ClearScrollRequestBuilder.java b/server/src/main/java/org/opensearch/action/search/ClearScrollRequestBuilder.java index ba76b641c8f56..63f64e02a9dd2 100644 --- a/server/src/main/java/org/opensearch/action/search/ClearScrollRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/search/ClearScrollRequestBuilder.java @@ -37,6 +37,11 @@ import java.util.List; +/** + * Transport request builder for clearing a search scroll + * + * @opensearch.internal + */ public class ClearScrollRequestBuilder extends ActionRequestBuilder { public ClearScrollRequestBuilder(OpenSearchClient client, ClearScrollAction action) { diff --git a/server/src/main/java/org/opensearch/action/search/ClearScrollResponse.java b/server/src/main/java/org/opensearch/action/search/ClearScrollResponse.java index 7a989e646e4d0..e836860fd1990 100644 --- a/server/src/main/java/org/opensearch/action/search/ClearScrollResponse.java +++ b/server/src/main/java/org/opensearch/action/search/ClearScrollResponse.java @@ -49,6 +49,11 @@ import static org.opensearch.rest.RestStatus.NOT_FOUND; import static org.opensearch.rest.RestStatus.OK; +/** + * Transport response for clearing a search scroll + * + * @opensearch.internal + */ public class ClearScrollResponse extends ActionResponse implements StatusToXContentObject { private static final ParseField SUCCEEDED = new ParseField("succeeded"); diff --git a/server/src/main/java/org/opensearch/action/search/CountedCollector.java b/server/src/main/java/org/opensearch/action/search/CountedCollector.java index cb00902b52b7c..c73c4be2fa662 100644 --- a/server/src/main/java/org/opensearch/action/search/CountedCollector.java +++ b/server/src/main/java/org/opensearch/action/search/CountedCollector.java @@ -40,6 +40,8 @@ * This is a simple base class to simplify fan out to shards and collect their results. Each results passed to * {@link #onResult(SearchPhaseResult)} will be set to the provided result array * where the given index is used to set the result on the array. + * + * @opensearch.internal */ final class CountedCollector { private final ArraySearchPhaseResults resultConsumer; diff --git a/server/src/main/java/org/opensearch/action/search/DfsQueryPhase.java b/server/src/main/java/org/opensearch/action/search/DfsQueryPhase.java index 6152f4cfdc599..c5747842614c7 100644 --- a/server/src/main/java/org/opensearch/action/search/DfsQueryPhase.java +++ b/server/src/main/java/org/opensearch/action/search/DfsQueryPhase.java @@ -50,6 +50,8 @@ * retry on another shard if any of the shards are failing. Failures are treated as shard failures and are counted as a non-successful * operation. * @see CountedCollector#onFailure(int, SearchShardTarget, Exception) + * + * @opensearch.internal */ final class DfsQueryPhase extends SearchPhase { private final ArraySearchPhaseResults queryResult; diff --git a/server/src/main/java/org/opensearch/action/search/ExpandSearchPhase.java b/server/src/main/java/org/opensearch/action/search/ExpandSearchPhase.java index 6c131697cb31e..cdefe7c2c1712 100644 --- a/server/src/main/java/org/opensearch/action/search/ExpandSearchPhase.java +++ b/server/src/main/java/org/opensearch/action/search/ExpandSearchPhase.java @@ -53,6 +53,8 @@ * This search phase is an optional phase that will be executed once all hits are fetched from the shards that executes * field-collapsing on the inner hits. This phase only executes if field collapsing is requested in the search request and otherwise * forwards to the next phase immediately. + * + * @opensearch.internal */ final class ExpandSearchPhase extends SearchPhase { private final SearchPhaseContext context; diff --git a/server/src/main/java/org/opensearch/action/search/FetchSearchPhase.java b/server/src/main/java/org/opensearch/action/search/FetchSearchPhase.java index c106c5e2f8069..31ec896856ce6 100644 --- a/server/src/main/java/org/opensearch/action/search/FetchSearchPhase.java +++ b/server/src/main/java/org/opensearch/action/search/FetchSearchPhase.java @@ -56,6 +56,8 @@ /** * This search phase merges the query results from the previous phase together and calculates the topN hits for this search. * Then it reaches out to all relevant shards to fetch the topN hits. + * + * @opensearch.internal */ final class FetchSearchPhase extends SearchPhase { private final ArraySearchPhaseResults fetchResults; diff --git a/server/src/main/java/org/opensearch/action/search/MaxScoreCollector.java b/server/src/main/java/org/opensearch/action/search/MaxScoreCollector.java index fce1de8cecbda..d7e0ba6d30fec 100644 --- a/server/src/main/java/org/opensearch/action/search/MaxScoreCollector.java +++ b/server/src/main/java/org/opensearch/action/search/MaxScoreCollector.java @@ -40,6 +40,8 @@ /** * A collector that computes the maximum score. + * + * @opensearch.internal */ public class MaxScoreCollector extends SimpleCollector { diff --git a/server/src/main/java/org/opensearch/action/search/MultiSearchAction.java b/server/src/main/java/org/opensearch/action/search/MultiSearchAction.java index fc8416536bf0a..84c18855324a9 100644 --- a/server/src/main/java/org/opensearch/action/search/MultiSearchAction.java +++ b/server/src/main/java/org/opensearch/action/search/MultiSearchAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for executing a multi search + * + * @opensearch.internal + */ public class MultiSearchAction extends ActionType { public static final MultiSearchAction INSTANCE = new MultiSearchAction(); diff --git a/server/src/main/java/org/opensearch/action/search/MultiSearchRequest.java b/server/src/main/java/org/opensearch/action/search/MultiSearchRequest.java index c45b6477d30f0..810c5f4a11258 100644 --- a/server/src/main/java/org/opensearch/action/search/MultiSearchRequest.java +++ b/server/src/main/java/org/opensearch/action/search/MultiSearchRequest.java @@ -70,6 +70,8 @@ /** * A multi search API request. + * + * @opensearch.internal */ public class MultiSearchRequest extends ActionRequest implements CompositeIndicesRequest { diff --git a/server/src/main/java/org/opensearch/action/search/MultiSearchRequestBuilder.java b/server/src/main/java/org/opensearch/action/search/MultiSearchRequestBuilder.java index e8db52b949425..f9bb90c69d925 100644 --- a/server/src/main/java/org/opensearch/action/search/MultiSearchRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/search/MultiSearchRequestBuilder.java @@ -38,6 +38,8 @@ /** * A request builder for multiple search requests. + * + * @opensearch.internal */ public class MultiSearchRequestBuilder extends ActionRequestBuilder { diff --git a/server/src/main/java/org/opensearch/action/search/MultiSearchResponse.java b/server/src/main/java/org/opensearch/action/search/MultiSearchResponse.java index 3869d909cce6e..2349b3a0cab9a 100644 --- a/server/src/main/java/org/opensearch/action/search/MultiSearchResponse.java +++ b/server/src/main/java/org/opensearch/action/search/MultiSearchResponse.java @@ -58,6 +58,8 @@ /** * A multi search response. + * + * @opensearch.internal */ public class MultiSearchResponse extends ActionResponse implements Iterable, ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/search/ParsedScrollId.java b/server/src/main/java/org/opensearch/action/search/ParsedScrollId.java index 1a9eaf7e6716f..70be9a0b19e08 100644 --- a/server/src/main/java/org/opensearch/action/search/ParsedScrollId.java +++ b/server/src/main/java/org/opensearch/action/search/ParsedScrollId.java @@ -34,6 +34,11 @@ import java.util.Arrays; +/** + * Search scroll id that has been parsed + * + * @opensearch.internal + */ public class ParsedScrollId { public static final String QUERY_THEN_FETCH_TYPE = "queryThenFetch"; diff --git a/server/src/main/java/org/opensearch/action/search/QueryPhaseResultConsumer.java b/server/src/main/java/org/opensearch/action/search/QueryPhaseResultConsumer.java index 02e6b54777f7f..c94a63ca2270c 100644 --- a/server/src/main/java/org/opensearch/action/search/QueryPhaseResultConsumer.java +++ b/server/src/main/java/org/opensearch/action/search/QueryPhaseResultConsumer.java @@ -66,6 +66,8 @@ * in the {@link CircuitBreaker#REQUEST} circuit breaker. Before any partial or final reduce, the memory * needed to reduce the aggregations is estimated and a {@link CircuitBreakingException} is thrown if it * exceeds the maximum memory allowed in this breaker. + * + * @opensearch.internal */ public class QueryPhaseResultConsumer extends ArraySearchPhaseResults implements Releasable { private static final Logger logger = LogManager.getLogger(QueryPhaseResultConsumer.class); diff --git a/server/src/main/java/org/opensearch/action/search/ReduceSearchPhaseException.java b/server/src/main/java/org/opensearch/action/search/ReduceSearchPhaseException.java index 88558ceb6f7d9..57c1da5b25795 100644 --- a/server/src/main/java/org/opensearch/action/search/ReduceSearchPhaseException.java +++ b/server/src/main/java/org/opensearch/action/search/ReduceSearchPhaseException.java @@ -40,7 +40,7 @@ * A failure during a reduce phase (when receiving results from several shards, and reducing them * into one or more results and possible actions). * - * + * @opensearch.internal */ public class ReduceSearchPhaseException extends SearchPhaseExecutionException { diff --git a/server/src/main/java/org/opensearch/action/search/SearchAction.java b/server/src/main/java/org/opensearch/action/search/SearchAction.java index e3a906f8b30ce..c94b3b7352196 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchAction.java +++ b/server/src/main/java/org/opensearch/action/search/SearchAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for executing a search + * + * @opensearch.internal + */ public class SearchAction extends ActionType { public static final SearchAction INSTANCE = new SearchAction(); diff --git a/server/src/main/java/org/opensearch/action/search/SearchActionListener.java b/server/src/main/java/org/opensearch/action/search/SearchActionListener.java index c081dba3fe9c5..6983eed18b7b3 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchActionListener.java +++ b/server/src/main/java/org/opensearch/action/search/SearchActionListener.java @@ -38,6 +38,8 @@ /** * A base action listener that ensures shard target and shard index is set on all responses * received by this listener. + * + * @opensearch.internal */ abstract class SearchActionListener implements ActionListener { diff --git a/server/src/main/java/org/opensearch/action/search/SearchContextId.java b/server/src/main/java/org/opensearch/action/search/SearchContextId.java index 59ebb128b924a..c2bb46a7b0e57 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchContextId.java +++ b/server/src/main/java/org/opensearch/action/search/SearchContextId.java @@ -57,6 +57,11 @@ import java.util.Map; import java.util.Set; +/** + * Id for a serach context. + * + * @opensearch.internal + */ public class SearchContextId { private final Map shards; private final Map aliasFilter; diff --git a/server/src/main/java/org/opensearch/action/search/SearchContextIdForNode.java b/server/src/main/java/org/opensearch/action/search/SearchContextIdForNode.java index 379b268042e52..8f16a6e3ee226 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchContextIdForNode.java +++ b/server/src/main/java/org/opensearch/action/search/SearchContextIdForNode.java @@ -40,6 +40,11 @@ import java.io.IOException; +/** + * Id for a search context per node. + * + * @opensearch.internal + */ public final class SearchContextIdForNode implements Writeable { private final String node; private final ShardSearchContextId searchContextId; diff --git a/server/src/main/java/org/opensearch/action/search/SearchDfsQueryThenFetchAsyncAction.java b/server/src/main/java/org/opensearch/action/search/SearchDfsQueryThenFetchAsyncAction.java index 50aac3daed52d..71a986c0e15f7 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchDfsQueryThenFetchAsyncAction.java +++ b/server/src/main/java/org/opensearch/action/search/SearchDfsQueryThenFetchAsyncAction.java @@ -49,6 +49,11 @@ import java.util.concurrent.Executor; import java.util.function.BiFunction; +/** + * Async action for DFS Query Then Fetch + * + * @opensearch.internal + */ final class SearchDfsQueryThenFetchAsyncAction extends AbstractSearchAsyncAction { private final SearchPhaseController searchPhaseController; diff --git a/server/src/main/java/org/opensearch/action/search/SearchExecutionStatsCollector.java b/server/src/main/java/org/opensearch/action/search/SearchExecutionStatsCollector.java index ce77a6368f2b6..7082e33dfd5c5 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchExecutionStatsCollector.java +++ b/server/src/main/java/org/opensearch/action/search/SearchExecutionStatsCollector.java @@ -46,6 +46,8 @@ * A wrapper of search action listeners (search results) that unwraps the query * result to get the piggybacked queue size and service time EWMA, adding those * values to the coordinating nodes' {@link ResponseCollectorService}. + * + * @opensearch.internal */ public final class SearchExecutionStatsCollector implements ActionListener { diff --git a/server/src/main/java/org/opensearch/action/search/SearchPhase.java b/server/src/main/java/org/opensearch/action/search/SearchPhase.java index 18509a2694cd1..50f0940754078 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchPhase.java +++ b/server/src/main/java/org/opensearch/action/search/SearchPhase.java @@ -38,6 +38,8 @@ /** * Base class for all individual search phases like collecting distributed frequencies, fetching documents, querying shards. + * + * @opensearch.internal */ abstract class SearchPhase implements CheckedRunnable { private final String name; diff --git a/server/src/main/java/org/opensearch/action/search/SearchPhaseContext.java b/server/src/main/java/org/opensearch/action/search/SearchPhaseContext.java index 2f30d28a0924c..be364fbcb9c84 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchPhaseContext.java +++ b/server/src/main/java/org/opensearch/action/search/SearchPhaseContext.java @@ -47,6 +47,8 @@ /** * This class provide contextual state and access to resources across multiple search phases. + * + * @opensearch.internal */ interface SearchPhaseContext extends Executor { // TODO maybe we can make this concrete later - for now we just implement this in the base class for all initial phases diff --git a/server/src/main/java/org/opensearch/action/search/SearchPhaseController.java b/server/src/main/java/org/opensearch/action/search/SearchPhaseController.java index 8c3b1d20b33a0..4fb940675a5aa 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchPhaseController.java +++ b/server/src/main/java/org/opensearch/action/search/SearchPhaseController.java @@ -84,6 +84,11 @@ import java.util.function.IntFunction; import java.util.stream.Collectors; +/** + * Controller for the search phase. + * + * @opensearch.internal + */ public final class SearchPhaseController { private static final ScoreDoc[] EMPTY_DOCS = new ScoreDoc[0]; diff --git a/server/src/main/java/org/opensearch/action/search/SearchPhaseExecutionException.java b/server/src/main/java/org/opensearch/action/search/SearchPhaseExecutionException.java index fbe6ef667f4f7..cb24118408abf 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchPhaseExecutionException.java +++ b/server/src/main/java/org/opensearch/action/search/SearchPhaseExecutionException.java @@ -46,6 +46,11 @@ import java.util.Arrays; import java.util.List; +/** + * Main exception thrown when there is an error in the search phase + * + * @opensearch.internal + */ public class SearchPhaseExecutionException extends OpenSearchException { private final String phaseName; private final ShardSearchFailure[] shardFailures; diff --git a/server/src/main/java/org/opensearch/action/search/SearchPhaseResults.java b/server/src/main/java/org/opensearch/action/search/SearchPhaseResults.java index 3fa520f1fb5d6..1baea0e721c44 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchPhaseResults.java +++ b/server/src/main/java/org/opensearch/action/search/SearchPhaseResults.java @@ -39,6 +39,8 @@ /** * This class acts as a basic result collection that can be extended to do on-the-fly reduction or result processing + * + * @opensearch.internal */ abstract class SearchPhaseResults { private final int numShards; diff --git a/server/src/main/java/org/opensearch/action/search/SearchProgressActionListener.java b/server/src/main/java/org/opensearch/action/search/SearchProgressActionListener.java index 088aac6d71d30..3f24eea0bfe1e 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchProgressActionListener.java +++ b/server/src/main/java/org/opensearch/action/search/SearchProgressActionListener.java @@ -37,5 +37,7 @@ /** * An {@link ActionListener} for search requests that allows to track progress of the {@link SearchAction}. * See {@link SearchProgressListener}. + * + * @opensearch.internal */ public abstract class SearchProgressActionListener extends SearchProgressListener implements ActionListener {} diff --git a/server/src/main/java/org/opensearch/action/search/SearchProgressListener.java b/server/src/main/java/org/opensearch/action/search/SearchProgressListener.java index 78b1dd19dadaa..ffc64682cb07d 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchProgressListener.java +++ b/server/src/main/java/org/opensearch/action/search/SearchProgressListener.java @@ -50,6 +50,8 @@ /** * A listener that allows to track progress of the {@link SearchAction}. + * + * @opensearch.api */ public abstract class SearchProgressListener { private static final Logger logger = LogManager.getLogger(SearchProgressListener.class); diff --git a/server/src/main/java/org/opensearch/action/search/SearchQueryThenFetchAsyncAction.java b/server/src/main/java/org/opensearch/action/search/SearchQueryThenFetchAsyncAction.java index 93ce3cfd8c715..1ead14aac6b51 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchQueryThenFetchAsyncAction.java +++ b/server/src/main/java/org/opensearch/action/search/SearchQueryThenFetchAsyncAction.java @@ -50,6 +50,11 @@ import java.util.concurrent.Executor; import java.util.function.BiFunction; +/** + * Async transport action for query then fetch + * + * @opensearch.internal + */ class SearchQueryThenFetchAsyncAction extends AbstractSearchAsyncAction { private final SearchPhaseController searchPhaseController; diff --git a/server/src/main/java/org/opensearch/action/search/SearchRequest.java b/server/src/main/java/org/opensearch/action/search/SearchRequest.java index c4b97c35bc405..da34dab6383d9 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchRequest.java +++ b/server/src/main/java/org/opensearch/action/search/SearchRequest.java @@ -69,6 +69,8 @@ * @see org.opensearch.client.Requests#searchRequest(String...) * @see org.opensearch.client.Client#search(SearchRequest) * @see SearchResponse + * + * @opensearch.internal */ public class SearchRequest extends ActionRequest implements IndicesRequest.Replaceable { diff --git a/server/src/main/java/org/opensearch/action/search/SearchRequestBuilder.java b/server/src/main/java/org/opensearch/action/search/SearchRequestBuilder.java index 6def33f82b7bd..8e3d9d3968fc6 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/search/SearchRequestBuilder.java @@ -57,6 +57,8 @@ /** * A search action request builder. + * + * @opensearch.internal */ public class SearchRequestBuilder extends ActionRequestBuilder { diff --git a/server/src/main/java/org/opensearch/action/search/SearchResponse.java b/server/src/main/java/org/opensearch/action/search/SearchResponse.java index e1175dc079ee0..a99de14d2a9e3 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchResponse.java +++ b/server/src/main/java/org/opensearch/action/search/SearchResponse.java @@ -69,6 +69,8 @@ /** * A response of a search request. + * + * @opensearch.internal */ public class SearchResponse extends ActionResponse implements StatusToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/search/SearchResponseMerger.java b/server/src/main/java/org/opensearch/action/search/SearchResponseMerger.java index 528c0693fbcd8..9c32da2d122e0 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchResponseMerger.java +++ b/server/src/main/java/org/opensearch/action/search/SearchResponseMerger.java @@ -79,6 +79,8 @@ * - scroll requests are not supported * - field collapsing is supported, but whenever inner_hits are requested, they will be retrieved by each cluster locally after the fetch * phase, through the {@link ExpandSearchPhase}. Such inner_hits are not merged together as part of hits reduction. + * + * @opensearch.internal */ // TODO it may make sense to integrate the remote clusters responses as a shard response in the initial search phase and ignore hits coming // from the remote clusters in the fetch phase. This would be identical to the removed QueryAndFetch strategy except that only the remote diff --git a/server/src/main/java/org/opensearch/action/search/SearchResponseSections.java b/server/src/main/java/org/opensearch/action/search/SearchResponseSections.java index e146859bb295f..5fc584f76eb46 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchResponseSections.java +++ b/server/src/main/java/org/opensearch/action/search/SearchResponseSections.java @@ -52,6 +52,8 @@ * The reason why this class exists is that the high level REST client uses its own classes * to parse aggregations into, which are not serializable. This is the common part that can be * shared between core and client. + * + * @opensearch.internal */ public class SearchResponseSections implements ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/action/search/SearchScrollAction.java b/server/src/main/java/org/opensearch/action/search/SearchScrollAction.java index 4aec3d39e6f47..1f466d35f0ac2 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchScrollAction.java +++ b/server/src/main/java/org/opensearch/action/search/SearchScrollAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for a search scroll + * + * @opensearch.internal + */ public class SearchScrollAction extends ActionType { public static final SearchScrollAction INSTANCE = new SearchScrollAction(); diff --git a/server/src/main/java/org/opensearch/action/search/SearchScrollAsyncAction.java b/server/src/main/java/org/opensearch/action/search/SearchScrollAsyncAction.java index f98a75d37988c..ffa944ae62763 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchScrollAsyncAction.java +++ b/server/src/main/java/org/opensearch/action/search/SearchScrollAsyncAction.java @@ -62,6 +62,8 @@ * Abstract base class for scroll execution modes. This class encapsulates the basic logic to * fan out to nodes and execute the query part of the scroll request. Subclasses can for instance * run separate fetch phases etc. + * + * @opensearch.internal */ abstract class SearchScrollAsyncAction implements Runnable { protected final Logger logger; diff --git a/server/src/main/java/org/opensearch/action/search/SearchScrollQueryAndFetchAsyncAction.java b/server/src/main/java/org/opensearch/action/search/SearchScrollQueryAndFetchAsyncAction.java index 59ce2567bdf18..c1b4f56f7adc3 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchScrollQueryAndFetchAsyncAction.java +++ b/server/src/main/java/org/opensearch/action/search/SearchScrollQueryAndFetchAsyncAction.java @@ -44,6 +44,11 @@ import java.util.function.BiFunction; +/** + * Async action for a search scroll query then fetch + * + * @opensearch.internal + */ final class SearchScrollQueryAndFetchAsyncAction extends SearchScrollAsyncAction { private final SearchTask task; diff --git a/server/src/main/java/org/opensearch/action/search/SearchScrollQueryThenFetchAsyncAction.java b/server/src/main/java/org/opensearch/action/search/SearchScrollQueryThenFetchAsyncAction.java index effe5afd0cad6..4119cb1cf28a0 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchScrollQueryThenFetchAsyncAction.java +++ b/server/src/main/java/org/opensearch/action/search/SearchScrollQueryThenFetchAsyncAction.java @@ -50,6 +50,11 @@ import java.util.function.BiFunction; +/** + * async action for a search scroll query then fetch + * + * @opensearch.internal + */ final class SearchScrollQueryThenFetchAsyncAction extends SearchScrollAsyncAction { private final SearchTask task; diff --git a/server/src/main/java/org/opensearch/action/search/SearchScrollRequest.java b/server/src/main/java/org/opensearch/action/search/SearchScrollRequest.java index 828228e869831..8b53d1f3096fb 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchScrollRequest.java +++ b/server/src/main/java/org/opensearch/action/search/SearchScrollRequest.java @@ -50,6 +50,11 @@ import static org.opensearch.action.ValidateActions.addValidationError; +/** + * Transport request for a search scroll + * + * @opensearch.internal + */ public class SearchScrollRequest extends ActionRequest implements ToXContentObject { private String scrollId; diff --git a/server/src/main/java/org/opensearch/action/search/SearchScrollRequestBuilder.java b/server/src/main/java/org/opensearch/action/search/SearchScrollRequestBuilder.java index 79bd952333de2..638c595216631 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchScrollRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/search/SearchScrollRequestBuilder.java @@ -39,6 +39,8 @@ /** * A search scroll action request builder. + * + * @opensearch.internal */ public class SearchScrollRequestBuilder extends ActionRequestBuilder { diff --git a/server/src/main/java/org/opensearch/action/search/SearchShard.java b/server/src/main/java/org/opensearch/action/search/SearchShard.java index 110209e3e9af0..cdfc4e816b455 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchShard.java +++ b/server/src/main/java/org/opensearch/action/search/SearchShard.java @@ -41,6 +41,8 @@ /** * A class that encapsulates the {@link ShardId} and the cluster alias * of a shard used during the search action. + * + * @opensearch.internal */ public final class SearchShard implements Comparable { @Nullable diff --git a/server/src/main/java/org/opensearch/action/search/SearchShardIterator.java b/server/src/main/java/org/opensearch/action/search/SearchShardIterator.java index 1ae0d8f78aa9c..72951f60c286e 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchShardIterator.java +++ b/server/src/main/java/org/opensearch/action/search/SearchShardIterator.java @@ -53,6 +53,8 @@ * of the search request (useful especially with cross-cluster search, as each cluster has its own set of original indices) as well as * the cluster alias. * @see OriginalIndices + * + * @opensearch.internal */ public final class SearchShardIterator implements Comparable, Countable { diff --git a/server/src/main/java/org/opensearch/action/search/SearchShardTask.java b/server/src/main/java/org/opensearch/action/search/SearchShardTask.java index 2e506c6fe181b..e5f25595b9ec8 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchShardTask.java +++ b/server/src/main/java/org/opensearch/action/search/SearchShardTask.java @@ -42,6 +42,8 @@ /** * Task storing information about a currently running search shard request. * See {@link ShardSearchRequest}, {@link ShardFetchSearchRequest}, ... + * + * @opensearch.internal */ public class SearchShardTask extends CancellableTask { diff --git a/server/src/main/java/org/opensearch/action/search/SearchTask.java b/server/src/main/java/org/opensearch/action/search/SearchTask.java index 7f80f7836be6c..89f23bb9bdaeb 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchTask.java +++ b/server/src/main/java/org/opensearch/action/search/SearchTask.java @@ -43,6 +43,8 @@ /** * Task storing information about a currently running {@link SearchRequest}. + * + * @opensearch.internal */ public class SearchTask extends CancellableTask { // generating description in a lazy way since source can be quite big diff --git a/server/src/main/java/org/opensearch/action/search/SearchTransportService.java b/server/src/main/java/org/opensearch/action/search/SearchTransportService.java index 121de6d1c80da..4a901ebef10ce 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchTransportService.java +++ b/server/src/main/java/org/opensearch/action/search/SearchTransportService.java @@ -79,6 +79,8 @@ /** * An encapsulation of {@link org.opensearch.search.SearchService} operations exposed through * transport. + * + * @opensearch.internal */ public class SearchTransportService { diff --git a/server/src/main/java/org/opensearch/action/search/SearchType.java b/server/src/main/java/org/opensearch/action/search/SearchType.java index ea50ea4b93491..cb86c0d6c1b4a 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchType.java +++ b/server/src/main/java/org/opensearch/action/search/SearchType.java @@ -35,7 +35,7 @@ /** * Search type represent the manner at which the search operation is executed. * - * + * @opensearch.internal */ public enum SearchType { /** diff --git a/server/src/main/java/org/opensearch/action/search/ShardSearchFailure.java b/server/src/main/java/org/opensearch/action/search/ShardSearchFailure.java index 228eac89f48d5..03bca93d5f001 100644 --- a/server/src/main/java/org/opensearch/action/search/ShardSearchFailure.java +++ b/server/src/main/java/org/opensearch/action/search/ShardSearchFailure.java @@ -55,6 +55,8 @@ /** * Represents a failure to search on a specific shard. + * + * @opensearch.internal */ public class ShardSearchFailure extends ShardOperationFailedException { diff --git a/server/src/main/java/org/opensearch/action/search/TransportClearScrollAction.java b/server/src/main/java/org/opensearch/action/search/TransportClearScrollAction.java index 1158dbe2b06e8..c9b6e967d153c 100644 --- a/server/src/main/java/org/opensearch/action/search/TransportClearScrollAction.java +++ b/server/src/main/java/org/opensearch/action/search/TransportClearScrollAction.java @@ -41,6 +41,11 @@ import org.opensearch.tasks.Task; import org.opensearch.transport.TransportService; +/** + * Perform transport action to clear a search scroll + * + * @opensearch.internal + */ public class TransportClearScrollAction extends HandledTransportAction { private final ClusterService clusterService; diff --git a/server/src/main/java/org/opensearch/action/search/TransportMultiSearchAction.java b/server/src/main/java/org/opensearch/action/search/TransportMultiSearchAction.java index 6c54136254832..683b4b3eb2d19 100644 --- a/server/src/main/java/org/opensearch/action/search/TransportMultiSearchAction.java +++ b/server/src/main/java/org/opensearch/action/search/TransportMultiSearchAction.java @@ -54,6 +54,11 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.function.LongSupplier; +/** + * Perform action for a multi search + * + * @opensearch.internal + */ public class TransportMultiSearchAction extends HandledTransportAction { private final int allocatedProcessors; diff --git a/server/src/main/java/org/opensearch/action/search/TransportSearchAction.java b/server/src/main/java/org/opensearch/action/search/TransportSearchAction.java index 73eb7b0a98fef..6af56abba99cb 100644 --- a/server/src/main/java/org/opensearch/action/search/TransportSearchAction.java +++ b/server/src/main/java/org/opensearch/action/search/TransportSearchAction.java @@ -117,6 +117,11 @@ import static org.opensearch.action.search.SearchType.QUERY_THEN_FETCH; import static org.opensearch.search.sort.FieldSortBuilder.hasPrimaryFieldSort; +/** + * Perform search action + * + * @opensearch.internal + */ public class TransportSearchAction extends HandledTransportAction { /** The maximum number of shards for a single search request. */ diff --git a/server/src/main/java/org/opensearch/action/search/TransportSearchHelper.java b/server/src/main/java/org/opensearch/action/search/TransportSearchHelper.java index 7ddfdfec34cb1..3e5c76aa1f66f 100644 --- a/server/src/main/java/org/opensearch/action/search/TransportSearchHelper.java +++ b/server/src/main/java/org/opensearch/action/search/TransportSearchHelper.java @@ -48,6 +48,11 @@ import java.io.UncheckedIOException; import java.util.Base64; +/** + * Helper class for the search transport + * + * @opensearch.internal + */ final class TransportSearchHelper { private static final String INCLUDE_CONTEXT_UUID = "include_context_uuid"; diff --git a/server/src/main/java/org/opensearch/action/search/TransportSearchScrollAction.java b/server/src/main/java/org/opensearch/action/search/TransportSearchScrollAction.java index cb7c0b4a1873b..b67270ec9c9a5 100644 --- a/server/src/main/java/org/opensearch/action/search/TransportSearchScrollAction.java +++ b/server/src/main/java/org/opensearch/action/search/TransportSearchScrollAction.java @@ -41,6 +41,11 @@ import org.opensearch.tasks.Task; import org.opensearch.transport.TransportService; +/** + * Perform the search scroll + * + * @opensearch.internal + */ public class TransportSearchScrollAction extends HandledTransportAction { private final ClusterService clusterService; diff --git a/server/src/main/java/org/opensearch/action/support/ActionFilter.java b/server/src/main/java/org/opensearch/action/support/ActionFilter.java index 414ef2a329214..2fe32b120d4a9 100644 --- a/server/src/main/java/org/opensearch/action/support/ActionFilter.java +++ b/server/src/main/java/org/opensearch/action/support/ActionFilter.java @@ -39,6 +39,8 @@ /** * A filter allowing to filter transport actions + * + * @opensearch.internal */ public interface ActionFilter { diff --git a/server/src/main/java/org/opensearch/action/support/ActionFilterChain.java b/server/src/main/java/org/opensearch/action/support/ActionFilterChain.java index 65821f14167f7..1eb5682343ffa 100644 --- a/server/src/main/java/org/opensearch/action/support/ActionFilterChain.java +++ b/server/src/main/java/org/opensearch/action/support/ActionFilterChain.java @@ -39,6 +39,8 @@ /** * A filter chain allowing to continue and process the transport action request + * + * @opensearch.internal */ public interface ActionFilterChain { diff --git a/server/src/main/java/org/opensearch/action/support/ActionFilters.java b/server/src/main/java/org/opensearch/action/support/ActionFilters.java index 452b7e7f5238f..95cafbea4d7c1 100644 --- a/server/src/main/java/org/opensearch/action/support/ActionFilters.java +++ b/server/src/main/java/org/opensearch/action/support/ActionFilters.java @@ -38,6 +38,8 @@ /** * Holds the action filters injected through plugins, properly sorted by {@link org.opensearch.action.support.ActionFilter#order()} + * + * @opensearch.internal */ public class ActionFilters { diff --git a/server/src/main/java/org/opensearch/action/support/ActiveShardCount.java b/server/src/main/java/org/opensearch/action/support/ActiveShardCount.java index 9edd9bba0ef6e..10699690d0aff 100644 --- a/server/src/main/java/org/opensearch/action/support/ActiveShardCount.java +++ b/server/src/main/java/org/opensearch/action/support/ActiveShardCount.java @@ -49,6 +49,8 @@ /** * A class whose instances represent a value for counting the number * of active shard copies for a given shard in an index. + * + * @opensearch.internal */ public final class ActiveShardCount implements Writeable { diff --git a/server/src/main/java/org/opensearch/action/support/ActiveShardsObserver.java b/server/src/main/java/org/opensearch/action/support/ActiveShardsObserver.java index 064ae2ee522f9..7a4ae0e31cf55 100644 --- a/server/src/main/java/org/opensearch/action/support/ActiveShardsObserver.java +++ b/server/src/main/java/org/opensearch/action/support/ActiveShardsObserver.java @@ -49,6 +49,8 @@ /** * This class provides primitives for waiting for a configured number of shards * to become active before sending a response on an {@link ActionListener}. + * + * @opensearch.internal */ public class ActiveShardsObserver { diff --git a/server/src/main/java/org/opensearch/action/support/AdapterActionFuture.java b/server/src/main/java/org/opensearch/action/support/AdapterActionFuture.java index aa197d1e255f9..93430a049d3a9 100644 --- a/server/src/main/java/org/opensearch/action/support/AdapterActionFuture.java +++ b/server/src/main/java/org/opensearch/action/support/AdapterActionFuture.java @@ -42,6 +42,11 @@ import java.util.concurrent.TimeUnit; +/** + * Future adapter action + * + * @opensearch.internal + */ public abstract class AdapterActionFuture extends BaseFuture implements ActionFuture, ActionListener { @Override diff --git a/server/src/main/java/org/opensearch/action/support/AutoCreateIndex.java b/server/src/main/java/org/opensearch/action/support/AutoCreateIndex.java index 322dfc85fbf54..c986730aa74da 100644 --- a/server/src/main/java/org/opensearch/action/support/AutoCreateIndex.java +++ b/server/src/main/java/org/opensearch/action/support/AutoCreateIndex.java @@ -52,6 +52,8 @@ /** * Encapsulates the logic of whether a new index should be automatically created when * a write operation is about to happen in a non existing index. + * + * @opensearch.internal */ public final class AutoCreateIndex { diff --git a/server/src/main/java/org/opensearch/action/support/ChannelActionListener.java b/server/src/main/java/org/opensearch/action/support/ChannelActionListener.java index 288c91b243cb1..5b0475093d3c2 100644 --- a/server/src/main/java/org/opensearch/action/support/ChannelActionListener.java +++ b/server/src/main/java/org/opensearch/action/support/ChannelActionListener.java @@ -37,6 +37,11 @@ import org.opensearch.transport.TransportRequest; import org.opensearch.transport.TransportResponse; +/** + * Listener for transport channel actions + * + * @opensearch.internal + */ public final class ChannelActionListener implements ActionListener { diff --git a/server/src/main/java/org/opensearch/action/support/ContextPreservingActionListener.java b/server/src/main/java/org/opensearch/action/support/ContextPreservingActionListener.java index b83e0541cb6d0..6eadc0b67ffbd 100644 --- a/server/src/main/java/org/opensearch/action/support/ContextPreservingActionListener.java +++ b/server/src/main/java/org/opensearch/action/support/ContextPreservingActionListener.java @@ -39,6 +39,8 @@ /** * Restores the given {@link org.opensearch.common.util.concurrent.ThreadContext.StoredContext} * once the listener is invoked + * + * @opensearch.internal */ public final class ContextPreservingActionListener implements ActionListener { diff --git a/server/src/main/java/org/opensearch/action/support/DefaultShardOperationFailedException.java b/server/src/main/java/org/opensearch/action/support/DefaultShardOperationFailedException.java index 19f2c22d79496..1d3b056a7de66 100644 --- a/server/src/main/java/org/opensearch/action/support/DefaultShardOperationFailedException.java +++ b/server/src/main/java/org/opensearch/action/support/DefaultShardOperationFailedException.java @@ -49,6 +49,11 @@ import static org.opensearch.ExceptionsHelper.detailedMessage; import static org.opensearch.common.xcontent.ConstructingObjectParser.constructorArg; +/** + * Exception for a default shard operation + * + * @opensearch.internal + */ public class DefaultShardOperationFailedException extends ShardOperationFailedException implements Writeable { private static final String INDEX = "index"; diff --git a/server/src/main/java/org/opensearch/action/support/DestructiveOperations.java b/server/src/main/java/org/opensearch/action/support/DestructiveOperations.java index ce9a0d7c7aece..84b3287322301 100644 --- a/server/src/main/java/org/opensearch/action/support/DestructiveOperations.java +++ b/server/src/main/java/org/opensearch/action/support/DestructiveOperations.java @@ -39,6 +39,8 @@ /** * Helper for dealing with destructive operations and wildcard usage. + * + * @opensearch.internal */ public final class DestructiveOperations { diff --git a/server/src/main/java/org/opensearch/action/support/GroupedActionListener.java b/server/src/main/java/org/opensearch/action/support/GroupedActionListener.java index 515ed73ae2392..3d15d63289d9e 100644 --- a/server/src/main/java/org/opensearch/action/support/GroupedActionListener.java +++ b/server/src/main/java/org/opensearch/action/support/GroupedActionListener.java @@ -46,6 +46,8 @@ * it has received N results (either successes or failures). This allows synchronous * tasks to be forked off in a loop with the same listener and respond to a * higher level listener once all tasks responded. + * + * @opensearch.internal */ public final class GroupedActionListener implements ActionListener { private final CountDown countDown; diff --git a/server/src/main/java/org/opensearch/action/support/HandledTransportAction.java b/server/src/main/java/org/opensearch/action/support/HandledTransportAction.java index 9613b55cc7641..e4c6addec40f3 100644 --- a/server/src/main/java/org/opensearch/action/support/HandledTransportAction.java +++ b/server/src/main/java/org/opensearch/action/support/HandledTransportAction.java @@ -42,6 +42,8 @@ /** * A TransportAction that self registers a handler into the transport service + * + * @opensearch.internal */ public abstract class HandledTransportAction extends TransportAction< Request, diff --git a/server/src/main/java/org/opensearch/action/support/IndicesOptions.java b/server/src/main/java/org/opensearch/action/support/IndicesOptions.java index 09b691787dffe..292a2c4b7d3da 100644 --- a/server/src/main/java/org/opensearch/action/support/IndicesOptions.java +++ b/server/src/main/java/org/opensearch/action/support/IndicesOptions.java @@ -55,6 +55,8 @@ /** * Controls how to deal with unavailable concrete indices (closed or missing), how wildcard expressions are expanded * to actual indices (all, closed or open indices) and how to deal with wildcard expressions that resolve to no indices. + * + * @opensearch.internal */ public class IndicesOptions implements ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/action/support/ListenerTimeouts.java b/server/src/main/java/org/opensearch/action/support/ListenerTimeouts.java index c31ca9b100624..ffe506905326f 100644 --- a/server/src/main/java/org/opensearch/action/support/ListenerTimeouts.java +++ b/server/src/main/java/org/opensearch/action/support/ListenerTimeouts.java @@ -41,6 +41,11 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Consumer; +/** + * Supports timeouts on listeners + * + * @opensearch.internal + */ public class ListenerTimeouts { /** diff --git a/server/src/main/java/org/opensearch/action/support/PlainActionFuture.java b/server/src/main/java/org/opensearch/action/support/PlainActionFuture.java index d7235a3b0ee46..abe63d8abd473 100644 --- a/server/src/main/java/org/opensearch/action/support/PlainActionFuture.java +++ b/server/src/main/java/org/opensearch/action/support/PlainActionFuture.java @@ -34,6 +34,11 @@ import org.opensearch.common.CheckedConsumer; +/** + * Creates a new future for a plain action. + * + * @opensearch.internal + */ public class PlainActionFuture extends AdapterActionFuture { public static PlainActionFuture newFuture() { diff --git a/server/src/main/java/org/opensearch/action/support/PlainListenableActionFuture.java b/server/src/main/java/org/opensearch/action/support/PlainListenableActionFuture.java index 16a82b91145ae..ac5f7d25efb18 100644 --- a/server/src/main/java/org/opensearch/action/support/PlainListenableActionFuture.java +++ b/server/src/main/java/org/opensearch/action/support/PlainListenableActionFuture.java @@ -38,6 +38,11 @@ import java.util.ArrayList; import java.util.List; +/** + * Future for a plain listenable action + * + * @opensearch.internal + */ public class PlainListenableActionFuture extends AdapterActionFuture implements ListenableActionFuture { volatile Object listeners; diff --git a/server/src/main/java/org/opensearch/action/support/RetryableAction.java b/server/src/main/java/org/opensearch/action/support/RetryableAction.java index e330948209b5c..38b7e6ec2a8a0 100644 --- a/server/src/main/java/org/opensearch/action/support/RetryableAction.java +++ b/server/src/main/java/org/opensearch/action/support/RetryableAction.java @@ -50,6 +50,8 @@ * The executor the action will be executed on can be defined in the constructor. Otherwise, SAME is the * default. The action will be retried with exponentially increasing delay periods until the timeout period * has been reached. + * + * @opensearch.internal */ public abstract class RetryableAction { diff --git a/server/src/main/java/org/opensearch/action/support/ThreadedActionListener.java b/server/src/main/java/org/opensearch/action/support/ThreadedActionListener.java index f6a4c87c57344..17ef64aa901c0 100644 --- a/server/src/main/java/org/opensearch/action/support/ThreadedActionListener.java +++ b/server/src/main/java/org/opensearch/action/support/ThreadedActionListener.java @@ -41,6 +41,8 @@ /** * An action listener that wraps another action listener and threading its execution. + * + * @opensearch.internal */ public final class ThreadedActionListener implements ActionListener { private final Logger logger; diff --git a/server/src/main/java/org/opensearch/action/support/TimeoutTaskCancellationUtility.java b/server/src/main/java/org/opensearch/action/support/TimeoutTaskCancellationUtility.java index e132555a3c071..759819d803f0e 100644 --- a/server/src/main/java/org/opensearch/action/support/TimeoutTaskCancellationUtility.java +++ b/server/src/main/java/org/opensearch/action/support/TimeoutTaskCancellationUtility.java @@ -29,6 +29,11 @@ import static org.opensearch.action.admin.cluster.node.tasks.get.GetTaskAction.TASKS_ORIGIN; import static org.opensearch.action.search.TransportSearchAction.SEARCH_CANCEL_AFTER_TIME_INTERVAL_SETTING; +/** + * Utility to cancel a timeout task + * + * @opensearch.internal + */ public class TimeoutTaskCancellationUtility { private static final Logger logger = LogManager.getLogger(TimeoutTaskCancellationUtility.class); diff --git a/server/src/main/java/org/opensearch/action/support/TransportAction.java b/server/src/main/java/org/opensearch/action/support/TransportAction.java index 84ece8cfec530..edcef8ef0c5fd 100644 --- a/server/src/main/java/org/opensearch/action/support/TransportAction.java +++ b/server/src/main/java/org/opensearch/action/support/TransportAction.java @@ -48,6 +48,11 @@ import java.util.concurrent.atomic.AtomicInteger; +/** + * Base class for a transport action + * + * @opensearch.internal + */ public abstract class TransportAction { public final String actionName; diff --git a/server/src/main/java/org/opensearch/action/support/TransportActions.java b/server/src/main/java/org/opensearch/action/support/TransportActions.java index d79059d39f407..03e7509b3b8e3 100644 --- a/server/src/main/java/org/opensearch/action/support/TransportActions.java +++ b/server/src/main/java/org/opensearch/action/support/TransportActions.java @@ -40,6 +40,11 @@ import org.opensearch.index.shard.IllegalIndexShardStateException; import org.opensearch.index.shard.ShardNotFoundException; +/** + * Utility class for transport actions + * + * @opensearch.internal + */ public class TransportActions { public static boolean isShardNotAvailableException(final Throwable e) { diff --git a/server/src/main/java/org/opensearch/action/support/WriteRequest.java b/server/src/main/java/org/opensearch/action/support/WriteRequest.java index 65737ffedeecb..81faf9a8f88ca 100644 --- a/server/src/main/java/org/opensearch/action/support/WriteRequest.java +++ b/server/src/main/java/org/opensearch/action/support/WriteRequest.java @@ -46,6 +46,8 @@ /** * Interface implemented by requests that modify the documents in an index like {@link IndexRequest}, {@link UpdateRequest}, and * {@link BulkRequest}. Rather than implement this directly most implementers should extend {@link ReplicatedWriteRequest}. + * + * @opensearch.internal */ public interface WriteRequest> extends Writeable { /** diff --git a/server/src/main/java/org/opensearch/action/support/WriteRequestBuilder.java b/server/src/main/java/org/opensearch/action/support/WriteRequestBuilder.java index c26a08ad6ab60..899d7a8cd65fe 100644 --- a/server/src/main/java/org/opensearch/action/support/WriteRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/support/WriteRequestBuilder.java @@ -34,6 +34,11 @@ import org.opensearch.action.support.WriteRequest.RefreshPolicy; +/** + * Builder for a write request operations + * + * @opensearch.internal + */ public interface WriteRequestBuilder> { WriteRequest request(); diff --git a/server/src/main/java/org/opensearch/action/support/WriteResponse.java b/server/src/main/java/org/opensearch/action/support/WriteResponse.java index 89b04bbdb8362..786f851d88542 100644 --- a/server/src/main/java/org/opensearch/action/support/WriteResponse.java +++ b/server/src/main/java/org/opensearch/action/support/WriteResponse.java @@ -42,6 +42,8 @@ /** * Interface implemented by responses for actions that modify the documents in an index like {@link IndexResponse}, {@link UpdateResponse}, * and {@link BulkResponse}. Rather than implement this directly most implementers should extend {@link DocWriteResponse}. + * + * @opensearch.internal */ public interface WriteResponse { /** diff --git a/server/src/main/java/org/opensearch/action/support/broadcast/BroadcastOperationRequestBuilder.java b/server/src/main/java/org/opensearch/action/support/broadcast/BroadcastOperationRequestBuilder.java index 2eaa029e687f4..d732a28c32ea3 100644 --- a/server/src/main/java/org/opensearch/action/support/broadcast/BroadcastOperationRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/support/broadcast/BroadcastOperationRequestBuilder.java @@ -37,6 +37,11 @@ import org.opensearch.action.support.IndicesOptions; import org.opensearch.client.OpenSearchClient; +/** + * Request builder for broadcast operations + * + * @opensearch.internal + */ public abstract class BroadcastOperationRequestBuilder< Request extends BroadcastRequest, Response extends BroadcastResponse, diff --git a/server/src/main/java/org/opensearch/action/support/broadcast/BroadcastRequest.java b/server/src/main/java/org/opensearch/action/support/broadcast/BroadcastRequest.java index 457f97acbe98b..84cb2965e6e61 100644 --- a/server/src/main/java/org/opensearch/action/support/broadcast/BroadcastRequest.java +++ b/server/src/main/java/org/opensearch/action/support/broadcast/BroadcastRequest.java @@ -42,6 +42,11 @@ import java.io.IOException; +/** + * Transport request for broadcast operations + * + * @opensearch.internal + */ public class BroadcastRequest> extends ActionRequest implements IndicesRequest.Replaceable { protected String[] indices; diff --git a/server/src/main/java/org/opensearch/action/support/broadcast/BroadcastResponse.java b/server/src/main/java/org/opensearch/action/support/broadcast/BroadcastResponse.java index 89dcec7bf75ae..9d0973a5f7307 100644 --- a/server/src/main/java/org/opensearch/action/support/broadcast/BroadcastResponse.java +++ b/server/src/main/java/org/opensearch/action/support/broadcast/BroadcastResponse.java @@ -52,6 +52,8 @@ /** * Base class for all broadcast operation based responses. + * + * @opensearch.internal */ public class BroadcastResponse extends ActionResponse implements ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/support/broadcast/BroadcastShardOperationFailedException.java b/server/src/main/java/org/opensearch/action/support/broadcast/BroadcastShardOperationFailedException.java index f91de7f3ced7a..ed84b48f38387 100644 --- a/server/src/main/java/org/opensearch/action/support/broadcast/BroadcastShardOperationFailedException.java +++ b/server/src/main/java/org/opensearch/action/support/broadcast/BroadcastShardOperationFailedException.java @@ -42,7 +42,7 @@ /** * An exception indicating that a failure occurred performing an operation on the shard. * - * + * @opensearch.internal */ public class BroadcastShardOperationFailedException extends OpenSearchException implements OpenSearchWrapperException { diff --git a/server/src/main/java/org/opensearch/action/support/broadcast/BroadcastShardRequest.java b/server/src/main/java/org/opensearch/action/support/broadcast/BroadcastShardRequest.java index e89a1437784b9..02fc305d4eb0d 100644 --- a/server/src/main/java/org/opensearch/action/support/broadcast/BroadcastShardRequest.java +++ b/server/src/main/java/org/opensearch/action/support/broadcast/BroadcastShardRequest.java @@ -42,6 +42,11 @@ import java.io.IOException; +/** + * Base class for broadcasting shard requests + * + * @opensearch.internal + */ public abstract class BroadcastShardRequest extends TransportRequest implements IndicesRequest { private ShardId shardId; diff --git a/server/src/main/java/org/opensearch/action/support/broadcast/BroadcastShardResponse.java b/server/src/main/java/org/opensearch/action/support/broadcast/BroadcastShardResponse.java index 96245ec4d91f1..b3045d52450cc 100644 --- a/server/src/main/java/org/opensearch/action/support/broadcast/BroadcastShardResponse.java +++ b/server/src/main/java/org/opensearch/action/support/broadcast/BroadcastShardResponse.java @@ -39,6 +39,11 @@ import java.io.IOException; +/** + * Base class for broadcasting response + * + * @opensearch.internal + */ public abstract class BroadcastShardResponse extends TransportResponse { ShardId shardId; diff --git a/server/src/main/java/org/opensearch/action/support/broadcast/TransportBroadcastAction.java b/server/src/main/java/org/opensearch/action/support/broadcast/TransportBroadcastAction.java index 32dda0af3970d..728497af8d0d5 100644 --- a/server/src/main/java/org/opensearch/action/support/broadcast/TransportBroadcastAction.java +++ b/server/src/main/java/org/opensearch/action/support/broadcast/TransportBroadcastAction.java @@ -63,6 +63,11 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReferenceArray; +/** + * Base transport broadcast action class + * + * @opensearch.internal + */ public abstract class TransportBroadcastAction< Request extends BroadcastRequest, Response extends BroadcastResponse, diff --git a/server/src/main/java/org/opensearch/action/support/broadcast/node/TransportBroadcastByNodeAction.java b/server/src/main/java/org/opensearch/action/support/broadcast/node/TransportBroadcastByNodeAction.java index 6eb3c7a0cfe89..1c5b71c5a1fb7 100644 --- a/server/src/main/java/org/opensearch/action/support/broadcast/node/TransportBroadcastByNodeAction.java +++ b/server/src/main/java/org/opensearch/action/support/broadcast/node/TransportBroadcastByNodeAction.java @@ -86,6 +86,8 @@ * @param the underlying client request * @param the response to the client request * @param per-shard operation results + * + * @opensearch.internal */ public abstract class TransportBroadcastByNodeAction< Request extends BroadcastRequest, diff --git a/server/src/main/java/org/opensearch/action/support/master/AcknowledgedRequest.java b/server/src/main/java/org/opensearch/action/support/master/AcknowledgedRequest.java index 278c4f287b4f5..7f665b4e658a1 100644 --- a/server/src/main/java/org/opensearch/action/support/master/AcknowledgedRequest.java +++ b/server/src/main/java/org/opensearch/action/support/master/AcknowledgedRequest.java @@ -43,6 +43,8 @@ /** * Abstract class that allows to mark action requests that support acknowledgements. * Facilitates consistency across different api. + * + * @opensearch.internal */ public abstract class AcknowledgedRequest> extends MasterNodeRequest implements diff --git a/server/src/main/java/org/opensearch/action/support/master/AcknowledgedRequestBuilder.java b/server/src/main/java/org/opensearch/action/support/master/AcknowledgedRequestBuilder.java index daed5a09bb0f3..7a0824c6d30ca 100644 --- a/server/src/main/java/org/opensearch/action/support/master/AcknowledgedRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/support/master/AcknowledgedRequestBuilder.java @@ -37,6 +37,8 @@ /** * Base request builder for cluster-manager node operations that support acknowledgements + * + * @opensearch.internal */ public abstract class AcknowledgedRequestBuilder< Request extends AcknowledgedRequest, diff --git a/server/src/main/java/org/opensearch/action/support/master/AcknowledgedResponse.java b/server/src/main/java/org/opensearch/action/support/master/AcknowledgedResponse.java index dca3096b99440..415e52b68e368 100644 --- a/server/src/main/java/org/opensearch/action/support/master/AcknowledgedResponse.java +++ b/server/src/main/java/org/opensearch/action/support/master/AcknowledgedResponse.java @@ -48,6 +48,8 @@ /** * A response that indicates that a request has been acknowledged + * + * @opensearch.internal */ public class AcknowledgedResponse extends ActionResponse implements ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/support/master/MasterNodeOperationRequestBuilder.java b/server/src/main/java/org/opensearch/action/support/master/MasterNodeOperationRequestBuilder.java index 98996e222b30a..b327e76a25873 100644 --- a/server/src/main/java/org/opensearch/action/support/master/MasterNodeOperationRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/support/master/MasterNodeOperationRequestBuilder.java @@ -40,6 +40,8 @@ /** * Base request builder for cluster-manager node operations + * + * @opensearch.internal */ public abstract class MasterNodeOperationRequestBuilder< Request extends MasterNodeRequest, diff --git a/server/src/main/java/org/opensearch/action/support/master/MasterNodeReadOperationRequestBuilder.java b/server/src/main/java/org/opensearch/action/support/master/MasterNodeReadOperationRequestBuilder.java index 99e6b37debd8f..d36b419577cab 100644 --- a/server/src/main/java/org/opensearch/action/support/master/MasterNodeReadOperationRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/support/master/MasterNodeReadOperationRequestBuilder.java @@ -38,6 +38,8 @@ /** * Base request builder for cluster-manager node read operations that can be executed on the local node as well + * + * @opensearch.internal */ public abstract class MasterNodeReadOperationRequestBuilder< Request extends MasterNodeReadRequest, diff --git a/server/src/main/java/org/opensearch/action/support/master/MasterNodeReadRequest.java b/server/src/main/java/org/opensearch/action/support/master/MasterNodeReadRequest.java index 9842c47652a97..3188f632c5ec8 100644 --- a/server/src/main/java/org/opensearch/action/support/master/MasterNodeReadRequest.java +++ b/server/src/main/java/org/opensearch/action/support/master/MasterNodeReadRequest.java @@ -39,6 +39,8 @@ /** * Base request for cluster-manager based read operations that allows to read the cluster state from the local node if needed + * + * @opensearch.internal */ public abstract class MasterNodeReadRequest> extends MasterNodeRequest { diff --git a/server/src/main/java/org/opensearch/action/support/master/MasterNodeRequest.java b/server/src/main/java/org/opensearch/action/support/master/MasterNodeRequest.java index f7ea962f7c4a1..34a8c65dde491 100644 --- a/server/src/main/java/org/opensearch/action/support/master/MasterNodeRequest.java +++ b/server/src/main/java/org/opensearch/action/support/master/MasterNodeRequest.java @@ -41,6 +41,8 @@ /** * A based request for cluster-manager based operation. + * + * @opensearch.internal */ public abstract class MasterNodeRequest> extends ActionRequest { diff --git a/server/src/main/java/org/opensearch/action/support/master/ShardsAcknowledgedResponse.java b/server/src/main/java/org/opensearch/action/support/master/ShardsAcknowledgedResponse.java index 5964867d2d618..d100874296844 100644 --- a/server/src/main/java/org/opensearch/action/support/master/ShardsAcknowledgedResponse.java +++ b/server/src/main/java/org/opensearch/action/support/master/ShardsAcknowledgedResponse.java @@ -44,6 +44,11 @@ import static org.opensearch.common.xcontent.ConstructingObjectParser.constructorArg; +/** + * Transport response for shard acknowledgements + * + * @opensearch.internal + */ public abstract class ShardsAcknowledgedResponse extends AcknowledgedResponse { protected static final ParseField SHARDS_ACKNOWLEDGED = new ParseField("shards_acknowledged"); diff --git a/server/src/main/java/org/opensearch/action/support/master/TransportMasterNodeAction.java b/server/src/main/java/org/opensearch/action/support/master/TransportMasterNodeAction.java index 083bea079174c..4ae490018e58f 100644 --- a/server/src/main/java/org/opensearch/action/support/master/TransportMasterNodeAction.java +++ b/server/src/main/java/org/opensearch/action/support/master/TransportMasterNodeAction.java @@ -68,6 +68,8 @@ /** * A base class for operations that needs to be performed on the cluster-manager node. + * + * @opensearch.internal */ public abstract class TransportMasterNodeAction, Response extends ActionResponse> extends HandledTransportAction { diff --git a/server/src/main/java/org/opensearch/action/support/master/TransportMasterNodeReadAction.java b/server/src/main/java/org/opensearch/action/support/master/TransportMasterNodeReadAction.java index b8be63dd6564b..8514174bca8c7 100644 --- a/server/src/main/java/org/opensearch/action/support/master/TransportMasterNodeReadAction.java +++ b/server/src/main/java/org/opensearch/action/support/master/TransportMasterNodeReadAction.java @@ -43,6 +43,8 @@ /** * A base class for read operations that needs to be performed on the cluster-manager node. * Can also be executed on the local node if needed. + * + * @opensearch.internal */ public abstract class TransportMasterNodeReadAction, Response extends ActionResponse> extends TransportMasterNodeAction { diff --git a/server/src/main/java/org/opensearch/action/support/master/info/ClusterInfoRequest.java b/server/src/main/java/org/opensearch/action/support/master/info/ClusterInfoRequest.java index 0b392caa3e588..ae3b2350f574c 100644 --- a/server/src/main/java/org/opensearch/action/support/master/info/ClusterInfoRequest.java +++ b/server/src/main/java/org/opensearch/action/support/master/info/ClusterInfoRequest.java @@ -42,6 +42,11 @@ import java.io.IOException; +/** + * Transport request for cluster information + * + * @opensearch.internal + */ public abstract class ClusterInfoRequest> extends MasterNodeReadRequest implements IndicesRequest.Replaceable { diff --git a/server/src/main/java/org/opensearch/action/support/master/info/ClusterInfoRequestBuilder.java b/server/src/main/java/org/opensearch/action/support/master/info/ClusterInfoRequestBuilder.java index d806f96eb9ff2..09ed9b590d9c4 100644 --- a/server/src/main/java/org/opensearch/action/support/master/info/ClusterInfoRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/support/master/info/ClusterInfoRequestBuilder.java @@ -38,6 +38,11 @@ import org.opensearch.client.OpenSearchClient; import org.opensearch.common.util.ArrayUtils; +/** + * Transport request builder for cluster information + * + * @opensearch.internal + */ public abstract class ClusterInfoRequestBuilder< Request extends ClusterInfoRequest, Response extends ActionResponse, diff --git a/server/src/main/java/org/opensearch/action/support/master/info/TransportClusterInfoAction.java b/server/src/main/java/org/opensearch/action/support/master/info/TransportClusterInfoAction.java index 9bcfaea056a89..e3ad4afcad02e 100644 --- a/server/src/main/java/org/opensearch/action/support/master/info/TransportClusterInfoAction.java +++ b/server/src/main/java/org/opensearch/action/support/master/info/TransportClusterInfoAction.java @@ -44,6 +44,11 @@ import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; +/** + * Perform cluster information action + * + * @opensearch.internal + */ public abstract class TransportClusterInfoAction, Response extends ActionResponse> extends TransportMasterNodeReadAction { diff --git a/server/src/main/java/org/opensearch/action/support/nodes/BaseNodeRequest.java b/server/src/main/java/org/opensearch/action/support/nodes/BaseNodeRequest.java index 27d9cb8b6c002..b5ff1d60ff75b 100644 --- a/server/src/main/java/org/opensearch/action/support/nodes/BaseNodeRequest.java +++ b/server/src/main/java/org/opensearch/action/support/nodes/BaseNodeRequest.java @@ -39,7 +39,15 @@ import java.io.IOException; +/** + * Base class for node transport requests + * + * @opensearch.internal + * + * @deprecated this class is deprecated and classes will extend TransportRequest directly + */ // TODO: this class can be removed in main once 7.x is bumped to 7.4.0 +@Deprecated public abstract class BaseNodeRequest extends TransportRequest { public BaseNodeRequest() {} diff --git a/server/src/main/java/org/opensearch/action/support/nodes/BaseNodeResponse.java b/server/src/main/java/org/opensearch/action/support/nodes/BaseNodeResponse.java index 13d9293c21123..62e814d7e7ec0 100644 --- a/server/src/main/java/org/opensearch/action/support/nodes/BaseNodeResponse.java +++ b/server/src/main/java/org/opensearch/action/support/nodes/BaseNodeResponse.java @@ -41,6 +41,8 @@ /** * A base class for node level operations. + * + * @opensearch.internal */ public abstract class BaseNodeResponse extends TransportResponse { diff --git a/server/src/main/java/org/opensearch/action/support/nodes/BaseNodesRequest.java b/server/src/main/java/org/opensearch/action/support/nodes/BaseNodesRequest.java index b36fc585e99a8..f4b25a43dc206 100644 --- a/server/src/main/java/org/opensearch/action/support/nodes/BaseNodesRequest.java +++ b/server/src/main/java/org/opensearch/action/support/nodes/BaseNodesRequest.java @@ -42,6 +42,11 @@ import java.io.IOException; +/** + * Base class for requests targeting a list of nodes + * + * @opensearch.internal + */ public abstract class BaseNodesRequest> extends ActionRequest { /** diff --git a/server/src/main/java/org/opensearch/action/support/nodes/BaseNodesResponse.java b/server/src/main/java/org/opensearch/action/support/nodes/BaseNodesResponse.java index 2ba00d77d0660..a47eb4be898ca 100644 --- a/server/src/main/java/org/opensearch/action/support/nodes/BaseNodesResponse.java +++ b/server/src/main/java/org/opensearch/action/support/nodes/BaseNodesResponse.java @@ -44,6 +44,11 @@ import java.util.Map; import java.util.Objects; +/** + * Transport response for nodes requests + * + * @opensearch.internal + */ public abstract class BaseNodesResponse extends ActionResponse { private ClusterName clusterName; diff --git a/server/src/main/java/org/opensearch/action/support/nodes/NodesOperationRequestBuilder.java b/server/src/main/java/org/opensearch/action/support/nodes/NodesOperationRequestBuilder.java index d8017ace7d3e6..9d5e1b3ab4ed4 100644 --- a/server/src/main/java/org/opensearch/action/support/nodes/NodesOperationRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/support/nodes/NodesOperationRequestBuilder.java @@ -37,6 +37,11 @@ import org.opensearch.client.OpenSearchClient; import org.opensearch.common.unit.TimeValue; +/** + * Builder for Operation Requests + * + * @opensearch.internal + */ public abstract class NodesOperationRequestBuilder< Request extends BaseNodesRequest, Response extends BaseNodesResponse, diff --git a/server/src/main/java/org/opensearch/action/support/nodes/TransportNodesAction.java b/server/src/main/java/org/opensearch/action/support/nodes/TransportNodesAction.java index 030b14678c0e5..614740e6bc8a1 100644 --- a/server/src/main/java/org/opensearch/action/support/nodes/TransportNodesAction.java +++ b/server/src/main/java/org/opensearch/action/support/nodes/TransportNodesAction.java @@ -62,6 +62,11 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReferenceArray; +/** + * Base action class for transport nodes + * + * @opensearch.internal + */ public abstract class TransportNodesAction< NodesRequest extends BaseNodesRequest, NodesResponse extends BaseNodesResponse, diff --git a/server/src/main/java/org/opensearch/action/support/replication/BasicReplicationRequest.java b/server/src/main/java/org/opensearch/action/support/replication/BasicReplicationRequest.java index 1022a476bf885..bd0663fc3d352 100644 --- a/server/src/main/java/org/opensearch/action/support/replication/BasicReplicationRequest.java +++ b/server/src/main/java/org/opensearch/action/support/replication/BasicReplicationRequest.java @@ -42,6 +42,8 @@ * Unfortunately ReplicationRequest can't be declared as a type parameter * because it has a self referential type parameter of its own. So use this * instead. + * + * @opensearch.internal */ public class BasicReplicationRequest extends ReplicationRequest { /** diff --git a/server/src/main/java/org/opensearch/action/support/replication/PendingReplicationActions.java b/server/src/main/java/org/opensearch/action/support/replication/PendingReplicationActions.java index 1e554913e527d..b305c4c8c83a7 100644 --- a/server/src/main/java/org/opensearch/action/support/replication/PendingReplicationActions.java +++ b/server/src/main/java/org/opensearch/action/support/replication/PendingReplicationActions.java @@ -46,6 +46,11 @@ import java.util.Set; import java.util.function.Consumer; +/** + * Pending Replication Actions + * + * @opensearch.internal + */ public class PendingReplicationActions implements Consumer, Releasable { private final Map>> onGoingReplicationActions = ConcurrentCollections.newConcurrentMap(); diff --git a/server/src/main/java/org/opensearch/action/support/replication/ReplicatedWriteRequest.java b/server/src/main/java/org/opensearch/action/support/replication/ReplicatedWriteRequest.java index e18765d7a3546..8018de175b47e 100644 --- a/server/src/main/java/org/opensearch/action/support/replication/ReplicatedWriteRequest.java +++ b/server/src/main/java/org/opensearch/action/support/replication/ReplicatedWriteRequest.java @@ -46,6 +46,8 @@ /** * Requests that are both {@linkplain ReplicationRequest}s (run on a shard's primary first, then the replica) and {@linkplain WriteRequest} * (modify documents on a shard), for example {@link BulkShardRequest}, {@link IndexRequest}, and {@link DeleteRequest}. + * + * @opensearch.internal */ public abstract class ReplicatedWriteRequest> extends ReplicationRequest implements WriteRequest { private RefreshPolicy refreshPolicy = RefreshPolicy.NONE; diff --git a/server/src/main/java/org/opensearch/action/support/replication/ReplicationOperation.java b/server/src/main/java/org/opensearch/action/support/replication/ReplicationOperation.java index f7fd6acf8be23..6c6da7d9b5753 100644 --- a/server/src/main/java/org/opensearch/action/support/replication/ReplicationOperation.java +++ b/server/src/main/java/org/opensearch/action/support/replication/ReplicationOperation.java @@ -67,6 +67,11 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.function.LongSupplier; +/** + * Operation for a replication request + * + * @opensearch.internal + */ public class ReplicationOperation< Request extends ReplicationRequest, ReplicaRequest extends ReplicationRequest, diff --git a/server/src/main/java/org/opensearch/action/support/replication/ReplicationRequest.java b/server/src/main/java/org/opensearch/action/support/replication/ReplicationRequest.java index e7428e2913f1a..72214e73b9180 100644 --- a/server/src/main/java/org/opensearch/action/support/replication/ReplicationRequest.java +++ b/server/src/main/java/org/opensearch/action/support/replication/ReplicationRequest.java @@ -56,6 +56,8 @@ /** * Requests that are run on a particular replica, first on the primary and then on the replicas like {@link IndexRequest} or * {@link TransportShardRefreshAction}. + * + * @opensearch.internal */ public abstract class ReplicationRequest> extends ActionRequest implements IndicesRequest { diff --git a/server/src/main/java/org/opensearch/action/support/replication/ReplicationRequestBuilder.java b/server/src/main/java/org/opensearch/action/support/replication/ReplicationRequestBuilder.java index 1994c70aec17c..df60e585e7272 100644 --- a/server/src/main/java/org/opensearch/action/support/replication/ReplicationRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/support/replication/ReplicationRequestBuilder.java @@ -39,6 +39,11 @@ import org.opensearch.client.OpenSearchClient; import org.opensearch.common.unit.TimeValue; +/** + * Transport request builder for a replication operation + * + * @opensearch.internal + */ public abstract class ReplicationRequestBuilder< Request extends ReplicationRequest, Response extends ActionResponse, diff --git a/server/src/main/java/org/opensearch/action/support/replication/ReplicationResponse.java b/server/src/main/java/org/opensearch/action/support/replication/ReplicationResponse.java index 6434d36861c6f..38fa7ac7520e5 100644 --- a/server/src/main/java/org/opensearch/action/support/replication/ReplicationResponse.java +++ b/server/src/main/java/org/opensearch/action/support/replication/ReplicationResponse.java @@ -56,6 +56,8 @@ /** * Base class for write action responses. + * + * @opensearch.internal */ public class ReplicationResponse extends ActionResponse { diff --git a/server/src/main/java/org/opensearch/action/support/replication/ReplicationTask.java b/server/src/main/java/org/opensearch/action/support/replication/ReplicationTask.java index b24dcd0648043..6fe658d338fae 100644 --- a/server/src/main/java/org/opensearch/action/support/replication/ReplicationTask.java +++ b/server/src/main/java/org/opensearch/action/support/replication/ReplicationTask.java @@ -46,6 +46,8 @@ /** * Task that tracks replication actions. + * + * @opensearch.internal */ public class ReplicationTask extends Task { private volatile String phase = "starting"; diff --git a/server/src/main/java/org/opensearch/action/support/replication/TransportBroadcastReplicationAction.java b/server/src/main/java/org/opensearch/action/support/replication/TransportBroadcastReplicationAction.java index dd1ce9f70a28a..b4bacefad8ad2 100644 --- a/server/src/main/java/org/opensearch/action/support/replication/TransportBroadcastReplicationAction.java +++ b/server/src/main/java/org/opensearch/action/support/replication/TransportBroadcastReplicationAction.java @@ -61,6 +61,8 @@ /** * Base class for requests that should be executed on all shards of an index or several indices. * This action sends shard requests to all primary shards of the indices and they are then replicated like write requests + * + * @opensearch.internal */ public abstract class TransportBroadcastReplicationAction< Request extends BroadcastRequest, diff --git a/server/src/main/java/org/opensearch/action/support/replication/TransportReplicationAction.java b/server/src/main/java/org/opensearch/action/support/replication/TransportReplicationAction.java index 0ea08eccae33d..476b679fedaf6 100644 --- a/server/src/main/java/org/opensearch/action/support/replication/TransportReplicationAction.java +++ b/server/src/main/java/org/opensearch/action/support/replication/TransportReplicationAction.java @@ -103,6 +103,8 @@ * The action samples cluster state on the receiving node to reroute to node with primary copy and on the * primary node to validate request before primary operation followed by sampling state again for resolving * nodes with replica copies to perform replication. + * + * @opensearch.internal */ public abstract class TransportReplicationAction< Request extends ReplicationRequest, diff --git a/server/src/main/java/org/opensearch/action/support/replication/TransportWriteAction.java b/server/src/main/java/org/opensearch/action/support/replication/TransportWriteAction.java index c9fb959306b9c..2104f60c2fd32 100644 --- a/server/src/main/java/org/opensearch/action/support/replication/TransportWriteAction.java +++ b/server/src/main/java/org/opensearch/action/support/replication/TransportWriteAction.java @@ -69,6 +69,8 @@ /** * Base class for transport actions that modify data in some shard like index, delete, and shardBulk. * Allows performing async actions (e.g. refresh) after performing write operations on primary and replica shards + * + * @opensearch.internal */ public abstract class TransportWriteAction< Request extends ReplicatedWriteRequest, diff --git a/server/src/main/java/org/opensearch/action/support/single/instance/InstanceShardOperationRequest.java b/server/src/main/java/org/opensearch/action/support/single/instance/InstanceShardOperationRequest.java index 0dd72671fb8c3..85c15e1a01921 100644 --- a/server/src/main/java/org/opensearch/action/support/single/instance/InstanceShardOperationRequest.java +++ b/server/src/main/java/org/opensearch/action/support/single/instance/InstanceShardOperationRequest.java @@ -46,8 +46,13 @@ import java.io.IOException; import java.util.concurrent.TimeUnit; +/** + * Transport Request for an Index Shard Operation + * + * @opensearch.internal + */ // TODO: This request and its associated transport action can be folded into UpdateRequest which is its only concrete production code -// implementation +// implementation public abstract class InstanceShardOperationRequest> extends ActionRequest implements IndicesRequest { diff --git a/server/src/main/java/org/opensearch/action/support/single/instance/InstanceShardOperationRequestBuilder.java b/server/src/main/java/org/opensearch/action/support/single/instance/InstanceShardOperationRequestBuilder.java index 7bbbd7d11e6ab..6fe7b503e4602 100644 --- a/server/src/main/java/org/opensearch/action/support/single/instance/InstanceShardOperationRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/support/single/instance/InstanceShardOperationRequestBuilder.java @@ -38,6 +38,11 @@ import org.opensearch.client.OpenSearchClient; import org.opensearch.common.unit.TimeValue; +/** + * Request builder for a shard operation + * + * @opensearch.internal + */ public abstract class InstanceShardOperationRequestBuilder< Request extends InstanceShardOperationRequest, Response extends ActionResponse, diff --git a/server/src/main/java/org/opensearch/action/support/single/instance/TransportInstanceSingleOperationAction.java b/server/src/main/java/org/opensearch/action/support/single/instance/TransportInstanceSingleOperationAction.java index f91b2e8ce2e98..a6a16157ed264 100644 --- a/server/src/main/java/org/opensearch/action/support/single/instance/TransportInstanceSingleOperationAction.java +++ b/server/src/main/java/org/opensearch/action/support/single/instance/TransportInstanceSingleOperationAction.java @@ -69,6 +69,11 @@ import static org.opensearch.cluster.metadata.IndexNameExpressionResolver.EXCLUDED_DATA_STREAMS_KEY; +/** + * Base class for a single operation action + * + * @opensearch.internal + */ public abstract class TransportInstanceSingleOperationAction< Request extends InstanceShardOperationRequest, Response extends ActionResponse> extends HandledTransportAction { diff --git a/server/src/main/java/org/opensearch/action/support/single/shard/SingleShardOperationRequestBuilder.java b/server/src/main/java/org/opensearch/action/support/single/shard/SingleShardOperationRequestBuilder.java index d981bfaf60f2c..cf93947cd4afe 100644 --- a/server/src/main/java/org/opensearch/action/support/single/shard/SingleShardOperationRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/support/single/shard/SingleShardOperationRequestBuilder.java @@ -37,6 +37,11 @@ import org.opensearch.action.ActionResponse; import org.opensearch.client.OpenSearchClient; +/** + * Request builder for a single shard operation request + * + * @opensearch.internal + */ public abstract class SingleShardOperationRequestBuilder< Request extends SingleShardRequest, Response extends ActionResponse, diff --git a/server/src/main/java/org/opensearch/action/support/single/shard/SingleShardRequest.java b/server/src/main/java/org/opensearch/action/support/single/shard/SingleShardRequest.java index faae069b4b7fa..61777e2b7bae2 100644 --- a/server/src/main/java/org/opensearch/action/support/single/shard/SingleShardRequest.java +++ b/server/src/main/java/org/opensearch/action/support/single/shard/SingleShardRequest.java @@ -44,6 +44,11 @@ import java.io.IOException; +/** + * Single shard request. + * + * @opensearch.internal + */ public abstract class SingleShardRequest> extends ActionRequest implements IndicesRequest { public static final IndicesOptions INDICES_OPTIONS = IndicesOptions.strictSingleIndexNoExpandForbidClosed(); diff --git a/server/src/main/java/org/opensearch/action/support/single/shard/TransportSingleShardAction.java b/server/src/main/java/org/opensearch/action/support/single/shard/TransportSingleShardAction.java index 2a03abac733cd..679360360eed4 100644 --- a/server/src/main/java/org/opensearch/action/support/single/shard/TransportSingleShardAction.java +++ b/server/src/main/java/org/opensearch/action/support/single/shard/TransportSingleShardAction.java @@ -71,6 +71,8 @@ * A base class for operations that need to perform a read operation on a single shard copy. If the operation fails, * the read operation can be performed on other shard copies. Concrete implementations can provide their own list * of candidate shards to try the read operation on. + * + * @opensearch.internal */ public abstract class TransportSingleShardAction, Response extends ActionResponse> extends TransportAction { diff --git a/server/src/main/java/org/opensearch/action/support/tasks/BaseTasksRequest.java b/server/src/main/java/org/opensearch/action/support/tasks/BaseTasksRequest.java index bbe7b918b26a5..34a8412ea4129 100644 --- a/server/src/main/java/org/opensearch/action/support/tasks/BaseTasksRequest.java +++ b/server/src/main/java/org/opensearch/action/support/tasks/BaseTasksRequest.java @@ -49,6 +49,8 @@ /** * A base class for task requests + * + * @opensearch.internal */ public class BaseTasksRequest> extends ActionRequest { diff --git a/server/src/main/java/org/opensearch/action/support/tasks/BaseTasksResponse.java b/server/src/main/java/org/opensearch/action/support/tasks/BaseTasksResponse.java index 3ba32cf2a3b12..dce52d078ffe8 100644 --- a/server/src/main/java/org/opensearch/action/support/tasks/BaseTasksResponse.java +++ b/server/src/main/java/org/opensearch/action/support/tasks/BaseTasksResponse.java @@ -54,6 +54,8 @@ /** * Base class for responses of task-related operations + * + * @opensearch.internal */ public class BaseTasksResponse extends ActionResponse { protected static final String TASK_FAILURES = "task_failures"; diff --git a/server/src/main/java/org/opensearch/action/support/tasks/TasksRequestBuilder.java b/server/src/main/java/org/opensearch/action/support/tasks/TasksRequestBuilder.java index 0dd0f585ae9e6..a15d008fea475 100644 --- a/server/src/main/java/org/opensearch/action/support/tasks/TasksRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/support/tasks/TasksRequestBuilder.java @@ -39,6 +39,8 @@ /** * Builder for task-based requests + * + * @opensearch.internal */ public class TasksRequestBuilder< Request extends BaseTasksRequest, diff --git a/server/src/main/java/org/opensearch/action/support/tasks/TransportTasksAction.java b/server/src/main/java/org/opensearch/action/support/tasks/TransportTasksAction.java index 7bd5a8503b123..7a79d449538aa 100644 --- a/server/src/main/java/org/opensearch/action/support/tasks/TransportTasksAction.java +++ b/server/src/main/java/org/opensearch/action/support/tasks/TransportTasksAction.java @@ -73,6 +73,8 @@ /** * The base class for transport actions that are interacting with currently running tasks. + * + * @opensearch.internal */ public abstract class TransportTasksAction< OperationTask extends Task, diff --git a/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsAction.java b/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsAction.java index a14ae0ce94cc7..27d93f2a8e916 100644 --- a/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsAction.java +++ b/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * A single multi term action. + * + * @opensearch.internal + */ public class MultiTermVectorsAction extends ActionType { public static final MultiTermVectorsAction INSTANCE = new MultiTermVectorsAction(); diff --git a/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsItemResponse.java b/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsItemResponse.java index 037f4b95e3c73..0367c01d7e4b7 100644 --- a/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsItemResponse.java +++ b/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsItemResponse.java @@ -39,7 +39,9 @@ import java.io.IOException; /** - * A single multi get response. + * A single multi term response. + * + * @opensearch.internal */ public class MultiTermVectorsItemResponse implements Writeable { diff --git a/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsRequest.java b/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsRequest.java index aada19b081a1c..b07472a1bb5d7 100644 --- a/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsRequest.java +++ b/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsRequest.java @@ -51,6 +51,11 @@ import java.util.List; import java.util.Set; +/** + * A single multi get request. + * + * @opensearch.internal + */ public class MultiTermVectorsRequest extends ActionRequest implements Iterable, diff --git a/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsRequestBuilder.java b/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsRequestBuilder.java index 51711c01beb44..04dfd39112d6e 100644 --- a/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsRequestBuilder.java @@ -35,6 +35,11 @@ import org.opensearch.action.ActionRequestBuilder; import org.opensearch.client.OpenSearchClient; +/** + * A single multi get request builder. + * + * @opensearch.internal + */ public class MultiTermVectorsRequestBuilder extends ActionRequestBuilder { public MultiTermVectorsRequestBuilder(OpenSearchClient client, MultiTermVectorsAction action) { diff --git a/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsResponse.java b/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsResponse.java index 599c2fa883dc7..1dd4f524f86a2 100644 --- a/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsResponse.java +++ b/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsResponse.java @@ -45,6 +45,11 @@ import java.util.Arrays; import java.util.Iterator; +/** + * A multi get response. + * + * @opensearch.internal + */ public class MultiTermVectorsResponse extends ActionResponse implements Iterable, ToXContentObject { /** diff --git a/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsShardRequest.java b/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsShardRequest.java index 85491b37b4914..d8c0c918cb821 100644 --- a/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsShardRequest.java +++ b/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsShardRequest.java @@ -42,6 +42,11 @@ import java.util.ArrayList; import java.util.List; +/** + * A multi get shard request. + * + * @opensearch.internal + */ public class MultiTermVectorsShardRequest extends SingleShardRequest { private int shardId; diff --git a/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsShardResponse.java b/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsShardResponse.java index b01582230ed85..c819c591468ea 100644 --- a/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsShardResponse.java +++ b/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsShardResponse.java @@ -41,6 +41,11 @@ import java.util.ArrayList; import java.util.List; +/** + * A multi get shard response. + * + * @opensearch.internal + */ public class MultiTermVectorsShardResponse extends ActionResponse { final IntArrayList locations; diff --git a/server/src/main/java/org/opensearch/action/termvectors/TermVectorsAction.java b/server/src/main/java/org/opensearch/action/termvectors/TermVectorsAction.java index acdeb3d18c880..e810621b1a064 100644 --- a/server/src/main/java/org/opensearch/action/termvectors/TermVectorsAction.java +++ b/server/src/main/java/org/opensearch/action/termvectors/TermVectorsAction.java @@ -34,6 +34,12 @@ import org.opensearch.action.ActionType; +/** + * Transport action for returning the term vector (doc frequency, positions, offsets) for a + * document. + * + * @opensearch.internal + */ public class TermVectorsAction extends ActionType { public static final TermVectorsAction INSTANCE = new TermVectorsAction(); diff --git a/server/src/main/java/org/opensearch/action/termvectors/TermVectorsFields.java b/server/src/main/java/org/opensearch/action/termvectors/TermVectorsFields.java index 0033e9299b76d..2349abcd5cbdc 100644 --- a/server/src/main/java/org/opensearch/action/termvectors/TermVectorsFields.java +++ b/server/src/main/java/org/opensearch/action/termvectors/TermVectorsFields.java @@ -130,8 +130,9 @@ *

    6. BytesRef: payload_freqency (if payloads)
    7. * * + * + * @opensearch.internal */ - public final class TermVectorsFields extends Fields { private final ObjectLongHashMap fieldMap; diff --git a/server/src/main/java/org/opensearch/action/termvectors/TermVectorsFilter.java b/server/src/main/java/org/opensearch/action/termvectors/TermVectorsFilter.java index 2d2650e2b9389..ea54cea675900 100644 --- a/server/src/main/java/org/opensearch/action/termvectors/TermVectorsFilter.java +++ b/server/src/main/java/org/opensearch/action/termvectors/TermVectorsFilter.java @@ -45,6 +45,12 @@ import java.util.Map; import java.util.Set; +/** + * Filter the term vector (doc frequency, positions, offsets) for a + * document. + * + * @opensearch.internal + */ public class TermVectorsFilter { public static final int DEFAULT_MAX_QUERY_TERMS = 25; public static final int DEFAULT_MIN_TERM_FREQ = 0; diff --git a/server/src/main/java/org/opensearch/action/termvectors/TermVectorsRequest.java b/server/src/main/java/org/opensearch/action/termvectors/TermVectorsRequest.java index 214d5f0d6d4fa..7da1df1dbe308 100644 --- a/server/src/main/java/org/opensearch/action/termvectors/TermVectorsRequest.java +++ b/server/src/main/java/org/opensearch/action/termvectors/TermVectorsRequest.java @@ -73,6 +73,8 @@ *

      * Note, the {@link #index()}, and {@link #id(String)} are * required. + * + * @opensearch.internal */ public class TermVectorsRequest extends SingleShardRequest implements RealtimeRequest { private static final ParseField INDEX = new ParseField("_index"); diff --git a/server/src/main/java/org/opensearch/action/termvectors/TermVectorsRequestBuilder.java b/server/src/main/java/org/opensearch/action/termvectors/TermVectorsRequestBuilder.java index 7294db072ad38..d9227a1afa199 100644 --- a/server/src/main/java/org/opensearch/action/termvectors/TermVectorsRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/termvectors/TermVectorsRequestBuilder.java @@ -45,6 +45,8 @@ *

      * Note, the {@code index}, {@code type} and {@code id} are * required. + * + * @opensearch.internal */ public class TermVectorsRequestBuilder extends ActionRequestBuilder { diff --git a/server/src/main/java/org/opensearch/action/termvectors/TermVectorsResponse.java b/server/src/main/java/org/opensearch/action/termvectors/TermVectorsResponse.java index 870609d526909..80d80d01b9a93 100644 --- a/server/src/main/java/org/opensearch/action/termvectors/TermVectorsResponse.java +++ b/server/src/main/java/org/opensearch/action/termvectors/TermVectorsResponse.java @@ -58,6 +58,12 @@ import java.util.Iterator; import java.util.Set; +/** + * Response returning the term vector (doc frequency, positions, offsets) for a + * document. + * + * @opensearch.internal + */ public class TermVectorsResponse extends ActionResponse implements ToXContentObject { private static class FieldStrings { diff --git a/server/src/main/java/org/opensearch/action/termvectors/TermVectorsWriter.java b/server/src/main/java/org/opensearch/action/termvectors/TermVectorsWriter.java index 2c1e543774da6..e7772cf300f5a 100644 --- a/server/src/main/java/org/opensearch/action/termvectors/TermVectorsWriter.java +++ b/server/src/main/java/org/opensearch/action/termvectors/TermVectorsWriter.java @@ -49,6 +49,12 @@ import java.util.List; import java.util.Set; +/** + * Writer for the term vector (doc frequency, positions, offsets) for a + * document. + * + * @opensearch.internal + */ // package only - this is an internal class! final class TermVectorsWriter { final List fields = new ArrayList<>(); diff --git a/server/src/main/java/org/opensearch/action/termvectors/TransportMultiTermVectorsAction.java b/server/src/main/java/org/opensearch/action/termvectors/TransportMultiTermVectorsAction.java index 127b31f329d09..d90c3968bddbb 100644 --- a/server/src/main/java/org/opensearch/action/termvectors/TransportMultiTermVectorsAction.java +++ b/server/src/main/java/org/opensearch/action/termvectors/TransportMultiTermVectorsAction.java @@ -51,6 +51,11 @@ import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; +/** + * Performs the multi term get operation. + * + * @opensearch.internal + */ public class TransportMultiTermVectorsAction extends HandledTransportAction { private final ClusterService clusterService; diff --git a/server/src/main/java/org/opensearch/action/termvectors/TransportShardMultiTermsVectorAction.java b/server/src/main/java/org/opensearch/action/termvectors/TransportShardMultiTermsVectorAction.java index 511b68965ebdf..b5928dc99571f 100644 --- a/server/src/main/java/org/opensearch/action/termvectors/TransportShardMultiTermsVectorAction.java +++ b/server/src/main/java/org/opensearch/action/termvectors/TransportShardMultiTermsVectorAction.java @@ -50,6 +50,11 @@ import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; +/** + * Performs the multi term shard level get operation. + * + * @opensearch.internal + */ public class TransportShardMultiTermsVectorAction extends TransportSingleShardAction< MultiTermVectorsShardRequest, MultiTermVectorsShardResponse> { diff --git a/server/src/main/java/org/opensearch/action/termvectors/TransportTermVectorsAction.java b/server/src/main/java/org/opensearch/action/termvectors/TransportTermVectorsAction.java index 3cfd9cf7da7c5..11770cd10d982 100644 --- a/server/src/main/java/org/opensearch/action/termvectors/TransportTermVectorsAction.java +++ b/server/src/main/java/org/opensearch/action/termvectors/TransportTermVectorsAction.java @@ -55,6 +55,8 @@ /** * Performs the get operation. + * + * @opensearch.internal */ public class TransportTermVectorsAction extends TransportSingleShardAction { diff --git a/server/src/main/java/org/opensearch/action/update/TransportUpdateAction.java b/server/src/main/java/org/opensearch/action/update/TransportUpdateAction.java index e554ebc0f8414..c0c28f39b1e03 100644 --- a/server/src/main/java/org/opensearch/action/update/TransportUpdateAction.java +++ b/server/src/main/java/org/opensearch/action/update/TransportUpdateAction.java @@ -81,6 +81,11 @@ import static org.opensearch.action.bulk.TransportSingleItemBulkWriteAction.toSingleItemBulkRequest; import static org.opensearch.action.bulk.TransportSingleItemBulkWriteAction.wrapBulkResponse; +/** + * Transport action for updating an index + * + * @opensearch.internal + */ public class TransportUpdateAction extends TransportInstanceSingleOperationAction { private final AutoCreateIndex autoCreateIndex; diff --git a/server/src/main/java/org/opensearch/action/update/UpdateAction.java b/server/src/main/java/org/opensearch/action/update/UpdateAction.java index c82cf96506de4..af520409f498c 100644 --- a/server/src/main/java/org/opensearch/action/update/UpdateAction.java +++ b/server/src/main/java/org/opensearch/action/update/UpdateAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Action for updating an index + * + * @opensearch.internal + */ public class UpdateAction extends ActionType { public static final UpdateAction INSTANCE = new UpdateAction(); diff --git a/server/src/main/java/org/opensearch/action/update/UpdateHelper.java b/server/src/main/java/org/opensearch/action/update/UpdateHelper.java index 0da41a3028edf..7f4c9524d406d 100644 --- a/server/src/main/java/org/opensearch/action/update/UpdateHelper.java +++ b/server/src/main/java/org/opensearch/action/update/UpdateHelper.java @@ -67,6 +67,8 @@ /** * Helper for translating an update request to an index, delete request or update response. + * + * @opensearch.internal */ public class UpdateHelper { diff --git a/server/src/main/java/org/opensearch/action/update/UpdateRequest.java b/server/src/main/java/org/opensearch/action/update/UpdateRequest.java index 36be9f0160c9a..d434f134f4321 100644 --- a/server/src/main/java/org/opensearch/action/update/UpdateRequest.java +++ b/server/src/main/java/org/opensearch/action/update/UpdateRequest.java @@ -72,6 +72,11 @@ import static org.opensearch.index.seqno.SequenceNumbers.UNASSIGNED_PRIMARY_TERM; import static org.opensearch.index.seqno.SequenceNumbers.UNASSIGNED_SEQ_NO; +/** + * Transport request for updating an index + * + * @opensearch.internal + */ public class UpdateRequest extends InstanceShardOperationRequest implements DocWriteRequest, diff --git a/server/src/main/java/org/opensearch/action/update/UpdateRequestBuilder.java b/server/src/main/java/org/opensearch/action/update/UpdateRequestBuilder.java index 73e470bf8ba69..e797c9857460c 100644 --- a/server/src/main/java/org/opensearch/action/update/UpdateRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/update/UpdateRequestBuilder.java @@ -46,6 +46,11 @@ import java.util.Map; +/** + * Transport request builder for updating an index + * + * @opensearch.internal + */ public class UpdateRequestBuilder extends InstanceShardOperationRequestBuilder implements WriteRequestBuilder { diff --git a/server/src/main/java/org/opensearch/action/update/UpdateResponse.java b/server/src/main/java/org/opensearch/action/update/UpdateResponse.java index 2c6efaf3c5f6b..b51210d2d202b 100644 --- a/server/src/main/java/org/opensearch/action/update/UpdateResponse.java +++ b/server/src/main/java/org/opensearch/action/update/UpdateResponse.java @@ -45,6 +45,11 @@ import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +/** + * Transport response for updating an index + * + * @opensearch.internal + */ public class UpdateResponse extends DocWriteResponse { private static final String GET = "get"; From 4878f3a4ba1cdf074ae48dee2ed06bd685ad87f0 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 4 May 2022 18:10:55 -0500 Subject: [PATCH 123/514] Bump google-api-client from 1.30.10 to 1.34.0 in /plugins/repository-gcs (#3161) (#3191) * Bump google-api-client from 1.30.10 to 1.34.0 in /plugins/repository-gcs Bumps [google-api-client](https://github.com/googleapis/google-api-java-client) from 1.30.10 to 1.34.0. - [Release notes](https://github.com/googleapis/google-api-java-client/releases) - [Changelog](https://github.com/googleapis/google-api-java-client/blob/main/CHANGELOG.md) - [Commits](https://github.com/googleapis/google-api-java-client/compare/v1.30.10...v1.34.0) --- updated-dependencies: - dependency-name: com.google.api-client:google-api-client dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Updating SHAs Signed-off-by: dependabot[bot] * Add missing classes to third party audit Signed-off-by: Andrew Ross Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] Co-authored-by: Andrew Ross (cherry picked from commit 2e53f9a1b81db7b382848a33ebb9aeea33a6088c) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- plugins/repository-gcs/build.gradle | 6 +++++- .../licenses/google-api-client-1.30.10.jar.sha1 | 1 - .../licenses/google-api-client-1.34.0.jar.sha1 | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) delete mode 100644 plugins/repository-gcs/licenses/google-api-client-1.30.10.jar.sha1 create mode 100644 plugins/repository-gcs/licenses/google-api-client-1.34.0.jar.sha1 diff --git a/plugins/repository-gcs/build.gradle b/plugins/repository-gcs/build.gradle index 241cd70eba071..4b674741611b4 100644 --- a/plugins/repository-gcs/build.gradle +++ b/plugins/repository-gcs/build.gradle @@ -70,7 +70,7 @@ dependencies { api 'com.google.auth:google-auth-library-credentials:0.20.0' api 'com.google.auth:google-auth-library-oauth2-http:0.20.0' api 'com.google.oauth-client:google-oauth-client:1.33.1' - api 'com.google.api-client:google-api-client:1.30.10' + api 'com.google.api-client:google-api-client:1.34.0' api 'com.google.http-client:google-http-client-appengine:1.35.0' api 'com.google.http-client:google-http-client-jackson2:1.35.0' api 'com.google.http-client:google-http-client-gson:1.41.4' @@ -126,6 +126,7 @@ thirdPartyAudit { ) ignoreMissingClasses( + 'com.google.api.client.http.apache.v2.ApacheHttpTransport', 'com.google.appengine.api.datastore.Blob', 'com.google.appengine.api.datastore.DatastoreService', 'com.google.appengine.api.datastore.DatastoreServiceFactory', @@ -168,6 +169,8 @@ thirdPartyAudit { 'org.apache.http.client.UserTokenHandler', 'org.apache.http.client.methods.HttpEntityEnclosingRequestBase', 'org.apache.http.client.methods.HttpRequestBase', + 'org.apache.http.config.Registry', + 'org.apache.http.config.RegistryBuilder', 'org.apache.http.config.SocketConfig', 'org.apache.http.config.SocketConfig$Builder', 'org.apache.http.conn.ClientConnectionManager', @@ -177,6 +180,7 @@ thirdPartyAudit { 'org.apache.http.conn.routing.HttpRoutePlanner', 'org.apache.http.conn.scheme.PlainSocketFactory', 'org.apache.http.conn.scheme.SchemeRegistry', + 'org.apache.http.conn.socket.PlainConnectionSocketFactory', 'org.apache.http.conn.ssl.SSLSocketFactory', 'org.apache.http.conn.ssl.X509HostnameVerifier', 'org.apache.http.entity.AbstractHttpEntity', diff --git a/plugins/repository-gcs/licenses/google-api-client-1.30.10.jar.sha1 b/plugins/repository-gcs/licenses/google-api-client-1.30.10.jar.sha1 deleted file mode 100644 index 62c51887ee1ea..0000000000000 --- a/plugins/repository-gcs/licenses/google-api-client-1.30.10.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -2de98417199785982e1f037fb8b52613f57175ae \ No newline at end of file diff --git a/plugins/repository-gcs/licenses/google-api-client-1.34.0.jar.sha1 b/plugins/repository-gcs/licenses/google-api-client-1.34.0.jar.sha1 new file mode 100644 index 0000000000000..9be9480435085 --- /dev/null +++ b/plugins/repository-gcs/licenses/google-api-client-1.34.0.jar.sha1 @@ -0,0 +1 @@ +af2586412cabeee49c9db6d736e75b745bc467f8 \ No newline at end of file From 2c3cc0ae25c4d42b085c7d3c7590b2bf9220271d Mon Sep 17 00:00:00 2001 From: Tianli Feng Date: Thu, 5 May 2022 13:40:52 -0700 Subject: [PATCH 124/514] Rename BecomeMasterTask to BecomeClusterManagerTask in JoinTaskExecutor (#3099) (#3179) Signed-off-by: Tianli Feng --- .../coordination/JoinTaskExecutor.java | 19 ++++++++++++++++++- .../coordination/JoinTaskExecutorTests.java | 11 +++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/org/opensearch/cluster/coordination/JoinTaskExecutor.java b/server/src/main/java/org/opensearch/cluster/coordination/JoinTaskExecutor.java index b8f7dfd116b7e..f0edeeb9319c5 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/JoinTaskExecutor.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/JoinTaskExecutor.java @@ -94,14 +94,19 @@ public String toString() { } public boolean isBecomeMasterTask() { - return reason.equals(BECOME_MASTER_TASK_REASON); + return reason.equals(BECOME_MASTER_TASK_REASON) || reason.equals(BECOME_CLUSTER_MANAGER_TASK_REASON); } public boolean isFinishElectionTask() { return reason.equals(FINISH_ELECTION_TASK_REASON); } + /** + * @deprecated As of 2.0, because supporting inclusive language, replaced by {@link #BECOME_CLUSTER_MANAGER_TASK_REASON} + */ + @Deprecated private static final String BECOME_MASTER_TASK_REASON = "_BECOME_MASTER_TASK_"; + private static final String BECOME_CLUSTER_MANAGER_TASK_REASON = "_BECOME_CLUSTER_MANAGER_TASK_"; private static final String FINISH_ELECTION_TASK_REASON = "_FINISH_ELECTION_"; } @@ -331,10 +336,22 @@ public boolean runOnlyOnMaster() { return false; } + /** + * a task indicates that the current node should become master + * @deprecated As of 2.0, because supporting inclusive language, replaced by {@link #newBecomeClusterManagerTask()} + */ + @Deprecated public static Task newBecomeMasterTask() { return new Task(null, Task.BECOME_MASTER_TASK_REASON); } + /** + * a task indicates that the current node should become cluster-manager + */ + public static Task newBecomeClusterManagerTask() { + return new Task(null, Task.BECOME_CLUSTER_MANAGER_TASK_REASON); + } + /** * a task that is used to signal the election is stopped and we should process pending joins. * it may be used in combination with {@link JoinTaskExecutor#newBecomeMasterTask()} diff --git a/server/src/test/java/org/opensearch/cluster/coordination/JoinTaskExecutorTests.java b/server/src/test/java/org/opensearch/cluster/coordination/JoinTaskExecutorTests.java index a019235c99743..c5ac3953fad6e 100644 --- a/server/src/test/java/org/opensearch/cluster/coordination/JoinTaskExecutorTests.java +++ b/server/src/test/java/org/opensearch/cluster/coordination/JoinTaskExecutorTests.java @@ -53,6 +53,7 @@ import java.util.HashSet; import java.util.Map; +import static org.hamcrest.Matchers.is; import static org.opensearch.test.VersionUtils.maxCompatibleVersion; import static org.opensearch.test.VersionUtils.randomCompatibleVersion; import static org.opensearch.test.VersionUtils.randomVersion; @@ -272,4 +273,14 @@ public void testUpdatesNodeWithOpenSearchVersionForExistingAndNewNodes() throws // 7.9.0 node without active channel but shouldn't get removed assertEquals(LegacyESVersion.V_7_10_0, resultNodes.get(node_7).getVersion()); } + + /** + * Validate isBecomeMasterTask() can identify "become cluster manager task" properly + */ + public void testIsBecomeClusterManagerTask() { + JoinTaskExecutor.Task joinTaskOfMaster = JoinTaskExecutor.newBecomeMasterTask(); + assertThat(joinTaskOfMaster.isBecomeMasterTask(), is(true)); + JoinTaskExecutor.Task joinTaskOfClusterManager = JoinTaskExecutor.newBecomeClusterManagerTask(); + assertThat(joinTaskOfClusterManager.isBecomeMasterTask(), is(true)); + } } From caac9c6d2bf212c3d284b7de1a49e27316cf9448 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 5 May 2022 17:01:47 -0400 Subject: [PATCH 125/514] [Javadocs] add to o.o.monitor,persistance,plugins,repo,script,threadpool,usage,watcher (#3186) (#3192) Adds javadocs to classes in the org.opensearch.monitor, persistence, plugins, repository, script, threadpool, usage, and watcher packages. Signed-off-by: Nicholas Walter Knize (cherry picked from commit 14704b30cafadcfdcd7cd81961ee07452804b0c3) Co-authored-by: Nick Knize --- server/src/main/java/org/opensearch/Assertions.java | 2 ++ server/src/main/java/org/opensearch/Build.java | 2 ++ .../src/main/java/org/opensearch/ExceptionsHelper.java | 5 +++++ server/src/main/java/org/opensearch/LegacyESVersion.java | 2 ++ .../org/opensearch/OpenSearchCorruptionException.java | 2 ++ .../main/java/org/opensearch/OpenSearchException.java | 2 ++ .../org/opensearch/OpenSearchGenerationException.java | 2 +- .../java/org/opensearch/OpenSearchParseException.java | 2 ++ .../java/org/opensearch/OpenSearchSecurityException.java | 2 ++ .../java/org/opensearch/OpenSearchStatusException.java | 2 ++ .../java/org/opensearch/OpenSearchTimeoutException.java | 2 +- .../java/org/opensearch/OpenSearchWrapperException.java | 2 ++ .../org/opensearch/ResourceAlreadyExistsException.java | 5 +++++ .../java/org/opensearch/ResourceNotFoundException.java | 2 ++ .../src/main/java/org/opensearch/SpecialPermission.java | 2 ++ server/src/main/java/org/opensearch/Version.java | 5 +++++ .../main/java/org/opensearch/monitor/MonitorService.java | 5 +++++ .../java/org/opensearch/monitor/NodeHealthService.java | 5 +++++ server/src/main/java/org/opensearch/monitor/Probes.java | 5 +++++ .../src/main/java/org/opensearch/monitor/StatusInfo.java | 2 ++ .../java/org/opensearch/monitor/fs/FsHealthService.java | 2 ++ .../src/main/java/org/opensearch/monitor/fs/FsInfo.java | 5 +++++ .../src/main/java/org/opensearch/monitor/fs/FsProbe.java | 5 +++++ .../main/java/org/opensearch/monitor/fs/FsService.java | 5 +++++ .../org/opensearch/monitor/jvm/DeadlockAnalyzer.java | 5 +++++ .../main/java/org/opensearch/monitor/jvm/GcNames.java | 5 +++++ .../main/java/org/opensearch/monitor/jvm/HotThreads.java | 5 +++++ .../org/opensearch/monitor/jvm/JvmGcMonitorService.java | 5 +++++ .../main/java/org/opensearch/monitor/jvm/JvmInfo.java | 5 +++++ .../src/main/java/org/opensearch/monitor/jvm/JvmPid.java | 5 +++++ .../main/java/org/opensearch/monitor/jvm/JvmService.java | 5 +++++ .../main/java/org/opensearch/monitor/jvm/JvmStats.java | 5 +++++ .../src/main/java/org/opensearch/monitor/os/OsInfo.java | 5 +++++ .../src/main/java/org/opensearch/monitor/os/OsProbe.java | 2 ++ .../main/java/org/opensearch/monitor/os/OsService.java | 5 +++++ .../src/main/java/org/opensearch/monitor/os/OsStats.java | 5 +++++ .../java/org/opensearch/monitor/process/ProcessInfo.java | 5 +++++ .../org/opensearch/monitor/process/ProcessProbe.java | 5 +++++ .../org/opensearch/monitor/process/ProcessService.java | 5 +++++ .../org/opensearch/monitor/process/ProcessStats.java | 5 +++++ .../opensearch/persistent/AllocatedPersistentTask.java | 2 ++ .../persistent/CompletionPersistentTaskAction.java | 2 ++ .../persistent/NodePersistentTasksExecutor.java | 2 ++ .../org/opensearch/persistent/PersistentTaskParams.java | 2 ++ .../opensearch/persistent/PersistentTaskResponse.java | 2 ++ .../org/opensearch/persistent/PersistentTaskState.java | 2 ++ .../persistent/PersistentTasksClusterService.java | 2 ++ .../persistent/PersistentTasksCustomMetadata.java | 2 ++ .../opensearch/persistent/PersistentTasksExecutor.java | 2 ++ .../persistent/PersistentTasksExecutorRegistry.java | 2 ++ .../persistent/PersistentTasksNodeService.java | 2 ++ .../opensearch/persistent/PersistentTasksService.java | 2 ++ .../persistent/RemovePersistentTaskAction.java | 5 +++++ .../opensearch/persistent/StartPersistentTaskAction.java | 2 ++ .../persistent/UpdatePersistentTaskStatusAction.java | 5 +++++ .../persistent/decider/AssignmentDecision.java | 2 ++ .../persistent/decider/EnableAssignmentDecider.java | 2 ++ .../main/java/org/opensearch/plugins/ActionPlugin.java | 2 ++ .../main/java/org/opensearch/plugins/AnalysisPlugin.java | 2 ++ .../org/opensearch/plugins/CircuitBreakerPlugin.java | 2 ++ .../main/java/org/opensearch/plugins/ClusterPlugin.java | 2 ++ .../java/org/opensearch/plugins/DiscoveryPlugin.java | 2 ++ .../main/java/org/opensearch/plugins/EnginePlugin.java | 2 ++ .../java/org/opensearch/plugins/ExtensiblePlugin.java | 2 ++ .../java/org/opensearch/plugins/IndexStorePlugin.java | 2 ++ .../main/java/org/opensearch/plugins/IngestPlugin.java | 2 ++ .../main/java/org/opensearch/plugins/MapperPlugin.java | 2 ++ .../java/org/opensearch/plugins/MetadataUpgrader.java | 2 ++ .../main/java/org/opensearch/plugins/NetworkPlugin.java | 2 ++ .../org/opensearch/plugins/PersistentTaskPlugin.java | 2 ++ .../src/main/java/org/opensearch/plugins/Platforms.java | 2 ++ server/src/main/java/org/opensearch/plugins/Plugin.java | 2 ++ .../src/main/java/org/opensearch/plugins/PluginInfo.java | 2 ++ .../org/opensearch/plugins/PluginLoaderIndirection.java | 2 ++ .../main/java/org/opensearch/plugins/PluginSecurity.java | 5 +++++ .../java/org/opensearch/plugins/ReloadablePlugin.java | 2 ++ .../java/org/opensearch/plugins/RepositoryPlugin.java | 2 ++ .../main/java/org/opensearch/plugins/ScriptPlugin.java | 2 ++ .../main/java/org/opensearch/plugins/SearchPlugin.java | 2 ++ .../java/org/opensearch/plugins/SystemIndexPlugin.java | 2 ++ .../opensearch/plugins/spi/NamedXContentProvider.java | 2 ++ .../org/opensearch/repositories/FilterRepository.java | 5 +++++ .../main/java/org/opensearch/repositories/IndexId.java | 2 ++ .../repositories/IndexMetaDataGenerations.java | 2 ++ .../org/opensearch/repositories/RepositoriesModule.java | 2 ++ .../org/opensearch/repositories/RepositoriesService.java | 2 ++ .../repositories/RepositoriesStatsArchive.java | 5 +++++ .../java/org/opensearch/repositories/Repository.java | 2 ++ .../opensearch/repositories/RepositoryCleanupResult.java | 5 +++++ .../java/org/opensearch/repositories/RepositoryData.java | 2 ++ .../org/opensearch/repositories/RepositoryException.java | 2 ++ .../java/org/opensearch/repositories/RepositoryInfo.java | 5 +++++ .../repositories/RepositoryMissingException.java | 2 ++ .../org/opensearch/repositories/RepositoryOperation.java | 2 ++ .../org/opensearch/repositories/RepositoryShardId.java | 2 ++ .../org/opensearch/repositories/RepositoryStats.java | 5 +++++ .../opensearch/repositories/RepositoryStatsSnapshot.java | 5 +++++ .../repositories/RepositoryVerificationException.java | 2 ++ .../org/opensearch/repositories/ShardGenerations.java | 5 +++++ .../org/opensearch/repositories/VerificationFailure.java | 5 +++++ .../repositories/VerifyNodeRepositoryAction.java | 5 +++++ .../repositories/blobstore/BlobStoreRepository.java | 2 ++ .../repositories/blobstore/ChecksumBlobStoreFormat.java | 2 ++ .../repositories/blobstore/FileRestoreContext.java | 2 ++ .../blobstore/MeteredBlobStoreRepository.java | 5 +++++ .../org/opensearch/repositories/fs/FsRepository.java | 2 ++ .../java/org/opensearch/script/AggregationScript.java | 5 +++++ .../org/opensearch/script/BucketAggregationScript.java | 2 ++ .../script/BucketAggregationSelectorScript.java | 2 ++ .../main/java/org/opensearch/script/ClassPermission.java | 2 ++ .../src/main/java/org/opensearch/script/DynamicMap.java | 2 ++ .../org/opensearch/script/ExplainableScoreScript.java | 2 ++ .../src/main/java/org/opensearch/script/FieldScript.java | 2 ++ .../main/java/org/opensearch/script/FilterScript.java | 2 ++ .../org/opensearch/script/GeneralScriptException.java | 2 ++ .../org/opensearch/script/IngestConditionalScript.java | 2 ++ .../main/java/org/opensearch/script/IngestScript.java | 2 ++ .../opensearch/script/JodaCompatibleZonedDateTime.java | 2 ++ .../java/org/opensearch/script/NumberSortScript.java | 5 +++++ .../src/main/java/org/opensearch/script/ScoreScript.java | 2 ++ .../java/org/opensearch/script/ScoreScriptUtils.java | 5 +++++ server/src/main/java/org/opensearch/script/Script.java | 2 ++ .../src/main/java/org/opensearch/script/ScriptCache.java | 2 ++ .../java/org/opensearch/script/ScriptCacheStats.java | 9 ++++++++- .../main/java/org/opensearch/script/ScriptContext.java | 2 ++ .../java/org/opensearch/script/ScriptContextInfo.java | 5 +++++ .../java/org/opensearch/script/ScriptContextStats.java | 5 +++++ .../main/java/org/opensearch/script/ScriptEngine.java | 2 ++ .../main/java/org/opensearch/script/ScriptException.java | 2 ++ .../main/java/org/opensearch/script/ScriptFactory.java | 2 ++ .../java/org/opensearch/script/ScriptLanguagesInfo.java | 2 ++ .../main/java/org/opensearch/script/ScriptMetadata.java | 2 ++ .../main/java/org/opensearch/script/ScriptMetrics.java | 5 +++++ .../main/java/org/opensearch/script/ScriptModule.java | 2 ++ .../main/java/org/opensearch/script/ScriptService.java | 5 +++++ .../src/main/java/org/opensearch/script/ScriptStats.java | 5 +++++ .../src/main/java/org/opensearch/script/ScriptType.java | 2 ++ .../org/opensearch/script/ScriptedMetricAggContexts.java | 5 +++++ .../script/SignificantTermsHeuristicScoreScript.java | 2 ++ .../java/org/opensearch/script/SimilarityScript.java | 6 +++++- .../org/opensearch/script/SimilarityWeightScript.java | 6 +++++- .../java/org/opensearch/script/StoredScriptSource.java | 2 ++ .../java/org/opensearch/script/StringSortScript.java | 5 +++++ .../main/java/org/opensearch/script/TemplateScript.java | 2 ++ .../java/org/opensearch/script/TermsSetQueryScript.java | 5 +++++ .../main/java/org/opensearch/script/UpdateScript.java | 2 ++ .../threadpool/AutoQueueAdjustingExecutorBuilder.java | 2 ++ .../org/opensearch/threadpool/CancellableAdapter.java | 5 +++++ .../java/org/opensearch/threadpool/ExecutorBuilder.java | 2 ++ .../org/opensearch/threadpool/FixedExecutorBuilder.java | 2 ++ .../opensearch/threadpool/ScalingExecutorBuilder.java | 2 ++ .../threadpool/ScheduledCancellableAdapter.java | 5 +++++ .../main/java/org/opensearch/threadpool/Scheduler.java | 2 ++ .../main/java/org/opensearch/threadpool/ThreadPool.java | 5 +++++ .../java/org/opensearch/threadpool/ThreadPoolInfo.java | 5 +++++ .../java/org/opensearch/threadpool/ThreadPoolStats.java | 5 +++++ .../src/main/java/org/opensearch/usage/UsageService.java | 2 ++ .../org/opensearch/watcher/AbstractResourceWatcher.java | 2 ++ .../java/org/opensearch/watcher/FileChangesListener.java | 2 ++ .../main/java/org/opensearch/watcher/FileWatcher.java | 2 ++ .../java/org/opensearch/watcher/ResourceWatcher.java | 2 ++ .../org/opensearch/watcher/ResourceWatcherService.java | 2 ++ .../main/java/org/opensearch/watcher/WatcherHandle.java | 5 +++++ 163 files changed, 498 insertions(+), 5 deletions(-) diff --git a/server/src/main/java/org/opensearch/Assertions.java b/server/src/main/java/org/opensearch/Assertions.java index 6873364f7987d..843853ec8b20b 100644 --- a/server/src/main/java/org/opensearch/Assertions.java +++ b/server/src/main/java/org/opensearch/Assertions.java @@ -36,6 +36,8 @@ * Provides a static final field that can be used to check if assertions are enabled. Since this field might be used elsewhere to check if * assertions are enabled, if you are running with assertions enabled for specific packages or classes, you should enable assertions on this * class too (e.g., {@code -ea org.opensearch.Assertions -ea org.opensearch.cluster.service.MasterService}). + * + * @opensearch.internal */ public final class Assertions { diff --git a/server/src/main/java/org/opensearch/Build.java b/server/src/main/java/org/opensearch/Build.java index 9508a63de5991..1d21de6863eef 100644 --- a/server/src/main/java/org/opensearch/Build.java +++ b/server/src/main/java/org/opensearch/Build.java @@ -46,6 +46,8 @@ /** * Information about a build of OpenSearch. + * + * @opensearch.internal */ public class Build { /** diff --git a/server/src/main/java/org/opensearch/ExceptionsHelper.java b/server/src/main/java/org/opensearch/ExceptionsHelper.java index 418bf9811a7b3..f252d0b05af79 100644 --- a/server/src/main/java/org/opensearch/ExceptionsHelper.java +++ b/server/src/main/java/org/opensearch/ExceptionsHelper.java @@ -61,6 +61,11 @@ import java.util.function.Predicate; import java.util.stream.Collectors; +/** + * Helper class for OpenSearch Exceptions + * + * @opensearch.internal + */ public final class ExceptionsHelper { private static final Logger logger = LogManager.getLogger(ExceptionsHelper.class); diff --git a/server/src/main/java/org/opensearch/LegacyESVersion.java b/server/src/main/java/org/opensearch/LegacyESVersion.java index 38b655b09b151..d4ac3c7d2f8b1 100644 --- a/server/src/main/java/org/opensearch/LegacyESVersion.java +++ b/server/src/main/java/org/opensearch/LegacyESVersion.java @@ -43,6 +43,8 @@ * * This class keeps all the supported OpenSearch predecessor versions for * backward compatibility purpose. + * + * @opensearch.internal */ public class LegacyESVersion extends Version { diff --git a/server/src/main/java/org/opensearch/OpenSearchCorruptionException.java b/server/src/main/java/org/opensearch/OpenSearchCorruptionException.java index ecca2191295a4..eb012b209c7de 100644 --- a/server/src/main/java/org/opensearch/OpenSearchCorruptionException.java +++ b/server/src/main/java/org/opensearch/OpenSearchCorruptionException.java @@ -36,6 +36,8 @@ /** * This exception is thrown when OpenSearch detects * an inconsistency in one of it's persistent files. + * + * @opensearch.internal */ public class OpenSearchCorruptionException extends IOException { diff --git a/server/src/main/java/org/opensearch/OpenSearchException.java b/server/src/main/java/org/opensearch/OpenSearchException.java index 5a9e5b91982a2..a6a12d7ebb4f7 100644 --- a/server/src/main/java/org/opensearch/OpenSearchException.java +++ b/server/src/main/java/org/opensearch/OpenSearchException.java @@ -73,6 +73,8 @@ /** * A base class for all opensearch exceptions. + * + * @opensearch.internal */ public class OpenSearchException extends RuntimeException implements ToXContentFragment, Writeable { diff --git a/server/src/main/java/org/opensearch/OpenSearchGenerationException.java b/server/src/main/java/org/opensearch/OpenSearchGenerationException.java index 1f112aaf5a6e6..23f93263ee3d2 100644 --- a/server/src/main/java/org/opensearch/OpenSearchGenerationException.java +++ b/server/src/main/java/org/opensearch/OpenSearchGenerationException.java @@ -39,7 +39,7 @@ /** * A generic exception indicating failure to generate. * - * + * @opensearch.internal */ public class OpenSearchGenerationException extends OpenSearchException { diff --git a/server/src/main/java/org/opensearch/OpenSearchParseException.java b/server/src/main/java/org/opensearch/OpenSearchParseException.java index 0cc537f36a3ec..57eab19cc01f4 100644 --- a/server/src/main/java/org/opensearch/OpenSearchParseException.java +++ b/server/src/main/java/org/opensearch/OpenSearchParseException.java @@ -39,6 +39,8 @@ /** * Unchecked exception that is translated into a {@code 400 BAD REQUEST} error when it bubbles out over HTTP. + * + * @opensearch.internal */ public class OpenSearchParseException extends OpenSearchException { diff --git a/server/src/main/java/org/opensearch/OpenSearchSecurityException.java b/server/src/main/java/org/opensearch/OpenSearchSecurityException.java index 35edb058605a7..6f725573e71ce 100644 --- a/server/src/main/java/org/opensearch/OpenSearchSecurityException.java +++ b/server/src/main/java/org/opensearch/OpenSearchSecurityException.java @@ -38,6 +38,8 @@ /** * Generic security exception + * + * @opensearch.internal */ public class OpenSearchSecurityException extends OpenSearchStatusException { /** diff --git a/server/src/main/java/org/opensearch/OpenSearchStatusException.java b/server/src/main/java/org/opensearch/OpenSearchStatusException.java index 274eac8f8b2ad..b9cc51eaa2a8d 100644 --- a/server/src/main/java/org/opensearch/OpenSearchStatusException.java +++ b/server/src/main/java/org/opensearch/OpenSearchStatusException.java @@ -41,6 +41,8 @@ /** * Exception who's {@link RestStatus} is arbitrary rather than derived. Used, for example, by reindex-from-remote to wrap remote exceptions * that contain a status. + * + * @opensearch.internal */ public class OpenSearchStatusException extends OpenSearchException { private final RestStatus status; diff --git a/server/src/main/java/org/opensearch/OpenSearchTimeoutException.java b/server/src/main/java/org/opensearch/OpenSearchTimeoutException.java index 6b20e145e500b..6f97d8fc3dde3 100644 --- a/server/src/main/java/org/opensearch/OpenSearchTimeoutException.java +++ b/server/src/main/java/org/opensearch/OpenSearchTimeoutException.java @@ -39,7 +39,7 @@ /** * The same as {@link java.util.concurrent.TimeoutException} simply a runtime one. * - * + * @opensearch.internal */ public class OpenSearchTimeoutException extends OpenSearchException { public OpenSearchTimeoutException(StreamInput in) throws IOException { diff --git a/server/src/main/java/org/opensearch/OpenSearchWrapperException.java b/server/src/main/java/org/opensearch/OpenSearchWrapperException.java index aa3e857f96901..3ef5ec4feac2d 100644 --- a/server/src/main/java/org/opensearch/OpenSearchWrapperException.java +++ b/server/src/main/java/org/opensearch/OpenSearchWrapperException.java @@ -36,6 +36,8 @@ * An exception that is meant to be "unwrapped" when sent back to the user * as an error because its is {@link #getCause() cause}, if non-null is * always more useful to the user than the exception itself. + * + * @opensearch.internal */ public interface OpenSearchWrapperException { Throwable getCause(); diff --git a/server/src/main/java/org/opensearch/ResourceAlreadyExistsException.java b/server/src/main/java/org/opensearch/ResourceAlreadyExistsException.java index e6b5177538fa9..2fbbf459ea293 100644 --- a/server/src/main/java/org/opensearch/ResourceAlreadyExistsException.java +++ b/server/src/main/java/org/opensearch/ResourceAlreadyExistsException.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Exception when Resources already exists + * + * @opensearch.internal + */ public class ResourceAlreadyExistsException extends OpenSearchException { public ResourceAlreadyExistsException(Index index) { diff --git a/server/src/main/java/org/opensearch/ResourceNotFoundException.java b/server/src/main/java/org/opensearch/ResourceNotFoundException.java index 373493aeb53b1..6282f9f03b4f9 100644 --- a/server/src/main/java/org/opensearch/ResourceNotFoundException.java +++ b/server/src/main/java/org/opensearch/ResourceNotFoundException.java @@ -38,6 +38,8 @@ /** * Generic ResourceNotFoundException corresponding to the {@link RestStatus#NOT_FOUND} status code + * + * @opensearch.internal */ public class ResourceNotFoundException extends OpenSearchException { diff --git a/server/src/main/java/org/opensearch/SpecialPermission.java b/server/src/main/java/org/opensearch/SpecialPermission.java index 00ae1528d4ef2..8a694d4543f32 100644 --- a/server/src/main/java/org/opensearch/SpecialPermission.java +++ b/server/src/main/java/org/opensearch/SpecialPermission.java @@ -68,6 +68,8 @@ * ... * ); * + * + * @opensearch.internal */ public final class SpecialPermission extends BasicPermission { diff --git a/server/src/main/java/org/opensearch/Version.java b/server/src/main/java/org/opensearch/Version.java index abbc37a17d32b..405f5340dd505 100644 --- a/server/src/main/java/org/opensearch/Version.java +++ b/server/src/main/java/org/opensearch/Version.java @@ -51,6 +51,11 @@ import java.util.Locale; import java.util.Objects; +/** + * OpenSearch Version Class + * + * @opensearch.api + */ public class Version implements Comparable, ToXContentFragment { /* * The logic for ID is: XXYYZZAA, where XX is major version, YY is minor version, ZZ is revision, and AA is alpha/beta/rc indicator AA diff --git a/server/src/main/java/org/opensearch/monitor/MonitorService.java b/server/src/main/java/org/opensearch/monitor/MonitorService.java index 85a96a16ab912..0e24eb094cd4d 100644 --- a/server/src/main/java/org/opensearch/monitor/MonitorService.java +++ b/server/src/main/java/org/opensearch/monitor/MonitorService.java @@ -44,6 +44,11 @@ import java.io.IOException; +/** + * The resource monitoring service + * + * @opensearch.internal + */ public class MonitorService extends AbstractLifecycleComponent { private final JvmGcMonitorService jvmGcMonitorService; diff --git a/server/src/main/java/org/opensearch/monitor/NodeHealthService.java b/server/src/main/java/org/opensearch/monitor/NodeHealthService.java index e9e8cf33dcbd5..54d64e8c83b28 100644 --- a/server/src/main/java/org/opensearch/monitor/NodeHealthService.java +++ b/server/src/main/java/org/opensearch/monitor/NodeHealthService.java @@ -32,6 +32,11 @@ package org.opensearch.monitor; +/** + * The service for monitoring node health + * + * @opensearch.internal + */ @FunctionalInterface public interface NodeHealthService { diff --git a/server/src/main/java/org/opensearch/monitor/Probes.java b/server/src/main/java/org/opensearch/monitor/Probes.java index 12f0e67be32c5..08f9eb7c2c376 100644 --- a/server/src/main/java/org/opensearch/monitor/Probes.java +++ b/server/src/main/java/org/opensearch/monitor/Probes.java @@ -35,6 +35,11 @@ import java.lang.management.OperatingSystemMXBean; import java.lang.reflect.Method; +/** + * Probes the various resources + * + * @opensearch.internal + */ public class Probes { public static short getLoadAndScaleToPercent(Method method, OperatingSystemMXBean osMxBean) { if (method != null) { diff --git a/server/src/main/java/org/opensearch/monitor/StatusInfo.java b/server/src/main/java/org/opensearch/monitor/StatusInfo.java index b1d8528e8822f..fdb8bc9469b6a 100644 --- a/server/src/main/java/org/opensearch/monitor/StatusInfo.java +++ b/server/src/main/java/org/opensearch/monitor/StatusInfo.java @@ -35,6 +35,8 @@ /** * Class that represents the Health status for a node as determined by {@link NodeHealthService} and provides additional * info explaining the reasons + * + * @opensearch.internal */ public class StatusInfo { diff --git a/server/src/main/java/org/opensearch/monitor/fs/FsHealthService.java b/server/src/main/java/org/opensearch/monitor/fs/FsHealthService.java index a1f526a3a1bd8..5863f3396b2ce 100644 --- a/server/src/main/java/org/opensearch/monitor/fs/FsHealthService.java +++ b/server/src/main/java/org/opensearch/monitor/fs/FsHealthService.java @@ -68,6 +68,8 @@ /** * Runs periodically and attempts to create a temp file to see if the filesystem is writable. If not then it marks the * path as unhealthy. + * + * @opensearch.internal */ public class FsHealthService extends AbstractLifecycleComponent implements NodeHealthService { diff --git a/server/src/main/java/org/opensearch/monitor/fs/FsInfo.java b/server/src/main/java/org/opensearch/monitor/fs/FsInfo.java index 5a17cb05ef225..f28bdbfa916a2 100644 --- a/server/src/main/java/org/opensearch/monitor/fs/FsInfo.java +++ b/server/src/main/java/org/opensearch/monitor/fs/FsInfo.java @@ -49,6 +49,11 @@ import java.util.Iterator; import java.util.Set; +/** + * FileSystem information + * + * @opensearch.internal + */ public class FsInfo implements Iterable, Writeable, ToXContentFragment { public static class Path implements Writeable, ToXContentObject { diff --git a/server/src/main/java/org/opensearch/monitor/fs/FsProbe.java b/server/src/main/java/org/opensearch/monitor/fs/FsProbe.java index 7fd5c66895db6..37cfee62bee27 100644 --- a/server/src/main/java/org/opensearch/monitor/fs/FsProbe.java +++ b/server/src/main/java/org/opensearch/monitor/fs/FsProbe.java @@ -51,6 +51,11 @@ import java.util.Map; import java.util.Set; +/** + * FileSystem probe + * + * @opensearch.internal + */ public class FsProbe { private static final Logger logger = LogManager.getLogger(FsProbe.class); diff --git a/server/src/main/java/org/opensearch/monitor/fs/FsService.java b/server/src/main/java/org/opensearch/monitor/fs/FsService.java index 837b7dbbe4fa2..728a6d7f0b36d 100644 --- a/server/src/main/java/org/opensearch/monitor/fs/FsService.java +++ b/server/src/main/java/org/opensearch/monitor/fs/FsService.java @@ -44,6 +44,11 @@ import java.io.IOException; import java.util.function.Supplier; +/** + * FileSystem service + * + * @opensearch.internal + */ public class FsService { private static final Logger logger = LogManager.getLogger(FsService.class); diff --git a/server/src/main/java/org/opensearch/monitor/jvm/DeadlockAnalyzer.java b/server/src/main/java/org/opensearch/monitor/jvm/DeadlockAnalyzer.java index 22705d8d163b8..6751c52a0a536 100644 --- a/server/src/main/java/org/opensearch/monitor/jvm/DeadlockAnalyzer.java +++ b/server/src/main/java/org/opensearch/monitor/jvm/DeadlockAnalyzer.java @@ -45,6 +45,11 @@ import static java.util.Collections.unmodifiableMap; import static java.util.Collections.unmodifiableSet; +/** + * Analyzes Operating System deadlocks + * + * @opensearch.internal + */ public class DeadlockAnalyzer { private static final Deadlock NULL_RESULT[] = new Deadlock[0]; diff --git a/server/src/main/java/org/opensearch/monitor/jvm/GcNames.java b/server/src/main/java/org/opensearch/monitor/jvm/GcNames.java index 3b464314b7ceb..d6b77186e021c 100644 --- a/server/src/main/java/org/opensearch/monitor/jvm/GcNames.java +++ b/server/src/main/java/org/opensearch/monitor/jvm/GcNames.java @@ -32,6 +32,11 @@ package org.opensearch.monitor.jvm; +/** + * Simple utility class for human readable GC names + * + * @opensearch.internal + */ public class GcNames { public static final String YOUNG = "young"; diff --git a/server/src/main/java/org/opensearch/monitor/jvm/HotThreads.java b/server/src/main/java/org/opensearch/monitor/jvm/HotThreads.java index 8e91a7258aabd..b5963d8ebd889 100644 --- a/server/src/main/java/org/opensearch/monitor/jvm/HotThreads.java +++ b/server/src/main/java/org/opensearch/monitor/jvm/HotThreads.java @@ -51,6 +51,11 @@ import java.util.concurrent.TimeUnit; import java.util.function.ToLongFunction; +/** + * Monitors hot threads + * + * @opensearch.internal + */ public class HotThreads { private static final Object mutex = new Object(); diff --git a/server/src/main/java/org/opensearch/monitor/jvm/JvmGcMonitorService.java b/server/src/main/java/org/opensearch/monitor/jvm/JvmGcMonitorService.java index 5020cbec36e44..7bdc74d9ae574 100644 --- a/server/src/main/java/org/opensearch/monitor/jvm/JvmGcMonitorService.java +++ b/server/src/main/java/org/opensearch/monitor/jvm/JvmGcMonitorService.java @@ -54,6 +54,11 @@ import static java.util.Collections.unmodifiableMap; +/** + * Service to monitor garbage collection + * + * @opensearch.internal + */ public class JvmGcMonitorService extends AbstractLifecycleComponent { private static final Logger logger = LogManager.getLogger(JvmGcMonitorService.class); diff --git a/server/src/main/java/org/opensearch/monitor/jvm/JvmInfo.java b/server/src/main/java/org/opensearch/monitor/jvm/JvmInfo.java index ed6d21869acd7..31f597ebebcc8 100644 --- a/server/src/main/java/org/opensearch/monitor/jvm/JvmInfo.java +++ b/server/src/main/java/org/opensearch/monitor/jvm/JvmInfo.java @@ -57,6 +57,11 @@ import java.util.List; import java.util.Map; +/** + * Holds information about the JVM + * + * @opensearch.internal + */ public class JvmInfo implements ReportingService.Info { private static JvmInfo INSTANCE; diff --git a/server/src/main/java/org/opensearch/monitor/jvm/JvmPid.java b/server/src/main/java/org/opensearch/monitor/jvm/JvmPid.java index 9a2fbfbd27c68..928257af71aa5 100644 --- a/server/src/main/java/org/opensearch/monitor/jvm/JvmPid.java +++ b/server/src/main/java/org/opensearch/monitor/jvm/JvmPid.java @@ -32,6 +32,11 @@ package org.opensearch.monitor.jvm; +/** + * JVM Process ID + * + * @opensearch.internal + */ class JvmPid { static long getPid() { diff --git a/server/src/main/java/org/opensearch/monitor/jvm/JvmService.java b/server/src/main/java/org/opensearch/monitor/jvm/JvmService.java index edf8e47317114..d59120063e338 100644 --- a/server/src/main/java/org/opensearch/monitor/jvm/JvmService.java +++ b/server/src/main/java/org/opensearch/monitor/jvm/JvmService.java @@ -40,6 +40,11 @@ import org.opensearch.common.unit.TimeValue; import org.opensearch.node.ReportingService; +/** + * Service for monitoring the JVM + * + * @opensearch.internal + */ public class JvmService implements ReportingService { private static final Logger logger = LogManager.getLogger(JvmService.class); diff --git a/server/src/main/java/org/opensearch/monitor/jvm/JvmStats.java b/server/src/main/java/org/opensearch/monitor/jvm/JvmStats.java index e8fa037f3a4d7..0924adb4e8114 100644 --- a/server/src/main/java/org/opensearch/monitor/jvm/JvmStats.java +++ b/server/src/main/java/org/opensearch/monitor/jvm/JvmStats.java @@ -58,6 +58,11 @@ import java.util.List; import java.util.concurrent.TimeUnit; +/** + * Holds JVM statistics + * + * @opensearch.internal + */ public class JvmStats implements Writeable, ToXContentFragment { private static final RuntimeMXBean runtimeMXBean; diff --git a/server/src/main/java/org/opensearch/monitor/os/OsInfo.java b/server/src/main/java/org/opensearch/monitor/os/OsInfo.java index 2dacb88b4b254..5f683778349c6 100644 --- a/server/src/main/java/org/opensearch/monitor/os/OsInfo.java +++ b/server/src/main/java/org/opensearch/monitor/os/OsInfo.java @@ -40,6 +40,11 @@ import java.io.IOException; +/** + * Holds Operating System Information + * + * @opensearch.internal + */ public class OsInfo implements ReportingService.Info { private final long refreshInterval; diff --git a/server/src/main/java/org/opensearch/monitor/os/OsProbe.java b/server/src/main/java/org/opensearch/monitor/os/OsProbe.java index eda86c49539dd..98229941252ba 100644 --- a/server/src/main/java/org/opensearch/monitor/os/OsProbe.java +++ b/server/src/main/java/org/opensearch/monitor/os/OsProbe.java @@ -74,6 +74,8 @@ * - An error case retrieving these values from a linux kernel * - A non-standard libc implementation not implementing the required values * For a more exhaustive explanation, see https://github.com/elastic/elasticsearch/pull/42725 + * + * @opensearch.internal */ public class OsProbe { diff --git a/server/src/main/java/org/opensearch/monitor/os/OsService.java b/server/src/main/java/org/opensearch/monitor/os/OsService.java index 344a5ccf5f849..00e4bb1365b71 100644 --- a/server/src/main/java/org/opensearch/monitor/os/OsService.java +++ b/server/src/main/java/org/opensearch/monitor/os/OsService.java @@ -44,6 +44,11 @@ import java.io.IOException; +/** + * Service for the Operating System + * + * @opensearch.internal + */ public class OsService implements ReportingService { private static final Logger logger = LogManager.getLogger(OsService.class); diff --git a/server/src/main/java/org/opensearch/monitor/os/OsStats.java b/server/src/main/java/org/opensearch/monitor/os/OsStats.java index cc9dec8d2727b..e05fb56ba5570 100644 --- a/server/src/main/java/org/opensearch/monitor/os/OsStats.java +++ b/server/src/main/java/org/opensearch/monitor/os/OsStats.java @@ -45,6 +45,11 @@ import java.util.Arrays; import java.util.Objects; +/** + * Holds stats for the Operating System + * + * @opensearch.internal + */ public class OsStats implements Writeable, ToXContentFragment { private final long timestamp; diff --git a/server/src/main/java/org/opensearch/monitor/process/ProcessInfo.java b/server/src/main/java/org/opensearch/monitor/process/ProcessInfo.java index 073309b61926a..1ddf7b74e0d1c 100644 --- a/server/src/main/java/org/opensearch/monitor/process/ProcessInfo.java +++ b/server/src/main/java/org/opensearch/monitor/process/ProcessInfo.java @@ -40,6 +40,11 @@ import java.io.IOException; +/** + * Holds information for monitoring the process + * + * @opensearch.internal + */ public class ProcessInfo implements ReportingService.Info { private final long refreshInterval; diff --git a/server/src/main/java/org/opensearch/monitor/process/ProcessProbe.java b/server/src/main/java/org/opensearch/monitor/process/ProcessProbe.java index 09faae6bcaefa..c2f83003d2c04 100644 --- a/server/src/main/java/org/opensearch/monitor/process/ProcessProbe.java +++ b/server/src/main/java/org/opensearch/monitor/process/ProcessProbe.java @@ -41,6 +41,11 @@ import static org.opensearch.monitor.jvm.JvmInfo.jvmInfo; +/** + * Probes the process + * + * @opensearch.internal + */ public class ProcessProbe { private static final OperatingSystemMXBean osMxBean = ManagementFactory.getOperatingSystemMXBean(); diff --git a/server/src/main/java/org/opensearch/monitor/process/ProcessService.java b/server/src/main/java/org/opensearch/monitor/process/ProcessService.java index c60d4435b46b0..538f546bd98ee 100644 --- a/server/src/main/java/org/opensearch/monitor/process/ProcessService.java +++ b/server/src/main/java/org/opensearch/monitor/process/ProcessService.java @@ -41,6 +41,11 @@ import org.opensearch.common.util.SingleObjectCache; import org.opensearch.node.ReportingService; +/** + * The service for the process + * + * @opensearch.internal + */ public final class ProcessService implements ReportingService { private static final Logger logger = LogManager.getLogger(ProcessService.class); diff --git a/server/src/main/java/org/opensearch/monitor/process/ProcessStats.java b/server/src/main/java/org/opensearch/monitor/process/ProcessStats.java index 6fce06ac5a93d..e5ed6a4a7d369 100644 --- a/server/src/main/java/org/opensearch/monitor/process/ProcessStats.java +++ b/server/src/main/java/org/opensearch/monitor/process/ProcessStats.java @@ -43,6 +43,11 @@ import java.io.IOException; +/** + * Holds stats for the process + * + * @opensearch.internal + */ public class ProcessStats implements Writeable, ToXContentFragment { private final long timestamp; diff --git a/server/src/main/java/org/opensearch/persistent/AllocatedPersistentTask.java b/server/src/main/java/org/opensearch/persistent/AllocatedPersistentTask.java index 48397a1b1e8df..caede050df5a7 100644 --- a/server/src/main/java/org/opensearch/persistent/AllocatedPersistentTask.java +++ b/server/src/main/java/org/opensearch/persistent/AllocatedPersistentTask.java @@ -48,6 +48,8 @@ /** * Represents a executor node operation that corresponds to a persistent task + * + * @opensearch.internal */ public class AllocatedPersistentTask extends CancellableTask { diff --git a/server/src/main/java/org/opensearch/persistent/CompletionPersistentTaskAction.java b/server/src/main/java/org/opensearch/persistent/CompletionPersistentTaskAction.java index 4aa9b8d7eb781..6ae3150a04019 100644 --- a/server/src/main/java/org/opensearch/persistent/CompletionPersistentTaskAction.java +++ b/server/src/main/java/org/opensearch/persistent/CompletionPersistentTaskAction.java @@ -58,6 +58,8 @@ /** * ActionType that is used by executor node to indicate that the persistent action finished or failed on the node and needs to be * removed from the cluster state in case of successful completion or restarted on some other node in case of failure. + * + * @opensearch.internal */ public class CompletionPersistentTaskAction extends ActionType { diff --git a/server/src/main/java/org/opensearch/persistent/NodePersistentTasksExecutor.java b/server/src/main/java/org/opensearch/persistent/NodePersistentTasksExecutor.java index d62a6dd669a6c..209df1e1f498d 100644 --- a/server/src/main/java/org/opensearch/persistent/NodePersistentTasksExecutor.java +++ b/server/src/main/java/org/opensearch/persistent/NodePersistentTasksExecutor.java @@ -39,6 +39,8 @@ * This component is responsible for execution of persistent tasks. * * It abstracts away the execution of tasks and greatly simplifies testing of PersistentTasksNodeService + * + * @opensearch.internal */ public class NodePersistentTasksExecutor { diff --git a/server/src/main/java/org/opensearch/persistent/PersistentTaskParams.java b/server/src/main/java/org/opensearch/persistent/PersistentTaskParams.java index e10d70688a912..a34ed6bf1daf2 100644 --- a/server/src/main/java/org/opensearch/persistent/PersistentTaskParams.java +++ b/server/src/main/java/org/opensearch/persistent/PersistentTaskParams.java @@ -38,6 +38,8 @@ /** * Parameters used to start persistent task + * + * @opensearch.internal */ public interface PersistentTaskParams extends VersionedNamedWriteable, ToXContentObject, ClusterState.FeatureAware { diff --git a/server/src/main/java/org/opensearch/persistent/PersistentTaskResponse.java b/server/src/main/java/org/opensearch/persistent/PersistentTaskResponse.java index cc09d3d0b39d7..7abc81d72d698 100644 --- a/server/src/main/java/org/opensearch/persistent/PersistentTaskResponse.java +++ b/server/src/main/java/org/opensearch/persistent/PersistentTaskResponse.java @@ -41,6 +41,8 @@ /** * Response upon a successful start or an persistent task + * + * @opensearch.internal */ public class PersistentTaskResponse extends ActionResponse { private PersistentTask task; diff --git a/server/src/main/java/org/opensearch/persistent/PersistentTaskState.java b/server/src/main/java/org/opensearch/persistent/PersistentTaskState.java index 3b57ce92e8634..a785798dbb5cf 100644 --- a/server/src/main/java/org/opensearch/persistent/PersistentTaskState.java +++ b/server/src/main/java/org/opensearch/persistent/PersistentTaskState.java @@ -37,5 +37,7 @@ /** * {@link PersistentTaskState} represents the state of the persistent tasks, as it * is persisted in the cluster state. + * + * @opensearch.internal */ public interface PersistentTaskState extends ToXContentObject, NamedWriteable {} diff --git a/server/src/main/java/org/opensearch/persistent/PersistentTasksClusterService.java b/server/src/main/java/org/opensearch/persistent/PersistentTasksClusterService.java index e6a9ae673211f..b76fc1b93915e 100644 --- a/server/src/main/java/org/opensearch/persistent/PersistentTasksClusterService.java +++ b/server/src/main/java/org/opensearch/persistent/PersistentTasksClusterService.java @@ -61,6 +61,8 @@ /** * Component that runs only on the cluster-manager node and is responsible for assigning running tasks to nodes + * + * @opensearch.internal */ public class PersistentTasksClusterService implements ClusterStateListener, Closeable { diff --git a/server/src/main/java/org/opensearch/persistent/PersistentTasksCustomMetadata.java b/server/src/main/java/org/opensearch/persistent/PersistentTasksCustomMetadata.java index d39e96e9da9e3..ac6536564d8d0 100644 --- a/server/src/main/java/org/opensearch/persistent/PersistentTasksCustomMetadata.java +++ b/server/src/main/java/org/opensearch/persistent/PersistentTasksCustomMetadata.java @@ -71,6 +71,8 @@ /** * A cluster state record that contains a list of all running persistent tasks + * + * @opensearch.internal */ public final class PersistentTasksCustomMetadata extends AbstractNamedDiffable implements Metadata.Custom { diff --git a/server/src/main/java/org/opensearch/persistent/PersistentTasksExecutor.java b/server/src/main/java/org/opensearch/persistent/PersistentTasksExecutor.java index 0c6e3bb590506..08a509af0b307 100644 --- a/server/src/main/java/org/opensearch/persistent/PersistentTasksExecutor.java +++ b/server/src/main/java/org/opensearch/persistent/PersistentTasksExecutor.java @@ -45,6 +45,8 @@ /** * An executor of tasks that can survive restart of requesting or executing node. * These tasks are using cluster state rather than only transport service to send requests and responses. + * + * @opensearch.internal */ public abstract class PersistentTasksExecutor { diff --git a/server/src/main/java/org/opensearch/persistent/PersistentTasksExecutorRegistry.java b/server/src/main/java/org/opensearch/persistent/PersistentTasksExecutorRegistry.java index 3f9bd06ead44b..8de183faa0464 100644 --- a/server/src/main/java/org/opensearch/persistent/PersistentTasksExecutorRegistry.java +++ b/server/src/main/java/org/opensearch/persistent/PersistentTasksExecutorRegistry.java @@ -38,6 +38,8 @@ /** * Components that registers all persistent task executors + * + * @opensearch.internal */ public class PersistentTasksExecutorRegistry { diff --git a/server/src/main/java/org/opensearch/persistent/PersistentTasksNodeService.java b/server/src/main/java/org/opensearch/persistent/PersistentTasksNodeService.java index 0a88204c7cfe9..54ffadb96243a 100644 --- a/server/src/main/java/org/opensearch/persistent/PersistentTasksNodeService.java +++ b/server/src/main/java/org/opensearch/persistent/PersistentTasksNodeService.java @@ -61,6 +61,8 @@ /** * This component is responsible for coordination of execution of persistent tasks on individual nodes. It runs on all * nodes in the cluster and monitors cluster state changes to detect started commands. + * + * @opensearch.internal */ public class PersistentTasksNodeService implements ClusterStateListener { diff --git a/server/src/main/java/org/opensearch/persistent/PersistentTasksService.java b/server/src/main/java/org/opensearch/persistent/PersistentTasksService.java index c3d78bb614200..1026be4ad8161 100644 --- a/server/src/main/java/org/opensearch/persistent/PersistentTasksService.java +++ b/server/src/main/java/org/opensearch/persistent/PersistentTasksService.java @@ -56,6 +56,8 @@ * This service is used by persistent tasks and allocated persistent tasks to communicate changes * to the cluster-manager node so that the cluster-manager can update the cluster state and can track of the states * of the persistent tasks. + * + * @opensearch.internal */ public class PersistentTasksService { diff --git a/server/src/main/java/org/opensearch/persistent/RemovePersistentTaskAction.java b/server/src/main/java/org/opensearch/persistent/RemovePersistentTaskAction.java index d35d5fbf70f0a..855e5b0099b29 100644 --- a/server/src/main/java/org/opensearch/persistent/RemovePersistentTaskAction.java +++ b/server/src/main/java/org/opensearch/persistent/RemovePersistentTaskAction.java @@ -53,6 +53,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Transport action to remove a persistent task + * + * @opensearch.internal + */ public class RemovePersistentTaskAction extends ActionType { public static final RemovePersistentTaskAction INSTANCE = new RemovePersistentTaskAction(); diff --git a/server/src/main/java/org/opensearch/persistent/StartPersistentTaskAction.java b/server/src/main/java/org/opensearch/persistent/StartPersistentTaskAction.java index b5d7885f1e313..2bd822d2fab62 100644 --- a/server/src/main/java/org/opensearch/persistent/StartPersistentTaskAction.java +++ b/server/src/main/java/org/opensearch/persistent/StartPersistentTaskAction.java @@ -58,6 +58,8 @@ /** * This action can be used to add the record for the persistent action to the cluster state. + * + * @opensearch.internal */ public class StartPersistentTaskAction extends ActionType { diff --git a/server/src/main/java/org/opensearch/persistent/UpdatePersistentTaskStatusAction.java b/server/src/main/java/org/opensearch/persistent/UpdatePersistentTaskStatusAction.java index b72e8c963dc43..928e51f5a594c 100644 --- a/server/src/main/java/org/opensearch/persistent/UpdatePersistentTaskStatusAction.java +++ b/server/src/main/java/org/opensearch/persistent/UpdatePersistentTaskStatusAction.java @@ -55,6 +55,11 @@ import static org.opensearch.action.ValidateActions.addValidationError; +/** + * Transport action for updating persistent tasks + * + * @opensearch.internal + */ public class UpdatePersistentTaskStatusAction extends ActionType { public static final UpdatePersistentTaskStatusAction INSTANCE = new UpdatePersistentTaskStatusAction(); diff --git a/server/src/main/java/org/opensearch/persistent/decider/AssignmentDecision.java b/server/src/main/java/org/opensearch/persistent/decider/AssignmentDecision.java index 45d4e643f624b..70a03b7710b6f 100644 --- a/server/src/main/java/org/opensearch/persistent/decider/AssignmentDecision.java +++ b/server/src/main/java/org/opensearch/persistent/decider/AssignmentDecision.java @@ -39,6 +39,8 @@ * assigning a persistent task to a node of the cluster. * * @see EnableAssignmentDecider + * + * @opensearch.internal */ public final class AssignmentDecision { diff --git a/server/src/main/java/org/opensearch/persistent/decider/EnableAssignmentDecider.java b/server/src/main/java/org/opensearch/persistent/decider/EnableAssignmentDecider.java index 795fb3b77b9fb..4c306dca758e7 100644 --- a/server/src/main/java/org/opensearch/persistent/decider/EnableAssignmentDecider.java +++ b/server/src/main/java/org/opensearch/persistent/decider/EnableAssignmentDecider.java @@ -51,6 +51,8 @@ * * * @see Allocation + * + * @opensearch.internal */ public class EnableAssignmentDecider { diff --git a/server/src/main/java/org/opensearch/plugins/ActionPlugin.java b/server/src/main/java/org/opensearch/plugins/ActionPlugin.java index 31f5159120337..f6bfb815ccf1e 100644 --- a/server/src/main/java/org/opensearch/plugins/ActionPlugin.java +++ b/server/src/main/java/org/opensearch/plugins/ActionPlugin.java @@ -72,6 +72,8 @@ * new ActionHandler<>(RethrottleAction.INSTANCE, TransportRethrottleAction.class)); * } * } + * + * @opensearch.api */ public interface ActionPlugin { /** diff --git a/server/src/main/java/org/opensearch/plugins/AnalysisPlugin.java b/server/src/main/java/org/opensearch/plugins/AnalysisPlugin.java index 8022129df3699..53dcc916b244f 100644 --- a/server/src/main/java/org/opensearch/plugins/AnalysisPlugin.java +++ b/server/src/main/java/org/opensearch/plugins/AnalysisPlugin.java @@ -72,6 +72,8 @@ * OpenSearch doesn't have any automatic mechanism to share these components between indexes. If any component is heavy enough to warrant * such sharing then it is the Plugin's responsibility to do it in their {@link AnalysisProvider} implementation. We recommend against doing * this unless absolutely necessary because it can be difficult to get the caching right given things like behavior changes across versions. + * + * @opensearch.api */ public interface AnalysisPlugin { /** diff --git a/server/src/main/java/org/opensearch/plugins/CircuitBreakerPlugin.java b/server/src/main/java/org/opensearch/plugins/CircuitBreakerPlugin.java index 01aaddf96a70d..f52aab5b238b3 100644 --- a/server/src/main/java/org/opensearch/plugins/CircuitBreakerPlugin.java +++ b/server/src/main/java/org/opensearch/plugins/CircuitBreakerPlugin.java @@ -39,6 +39,8 @@ /** * An extension point for {@link Plugin} implementations to add custom circuit breakers + * + * @opensearch.api */ public interface CircuitBreakerPlugin { diff --git a/server/src/main/java/org/opensearch/plugins/ClusterPlugin.java b/server/src/main/java/org/opensearch/plugins/ClusterPlugin.java index 54a94d540ce32..b0ed91dd4c468 100644 --- a/server/src/main/java/org/opensearch/plugins/ClusterPlugin.java +++ b/server/src/main/java/org/opensearch/plugins/ClusterPlugin.java @@ -45,6 +45,8 @@ /** * An extension point for {@link Plugin} implementations to customer behavior of cluster management. + * + * @opensearch.api */ public interface ClusterPlugin { diff --git a/server/src/main/java/org/opensearch/plugins/DiscoveryPlugin.java b/server/src/main/java/org/opensearch/plugins/DiscoveryPlugin.java index 764e249474d9b..89433b2a3b67d 100644 --- a/server/src/main/java/org/opensearch/plugins/DiscoveryPlugin.java +++ b/server/src/main/java/org/opensearch/plugins/DiscoveryPlugin.java @@ -57,6 +57,8 @@ * } * } * + * + * @opensearch.api */ public interface DiscoveryPlugin { diff --git a/server/src/main/java/org/opensearch/plugins/EnginePlugin.java b/server/src/main/java/org/opensearch/plugins/EnginePlugin.java index 31844dbdaec2b..92ae2ff9cd661 100644 --- a/server/src/main/java/org/opensearch/plugins/EnginePlugin.java +++ b/server/src/main/java/org/opensearch/plugins/EnginePlugin.java @@ -45,6 +45,8 @@ /** * A plugin that provides alternative engine implementations. + * + * @opensearch.api */ public interface EnginePlugin { diff --git a/server/src/main/java/org/opensearch/plugins/ExtensiblePlugin.java b/server/src/main/java/org/opensearch/plugins/ExtensiblePlugin.java index 9cab282910599..52a01c817fcb1 100644 --- a/server/src/main/java/org/opensearch/plugins/ExtensiblePlugin.java +++ b/server/src/main/java/org/opensearch/plugins/ExtensiblePlugin.java @@ -39,6 +39,8 @@ * * This class provides a callback for extensible plugins to be informed of other plugins * which extend them. + * + * @opensearch.api */ public interface ExtensiblePlugin { diff --git a/server/src/main/java/org/opensearch/plugins/IndexStorePlugin.java b/server/src/main/java/org/opensearch/plugins/IndexStorePlugin.java index 0a6e6a9ff3b67..2f549fec54759 100644 --- a/server/src/main/java/org/opensearch/plugins/IndexStorePlugin.java +++ b/server/src/main/java/org/opensearch/plugins/IndexStorePlugin.java @@ -46,6 +46,8 @@ /** * A plugin that provides alternative directory implementations. + * + * @opensearch.api */ public interface IndexStorePlugin { diff --git a/server/src/main/java/org/opensearch/plugins/IngestPlugin.java b/server/src/main/java/org/opensearch/plugins/IngestPlugin.java index d04a3c3add88c..f78170c2ae3af 100644 --- a/server/src/main/java/org/opensearch/plugins/IngestPlugin.java +++ b/server/src/main/java/org/opensearch/plugins/IngestPlugin.java @@ -39,6 +39,8 @@ /** * An extension point for {@link Plugin} implementations to add custom ingest processors + * + * @opensearch.api */ public interface IngestPlugin { diff --git a/server/src/main/java/org/opensearch/plugins/MapperPlugin.java b/server/src/main/java/org/opensearch/plugins/MapperPlugin.java index d31aafb863dc6..ff6daf1b720f6 100644 --- a/server/src/main/java/org/opensearch/plugins/MapperPlugin.java +++ b/server/src/main/java/org/opensearch/plugins/MapperPlugin.java @@ -42,6 +42,8 @@ /** * An extension point for {@link Plugin} implementations to add custom mappers + * + * @opensearch.api */ public interface MapperPlugin { diff --git a/server/src/main/java/org/opensearch/plugins/MetadataUpgrader.java b/server/src/main/java/org/opensearch/plugins/MetadataUpgrader.java index 997fc88e5dbd9..37419b08f4b1e 100644 --- a/server/src/main/java/org/opensearch/plugins/MetadataUpgrader.java +++ b/server/src/main/java/org/opensearch/plugins/MetadataUpgrader.java @@ -42,6 +42,8 @@ /** * Upgrades {@link Metadata} on startup on behalf of installed {@link Plugin}s + * + * @opensearch.api */ public class MetadataUpgrader { public final UnaryOperator> indexTemplateMetadataUpgraders; diff --git a/server/src/main/java/org/opensearch/plugins/NetworkPlugin.java b/server/src/main/java/org/opensearch/plugins/NetworkPlugin.java index b53718fccf42a..c1eb9b579c832 100644 --- a/server/src/main/java/org/opensearch/plugins/NetworkPlugin.java +++ b/server/src/main/java/org/opensearch/plugins/NetworkPlugin.java @@ -52,6 +52,8 @@ /** * Plugin for extending network and transport related classes + * + * @opensearch.api */ public interface NetworkPlugin { diff --git a/server/src/main/java/org/opensearch/plugins/PersistentTaskPlugin.java b/server/src/main/java/org/opensearch/plugins/PersistentTaskPlugin.java index 61cb519f0546d..5eb200f47422d 100644 --- a/server/src/main/java/org/opensearch/plugins/PersistentTaskPlugin.java +++ b/server/src/main/java/org/opensearch/plugins/PersistentTaskPlugin.java @@ -43,6 +43,8 @@ /** * Plugin for registering persistent tasks executors. + * + * @opensearch.api */ public interface PersistentTaskPlugin { diff --git a/server/src/main/java/org/opensearch/plugins/Platforms.java b/server/src/main/java/org/opensearch/plugins/Platforms.java index e9c767ed00880..86a442d593b47 100644 --- a/server/src/main/java/org/opensearch/plugins/Platforms.java +++ b/server/src/main/java/org/opensearch/plugins/Platforms.java @@ -39,6 +39,8 @@ /** * Encapsulates platform-dependent methods for handling native components of plugins. + * + * @opensearch.api */ public class Platforms { diff --git a/server/src/main/java/org/opensearch/plugins/Plugin.java b/server/src/main/java/org/opensearch/plugins/Plugin.java index 9a7dcbd6a78f6..b51de5693dbf4 100644 --- a/server/src/main/java/org/opensearch/plugins/Plugin.java +++ b/server/src/main/java/org/opensearch/plugins/Plugin.java @@ -86,6 +86,8 @@ *

    8. {@link SearchPlugin} *
    9. {@link ReloadablePlugin} * + * + * @opensearch.api */ public abstract class Plugin implements Closeable { diff --git a/server/src/main/java/org/opensearch/plugins/PluginInfo.java b/server/src/main/java/org/opensearch/plugins/PluginInfo.java index c4867f7a07dc4..bcb8e4d6fc97d 100644 --- a/server/src/main/java/org/opensearch/plugins/PluginInfo.java +++ b/server/src/main/java/org/opensearch/plugins/PluginInfo.java @@ -56,6 +56,8 @@ /** * An in-memory representation of the plugin descriptor. + * + * @opensearch.api */ public class PluginInfo implements Writeable, ToXContentObject { diff --git a/server/src/main/java/org/opensearch/plugins/PluginLoaderIndirection.java b/server/src/main/java/org/opensearch/plugins/PluginLoaderIndirection.java index e62f46038e8ef..199784d1f7630 100644 --- a/server/src/main/java/org/opensearch/plugins/PluginLoaderIndirection.java +++ b/server/src/main/java/org/opensearch/plugins/PluginLoaderIndirection.java @@ -37,6 +37,8 @@ /** * This class exists solely as an intermediate layer to avoid causing PluginsService * to load ExtendedPluginsClassLoader when used in the transport client. + * + * @opensearch.api */ class PluginLoaderIndirection { diff --git a/server/src/main/java/org/opensearch/plugins/PluginSecurity.java b/server/src/main/java/org/opensearch/plugins/PluginSecurity.java index 6665d8088c4ff..e783a53dcb82f 100644 --- a/server/src/main/java/org/opensearch/plugins/PluginSecurity.java +++ b/server/src/main/java/org/opensearch/plugins/PluginSecurity.java @@ -54,6 +54,11 @@ import java.util.Set; import java.util.stream.Collectors; +/** + * Security Policy for Plugins + * + * @opensearch.api + */ class PluginSecurity { /** diff --git a/server/src/main/java/org/opensearch/plugins/ReloadablePlugin.java b/server/src/main/java/org/opensearch/plugins/ReloadablePlugin.java index 6b9194129dd5f..7a0854f2c89b9 100644 --- a/server/src/main/java/org/opensearch/plugins/ReloadablePlugin.java +++ b/server/src/main/java/org/opensearch/plugins/ReloadablePlugin.java @@ -40,6 +40,8 @@ * is reloaded it might rebuild any internal members. Plugins usually implement * this interface in order to reread the values of {@code SecureSetting}s and * then rebuild any dependent internal members. + * + * @opensearch.api */ public interface ReloadablePlugin { /** diff --git a/server/src/main/java/org/opensearch/plugins/RepositoryPlugin.java b/server/src/main/java/org/opensearch/plugins/RepositoryPlugin.java index 2c52961bb5f32..4d0a7b2d0a533 100644 --- a/server/src/main/java/org/opensearch/plugins/RepositoryPlugin.java +++ b/server/src/main/java/org/opensearch/plugins/RepositoryPlugin.java @@ -43,6 +43,8 @@ /** * An extension point for {@link Plugin} implementations to add custom snapshot repositories. + * + * @opensearch.api */ public interface RepositoryPlugin { diff --git a/server/src/main/java/org/opensearch/plugins/ScriptPlugin.java b/server/src/main/java/org/opensearch/plugins/ScriptPlugin.java index 85f75f9940591..7c8d71d21c0fd 100644 --- a/server/src/main/java/org/opensearch/plugins/ScriptPlugin.java +++ b/server/src/main/java/org/opensearch/plugins/ScriptPlugin.java @@ -42,6 +42,8 @@ /** * An additional extension point for {@link Plugin}s that extends OpenSearch's scripting functionality. + * + * @opensearch.api */ public interface ScriptPlugin { diff --git a/server/src/main/java/org/opensearch/plugins/SearchPlugin.java b/server/src/main/java/org/opensearch/plugins/SearchPlugin.java index f650a1ce5512f..a743360e1e90c 100644 --- a/server/src/main/java/org/opensearch/plugins/SearchPlugin.java +++ b/server/src/main/java/org/opensearch/plugins/SearchPlugin.java @@ -87,6 +87,8 @@ /** * Plugin for extending search time behavior. + * + * @opensearch.api */ public interface SearchPlugin { /** diff --git a/server/src/main/java/org/opensearch/plugins/SystemIndexPlugin.java b/server/src/main/java/org/opensearch/plugins/SystemIndexPlugin.java index b7ff72fd231a6..4937a5ed091dc 100644 --- a/server/src/main/java/org/opensearch/plugins/SystemIndexPlugin.java +++ b/server/src/main/java/org/opensearch/plugins/SystemIndexPlugin.java @@ -41,6 +41,8 @@ /** * Plugin for defining system indices. Extends {@link ActionPlugin} because system indices must be accessed via APIs * added by the plugin that owns the system index, rather than standard APIs. + * + * @opensearch.api */ public interface SystemIndexPlugin extends ActionPlugin { diff --git a/server/src/main/java/org/opensearch/plugins/spi/NamedXContentProvider.java b/server/src/main/java/org/opensearch/plugins/spi/NamedXContentProvider.java index ddbf88965f716..0d3c575ce9b9e 100644 --- a/server/src/main/java/org/opensearch/plugins/spi/NamedXContentProvider.java +++ b/server/src/main/java/org/opensearch/plugins/spi/NamedXContentProvider.java @@ -38,6 +38,8 @@ /** * Provides named XContent parsers. + * + * @opensearch.api */ public interface NamedXContentProvider { diff --git a/server/src/main/java/org/opensearch/repositories/FilterRepository.java b/server/src/main/java/org/opensearch/repositories/FilterRepository.java index 09f3b0ae223d5..aaa021a0e8b93 100644 --- a/server/src/main/java/org/opensearch/repositories/FilterRepository.java +++ b/server/src/main/java/org/opensearch/repositories/FilterRepository.java @@ -57,6 +57,11 @@ import java.util.function.Consumer; import java.util.function.Function; +/** + * Repository that is filtered + * + * @opensearch.internal + */ public class FilterRepository implements Repository { private final Repository in; diff --git a/server/src/main/java/org/opensearch/repositories/IndexId.java b/server/src/main/java/org/opensearch/repositories/IndexId.java index 02cf745a455e9..eda98e1af8188 100644 --- a/server/src/main/java/org/opensearch/repositories/IndexId.java +++ b/server/src/main/java/org/opensearch/repositories/IndexId.java @@ -45,6 +45,8 @@ /** * Represents a single snapshotted index in the repository. + * + * @opensearch.internal */ public final class IndexId implements Writeable, ToXContentObject { protected static final String NAME = "name"; diff --git a/server/src/main/java/org/opensearch/repositories/IndexMetaDataGenerations.java b/server/src/main/java/org/opensearch/repositories/IndexMetaDataGenerations.java index 4ea0217c5870f..afabf4ebfdb58 100644 --- a/server/src/main/java/org/opensearch/repositories/IndexMetaDataGenerations.java +++ b/server/src/main/java/org/opensearch/repositories/IndexMetaDataGenerations.java @@ -49,6 +49,8 @@ * {@link org.opensearch.repositories.blobstore.BlobStoreRepository#finalizeSnapshot} the identifier for an instance of * {@link IndexMetadata} should be computed and then used to check if it already exists in the repository via * {@link #getIndexMetaBlobId(String)}. + * + * @opensearch.internal */ public final class IndexMetaDataGenerations { diff --git a/server/src/main/java/org/opensearch/repositories/RepositoriesModule.java b/server/src/main/java/org/opensearch/repositories/RepositoriesModule.java index 228c62c353355..1d38c05c3fbf8 100644 --- a/server/src/main/java/org/opensearch/repositories/RepositoriesModule.java +++ b/server/src/main/java/org/opensearch/repositories/RepositoriesModule.java @@ -49,6 +49,8 @@ /** * Sets up classes for Snapshot/Restore. + * + * @opensearch.internal */ public final class RepositoriesModule { diff --git a/server/src/main/java/org/opensearch/repositories/RepositoriesService.java b/server/src/main/java/org/opensearch/repositories/RepositoriesService.java index b521da8453bb2..5b4e30f8495e8 100644 --- a/server/src/main/java/org/opensearch/repositories/RepositoriesService.java +++ b/server/src/main/java/org/opensearch/repositories/RepositoriesService.java @@ -79,6 +79,8 @@ /** * Service responsible for maintaining and providing access to snapshot repositories on nodes. + * + * @opensearch.internal */ public class RepositoriesService extends AbstractLifecycleComponent implements ClusterStateApplier { diff --git a/server/src/main/java/org/opensearch/repositories/RepositoriesStatsArchive.java b/server/src/main/java/org/opensearch/repositories/RepositoriesStatsArchive.java index f5c600b5ff444..b8f100706f81e 100644 --- a/server/src/main/java/org/opensearch/repositories/RepositoriesStatsArchive.java +++ b/server/src/main/java/org/opensearch/repositories/RepositoriesStatsArchive.java @@ -44,6 +44,11 @@ import java.util.function.LongSupplier; import java.util.stream.Collectors; +/** + * Archive of repository stats + * + * @opensearch.internal + */ public final class RepositoriesStatsArchive { private static final Logger logger = LogManager.getLogger(RepositoriesStatsArchive.class); diff --git a/server/src/main/java/org/opensearch/repositories/Repository.java b/server/src/main/java/org/opensearch/repositories/Repository.java index 18ad02bab48f9..a16e0e8d441bc 100644 --- a/server/src/main/java/org/opensearch/repositories/Repository.java +++ b/server/src/main/java/org/opensearch/repositories/Repository.java @@ -70,6 +70,8 @@ * for each shard
    10. *
    11. When all shard calls return cluster-manager calls {@link #finalizeSnapshot} with possible list of failures
    12. * + * + * @opensearch.internal */ public interface Repository extends LifecycleComponent { diff --git a/server/src/main/java/org/opensearch/repositories/RepositoryCleanupResult.java b/server/src/main/java/org/opensearch/repositories/RepositoryCleanupResult.java index 7851274a48fbe..5bed6fb1766b7 100644 --- a/server/src/main/java/org/opensearch/repositories/RepositoryCleanupResult.java +++ b/server/src/main/java/org/opensearch/repositories/RepositoryCleanupResult.java @@ -43,6 +43,11 @@ import java.io.IOException; +/** + * Result of a repository cleanup action + * + * @opensearch.internal + */ public final class RepositoryCleanupResult implements Writeable, ToXContentObject { public static final ObjectParser PARSER = new ObjectParser<>( diff --git a/server/src/main/java/org/opensearch/repositories/RepositoryData.java b/server/src/main/java/org/opensearch/repositories/RepositoryData.java index 7857df512cd75..e8132801e4238 100644 --- a/server/src/main/java/org/opensearch/repositories/RepositoryData.java +++ b/server/src/main/java/org/opensearch/repositories/RepositoryData.java @@ -60,6 +60,8 @@ /** * A class that represents the data in a repository, as captured in the * repository's index blob. + * + * @opensearch.internal */ public final class RepositoryData { diff --git a/server/src/main/java/org/opensearch/repositories/RepositoryException.java b/server/src/main/java/org/opensearch/repositories/RepositoryException.java index 8196fa24f2a92..6606bf36a6136 100644 --- a/server/src/main/java/org/opensearch/repositories/RepositoryException.java +++ b/server/src/main/java/org/opensearch/repositories/RepositoryException.java @@ -40,6 +40,8 @@ /** * Generic repository exception + * + * @opensearch.internal */ public class RepositoryException extends OpenSearchException { private final String repository; diff --git a/server/src/main/java/org/opensearch/repositories/RepositoryInfo.java b/server/src/main/java/org/opensearch/repositories/RepositoryInfo.java index 5266cfa28bd0e..e65e328bd8cfd 100644 --- a/server/src/main/java/org/opensearch/repositories/RepositoryInfo.java +++ b/server/src/main/java/org/opensearch/repositories/RepositoryInfo.java @@ -44,6 +44,11 @@ import java.util.Map; import java.util.Objects; +/** + * Information about a repository + * + * @opensearch.internal + */ public final class RepositoryInfo implements Writeable, ToXContentFragment { public final String ephemeralId; public final String name; diff --git a/server/src/main/java/org/opensearch/repositories/RepositoryMissingException.java b/server/src/main/java/org/opensearch/repositories/RepositoryMissingException.java index 5a0b59e50e62f..c84c25127237b 100644 --- a/server/src/main/java/org/opensearch/repositories/RepositoryMissingException.java +++ b/server/src/main/java/org/opensearch/repositories/RepositoryMissingException.java @@ -39,6 +39,8 @@ /** * Repository missing exception + * + * @opensearch.internal */ public class RepositoryMissingException extends RepositoryException { diff --git a/server/src/main/java/org/opensearch/repositories/RepositoryOperation.java b/server/src/main/java/org/opensearch/repositories/RepositoryOperation.java index 5e11d3e2f400e..ec8dcd5ca91a3 100644 --- a/server/src/main/java/org/opensearch/repositories/RepositoryOperation.java +++ b/server/src/main/java/org/opensearch/repositories/RepositoryOperation.java @@ -33,6 +33,8 @@ /** * Coordinates of an operation that modifies a repository, assuming that repository at a specific generation. + * + * @opensearch.internal */ public interface RepositoryOperation { diff --git a/server/src/main/java/org/opensearch/repositories/RepositoryShardId.java b/server/src/main/java/org/opensearch/repositories/RepositoryShardId.java index cd4e180215db0..1dd4bf438e01e 100644 --- a/server/src/main/java/org/opensearch/repositories/RepositoryShardId.java +++ b/server/src/main/java/org/opensearch/repositories/RepositoryShardId.java @@ -41,6 +41,8 @@ /** * Represents a shard snapshot in a repository. + * + * @opensearch.internal */ public final class RepositoryShardId implements Writeable { diff --git a/server/src/main/java/org/opensearch/repositories/RepositoryStats.java b/server/src/main/java/org/opensearch/repositories/RepositoryStats.java index c832b86eb69a4..006258859822f 100644 --- a/server/src/main/java/org/opensearch/repositories/RepositoryStats.java +++ b/server/src/main/java/org/opensearch/repositories/RepositoryStats.java @@ -42,6 +42,11 @@ import java.util.Map; import java.util.Objects; +/** + * Stats about a repository + * + * @opensearch.internal + */ public class RepositoryStats implements Writeable { public static final RepositoryStats EMPTY_STATS = new RepositoryStats(Collections.emptyMap()); diff --git a/server/src/main/java/org/opensearch/repositories/RepositoryStatsSnapshot.java b/server/src/main/java/org/opensearch/repositories/RepositoryStatsSnapshot.java index c7824e29bc953..e37ec0cba6512 100644 --- a/server/src/main/java/org/opensearch/repositories/RepositoryStatsSnapshot.java +++ b/server/src/main/java/org/opensearch/repositories/RepositoryStatsSnapshot.java @@ -42,6 +42,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Stats snapshot about a repository + * + * @opensearch.internal + */ public final class RepositoryStatsSnapshot implements Writeable, ToXContentObject { public static final long UNKNOWN_CLUSTER_VERSION = -1; private final RepositoryInfo repositoryInfo; diff --git a/server/src/main/java/org/opensearch/repositories/RepositoryVerificationException.java b/server/src/main/java/org/opensearch/repositories/RepositoryVerificationException.java index 949c1b7e25ff9..aaf06f4dbcd7f 100644 --- a/server/src/main/java/org/opensearch/repositories/RepositoryVerificationException.java +++ b/server/src/main/java/org/opensearch/repositories/RepositoryVerificationException.java @@ -39,6 +39,8 @@ /** * Repository verification exception + * + * @opensearch.internal */ public class RepositoryVerificationException extends RepositoryException { diff --git a/server/src/main/java/org/opensearch/repositories/ShardGenerations.java b/server/src/main/java/org/opensearch/repositories/ShardGenerations.java index 28cca3fe26646..5857ec537d1dc 100644 --- a/server/src/main/java/org/opensearch/repositories/ShardGenerations.java +++ b/server/src/main/java/org/opensearch/repositories/ShardGenerations.java @@ -47,6 +47,11 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; +/** + * Generations of shards for snapshots + * + * @opensearch.internal + */ public final class ShardGenerations { public static final ShardGenerations EMPTY = new ShardGenerations(Collections.emptyMap()); diff --git a/server/src/main/java/org/opensearch/repositories/VerificationFailure.java b/server/src/main/java/org/opensearch/repositories/VerificationFailure.java index d285f3418eea5..51f0caed04903 100644 --- a/server/src/main/java/org/opensearch/repositories/VerificationFailure.java +++ b/server/src/main/java/org/opensearch/repositories/VerificationFailure.java @@ -32,6 +32,11 @@ package org.opensearch.repositories; +/** + * Exception thrown when a repository fails verification + * + * @opensearch.internal + */ public class VerificationFailure { private String nodeId; diff --git a/server/src/main/java/org/opensearch/repositories/VerifyNodeRepositoryAction.java b/server/src/main/java/org/opensearch/repositories/VerifyNodeRepositoryAction.java index 70bc4b9590385..6b8c44ed6d54c 100644 --- a/server/src/main/java/org/opensearch/repositories/VerifyNodeRepositoryAction.java +++ b/server/src/main/java/org/opensearch/repositories/VerifyNodeRepositoryAction.java @@ -59,6 +59,11 @@ import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.atomic.AtomicInteger; +/** + * Action to verify a node repository + * + * @opensearch.internal + */ public class VerifyNodeRepositoryAction { private static final Logger logger = LogManager.getLogger(VerifyNodeRepositoryAction.class); diff --git a/server/src/main/java/org/opensearch/repositories/blobstore/BlobStoreRepository.java b/server/src/main/java/org/opensearch/repositories/blobstore/BlobStoreRepository.java index d95612e31ca38..6eaec491c8177 100644 --- a/server/src/main/java/org/opensearch/repositories/blobstore/BlobStoreRepository.java +++ b/server/src/main/java/org/opensearch/repositories/blobstore/BlobStoreRepository.java @@ -166,6 +166,8 @@ *

      * For in depth documentation on how exactly implementations of this class interact with the snapshot functionality please refer to the * documentation of the package {@link org.opensearch.repositories.blobstore}. + * + * @opensearch.internal */ public abstract class BlobStoreRepository extends AbstractLifecycleComponent implements Repository { private static final Logger logger = LogManager.getLogger(BlobStoreRepository.class); diff --git a/server/src/main/java/org/opensearch/repositories/blobstore/ChecksumBlobStoreFormat.java b/server/src/main/java/org/opensearch/repositories/blobstore/ChecksumBlobStoreFormat.java index 467cfecfb9016..cecbedb3d5c22 100644 --- a/server/src/main/java/org/opensearch/repositories/blobstore/ChecksumBlobStoreFormat.java +++ b/server/src/main/java/org/opensearch/repositories/blobstore/ChecksumBlobStoreFormat.java @@ -69,6 +69,8 @@ /** * Snapshot metadata file format used in v2.0 and above + * + * @opensearch.internal */ public final class ChecksumBlobStoreFormat { diff --git a/server/src/main/java/org/opensearch/repositories/blobstore/FileRestoreContext.java b/server/src/main/java/org/opensearch/repositories/blobstore/FileRestoreContext.java index 28c75e51dc407..d6cffcfbb8db8 100644 --- a/server/src/main/java/org/opensearch/repositories/blobstore/FileRestoreContext.java +++ b/server/src/main/java/org/opensearch/repositories/blobstore/FileRestoreContext.java @@ -61,6 +61,8 @@ * restore from some form of a snapshot. It will setup a new store, identify files that need to be copied * for the source, and perform the copies. Implementers must implement the functionality of opening the * underlying file streams for snapshotted lucene file. + * + * @opensearch.internal */ public abstract class FileRestoreContext { diff --git a/server/src/main/java/org/opensearch/repositories/blobstore/MeteredBlobStoreRepository.java b/server/src/main/java/org/opensearch/repositories/blobstore/MeteredBlobStoreRepository.java index a3ebda3982aa9..19452adc9917b 100644 --- a/server/src/main/java/org/opensearch/repositories/blobstore/MeteredBlobStoreRepository.java +++ b/server/src/main/java/org/opensearch/repositories/blobstore/MeteredBlobStoreRepository.java @@ -43,6 +43,11 @@ import java.util.Map; +/** + * A blob store repository that is metered + * + * @opensearch.internal + */ public abstract class MeteredBlobStoreRepository extends BlobStoreRepository { private final RepositoryInfo repositoryInfo; diff --git a/server/src/main/java/org/opensearch/repositories/fs/FsRepository.java b/server/src/main/java/org/opensearch/repositories/fs/FsRepository.java index 51417733ebe61..3b441d32d17fc 100644 --- a/server/src/main/java/org/opensearch/repositories/fs/FsRepository.java +++ b/server/src/main/java/org/opensearch/repositories/fs/FsRepository.java @@ -62,6 +62,8 @@ * Defaults to not chucked. *
      {@code compress}
      If set to true metadata files will be stored compressed. Defaults to false.
      * + * + * @opensearch.internal */ public class FsRepository extends BlobStoreRepository { private static final Logger logger = LogManager.getLogger(FsRepository.class); diff --git a/server/src/main/java/org/opensearch/script/AggregationScript.java b/server/src/main/java/org/opensearch/script/AggregationScript.java index c45541ff93658..84dd308a9088d 100644 --- a/server/src/main/java/org/opensearch/script/AggregationScript.java +++ b/server/src/main/java/org/opensearch/script/AggregationScript.java @@ -46,6 +46,11 @@ import java.util.Map; import java.util.function.Function; +/** + * Scripts for aggregations + * + * @opensearch.internal + */ public abstract class AggregationScript implements ScorerAware { public static final String[] PARAMETERS = {}; diff --git a/server/src/main/java/org/opensearch/script/BucketAggregationScript.java b/server/src/main/java/org/opensearch/script/BucketAggregationScript.java index b87cf85075d9e..ee54e83adcdea 100644 --- a/server/src/main/java/org/opensearch/script/BucketAggregationScript.java +++ b/server/src/main/java/org/opensearch/script/BucketAggregationScript.java @@ -36,6 +36,8 @@ /** * A script used in bucket aggregations that returns a {@code double} value. + * + * @opensearch.internal */ public abstract class BucketAggregationScript { diff --git a/server/src/main/java/org/opensearch/script/BucketAggregationSelectorScript.java b/server/src/main/java/org/opensearch/script/BucketAggregationSelectorScript.java index 45c2df8a8394a..6accb3043b8db 100644 --- a/server/src/main/java/org/opensearch/script/BucketAggregationSelectorScript.java +++ b/server/src/main/java/org/opensearch/script/BucketAggregationSelectorScript.java @@ -36,6 +36,8 @@ /** * A script used in bucket aggregations that returns a {@code boolean} value. + * + * @opensearch.internal */ public abstract class BucketAggregationSelectorScript { diff --git a/server/src/main/java/org/opensearch/script/ClassPermission.java b/server/src/main/java/org/opensearch/script/ClassPermission.java index 0d3166403d5d1..9be8ecbc7c33e 100644 --- a/server/src/main/java/org/opensearch/script/ClassPermission.java +++ b/server/src/main/java/org/opensearch/script/ClassPermission.java @@ -85,6 +85,8 @@ *
    13. {@link org.joda.time.ReadableDateTime}
    14. *
    15. {@link org.joda.time.ReadableInstant}
    16. * + * + * @opensearch.internal */ public final class ClassPermission extends BasicPermission { public static final String STANDARD = "<>"; diff --git a/server/src/main/java/org/opensearch/script/DynamicMap.java b/server/src/main/java/org/opensearch/script/DynamicMap.java index 4be4c8575ddae..985d454b0f87c 100644 --- a/server/src/main/java/org/opensearch/script/DynamicMap.java +++ b/server/src/main/java/org/opensearch/script/DynamicMap.java @@ -42,6 +42,8 @@ * functions is provided for the overridden values where the function * is applied to the existing value when one exists for the * corresponding key. + * + * @opensearch.internal */ public final class DynamicMap implements Map { diff --git a/server/src/main/java/org/opensearch/script/ExplainableScoreScript.java b/server/src/main/java/org/opensearch/script/ExplainableScoreScript.java index 6ea3a322449e5..fa6755953c8bd 100644 --- a/server/src/main/java/org/opensearch/script/ExplainableScoreScript.java +++ b/server/src/main/java/org/opensearch/script/ExplainableScoreScript.java @@ -41,6 +41,8 @@ * To be implemented by {@link ScoreScript} which can provided an {@link Explanation} of the score * This is currently not used inside opensearch but it is used, see for example here: * https://github.com/elastic/elasticsearch/issues/8561 + * + * @opensearch.internal */ public interface ExplainableScoreScript { diff --git a/server/src/main/java/org/opensearch/script/FieldScript.java b/server/src/main/java/org/opensearch/script/FieldScript.java index aba3980facc93..40d3e8a70f923 100644 --- a/server/src/main/java/org/opensearch/script/FieldScript.java +++ b/server/src/main/java/org/opensearch/script/FieldScript.java @@ -46,6 +46,8 @@ /** * A script to produce dynamic values for return fields. + * + * @opensearch.internal */ public abstract class FieldScript { diff --git a/server/src/main/java/org/opensearch/script/FilterScript.java b/server/src/main/java/org/opensearch/script/FilterScript.java index ffdf643606cb8..ca3bc79de0929 100644 --- a/server/src/main/java/org/opensearch/script/FilterScript.java +++ b/server/src/main/java/org/opensearch/script/FilterScript.java @@ -42,6 +42,8 @@ /** * A script implementation of a query filter. * See {@link org.opensearch.index.query.ScriptQueryBuilder}. + * + * @opensearch.internal */ public abstract class FilterScript { diff --git a/server/src/main/java/org/opensearch/script/GeneralScriptException.java b/server/src/main/java/org/opensearch/script/GeneralScriptException.java index 86398bff990e7..b52a242b5de92 100644 --- a/server/src/main/java/org/opensearch/script/GeneralScriptException.java +++ b/server/src/main/java/org/opensearch/script/GeneralScriptException.java @@ -47,6 +47,8 @@ * @deprecated Use ScriptException for exceptions from the scripting engine, * otherwise use a more appropriate exception (e.g. if thrown * from various abstractions) + * + * @opensearch.internal */ @Deprecated public class GeneralScriptException extends OpenSearchException implements OpenSearchWrapperException { diff --git a/server/src/main/java/org/opensearch/script/IngestConditionalScript.java b/server/src/main/java/org/opensearch/script/IngestConditionalScript.java index c41fae1f759e8..378ac6e39394f 100644 --- a/server/src/main/java/org/opensearch/script/IngestConditionalScript.java +++ b/server/src/main/java/org/opensearch/script/IngestConditionalScript.java @@ -38,6 +38,8 @@ /** * A script used by {@link org.opensearch.ingest.ConditionalProcessor}. + * + * @opensearch.internal */ public abstract class IngestConditionalScript { diff --git a/server/src/main/java/org/opensearch/script/IngestScript.java b/server/src/main/java/org/opensearch/script/IngestScript.java index 65a7bc1f3e52c..96802df1096e4 100644 --- a/server/src/main/java/org/opensearch/script/IngestScript.java +++ b/server/src/main/java/org/opensearch/script/IngestScript.java @@ -38,6 +38,8 @@ /** * A script used by the Ingest Script Processor. + * + * @opensearch.internal */ public abstract class IngestScript { diff --git a/server/src/main/java/org/opensearch/script/JodaCompatibleZonedDateTime.java b/server/src/main/java/org/opensearch/script/JodaCompatibleZonedDateTime.java index a92d7c4cf45f7..8f48da739359a 100644 --- a/server/src/main/java/org/opensearch/script/JodaCompatibleZonedDateTime.java +++ b/server/src/main/java/org/opensearch/script/JodaCompatibleZonedDateTime.java @@ -69,6 +69,8 @@ /** * A wrapper around ZonedDateTime that exposes joda methods for backcompat. + * + * @opensearch.internal */ public class JodaCompatibleZonedDateTime implements diff --git a/server/src/main/java/org/opensearch/script/NumberSortScript.java b/server/src/main/java/org/opensearch/script/NumberSortScript.java index 4ce1cee6fed17..097e5045aa803 100644 --- a/server/src/main/java/org/opensearch/script/NumberSortScript.java +++ b/server/src/main/java/org/opensearch/script/NumberSortScript.java @@ -36,6 +36,11 @@ import org.apache.lucene.index.LeafReaderContext; import org.opensearch.search.lookup.SearchLookup; +/** + * Script for number sorts + * + * @opensearch.internal + */ public abstract class NumberSortScript extends AbstractSortScript { public static final String[] PARAMETERS = {}; diff --git a/server/src/main/java/org/opensearch/script/ScoreScript.java b/server/src/main/java/org/opensearch/script/ScoreScript.java index 1f690faf2f68b..887032aa97811 100644 --- a/server/src/main/java/org/opensearch/script/ScoreScript.java +++ b/server/src/main/java/org/opensearch/script/ScoreScript.java @@ -50,6 +50,8 @@ /** * A script used for adjusting the score on a per document basis. + * + * @opensearch.internal */ public abstract class ScoreScript { diff --git a/server/src/main/java/org/opensearch/script/ScoreScriptUtils.java b/server/src/main/java/org/opensearch/script/ScoreScriptUtils.java index ed9d4e6c4f8a7..1b1f7d7ba427b 100644 --- a/server/src/main/java/org/opensearch/script/ScoreScriptUtils.java +++ b/server/src/main/java/org/opensearch/script/ScoreScriptUtils.java @@ -48,6 +48,11 @@ import static com.carrotsearch.hppc.BitMixer.mix32; +/** + * Utilities for scoring scripts + * + * @opensearch.internal + */ public final class ScoreScriptUtils { /****** STATIC FUNCTIONS that can be used by users for score calculations **/ diff --git a/server/src/main/java/org/opensearch/script/Script.java b/server/src/main/java/org/opensearch/script/Script.java index 561324e24bd07..a81ffa7b622a5 100644 --- a/server/src/main/java/org/opensearch/script/Script.java +++ b/server/src/main/java/org/opensearch/script/Script.java @@ -95,6 +95,8 @@ * use an empty {@link Map} to specify no params * * + * + * @opensearch.internal */ public final class Script implements ToXContentObject, Writeable { diff --git a/server/src/main/java/org/opensearch/script/ScriptCache.java b/server/src/main/java/org/opensearch/script/ScriptCache.java index 71476ce55d661..1b898b90ba144 100644 --- a/server/src/main/java/org/opensearch/script/ScriptCache.java +++ b/server/src/main/java/org/opensearch/script/ScriptCache.java @@ -50,6 +50,8 @@ /** * Script cache and compilation rate limiter. + * + * @opensearch.internal */ public class ScriptCache { diff --git a/server/src/main/java/org/opensearch/script/ScriptCacheStats.java b/server/src/main/java/org/opensearch/script/ScriptCacheStats.java index 97bf6aa443b0d..cb88759a5cd5d 100644 --- a/server/src/main/java/org/opensearch/script/ScriptCacheStats.java +++ b/server/src/main/java/org/opensearch/script/ScriptCacheStats.java @@ -45,7 +45,14 @@ import java.util.Objects; import java.util.stream.Collectors; -// This class is deprecated in favor of ScriptStats and ScriptContextStats. It is removed in 8. +/** + * Stats for script caching + * + * @opensearch.internal + * + * @deprecated This class is deprecated in favor of ScriptStats and ScriptContextStats. It is removed in OpenSearch 2.0. + */ +@Deprecated public class ScriptCacheStats implements Writeable, ToXContentFragment { private final Map context; private final ScriptStats general; diff --git a/server/src/main/java/org/opensearch/script/ScriptContext.java b/server/src/main/java/org/opensearch/script/ScriptContext.java index 299528494f7dc..27ad1f3ce03c8 100644 --- a/server/src/main/java/org/opensearch/script/ScriptContext.java +++ b/server/src/main/java/org/opensearch/script/ScriptContext.java @@ -69,6 +69,8 @@ * For example, to check if a variable {@code doc} is used, a method {@code boolean needsDoc()} should be added. * If the variable name starts with an underscore, for example, {@code _score}, the needs method would * be {@code boolean needs_score()}. + * + * @opensearch.internal */ public final class ScriptContext { diff --git a/server/src/main/java/org/opensearch/script/ScriptContextInfo.java b/server/src/main/java/org/opensearch/script/ScriptContextInfo.java index 360ef93868722..68297eb12216a 100644 --- a/server/src/main/java/org/opensearch/script/ScriptContextInfo.java +++ b/server/src/main/java/org/opensearch/script/ScriptContextInfo.java @@ -57,6 +57,11 @@ import static org.opensearch.common.xcontent.ConstructingObjectParser.constructorArg; +/** + * Information about a script context + * + * @opensearch.internal + */ public class ScriptContextInfo implements ToXContentObject, Writeable { public final String name; public final ScriptMethodInfo execute; diff --git a/server/src/main/java/org/opensearch/script/ScriptContextStats.java b/server/src/main/java/org/opensearch/script/ScriptContextStats.java index 345b5193a29d7..ee5c0db3106f6 100644 --- a/server/src/main/java/org/opensearch/script/ScriptContextStats.java +++ b/server/src/main/java/org/opensearch/script/ScriptContextStats.java @@ -41,6 +41,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Stats for a script context + * + * @opensearch.internal + */ public class ScriptContextStats implements Writeable, ToXContentFragment, Comparable { private final String context; private final long compilations; diff --git a/server/src/main/java/org/opensearch/script/ScriptEngine.java b/server/src/main/java/org/opensearch/script/ScriptEngine.java index 35cc0a55237e4..418fbed52da30 100644 --- a/server/src/main/java/org/opensearch/script/ScriptEngine.java +++ b/server/src/main/java/org/opensearch/script/ScriptEngine.java @@ -39,6 +39,8 @@ /** * A script language implementation. + * + * @opensearch.internal */ public interface ScriptEngine extends Closeable { diff --git a/server/src/main/java/org/opensearch/script/ScriptException.java b/server/src/main/java/org/opensearch/script/ScriptException.java index d053d3567610e..8255751189002 100644 --- a/server/src/main/java/org/opensearch/script/ScriptException.java +++ b/server/src/main/java/org/opensearch/script/ScriptException.java @@ -59,6 +59,8 @@ *
    17. {@code script}: Identifier for which script failed. *
    18. {@code lang}: Scripting engine language, such as "painless" * + * + * @opensearch.internal */ @SuppressWarnings("serial") public class ScriptException extends OpenSearchException { diff --git a/server/src/main/java/org/opensearch/script/ScriptFactory.java b/server/src/main/java/org/opensearch/script/ScriptFactory.java index 6366d5dbc9287..96cba8aa66a2c 100644 --- a/server/src/main/java/org/opensearch/script/ScriptFactory.java +++ b/server/src/main/java/org/opensearch/script/ScriptFactory.java @@ -34,6 +34,8 @@ /** * Contains utility methods for compiled scripts without impacting concrete script signatures + * + * @opensearch.internal */ public interface ScriptFactory { /** Returns {@code true} if the result of the script will be deterministic, {@code false} otherwise. */ diff --git a/server/src/main/java/org/opensearch/script/ScriptLanguagesInfo.java b/server/src/main/java/org/opensearch/script/ScriptLanguagesInfo.java index acc26530211c0..727d6dda85367 100644 --- a/server/src/main/java/org/opensearch/script/ScriptLanguagesInfo.java +++ b/server/src/main/java/org/opensearch/script/ScriptLanguagesInfo.java @@ -90,6 +90,8 @@ * ] * } * + * + * @opensearch.internal */ public class ScriptLanguagesInfo implements ToXContentObject, Writeable { private static final ParseField TYPES_ALLOWED = new ParseField("types_allowed"); diff --git a/server/src/main/java/org/opensearch/script/ScriptMetadata.java b/server/src/main/java/org/opensearch/script/ScriptMetadata.java index 4fde74adbdf41..ed57d978bf2ff 100644 --- a/server/src/main/java/org/opensearch/script/ScriptMetadata.java +++ b/server/src/main/java/org/opensearch/script/ScriptMetadata.java @@ -57,6 +57,8 @@ /** * {@link ScriptMetadata} is used to store user-defined scripts * as part of the {@link ClusterState} using only an id as the key. + * + * @opensearch.internal */ public final class ScriptMetadata implements Metadata.Custom, Writeable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/script/ScriptMetrics.java b/server/src/main/java/org/opensearch/script/ScriptMetrics.java index 2a7ccd0a781f0..fd54c757fd017 100644 --- a/server/src/main/java/org/opensearch/script/ScriptMetrics.java +++ b/server/src/main/java/org/opensearch/script/ScriptMetrics.java @@ -34,6 +34,11 @@ import org.opensearch.common.metrics.CounterMetric; +/** + * Metrics for scripts + * + * @opensearch.internal + */ public class ScriptMetrics { final CounterMetric compilationsMetric = new CounterMetric(); final CounterMetric cacheEvictionsMetric = new CounterMetric(); diff --git a/server/src/main/java/org/opensearch/script/ScriptModule.java b/server/src/main/java/org/opensearch/script/ScriptModule.java index 5ccf16bf38457..b5527f6d8d07d 100644 --- a/server/src/main/java/org/opensearch/script/ScriptModule.java +++ b/server/src/main/java/org/opensearch/script/ScriptModule.java @@ -48,6 +48,8 @@ /** * Manages building {@link ScriptService}. + * + * @opensearch.internal */ public class ScriptModule { diff --git a/server/src/main/java/org/opensearch/script/ScriptService.java b/server/src/main/java/org/opensearch/script/ScriptService.java index 7be41dcd242f0..303fc5ccbcf88 100644 --- a/server/src/main/java/org/opensearch/script/ScriptService.java +++ b/server/src/main/java/org/opensearch/script/ScriptService.java @@ -71,6 +71,11 @@ import java.util.function.Function; import java.util.stream.Collectors; +/** + * Service for scripting + * + * @opensearch.internal + */ public class ScriptService implements Closeable, ClusterStateApplier { private static final Logger logger = LogManager.getLogger(ScriptService.class); diff --git a/server/src/main/java/org/opensearch/script/ScriptStats.java b/server/src/main/java/org/opensearch/script/ScriptStats.java index 31ce0683b36d8..34d868f1d6046 100644 --- a/server/src/main/java/org/opensearch/script/ScriptStats.java +++ b/server/src/main/java/org/opensearch/script/ScriptStats.java @@ -46,6 +46,11 @@ import java.util.List; import java.util.Map; +/** + * Stats for scripts + * + * @opensearch.internal + */ public class ScriptStats implements Writeable, ToXContentFragment { private final List contextStats; private final long compilations; diff --git a/server/src/main/java/org/opensearch/script/ScriptType.java b/server/src/main/java/org/opensearch/script/ScriptType.java index 29a6cceef5561..a0428d5c5ae57 100644 --- a/server/src/main/java/org/opensearch/script/ScriptType.java +++ b/server/src/main/java/org/opensearch/script/ScriptType.java @@ -44,6 +44,8 @@ * ScriptType represents the way a script is stored and retrieved from the {@link ScriptService}. * It's also used to by {@link ScriptService} to determine whether or not a {@link Script} is * allowed to be executed based on both default and user-defined settings. + * + * @opensearch.internal */ public enum ScriptType implements Writeable { diff --git a/server/src/main/java/org/opensearch/script/ScriptedMetricAggContexts.java b/server/src/main/java/org/opensearch/script/ScriptedMetricAggContexts.java index 1f187f7f0e8f5..43c6bb0a89890 100644 --- a/server/src/main/java/org/opensearch/script/ScriptedMetricAggContexts.java +++ b/server/src/main/java/org/opensearch/script/ScriptedMetricAggContexts.java @@ -47,6 +47,11 @@ import java.util.Map; import java.util.function.Function; +/** + * Contexts for scripted metric aggregations + * + * @opensearch.internal + */ public class ScriptedMetricAggContexts { public abstract static class InitScript { diff --git a/server/src/main/java/org/opensearch/script/SignificantTermsHeuristicScoreScript.java b/server/src/main/java/org/opensearch/script/SignificantTermsHeuristicScoreScript.java index 8227c673b9d97..9d61407570546 100644 --- a/server/src/main/java/org/opensearch/script/SignificantTermsHeuristicScoreScript.java +++ b/server/src/main/java/org/opensearch/script/SignificantTermsHeuristicScoreScript.java @@ -36,6 +36,8 @@ /** * A script used in significant terms heuristic scoring. + * + * @opensearch.internal */ public abstract class SignificantTermsHeuristicScoreScript { diff --git a/server/src/main/java/org/opensearch/script/SimilarityScript.java b/server/src/main/java/org/opensearch/script/SimilarityScript.java index 1683b8ad43bdf..dbee5af77e309 100644 --- a/server/src/main/java/org/opensearch/script/SimilarityScript.java +++ b/server/src/main/java/org/opensearch/script/SimilarityScript.java @@ -34,7 +34,11 @@ import org.opensearch.index.similarity.ScriptedSimilarity; -/** A script that is used to build {@link ScriptedSimilarity} instances. */ +/** + * A script that is used to build {@link ScriptedSimilarity} instances. + * + * @opensearch.internal + */ public abstract class SimilarityScript { /** Compute the score. diff --git a/server/src/main/java/org/opensearch/script/SimilarityWeightScript.java b/server/src/main/java/org/opensearch/script/SimilarityWeightScript.java index 33f2e76f24f2f..f780f87741680 100644 --- a/server/src/main/java/org/opensearch/script/SimilarityWeightScript.java +++ b/server/src/main/java/org/opensearch/script/SimilarityWeightScript.java @@ -34,7 +34,11 @@ import org.opensearch.index.similarity.ScriptedSimilarity; -/** A script that is used to compute scoring factors that are the same for all documents. */ +/** + * A script that is used to compute scoring factors that are the same for all documents. + * + * @opensearch.internal + */ public abstract class SimilarityWeightScript { /** Compute the weight. diff --git a/server/src/main/java/org/opensearch/script/StoredScriptSource.java b/server/src/main/java/org/opensearch/script/StoredScriptSource.java index a14d1db7259eb..25cff24efb92b 100644 --- a/server/src/main/java/org/opensearch/script/StoredScriptSource.java +++ b/server/src/main/java/org/opensearch/script/StoredScriptSource.java @@ -65,6 +65,8 @@ /** * {@link StoredScriptSource} represents user-defined parameters for a script * saved in the {@link ClusterState}. + * + * @opensearch.internal */ public class StoredScriptSource extends AbstractDiffable implements Writeable, ToXContentObject { diff --git a/server/src/main/java/org/opensearch/script/StringSortScript.java b/server/src/main/java/org/opensearch/script/StringSortScript.java index c518543588b3a..eee60d9dc4ef9 100644 --- a/server/src/main/java/org/opensearch/script/StringSortScript.java +++ b/server/src/main/java/org/opensearch/script/StringSortScript.java @@ -36,6 +36,11 @@ import org.apache.lucene.index.LeafReaderContext; import org.opensearch.search.lookup.SearchLookup; +/** + * Script for sorting strings + * + * @opensearch.internal + */ public abstract class StringSortScript extends AbstractSortScript { public static final String[] PARAMETERS = {}; diff --git a/server/src/main/java/org/opensearch/script/TemplateScript.java b/server/src/main/java/org/opensearch/script/TemplateScript.java index 2e13599af044c..0b03a4fd931c1 100644 --- a/server/src/main/java/org/opensearch/script/TemplateScript.java +++ b/server/src/main/java/org/opensearch/script/TemplateScript.java @@ -36,6 +36,8 @@ /** * A string template rendered as a script. + * + * @opensearch.internal */ public abstract class TemplateScript { diff --git a/server/src/main/java/org/opensearch/script/TermsSetQueryScript.java b/server/src/main/java/org/opensearch/script/TermsSetQueryScript.java index 200779cab2de0..d4a4d1cccbd5b 100644 --- a/server/src/main/java/org/opensearch/script/TermsSetQueryScript.java +++ b/server/src/main/java/org/opensearch/script/TermsSetQueryScript.java @@ -43,6 +43,11 @@ import java.util.Map; import java.util.function.Function; +/** + * Script for terms set query + * + * @opensearch.internal + */ public abstract class TermsSetQueryScript { public static final String[] PARAMETERS = {}; diff --git a/server/src/main/java/org/opensearch/script/UpdateScript.java b/server/src/main/java/org/opensearch/script/UpdateScript.java index aef8049bbeb0b..41f21f337877b 100644 --- a/server/src/main/java/org/opensearch/script/UpdateScript.java +++ b/server/src/main/java/org/opensearch/script/UpdateScript.java @@ -39,6 +39,8 @@ /** * An update script. + * + * @opensearch.internal */ public abstract class UpdateScript { diff --git a/server/src/main/java/org/opensearch/threadpool/AutoQueueAdjustingExecutorBuilder.java b/server/src/main/java/org/opensearch/threadpool/AutoQueueAdjustingExecutorBuilder.java index 2bac5eba9fc28..cd89d6110a072 100644 --- a/server/src/main/java/org/opensearch/threadpool/AutoQueueAdjustingExecutorBuilder.java +++ b/server/src/main/java/org/opensearch/threadpool/AutoQueueAdjustingExecutorBuilder.java @@ -52,6 +52,8 @@ /** * A builder for executors that automatically adjust the queue length as needed, depending on * Little's Law. See https://en.wikipedia.org/wiki/Little's_law for more information. + * + * @opensearch.internal */ public final class AutoQueueAdjustingExecutorBuilder extends ExecutorBuilder { diff --git a/server/src/main/java/org/opensearch/threadpool/CancellableAdapter.java b/server/src/main/java/org/opensearch/threadpool/CancellableAdapter.java index e4133e89485bc..cb37762892599 100644 --- a/server/src/main/java/org/opensearch/threadpool/CancellableAdapter.java +++ b/server/src/main/java/org/opensearch/threadpool/CancellableAdapter.java @@ -36,6 +36,11 @@ import java.util.concurrent.Future; +/** + * A cancellable adapter + * + * @opensearch.internal + */ class CancellableAdapter implements Scheduler.Cancellable { private Future future; diff --git a/server/src/main/java/org/opensearch/threadpool/ExecutorBuilder.java b/server/src/main/java/org/opensearch/threadpool/ExecutorBuilder.java index b9f4e31d5766f..5229afb0ec71c 100644 --- a/server/src/main/java/org/opensearch/threadpool/ExecutorBuilder.java +++ b/server/src/main/java/org/opensearch/threadpool/ExecutorBuilder.java @@ -43,6 +43,8 @@ * Base class for executor builders. * * @param the underlying type of the executor settings + * + * @opensearch.internal */ public abstract class ExecutorBuilder { diff --git a/server/src/main/java/org/opensearch/threadpool/FixedExecutorBuilder.java b/server/src/main/java/org/opensearch/threadpool/FixedExecutorBuilder.java index 7eeea8e1b3f4c..bb21c234e58fe 100644 --- a/server/src/main/java/org/opensearch/threadpool/FixedExecutorBuilder.java +++ b/server/src/main/java/org/opensearch/threadpool/FixedExecutorBuilder.java @@ -47,6 +47,8 @@ /** * A builder for fixed executors. + * + * @opensearch.internal */ public final class FixedExecutorBuilder extends ExecutorBuilder { diff --git a/server/src/main/java/org/opensearch/threadpool/ScalingExecutorBuilder.java b/server/src/main/java/org/opensearch/threadpool/ScalingExecutorBuilder.java index 6a183b01ef1e9..2690a3cc30238 100644 --- a/server/src/main/java/org/opensearch/threadpool/ScalingExecutorBuilder.java +++ b/server/src/main/java/org/opensearch/threadpool/ScalingExecutorBuilder.java @@ -48,6 +48,8 @@ /** * A builder for scaling executors. + * + * @opensearch.internal */ public final class ScalingExecutorBuilder extends ExecutorBuilder { diff --git a/server/src/main/java/org/opensearch/threadpool/ScheduledCancellableAdapter.java b/server/src/main/java/org/opensearch/threadpool/ScheduledCancellableAdapter.java index 31672363d2eaf..7e756e827b69e 100644 --- a/server/src/main/java/org/opensearch/threadpool/ScheduledCancellableAdapter.java +++ b/server/src/main/java/org/opensearch/threadpool/ScheduledCancellableAdapter.java @@ -38,6 +38,11 @@ import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +/** + * A cancellable adapter that is scheduled + * + * @opensearch.internal + */ class ScheduledCancellableAdapter implements Scheduler.ScheduledCancellable { private final ScheduledFuture scheduledFuture; diff --git a/server/src/main/java/org/opensearch/threadpool/Scheduler.java b/server/src/main/java/org/opensearch/threadpool/Scheduler.java index 3f0dff48fb0f5..7c502216af31b 100644 --- a/server/src/main/java/org/opensearch/threadpool/Scheduler.java +++ b/server/src/main/java/org/opensearch/threadpool/Scheduler.java @@ -53,6 +53,8 @@ /** * Scheduler that allows to schedule one-shot and periodic commands. + * + * @opensearch.internal */ public interface Scheduler { diff --git a/server/src/main/java/org/opensearch/threadpool/ThreadPool.java b/server/src/main/java/org/opensearch/threadpool/ThreadPool.java index c2530ccee5588..a6cb566cba678 100644 --- a/server/src/main/java/org/opensearch/threadpool/ThreadPool.java +++ b/server/src/main/java/org/opensearch/threadpool/ThreadPool.java @@ -72,6 +72,11 @@ import static java.util.Collections.unmodifiableMap; +/** + * The OpenSearch threadpool class + * + * @opensearch.internal + */ public class ThreadPool implements ReportingService, Scheduler { private static final Logger logger = LogManager.getLogger(ThreadPool.class); diff --git a/server/src/main/java/org/opensearch/threadpool/ThreadPoolInfo.java b/server/src/main/java/org/opensearch/threadpool/ThreadPoolInfo.java index 3b34734841c0d..e0414179d4099 100644 --- a/server/src/main/java/org/opensearch/threadpool/ThreadPoolInfo.java +++ b/server/src/main/java/org/opensearch/threadpool/ThreadPoolInfo.java @@ -42,6 +42,11 @@ import java.util.Iterator; import java.util.List; +/** + * Information about a threadpool + * + * @opensearch.internal + */ public class ThreadPoolInfo implements ReportingService.Info, Iterable { private final List infos; diff --git a/server/src/main/java/org/opensearch/threadpool/ThreadPoolStats.java b/server/src/main/java/org/opensearch/threadpool/ThreadPoolStats.java index 92273e15fa280..cf9e85ac30a92 100644 --- a/server/src/main/java/org/opensearch/threadpool/ThreadPoolStats.java +++ b/server/src/main/java/org/opensearch/threadpool/ThreadPoolStats.java @@ -44,6 +44,11 @@ import java.util.Iterator; import java.util.List; +/** + * Stats for a threadpool + * + * @opensearch.internal + */ public class ThreadPoolStats implements Writeable, ToXContentFragment, Iterable { public static class Stats implements Writeable, ToXContentFragment, Comparable { diff --git a/server/src/main/java/org/opensearch/usage/UsageService.java b/server/src/main/java/org/opensearch/usage/UsageService.java index 6f8f0076d50f8..14e25b591bda0 100644 --- a/server/src/main/java/org/opensearch/usage/UsageService.java +++ b/server/src/main/java/org/opensearch/usage/UsageService.java @@ -61,6 +61,8 @@ /** * A service to monitor usage of OpenSearch features. + * + * @opensearch.internal */ public class UsageService { diff --git a/server/src/main/java/org/opensearch/watcher/AbstractResourceWatcher.java b/server/src/main/java/org/opensearch/watcher/AbstractResourceWatcher.java index 9f33bb2d4f868..dc0976b123327 100644 --- a/server/src/main/java/org/opensearch/watcher/AbstractResourceWatcher.java +++ b/server/src/main/java/org/opensearch/watcher/AbstractResourceWatcher.java @@ -38,6 +38,8 @@ /** * Abstract resource watcher framework, which handles adding and removing listeners * and calling resource observer. + * + * @opensearch.internal */ public abstract class AbstractResourceWatcher implements ResourceWatcher { private final List listeners = new CopyOnWriteArrayList<>(); diff --git a/server/src/main/java/org/opensearch/watcher/FileChangesListener.java b/server/src/main/java/org/opensearch/watcher/FileChangesListener.java index a9843ad6ed879..7c6132946bbcb 100644 --- a/server/src/main/java/org/opensearch/watcher/FileChangesListener.java +++ b/server/src/main/java/org/opensearch/watcher/FileChangesListener.java @@ -35,6 +35,8 @@ /** * Callback interface that file changes File Watcher is using to notify listeners about changes. + * + * @opensearch.internal */ public interface FileChangesListener { /** diff --git a/server/src/main/java/org/opensearch/watcher/FileWatcher.java b/server/src/main/java/org/opensearch/watcher/FileWatcher.java index ec9fe0c1a1615..9eef64a3cb2db 100644 --- a/server/src/main/java/org/opensearch/watcher/FileWatcher.java +++ b/server/src/main/java/org/opensearch/watcher/FileWatcher.java @@ -46,6 +46,8 @@ * File resources watcher * * The file watcher checks directory and all its subdirectories for file changes and notifies its listeners accordingly + * + * @opensearch.internal */ public class FileWatcher extends AbstractResourceWatcher { diff --git a/server/src/main/java/org/opensearch/watcher/ResourceWatcher.java b/server/src/main/java/org/opensearch/watcher/ResourceWatcher.java index 43bcf601c997f..0c656c52388df 100644 --- a/server/src/main/java/org/opensearch/watcher/ResourceWatcher.java +++ b/server/src/main/java/org/opensearch/watcher/ResourceWatcher.java @@ -38,6 +38,8 @@ *

      * Different resource watchers can be registered with {@link ResourceWatcherService} to be called * periodically in order to check for changes in different external resources. + * + * @opensearch.internal */ public interface ResourceWatcher { /** diff --git a/server/src/main/java/org/opensearch/watcher/ResourceWatcherService.java b/server/src/main/java/org/opensearch/watcher/ResourceWatcherService.java index 9422ef7aa60ae..b8c819e187efd 100644 --- a/server/src/main/java/org/opensearch/watcher/ResourceWatcherService.java +++ b/server/src/main/java/org/opensearch/watcher/ResourceWatcherService.java @@ -53,6 +53,8 @@ * method. This service will call {@link org.opensearch.watcher.ResourceWatcher#checkAndNotify()} method of all * registered watcher periodically. The frequency of checks can be specified using {@code resource.reload.interval} setting, which * defaults to {@code 60s}. The service can be disabled by setting {@code resource.reload.enabled} setting to {@code false}. + * + * @opensearch.internal */ public class ResourceWatcherService implements Closeable { private static final Logger logger = LogManager.getLogger(ResourceWatcherService.class); diff --git a/server/src/main/java/org/opensearch/watcher/WatcherHandle.java b/server/src/main/java/org/opensearch/watcher/WatcherHandle.java index b6aa1df39e4eb..6890364cd0cd6 100644 --- a/server/src/main/java/org/opensearch/watcher/WatcherHandle.java +++ b/server/src/main/java/org/opensearch/watcher/WatcherHandle.java @@ -32,6 +32,11 @@ package org.opensearch.watcher; +/** + * Handle to a watcher + * + * @opensearch.internal + */ public class WatcherHandle { private final ResourceWatcherService.ResourceMonitor monitor; From 4431183ee3d505a00b25e539f97b3262cbbdeff1 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 5 May 2022 17:02:23 -0400 Subject: [PATCH 126/514] Bump commons-lang3 from 3.9 to 3.12.0 in /plugins/ingest-attachment (#3190) (#3194) * Bump commons-lang3 from 3.9 to 3.12.0 in /plugins/ingest-attachment Bumps commons-lang3 from 3.9 to 3.12.0. --- updated-dependencies: - dependency-name: org.apache.commons:commons-lang3 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Updating SHAs Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] (cherry picked from commit 112a108246a709225d612bf400d884d2e584df61) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- plugins/ingest-attachment/build.gradle | 2 +- .../ingest-attachment/licenses/commons-lang3-3.12.0.jar.sha1 | 1 + plugins/ingest-attachment/licenses/commons-lang3-3.9.jar.sha1 | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 plugins/ingest-attachment/licenses/commons-lang3-3.12.0.jar.sha1 delete mode 100644 plugins/ingest-attachment/licenses/commons-lang3-3.9.jar.sha1 diff --git a/plugins/ingest-attachment/build.gradle b/plugins/ingest-attachment/build.gradle index 231ce40f3f38c..4474724a32eb6 100644 --- a/plugins/ingest-attachment/build.gradle +++ b/plugins/ingest-attachment/build.gradle @@ -82,7 +82,7 @@ dependencies { api "org.apache.james:apache-mime4j-core:${versions.mime4j}" api "org.apache.james:apache-mime4j-dom:${versions.mime4j}" // EPUB books - api 'org.apache.commons:commons-lang3:3.9' + api 'org.apache.commons:commons-lang3:3.12.0' // Microsoft Word files with visio diagrams api 'org.apache.commons:commons-math3:3.6.1' // POIs dependency diff --git a/plugins/ingest-attachment/licenses/commons-lang3-3.12.0.jar.sha1 b/plugins/ingest-attachment/licenses/commons-lang3-3.12.0.jar.sha1 new file mode 100644 index 0000000000000..9273d8c01aaba --- /dev/null +++ b/plugins/ingest-attachment/licenses/commons-lang3-3.12.0.jar.sha1 @@ -0,0 +1 @@ +c6842c86792ff03b9f1d1fe2aab8dc23aa6c6f0e \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/commons-lang3-3.9.jar.sha1 b/plugins/ingest-attachment/licenses/commons-lang3-3.9.jar.sha1 deleted file mode 100644 index 2adcfd377f87c..0000000000000 --- a/plugins/ingest-attachment/licenses/commons-lang3-3.9.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -0122c7cee69b53ed4a7681c03d4ee4c0e2765da5 \ No newline at end of file From 5f19df1725109e6a9cb6750b2e17c2aaa28ae120 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 5 May 2022 17:04:11 -0400 Subject: [PATCH 127/514] [Javadocs] Add to o.o.disovery, env, gateway, http, ingest, lucene and node pkgs (#3185) (#3187) Adds javadocs to classes in the org.opensearch.discovery, env, gateway, http, ingest, lucene, and node packages. Signed-off-by: Nicholas Walter Knize (cherry picked from commit 4d3da00c1235fbceb65239336a027936ec781dc2) Co-authored-by: Nick Knize --- .../discovery/AckClusterStatePublishResponseHandler.java | 2 ++ .../BlockingClusterStatePublishResponseHandler.java | 2 ++ server/src/main/java/org/opensearch/discovery/Discovery.java | 2 ++ .../main/java/org/opensearch/discovery/DiscoveryModule.java | 2 ++ .../main/java/org/opensearch/discovery/DiscoveryStats.java | 5 +++++ .../org/opensearch/discovery/FileBasedSeedHostsProvider.java | 2 ++ .../discovery/HandshakingTransportAddressConnector.java | 5 +++++ .../opensearch/discovery/MasterNotDiscoveredException.java | 5 +++++ .../src/main/java/org/opensearch/discovery/PeerFinder.java | 5 +++++ .../src/main/java/org/opensearch/discovery/PeersRequest.java | 5 +++++ .../java/org/opensearch/discovery/SeedHostsProvider.java | 2 ++ .../java/org/opensearch/discovery/SeedHostsResolver.java | 5 +++++ .../opensearch/discovery/SettingsBasedSeedHostsProvider.java | 2 ++ server/src/main/java/org/opensearch/env/Environment.java | 2 ++ server/src/main/java/org/opensearch/env/NodeEnvironment.java | 2 ++ server/src/main/java/org/opensearch/env/NodeMetadata.java | 2 ++ .../main/java/org/opensearch/env/NodeRepurposeCommand.java | 5 +++++ .../main/java/org/opensearch/env/OpenSearchFileStore.java | 2 ++ .../java/org/opensearch/env/OverrideNodeVersionCommand.java | 5 +++++ server/src/main/java/org/opensearch/env/ShardLock.java | 2 ++ .../org/opensearch/env/ShardLockObtainFailedException.java | 2 ++ .../main/java/org/opensearch/gateway/AsyncShardFetch.java | 2 ++ .../org/opensearch/gateway/BaseGatewayShardAllocator.java | 2 ++ .../java/org/opensearch/gateway/ClusterStateUpdaters.java | 5 +++++ .../java/org/opensearch/gateway/CorruptStateException.java | 2 ++ .../java/org/opensearch/gateway/DanglingIndicesState.java | 2 ++ server/src/main/java/org/opensearch/gateway/Gateway.java | 5 +++++ .../main/java/org/opensearch/gateway/GatewayAllocator.java | 5 +++++ .../main/java/org/opensearch/gateway/GatewayException.java | 5 +++++ .../main/java/org/opensearch/gateway/GatewayMetaState.java | 2 ++ .../src/main/java/org/opensearch/gateway/GatewayModule.java | 5 +++++ .../src/main/java/org/opensearch/gateway/GatewayService.java | 5 +++++ .../opensearch/gateway/IncrementalClusterStateWriter.java | 2 ++ .../org/opensearch/gateway/LocalAllocateDangledIndices.java | 5 +++++ .../main/java/org/opensearch/gateway/MetaStateService.java | 2 ++ .../java/org/opensearch/gateway/MetadataStateFormat.java | 2 ++ .../org/opensearch/gateway/PersistedClusterStateService.java | 2 ++ .../java/org/opensearch/gateway/PrimaryShardAllocator.java | 2 ++ .../main/java/org/opensearch/gateway/PriorityComparator.java | 2 ++ .../java/org/opensearch/gateway/ReplicaShardAllocator.java | 5 +++++ .../gateway/TransportNodesListGatewayMetaState.java | 5 +++++ .../gateway/TransportNodesListGatewayStartedShards.java | 2 ++ .../java/org/opensearch/gateway/WriteStateException.java | 2 ++ .../org/opensearch/http/AbstractHttpServerTransport.java | 5 +++++ .../src/main/java/org/opensearch/http/BindHttpException.java | 5 +++++ server/src/main/java/org/opensearch/http/CorsHandler.java | 2 ++ .../main/java/org/opensearch/http/DefaultRestChannel.java | 2 ++ server/src/main/java/org/opensearch/http/HttpChannel.java | 5 +++++ server/src/main/java/org/opensearch/http/HttpException.java | 5 +++++ .../main/java/org/opensearch/http/HttpHandlingSettings.java | 5 +++++ server/src/main/java/org/opensearch/http/HttpInfo.java | 5 +++++ .../main/java/org/opensearch/http/HttpPipelinedMessage.java | 5 +++++ .../main/java/org/opensearch/http/HttpPipelinedRequest.java | 5 +++++ .../main/java/org/opensearch/http/HttpPipelinedResponse.java | 5 +++++ .../java/org/opensearch/http/HttpPipeliningAggregator.java | 5 +++++ .../java/org/opensearch/http/HttpReadTimeoutException.java | 5 +++++ server/src/main/java/org/opensearch/http/HttpRequest.java | 2 ++ server/src/main/java/org/opensearch/http/HttpResponse.java | 2 ++ .../src/main/java/org/opensearch/http/HttpServerChannel.java | 5 +++++ .../main/java/org/opensearch/http/HttpServerTransport.java | 5 +++++ server/src/main/java/org/opensearch/http/HttpStats.java | 5 +++++ server/src/main/java/org/opensearch/http/HttpTracer.java | 2 ++ .../main/java/org/opensearch/http/HttpTransportSettings.java | 5 +++++ server/src/main/java/org/opensearch/http/HttpUtils.java | 5 +++++ .../main/java/org/opensearch/ingest/AbstractProcessor.java | 2 ++ .../main/java/org/opensearch/ingest/CompoundProcessor.java | 2 ++ .../java/org/opensearch/ingest/ConditionalProcessor.java | 5 +++++ .../main/java/org/opensearch/ingest/ConfigurationUtils.java | 5 +++++ .../src/main/java/org/opensearch/ingest/DropProcessor.java | 2 ++ .../src/main/java/org/opensearch/ingest/IngestDocument.java | 2 ++ server/src/main/java/org/opensearch/ingest/IngestInfo.java | 5 +++++ .../src/main/java/org/opensearch/ingest/IngestMetadata.java | 2 ++ server/src/main/java/org/opensearch/ingest/IngestMetric.java | 2 ++ .../java/org/opensearch/ingest/IngestProcessorException.java | 2 ++ .../src/main/java/org/opensearch/ingest/IngestService.java | 2 ++ server/src/main/java/org/opensearch/ingest/IngestStats.java | 5 +++++ server/src/main/java/org/opensearch/ingest/Pipeline.java | 2 ++ .../java/org/opensearch/ingest/PipelineConfiguration.java | 2 ++ .../main/java/org/opensearch/ingest/PipelineProcessor.java | 5 +++++ server/src/main/java/org/opensearch/ingest/Processor.java | 2 ++ .../src/main/java/org/opensearch/ingest/ProcessorInfo.java | 5 +++++ .../java/org/opensearch/ingest/TrackingResultProcessor.java | 2 ++ server/src/main/java/org/opensearch/ingest/ValueSource.java | 2 ++ .../main/java/org/opensearch/ingest/WrappingProcessor.java | 2 ++ .../main/java/org/opensearch/lucene/queries/MinDocQuery.java | 5 ++++- .../opensearch/lucene/queries/SearchAfterSortedDocQuery.java | 1 + .../java/org/opensearch/node/AdaptiveSelectionStats.java | 2 ++ .../java/org/opensearch/node/InternalSettingsPreparer.java | 5 +++++ server/src/main/java/org/opensearch/node/Node.java | 2 ++ .../main/java/org/opensearch/node/NodeClosedException.java | 2 +- .../src/main/java/org/opensearch/node/NodeRoleSettings.java | 5 +++++ server/src/main/java/org/opensearch/node/NodeService.java | 5 +++++ .../java/org/opensearch/node/NodeValidationException.java | 2 ++ .../src/main/java/org/opensearch/node/ReportingService.java | 5 +++++ .../java/org/opensearch/node/ResponseCollectorService.java | 2 ++ 95 files changed, 319 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/opensearch/discovery/AckClusterStatePublishResponseHandler.java b/server/src/main/java/org/opensearch/discovery/AckClusterStatePublishResponseHandler.java index e281bbbfacba1..2de585e049f56 100644 --- a/server/src/main/java/org/opensearch/discovery/AckClusterStatePublishResponseHandler.java +++ b/server/src/main/java/org/opensearch/discovery/AckClusterStatePublishResponseHandler.java @@ -42,6 +42,8 @@ * Allows to wait for all nodes to reply to the publish of a new cluster state * and notifies the {@link org.opensearch.discovery.Discovery.AckListener} * so that the cluster state update can be acknowledged + * + * @opensearch.internal */ public class AckClusterStatePublishResponseHandler extends BlockingClusterStatePublishResponseHandler { diff --git a/server/src/main/java/org/opensearch/discovery/BlockingClusterStatePublishResponseHandler.java b/server/src/main/java/org/opensearch/discovery/BlockingClusterStatePublishResponseHandler.java index 6ee01d055be04..daed425034087 100644 --- a/server/src/main/java/org/opensearch/discovery/BlockingClusterStatePublishResponseHandler.java +++ b/server/src/main/java/org/opensearch/discovery/BlockingClusterStatePublishResponseHandler.java @@ -43,6 +43,8 @@ /** * Handles responses obtained when publishing a new cluster state from cluster-manager to all non cluster-manager nodes. * Allows to await a reply from all non cluster-manager nodes, up to a timeout + * + * @opensearch.internal */ public class BlockingClusterStatePublishResponseHandler { diff --git a/server/src/main/java/org/opensearch/discovery/Discovery.java b/server/src/main/java/org/opensearch/discovery/Discovery.java index 25d136d8a2563..25b3cb6c2b90d 100644 --- a/server/src/main/java/org/opensearch/discovery/Discovery.java +++ b/server/src/main/java/org/opensearch/discovery/Discovery.java @@ -39,6 +39,8 @@ * A pluggable module allowing to implement discovery of other nodes, publishing of the cluster * state to all nodes, electing a cluster-manager of the cluster that raises cluster state change * events. + * + * @opensearch.internal */ public interface Discovery extends LifecycleComponent, ClusterStatePublisher { diff --git a/server/src/main/java/org/opensearch/discovery/DiscoveryModule.java b/server/src/main/java/org/opensearch/discovery/DiscoveryModule.java index af3d07a1b12d5..c12283df1dbc9 100644 --- a/server/src/main/java/org/opensearch/discovery/DiscoveryModule.java +++ b/server/src/main/java/org/opensearch/discovery/DiscoveryModule.java @@ -75,6 +75,8 @@ /** * A module for loading classes for node discovery. + * + * @opensearch.internal */ public class DiscoveryModule { private static final Logger logger = LogManager.getLogger(DiscoveryModule.class); diff --git a/server/src/main/java/org/opensearch/discovery/DiscoveryStats.java b/server/src/main/java/org/opensearch/discovery/DiscoveryStats.java index e480799c9f7c4..78fafb98040eb 100644 --- a/server/src/main/java/org/opensearch/discovery/DiscoveryStats.java +++ b/server/src/main/java/org/opensearch/discovery/DiscoveryStats.java @@ -42,6 +42,11 @@ import java.io.IOException; +/** + * Stores discovery stats + * + * @opensearch.internal + */ public class DiscoveryStats implements Writeable, ToXContentFragment { private final PendingClusterStateStats queueStats; diff --git a/server/src/main/java/org/opensearch/discovery/FileBasedSeedHostsProvider.java b/server/src/main/java/org/opensearch/discovery/FileBasedSeedHostsProvider.java index c6cd8411afc91..94f36ba0a546e 100644 --- a/server/src/main/java/org/opensearch/discovery/FileBasedSeedHostsProvider.java +++ b/server/src/main/java/org/opensearch/discovery/FileBasedSeedHostsProvider.java @@ -57,6 +57,8 @@ * 67.81.244.10 * 67.81.244.11:9305 * 67.81.244.15:9400 + * + * @opensearch.internal */ public class FileBasedSeedHostsProvider implements SeedHostsProvider { diff --git a/server/src/main/java/org/opensearch/discovery/HandshakingTransportAddressConnector.java b/server/src/main/java/org/opensearch/discovery/HandshakingTransportAddressConnector.java index d2e2c5fbea8ac..fcc890b1c21c9 100644 --- a/server/src/main/java/org/opensearch/discovery/HandshakingTransportAddressConnector.java +++ b/server/src/main/java/org/opensearch/discovery/HandshakingTransportAddressConnector.java @@ -57,6 +57,11 @@ import static java.util.Collections.emptyMap; import static java.util.Collections.emptySet; +/** + * Connector for transport handshake + * + * @opensearch.internal + */ public class HandshakingTransportAddressConnector implements TransportAddressConnector { private static final Logger logger = LogManager.getLogger(HandshakingTransportAddressConnector.class); diff --git a/server/src/main/java/org/opensearch/discovery/MasterNotDiscoveredException.java b/server/src/main/java/org/opensearch/discovery/MasterNotDiscoveredException.java index 337a6cf309dec..dec50388b5624 100644 --- a/server/src/main/java/org/opensearch/discovery/MasterNotDiscoveredException.java +++ b/server/src/main/java/org/opensearch/discovery/MasterNotDiscoveredException.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Exception when the cluster-manager is not discovered + * + * @opensearch.internal + */ public class MasterNotDiscoveredException extends OpenSearchException { public MasterNotDiscoveredException() { diff --git a/server/src/main/java/org/opensearch/discovery/PeerFinder.java b/server/src/main/java/org/opensearch/discovery/PeerFinder.java index c174016925696..45b21b1eaa5da 100644 --- a/server/src/main/java/org/opensearch/discovery/PeerFinder.java +++ b/server/src/main/java/org/opensearch/discovery/PeerFinder.java @@ -65,6 +65,11 @@ import static java.util.Collections.emptyList; +/** + * finds peers + * + * @opensearch.internal + */ public abstract class PeerFinder { private static final Logger logger = LogManager.getLogger(PeerFinder.class); diff --git a/server/src/main/java/org/opensearch/discovery/PeersRequest.java b/server/src/main/java/org/opensearch/discovery/PeersRequest.java index 6a96ee3450050..83545acf80ba3 100644 --- a/server/src/main/java/org/opensearch/discovery/PeersRequest.java +++ b/server/src/main/java/org/opensearch/discovery/PeersRequest.java @@ -41,6 +41,11 @@ import java.util.List; import java.util.Objects; +/** + * Request sent to a peer node + * + * @opensearch.internal + */ public class PeersRequest extends TransportRequest { private final DiscoveryNode sourceNode; private final List knownPeers; diff --git a/server/src/main/java/org/opensearch/discovery/SeedHostsProvider.java b/server/src/main/java/org/opensearch/discovery/SeedHostsProvider.java index 23944f7bb122c..1a4b5a3182dbe 100644 --- a/server/src/main/java/org/opensearch/discovery/SeedHostsProvider.java +++ b/server/src/main/java/org/opensearch/discovery/SeedHostsProvider.java @@ -38,6 +38,8 @@ /** * A pluggable provider of the list of seed hosts to use for discovery. + * + * @opensearch.internal */ public interface SeedHostsProvider { diff --git a/server/src/main/java/org/opensearch/discovery/SeedHostsResolver.java b/server/src/main/java/org/opensearch/discovery/SeedHostsResolver.java index 0c002a2f29a5e..94e51fe5804ca 100644 --- a/server/src/main/java/org/opensearch/discovery/SeedHostsResolver.java +++ b/server/src/main/java/org/opensearch/discovery/SeedHostsResolver.java @@ -65,6 +65,11 @@ import java.util.function.Consumer; import java.util.stream.Collectors; +/** + * Resolves seed hosts listed in the config + * + * @opensearch.internal + */ public class SeedHostsResolver extends AbstractLifecycleComponent implements ConfiguredHostsResolver { public static final Setting LEGACY_DISCOVERY_ZEN_PING_UNICAST_CONCURRENT_CONNECTS_SETTING = Setting.intSetting( "discovery.zen.ping.unicast.concurrent_connects", diff --git a/server/src/main/java/org/opensearch/discovery/SettingsBasedSeedHostsProvider.java b/server/src/main/java/org/opensearch/discovery/SettingsBasedSeedHostsProvider.java index 87fd49bde6aad..2dcd819e727f2 100644 --- a/server/src/main/java/org/opensearch/discovery/SettingsBasedSeedHostsProvider.java +++ b/server/src/main/java/org/opensearch/discovery/SettingsBasedSeedHostsProvider.java @@ -52,6 +52,8 @@ * * An example setting might look as follows: * [67.81.244.10, 67.81.244.11:9305, 67.81.244.15:9400] + * + * @opensearch.internal */ public class SettingsBasedSeedHostsProvider implements SeedHostsProvider { diff --git a/server/src/main/java/org/opensearch/env/Environment.java b/server/src/main/java/org/opensearch/env/Environment.java index 88f324f4dbea9..d156bc1341bab 100644 --- a/server/src/main/java/org/opensearch/env/Environment.java +++ b/server/src/main/java/org/opensearch/env/Environment.java @@ -55,6 +55,8 @@ /** * The environment of where things exists. + * + * @opensearch.internal */ @SuppressForbidden(reason = "configures paths for the system") // TODO: move PathUtils to be package-private here instead of diff --git a/server/src/main/java/org/opensearch/env/NodeEnvironment.java b/server/src/main/java/org/opensearch/env/NodeEnvironment.java index 555ca990b736d..8a6c90952632d 100644 --- a/server/src/main/java/org/opensearch/env/NodeEnvironment.java +++ b/server/src/main/java/org/opensearch/env/NodeEnvironment.java @@ -107,6 +107,8 @@ /** * A component that holds all data paths for a single node. + * + * @opensearch.internal */ public final class NodeEnvironment implements Closeable { public static class NodePath { diff --git a/server/src/main/java/org/opensearch/env/NodeMetadata.java b/server/src/main/java/org/opensearch/env/NodeMetadata.java index cb6257002b62b..3944ecfd72d4c 100644 --- a/server/src/main/java/org/opensearch/env/NodeMetadata.java +++ b/server/src/main/java/org/opensearch/env/NodeMetadata.java @@ -48,6 +48,8 @@ /** * Metadata associated with this node: its persistent node ID and its version. * The metadata is persisted in the data folder of this node and is reused across restarts. + * + * @opensearch.internal */ public final class NodeMetadata { diff --git a/server/src/main/java/org/opensearch/env/NodeRepurposeCommand.java b/server/src/main/java/org/opensearch/env/NodeRepurposeCommand.java index dd4819f5804ac..2e9ea67a93944 100644 --- a/server/src/main/java/org/opensearch/env/NodeRepurposeCommand.java +++ b/server/src/main/java/org/opensearch/env/NodeRepurposeCommand.java @@ -59,6 +59,11 @@ import static org.opensearch.env.NodeEnvironment.INDICES_FOLDER; +/** + * Command to repurpose a node + * + * @opensearch.internal + */ public class NodeRepurposeCommand extends OpenSearchNodeCommand { static final String ABORTED_BY_USER_MSG = OpenSearchNodeCommand.ABORTED_BY_USER_MSG; diff --git a/server/src/main/java/org/opensearch/env/OpenSearchFileStore.java b/server/src/main/java/org/opensearch/env/OpenSearchFileStore.java index dce985f8320d4..834fb0e748915 100644 --- a/server/src/main/java/org/opensearch/env/OpenSearchFileStore.java +++ b/server/src/main/java/org/opensearch/env/OpenSearchFileStore.java @@ -49,6 +49,8 @@ * additional features, such as SSD detection and better * filesystem information for the root filesystem. * @see Environment#getFileStore(Path) + * + * @opensearch.internal */ class OpenSearchFileStore extends FileStore { /** Underlying filestore */ diff --git a/server/src/main/java/org/opensearch/env/OverrideNodeVersionCommand.java b/server/src/main/java/org/opensearch/env/OverrideNodeVersionCommand.java index ec92d00a88a6e..d07ea1acd25fa 100644 --- a/server/src/main/java/org/opensearch/env/OverrideNodeVersionCommand.java +++ b/server/src/main/java/org/opensearch/env/OverrideNodeVersionCommand.java @@ -43,6 +43,11 @@ import java.nio.file.Path; import java.util.Arrays; +/** + * Command to override a node version + * + * @opensearch.internal + */ public class OverrideNodeVersionCommand extends OpenSearchNodeCommand { private static final String TOO_NEW_MESSAGE = DELIMITER + "\n" diff --git a/server/src/main/java/org/opensearch/env/ShardLock.java b/server/src/main/java/org/opensearch/env/ShardLock.java index 21278a41dc76f..6e4cf7ebef016 100644 --- a/server/src/main/java/org/opensearch/env/ShardLock.java +++ b/server/src/main/java/org/opensearch/env/ShardLock.java @@ -43,6 +43,8 @@ * before executing any write operations on the shards data directory. * * @see NodeEnvironment + * + * @opensearch.internal */ public abstract class ShardLock implements Closeable { diff --git a/server/src/main/java/org/opensearch/env/ShardLockObtainFailedException.java b/server/src/main/java/org/opensearch/env/ShardLockObtainFailedException.java index 0bcd4c4128dbe..ea0715e063907 100644 --- a/server/src/main/java/org/opensearch/env/ShardLockObtainFailedException.java +++ b/server/src/main/java/org/opensearch/env/ShardLockObtainFailedException.java @@ -40,6 +40,8 @@ /** * Exception used when the in-memory lock for a shard cannot be obtained + * + * @opensearch.internal */ public class ShardLockObtainFailedException extends OpenSearchException { diff --git a/server/src/main/java/org/opensearch/gateway/AsyncShardFetch.java b/server/src/main/java/org/opensearch/gateway/AsyncShardFetch.java index e3c840b5d896e..6e359d690b1ec 100644 --- a/server/src/main/java/org/opensearch/gateway/AsyncShardFetch.java +++ b/server/src/main/java/org/opensearch/gateway/AsyncShardFetch.java @@ -69,6 +69,8 @@ * The async fetch logic maintains a map of which nodes are being fetched from in an async manner, * and once the results are back, it makes sure to schedule a reroute to make sure those results will * be taken into account. + * + * @opensearch.internal */ public abstract class AsyncShardFetch implements Releasable { diff --git a/server/src/main/java/org/opensearch/gateway/BaseGatewayShardAllocator.java b/server/src/main/java/org/opensearch/gateway/BaseGatewayShardAllocator.java index bbc78d78f4636..59ef894958cbe 100644 --- a/server/src/main/java/org/opensearch/gateway/BaseGatewayShardAllocator.java +++ b/server/src/main/java/org/opensearch/gateway/BaseGatewayShardAllocator.java @@ -53,6 +53,8 @@ * * Individual implementations of this class are responsible for providing * the logic to determine to which nodes (if any) those shards are allocated. + * + * @opensearch.internal */ public abstract class BaseGatewayShardAllocator { diff --git a/server/src/main/java/org/opensearch/gateway/ClusterStateUpdaters.java b/server/src/main/java/org/opensearch/gateway/ClusterStateUpdaters.java index b9913fa5983f7..4402da155ff5a 100644 --- a/server/src/main/java/org/opensearch/gateway/ClusterStateUpdaters.java +++ b/server/src/main/java/org/opensearch/gateway/ClusterStateUpdaters.java @@ -49,6 +49,11 @@ import static org.opensearch.gateway.GatewayService.STATE_NOT_RECOVERED_BLOCK; +/** + * Updates cluster state + * + * @opensearch.internal + */ public class ClusterStateUpdaters { private static final Logger logger = LogManager.getLogger(ClusterStateUpdaters.class); diff --git a/server/src/main/java/org/opensearch/gateway/CorruptStateException.java b/server/src/main/java/org/opensearch/gateway/CorruptStateException.java index 7c5aeb76e5118..3632dc057a053 100644 --- a/server/src/main/java/org/opensearch/gateway/CorruptStateException.java +++ b/server/src/main/java/org/opensearch/gateway/CorruptStateException.java @@ -36,6 +36,8 @@ /** * This exception is thrown when OpenSearch detects * an inconsistency in one of it's persistent states. + * + * @opensearch.internal */ public class CorruptStateException extends OpenSearchCorruptionException { diff --git a/server/src/main/java/org/opensearch/gateway/DanglingIndicesState.java b/server/src/main/java/org/opensearch/gateway/DanglingIndicesState.java index 25a1096919939..8c2a55fda3742 100644 --- a/server/src/main/java/org/opensearch/gateway/DanglingIndicesState.java +++ b/server/src/main/java/org/opensearch/gateway/DanglingIndicesState.java @@ -63,6 +63,8 @@ * The dangling indices state is responsible for finding new dangling indices (indices that have * their state written on disk, but don't exists in the metadata of the cluster), and importing * them into the cluster. + * + * @opensearch.internal */ public class DanglingIndicesState implements ClusterStateListener { diff --git a/server/src/main/java/org/opensearch/gateway/Gateway.java b/server/src/main/java/org/opensearch/gateway/Gateway.java index c25097723b8f7..1891c5020015c 100644 --- a/server/src/main/java/org/opensearch/gateway/Gateway.java +++ b/server/src/main/java/org/opensearch/gateway/Gateway.java @@ -47,6 +47,11 @@ import java.util.Arrays; import java.util.function.Function; +/** + * The Gateway + * + * @opensearch.internal + */ public class Gateway { private static final Logger logger = LogManager.getLogger(Gateway.class); diff --git a/server/src/main/java/org/opensearch/gateway/GatewayAllocator.java b/server/src/main/java/org/opensearch/gateway/GatewayAllocator.java index 76dc33e73a530..cdcf813d9ede0 100644 --- a/server/src/main/java/org/opensearch/gateway/GatewayAllocator.java +++ b/server/src/main/java/org/opensearch/gateway/GatewayAllocator.java @@ -63,6 +63,11 @@ import java.util.stream.Collectors; import java.util.stream.StreamSupport; +/** + * Allocator for the gateway + * + * @opensearch.internal + */ public class GatewayAllocator implements ExistingShardsAllocator { public static final String ALLOCATOR_NAME = "gateway_allocator"; diff --git a/server/src/main/java/org/opensearch/gateway/GatewayException.java b/server/src/main/java/org/opensearch/gateway/GatewayException.java index 262b45c9bba28..59313a3fe84a4 100644 --- a/server/src/main/java/org/opensearch/gateway/GatewayException.java +++ b/server/src/main/java/org/opensearch/gateway/GatewayException.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Base Exception for the gateway + * + * @opensearch.internal + */ public class GatewayException extends OpenSearchException { public GatewayException(StreamInput in) throws IOException { diff --git a/server/src/main/java/org/opensearch/gateway/GatewayMetaState.java b/server/src/main/java/org/opensearch/gateway/GatewayMetaState.java index 0ca70f37afa83..610219ab1f054 100644 --- a/server/src/main/java/org/opensearch/gateway/GatewayMetaState.java +++ b/server/src/main/java/org/opensearch/gateway/GatewayMetaState.java @@ -91,6 +91,8 @@ * the state being loaded when constructing the instance of this class is not necessarily the state that will be used as {@link * ClusterState#metadata()} because it might be stale or incomplete. Cluster-manager-eligible nodes must perform an election to find a complete and * non-stale state, and cluster-manager-ineligible nodes receive the real cluster state from the elected cluster-manager after joining the cluster. + * + * @opensearch.internal */ public class GatewayMetaState implements Closeable { diff --git a/server/src/main/java/org/opensearch/gateway/GatewayModule.java b/server/src/main/java/org/opensearch/gateway/GatewayModule.java index a58fe3657d27d..59ec0243c88c9 100644 --- a/server/src/main/java/org/opensearch/gateway/GatewayModule.java +++ b/server/src/main/java/org/opensearch/gateway/GatewayModule.java @@ -34,6 +34,11 @@ import org.opensearch.common.inject.AbstractModule; +/** + * Binds the gateway module + * + * @opensearch.internal + */ public class GatewayModule extends AbstractModule { @Override diff --git a/server/src/main/java/org/opensearch/gateway/GatewayService.java b/server/src/main/java/org/opensearch/gateway/GatewayService.java index 1a0efbcdf5bfb..06e92b7f0d7cf 100644 --- a/server/src/main/java/org/opensearch/gateway/GatewayService.java +++ b/server/src/main/java/org/opensearch/gateway/GatewayService.java @@ -60,6 +60,11 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Function; +/** + * The Gateway Service provider + * + * @opensearch.internal + */ public class GatewayService extends AbstractLifecycleComponent implements ClusterStateListener { private static final Logger logger = LogManager.getLogger(GatewayService.class); diff --git a/server/src/main/java/org/opensearch/gateway/IncrementalClusterStateWriter.java b/server/src/main/java/org/opensearch/gateway/IncrementalClusterStateWriter.java index 4933b70384960..3fdde3a3bad09 100644 --- a/server/src/main/java/org/opensearch/gateway/IncrementalClusterStateWriter.java +++ b/server/src/main/java/org/opensearch/gateway/IncrementalClusterStateWriter.java @@ -54,6 +54,8 @@ /** * Tracks the metadata written to disk, allowing updated metadata to be written incrementally (i.e. only writing out the changed metadata). + * + * @opensearch.internal */ public class IncrementalClusterStateWriter { diff --git a/server/src/main/java/org/opensearch/gateway/LocalAllocateDangledIndices.java b/server/src/main/java/org/opensearch/gateway/LocalAllocateDangledIndices.java index 4c29bc6f2692f..c100bbb9a7406 100644 --- a/server/src/main/java/org/opensearch/gateway/LocalAllocateDangledIndices.java +++ b/server/src/main/java/org/opensearch/gateway/LocalAllocateDangledIndices.java @@ -68,6 +68,11 @@ import static org.opensearch.cluster.metadata.MetadataIndexStateService.isIndexVerifiedBeforeClosed; +/** + * Allocates dangled indices + * + * @opensearch.internal + */ public class LocalAllocateDangledIndices { private static final Logger logger = LogManager.getLogger(LocalAllocateDangledIndices.class); diff --git a/server/src/main/java/org/opensearch/gateway/MetaStateService.java b/server/src/main/java/org/opensearch/gateway/MetaStateService.java index eb5a4adba9b0f..ffc9fe5cad0f1 100644 --- a/server/src/main/java/org/opensearch/gateway/MetaStateService.java +++ b/server/src/main/java/org/opensearch/gateway/MetaStateService.java @@ -54,6 +54,8 @@ /** * Handles writing and loading {@link Manifest}, {@link Metadata} and {@link IndexMetadata} + * + * @opensearch.internal */ public class MetaStateService { private static final Logger logger = LogManager.getLogger(MetaStateService.class); diff --git a/server/src/main/java/org/opensearch/gateway/MetadataStateFormat.java b/server/src/main/java/org/opensearch/gateway/MetadataStateFormat.java index fd1dee46815a8..db21d9cb8804e 100644 --- a/server/src/main/java/org/opensearch/gateway/MetadataStateFormat.java +++ b/server/src/main/java/org/opensearch/gateway/MetadataStateFormat.java @@ -75,6 +75,8 @@ * MetadataStateFormat is a base class to write checksummed * XContent based files to one or more directories in a standardized directory structure. * @param the type of the XContent base data-structure + * + * @opensearch.internal */ public abstract class MetadataStateFormat { public static final XContentType FORMAT = XContentType.SMILE; diff --git a/server/src/main/java/org/opensearch/gateway/PersistedClusterStateService.java b/server/src/main/java/org/opensearch/gateway/PersistedClusterStateService.java index 4bcd6bb9fc7a5..c3581265945b1 100644 --- a/server/src/main/java/org/opensearch/gateway/PersistedClusterStateService.java +++ b/server/src/main/java/org/opensearch/gateway/PersistedClusterStateService.java @@ -131,6 +131,8 @@ * +---------------------------+-------------------------+-------------------------------------------------------------------------------+ * * (the last-accepted term is recorded in Metadata → CoordinationMetadata so does not need repeating here) + * + * @opensearch.internal */ public class PersistedClusterStateService { private static final Logger logger = LogManager.getLogger(PersistedClusterStateService.class); diff --git a/server/src/main/java/org/opensearch/gateway/PrimaryShardAllocator.java b/server/src/main/java/org/opensearch/gateway/PrimaryShardAllocator.java index dbde8abf02d6d..b9cfebaa98521 100644 --- a/server/src/main/java/org/opensearch/gateway/PrimaryShardAllocator.java +++ b/server/src/main/java/org/opensearch/gateway/PrimaryShardAllocator.java @@ -74,6 +74,8 @@ * (see {@link org.opensearch.cluster.routing.allocation.allocator.BalancedShardsAllocator}), * nor does it allocate primaries when a primary shard failed and there is a valid replica * copy that can immediately be promoted to primary, as this takes place in {@link RoutingNodes#failShard}. + * + * @opensearch.internal */ public abstract class PrimaryShardAllocator extends BaseGatewayShardAllocator { /** diff --git a/server/src/main/java/org/opensearch/gateway/PriorityComparator.java b/server/src/main/java/org/opensearch/gateway/PriorityComparator.java index cf4cbf53daa37..7b3179a509057 100644 --- a/server/src/main/java/org/opensearch/gateway/PriorityComparator.java +++ b/server/src/main/java/org/opensearch/gateway/PriorityComparator.java @@ -51,6 +51,8 @@ *

    19. Lastly the index names are compared, which is useful when a date is baked into the index * name, e.g. logstash-2015.05.03
    20. *
    + * + * @opensearch.internal */ public abstract class PriorityComparator implements Comparator { diff --git a/server/src/main/java/org/opensearch/gateway/ReplicaShardAllocator.java b/server/src/main/java/org/opensearch/gateway/ReplicaShardAllocator.java index 64146201e29db..c0b831b6fe4d0 100644 --- a/server/src/main/java/org/opensearch/gateway/ReplicaShardAllocator.java +++ b/server/src/main/java/org/opensearch/gateway/ReplicaShardAllocator.java @@ -65,6 +65,11 @@ import static org.opensearch.cluster.routing.UnassignedInfo.INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING; +/** + * Allocates replica shards + * + * @opensearch.internal + */ public abstract class ReplicaShardAllocator extends BaseGatewayShardAllocator { /** * Process existing recoveries of replicas and see if we need to cancel them if we find a better diff --git a/server/src/main/java/org/opensearch/gateway/TransportNodesListGatewayMetaState.java b/server/src/main/java/org/opensearch/gateway/TransportNodesListGatewayMetaState.java index ce78962ef7843..ce9af1a7dd748 100644 --- a/server/src/main/java/org/opensearch/gateway/TransportNodesListGatewayMetaState.java +++ b/server/src/main/java/org/opensearch/gateway/TransportNodesListGatewayMetaState.java @@ -57,6 +57,11 @@ import java.io.IOException; import java.util.List; +/** + * Lists gateway meta state + * + * @opensearch.internal + */ public class TransportNodesListGatewayMetaState extends TransportNodesAction< TransportNodesListGatewayMetaState.Request, TransportNodesListGatewayMetaState.NodesGatewayMetaState, diff --git a/server/src/main/java/org/opensearch/gateway/TransportNodesListGatewayStartedShards.java b/server/src/main/java/org/opensearch/gateway/TransportNodesListGatewayStartedShards.java index 413bf0e23090d..11a2c8370ae7b 100644 --- a/server/src/main/java/org/opensearch/gateway/TransportNodesListGatewayStartedShards.java +++ b/server/src/main/java/org/opensearch/gateway/TransportNodesListGatewayStartedShards.java @@ -72,6 +72,8 @@ * This transport action is used to fetch the shard version from each node during primary allocation in {@link GatewayAllocator}. * We use this to find out which node holds the latest shard version and which of them used to be a primary in order to allocate * shards after node or cluster restarts. + * + * @opensearch.internal */ public class TransportNodesListGatewayStartedShards extends TransportNodesAction< TransportNodesListGatewayStartedShards.Request, diff --git a/server/src/main/java/org/opensearch/gateway/WriteStateException.java b/server/src/main/java/org/opensearch/gateway/WriteStateException.java index 11614397be5e5..e60eb0c11310d 100644 --- a/server/src/main/java/org/opensearch/gateway/WriteStateException.java +++ b/server/src/main/java/org/opensearch/gateway/WriteStateException.java @@ -37,6 +37,8 @@ /** * This exception is thrown when there is a problem of writing state to disk. + * + * @opensearch.internal */ public class WriteStateException extends IOException { private final boolean dirty; diff --git a/server/src/main/java/org/opensearch/http/AbstractHttpServerTransport.java b/server/src/main/java/org/opensearch/http/AbstractHttpServerTransport.java index 8d98370a90538..eb0a9a14836e8 100644 --- a/server/src/main/java/org/opensearch/http/AbstractHttpServerTransport.java +++ b/server/src/main/java/org/opensearch/http/AbstractHttpServerTransport.java @@ -78,6 +78,11 @@ import static org.opensearch.http.HttpTransportSettings.SETTING_HTTP_PUBLISH_HOST; import static org.opensearch.http.HttpTransportSettings.SETTING_HTTP_PUBLISH_PORT; +/** + * Base HttpServer class + * + * @opensearch.internal + */ public abstract class AbstractHttpServerTransport extends AbstractLifecycleComponent implements HttpServerTransport { private static final Logger logger = LogManager.getLogger(AbstractHttpServerTransport.class); private static final ActionListener NO_OP = ActionListener.wrap(() -> {}); diff --git a/server/src/main/java/org/opensearch/http/BindHttpException.java b/server/src/main/java/org/opensearch/http/BindHttpException.java index cfa537fca9bb7..0f0e7198db548 100644 --- a/server/src/main/java/org/opensearch/http/BindHttpException.java +++ b/server/src/main/java/org/opensearch/http/BindHttpException.java @@ -36,6 +36,11 @@ import java.io.IOException; +/** + * Exception thrown when trying to bind to an http endpoint + * + * @opensearch.internal + */ public class BindHttpException extends HttpException { public BindHttpException(String message) { diff --git a/server/src/main/java/org/opensearch/http/CorsHandler.java b/server/src/main/java/org/opensearch/http/CorsHandler.java index 0b2cedf093f33..3a16c8f82e40c 100644 --- a/server/src/main/java/org/opensearch/http/CorsHandler.java +++ b/server/src/main/java/org/opensearch/http/CorsHandler.java @@ -84,6 +84,8 @@ * * It modifies the original netty code to operate on OpenSearch http request/response abstractions. * Additionally, it removes CORS features that are not used by OpenSearch. + * + * @opensearch.internal */ public class CorsHandler { diff --git a/server/src/main/java/org/opensearch/http/DefaultRestChannel.java b/server/src/main/java/org/opensearch/http/DefaultRestChannel.java index d94eadf82463a..9df59cbb6f377 100644 --- a/server/src/main/java/org/opensearch/http/DefaultRestChannel.java +++ b/server/src/main/java/org/opensearch/http/DefaultRestChannel.java @@ -58,6 +58,8 @@ /** * The default rest channel for incoming requests. This class implements the basic logic for sending a rest * response. It will set necessary headers nad ensure that bytes are released after the response is sent. + * + * @opensearch.internal */ public class DefaultRestChannel extends AbstractRestChannel implements RestChannel { diff --git a/server/src/main/java/org/opensearch/http/HttpChannel.java b/server/src/main/java/org/opensearch/http/HttpChannel.java index c309a8c5decad..a3a3d46f629ce 100644 --- a/server/src/main/java/org/opensearch/http/HttpChannel.java +++ b/server/src/main/java/org/opensearch/http/HttpChannel.java @@ -37,6 +37,11 @@ import java.net.InetSocketAddress; +/** + * Represents an HTTP comms channel + * + * @opensearch.internal + */ public interface HttpChannel extends CloseableChannel { /** diff --git a/server/src/main/java/org/opensearch/http/HttpException.java b/server/src/main/java/org/opensearch/http/HttpException.java index 70fb6a956b8a1..c5eb734bbe5fc 100644 --- a/server/src/main/java/org/opensearch/http/HttpException.java +++ b/server/src/main/java/org/opensearch/http/HttpException.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Exception thrown on HTTP requests + * + * @opensearch.internal + */ public class HttpException extends OpenSearchException { public HttpException(String message) { diff --git a/server/src/main/java/org/opensearch/http/HttpHandlingSettings.java b/server/src/main/java/org/opensearch/http/HttpHandlingSettings.java index 3e9d252bd64d3..37f754d591b22 100644 --- a/server/src/main/java/org/opensearch/http/HttpHandlingSettings.java +++ b/server/src/main/java/org/opensearch/http/HttpHandlingSettings.java @@ -46,6 +46,11 @@ import static org.opensearch.http.HttpTransportSettings.SETTING_HTTP_RESET_COOKIES; import static org.opensearch.http.HttpTransportSettings.SETTING_PIPELINING_MAX_EVENTS; +/** + * HTTP Settings + * + * @opensearch.internal + */ public class HttpHandlingSettings { private final int maxContentLength; diff --git a/server/src/main/java/org/opensearch/http/HttpInfo.java b/server/src/main/java/org/opensearch/http/HttpInfo.java index cf49d2621ccfa..58a36091c7f99 100644 --- a/server/src/main/java/org/opensearch/http/HttpInfo.java +++ b/server/src/main/java/org/opensearch/http/HttpInfo.java @@ -44,6 +44,11 @@ import java.io.IOException; +/** + * Information about an http connection + * + * @opensearch.internal + */ public class HttpInfo implements ReportingService.Info { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(HttpInfo.class); diff --git a/server/src/main/java/org/opensearch/http/HttpPipelinedMessage.java b/server/src/main/java/org/opensearch/http/HttpPipelinedMessage.java index 4b1a8fc3ddd18..879da973274e5 100644 --- a/server/src/main/java/org/opensearch/http/HttpPipelinedMessage.java +++ b/server/src/main/java/org/opensearch/http/HttpPipelinedMessage.java @@ -31,6 +31,11 @@ package org.opensearch.http; +/** + * Pipeline messages for http connections + * + * @opensearch.internal + */ public interface HttpPipelinedMessage extends Comparable { /** diff --git a/server/src/main/java/org/opensearch/http/HttpPipelinedRequest.java b/server/src/main/java/org/opensearch/http/HttpPipelinedRequest.java index 1ab0b0afd46eb..852c35e2417d4 100644 --- a/server/src/main/java/org/opensearch/http/HttpPipelinedRequest.java +++ b/server/src/main/java/org/opensearch/http/HttpPipelinedRequest.java @@ -39,6 +39,11 @@ import java.util.List; import java.util.Map; +/** + * Pipeline requests for http connections + * + * @opensearch.internal + */ public class HttpPipelinedRequest implements HttpRequest, HttpPipelinedMessage { private final int sequence; diff --git a/server/src/main/java/org/opensearch/http/HttpPipelinedResponse.java b/server/src/main/java/org/opensearch/http/HttpPipelinedResponse.java index 4729e8f47c5d6..c535d977c0e1a 100644 --- a/server/src/main/java/org/opensearch/http/HttpPipelinedResponse.java +++ b/server/src/main/java/org/opensearch/http/HttpPipelinedResponse.java @@ -31,6 +31,11 @@ package org.opensearch.http; +/** + * Pipeline responses for http connections + * + * @opensearch.internal + */ public class HttpPipelinedResponse implements HttpPipelinedMessage, HttpResponse { private final int sequence; diff --git a/server/src/main/java/org/opensearch/http/HttpPipeliningAggregator.java b/server/src/main/java/org/opensearch/http/HttpPipeliningAggregator.java index 46db0aa3a8c4f..df6eb01a0b157 100644 --- a/server/src/main/java/org/opensearch/http/HttpPipeliningAggregator.java +++ b/server/src/main/java/org/opensearch/http/HttpPipeliningAggregator.java @@ -38,6 +38,11 @@ import java.util.List; import java.util.PriorityQueue; +/** + * Aggregates HTTP requests + * + * @opensearch.internal + */ public class HttpPipeliningAggregator { private final int maxEventsHeld; diff --git a/server/src/main/java/org/opensearch/http/HttpReadTimeoutException.java b/server/src/main/java/org/opensearch/http/HttpReadTimeoutException.java index 86045f7bbbe28..2769ab12730bb 100644 --- a/server/src/main/java/org/opensearch/http/HttpReadTimeoutException.java +++ b/server/src/main/java/org/opensearch/http/HttpReadTimeoutException.java @@ -31,6 +31,11 @@ package org.opensearch.http; +/** + * Timeout Exception for HTTP read operations + * + * @opensearch.internal + */ public class HttpReadTimeoutException extends RuntimeException { public HttpReadTimeoutException(long readTimeoutMillis) { diff --git a/server/src/main/java/org/opensearch/http/HttpRequest.java b/server/src/main/java/org/opensearch/http/HttpRequest.java index e0d4e739f1fd4..83980c3539ddc 100644 --- a/server/src/main/java/org/opensearch/http/HttpRequest.java +++ b/server/src/main/java/org/opensearch/http/HttpRequest.java @@ -44,6 +44,8 @@ /** * A basic http request abstraction. Http modules needs to implement this interface to integrate with the * server package's rest handling. + * + * @opensearch.internal */ public interface HttpRequest { diff --git a/server/src/main/java/org/opensearch/http/HttpResponse.java b/server/src/main/java/org/opensearch/http/HttpResponse.java index bec0a6348cd07..3c8269f4400e7 100644 --- a/server/src/main/java/org/opensearch/http/HttpResponse.java +++ b/server/src/main/java/org/opensearch/http/HttpResponse.java @@ -35,6 +35,8 @@ /** * A basic http response abstraction. Http modules must implement this interface as the server package rest * handling needs to set http headers for a response. + * + * @opensearch.internal */ public interface HttpResponse { diff --git a/server/src/main/java/org/opensearch/http/HttpServerChannel.java b/server/src/main/java/org/opensearch/http/HttpServerChannel.java index 5b9ad2b36f0f4..e57f03c54ce24 100644 --- a/server/src/main/java/org/opensearch/http/HttpServerChannel.java +++ b/server/src/main/java/org/opensearch/http/HttpServerChannel.java @@ -36,6 +36,11 @@ import java.net.InetSocketAddress; +/** + * Http server channel + * + * @opensearch.internal + */ public interface HttpServerChannel extends CloseableChannel { /** diff --git a/server/src/main/java/org/opensearch/http/HttpServerTransport.java b/server/src/main/java/org/opensearch/http/HttpServerTransport.java index ad7378073f84f..425fa23047764 100644 --- a/server/src/main/java/org/opensearch/http/HttpServerTransport.java +++ b/server/src/main/java/org/opensearch/http/HttpServerTransport.java @@ -39,6 +39,11 @@ import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestRequest; +/** + * HTTP Transport server + * + * @opensearch.internal + */ public interface HttpServerTransport extends LifecycleComponent, ReportingService { String HTTP_SERVER_WORKER_THREAD_NAME_PREFIX = "http_server_worker"; diff --git a/server/src/main/java/org/opensearch/http/HttpStats.java b/server/src/main/java/org/opensearch/http/HttpStats.java index 11450abcab020..c454853659443 100644 --- a/server/src/main/java/org/opensearch/http/HttpStats.java +++ b/server/src/main/java/org/opensearch/http/HttpStats.java @@ -40,6 +40,11 @@ import java.io.IOException; +/** + * Stats for HTTP connections + * + * @opensearch.internal + */ public class HttpStats implements Writeable, ToXContentFragment { private final long serverOpen; diff --git a/server/src/main/java/org/opensearch/http/HttpTracer.java b/server/src/main/java/org/opensearch/http/HttpTracer.java index a57694dc9adf4..bdabbb04d57f3 100644 --- a/server/src/main/java/org/opensearch/http/HttpTracer.java +++ b/server/src/main/java/org/opensearch/http/HttpTracer.java @@ -48,6 +48,8 @@ /** * Http request trace logger. See {@link #maybeTraceRequest(RestRequest, Exception)} for details. + * + * @opensearch.internal */ class HttpTracer { diff --git a/server/src/main/java/org/opensearch/http/HttpTransportSettings.java b/server/src/main/java/org/opensearch/http/HttpTransportSettings.java index 8ab881907fc2e..4522a59d67c05 100644 --- a/server/src/main/java/org/opensearch/http/HttpTransportSettings.java +++ b/server/src/main/java/org/opensearch/http/HttpTransportSettings.java @@ -50,6 +50,11 @@ import static org.opensearch.common.settings.Setting.intSetting; import static org.opensearch.common.settings.Setting.listSetting; +/** + * Transport settings for http connections + * + * @opensearch.internal + */ public final class HttpTransportSettings { public static final Setting SETTING_CORS_ENABLED = Setting.boolSetting("http.cors.enabled", false, Property.NodeScope); diff --git a/server/src/main/java/org/opensearch/http/HttpUtils.java b/server/src/main/java/org/opensearch/http/HttpUtils.java index 825e3ad756e78..39eee29a57ac3 100644 --- a/server/src/main/java/org/opensearch/http/HttpUtils.java +++ b/server/src/main/java/org/opensearch/http/HttpUtils.java @@ -32,6 +32,11 @@ package org.opensearch.http; +/** + * Utility class for HTTP connections + * + * @opensearch.internal + */ public class HttpUtils { static final String CLOSE = "close"; diff --git a/server/src/main/java/org/opensearch/ingest/AbstractProcessor.java b/server/src/main/java/org/opensearch/ingest/AbstractProcessor.java index a9547f9edeb86..6c22d1b7d21c0 100644 --- a/server/src/main/java/org/opensearch/ingest/AbstractProcessor.java +++ b/server/src/main/java/org/opensearch/ingest/AbstractProcessor.java @@ -35,6 +35,8 @@ /** * An Abstract Processor that holds tag and description information * about the processor. + * + * @opensearch.internal */ public abstract class AbstractProcessor implements Processor { protected final String tag; diff --git a/server/src/main/java/org/opensearch/ingest/CompoundProcessor.java b/server/src/main/java/org/opensearch/ingest/CompoundProcessor.java index 0857cdd7f9f19..8cdbc487dc137 100644 --- a/server/src/main/java/org/opensearch/ingest/CompoundProcessor.java +++ b/server/src/main/java/org/opensearch/ingest/CompoundProcessor.java @@ -48,6 +48,8 @@ /** * A Processor that executes a list of other "processors". It executes a separate list of * "onFailureProcessors" when any of the processors throw an {@link Exception}. + * + * @opensearch.internal */ public class CompoundProcessor implements Processor { public static final String ON_FAILURE_MESSAGE_FIELD = "on_failure_message"; diff --git a/server/src/main/java/org/opensearch/ingest/ConditionalProcessor.java b/server/src/main/java/org/opensearch/ingest/ConditionalProcessor.java index dcb249d75afc6..7d4a2b32fbb5f 100644 --- a/server/src/main/java/org/opensearch/ingest/ConditionalProcessor.java +++ b/server/src/main/java/org/opensearch/ingest/ConditionalProcessor.java @@ -57,6 +57,11 @@ import static org.opensearch.ingest.ConfigurationUtils.newConfigurationException; +/** + * Ingest processor based on specific conditions + * + * @opensearch.internal + */ public class ConditionalProcessor extends AbstractProcessor implements WrappingProcessor { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(DynamicMap.class); diff --git a/server/src/main/java/org/opensearch/ingest/ConfigurationUtils.java b/server/src/main/java/org/opensearch/ingest/ConfigurationUtils.java index 2f8516181b5e3..1a49e7407942e 100644 --- a/server/src/main/java/org/opensearch/ingest/ConfigurationUtils.java +++ b/server/src/main/java/org/opensearch/ingest/ConfigurationUtils.java @@ -58,6 +58,11 @@ import static org.opensearch.script.Script.DEFAULT_TEMPLATE_LANG; +/** + * Utility class for ingest processor configurations + * + * @opensearch.internal + */ public final class ConfigurationUtils { public static final String TAG_KEY = "tag"; diff --git a/server/src/main/java/org/opensearch/ingest/DropProcessor.java b/server/src/main/java/org/opensearch/ingest/DropProcessor.java index 8a9662a31d7c9..b3110755fa2d2 100644 --- a/server/src/main/java/org/opensearch/ingest/DropProcessor.java +++ b/server/src/main/java/org/opensearch/ingest/DropProcessor.java @@ -37,6 +37,8 @@ /** * Drop processor only returns {@code null} for the execution result to indicate that any document * executed by it should not be indexed. + * + * @opensearch.internal */ public final class DropProcessor extends AbstractProcessor { diff --git a/server/src/main/java/org/opensearch/ingest/IngestDocument.java b/server/src/main/java/org/opensearch/ingest/IngestDocument.java index b18946486f8c6..e1759342da7ef 100644 --- a/server/src/main/java/org/opensearch/ingest/IngestDocument.java +++ b/server/src/main/java/org/opensearch/ingest/IngestDocument.java @@ -59,6 +59,8 @@ /** * Represents a single document being captured before indexing and holds the source and metadata (like id, type and index). + * + * @opensearch.internal */ public final class IngestDocument { diff --git a/server/src/main/java/org/opensearch/ingest/IngestInfo.java b/server/src/main/java/org/opensearch/ingest/IngestInfo.java index e8d4e0dc0a73e..75c3202c6e14c 100644 --- a/server/src/main/java/org/opensearch/ingest/IngestInfo.java +++ b/server/src/main/java/org/opensearch/ingest/IngestInfo.java @@ -43,6 +43,11 @@ import java.util.Set; import java.util.TreeSet; +/** + * Information about an ingest event + * + * @opensearch.internal + */ public class IngestInfo implements ReportingService.Info { private final Set processors; diff --git a/server/src/main/java/org/opensearch/ingest/IngestMetadata.java b/server/src/main/java/org/opensearch/ingest/IngestMetadata.java index 36fea51e2e2f2..f55ba28e9c304 100644 --- a/server/src/main/java/org/opensearch/ingest/IngestMetadata.java +++ b/server/src/main/java/org/opensearch/ingest/IngestMetadata.java @@ -54,6 +54,8 @@ /** * Holds the ingest pipelines that are available in the cluster + * + * @opensearch.internal */ public final class IngestMetadata implements Metadata.Custom { diff --git a/server/src/main/java/org/opensearch/ingest/IngestMetric.java b/server/src/main/java/org/opensearch/ingest/IngestMetric.java index aac8c810f772a..2d4a1dc9cfdee 100644 --- a/server/src/main/java/org/opensearch/ingest/IngestMetric.java +++ b/server/src/main/java/org/opensearch/ingest/IngestMetric.java @@ -43,6 +43,8 @@ * The scope is determined by the calling code. For example you can use this class to count all documents across all pipeline, * or you can use this class to count documents for a given pipeline or a specific processor. * This class does not make assumptions about it's given scope. + * + * @opensearch.internal */ class IngestMetric { diff --git a/server/src/main/java/org/opensearch/ingest/IngestProcessorException.java b/server/src/main/java/org/opensearch/ingest/IngestProcessorException.java index 72e1cde5cac69..eccc81cf62459 100644 --- a/server/src/main/java/org/opensearch/ingest/IngestProcessorException.java +++ b/server/src/main/java/org/opensearch/ingest/IngestProcessorException.java @@ -41,6 +41,8 @@ /** * A dedicated wrapper for exceptions encountered executing an ingest processor. The wrapper is needed as we currently only unwrap causes * for instances of {@link OpenSearchWrapperException}. + * + * @opensearch.internal */ public class IngestProcessorException extends OpenSearchException implements OpenSearchWrapperException { diff --git a/server/src/main/java/org/opensearch/ingest/IngestService.java b/server/src/main/java/org/opensearch/ingest/IngestService.java index cbd5fa71b27de..b8256fe896da4 100644 --- a/server/src/main/java/org/opensearch/ingest/IngestService.java +++ b/server/src/main/java/org/opensearch/ingest/IngestService.java @@ -92,6 +92,8 @@ /** * Holder class for several ingest related services. + * + * @opensearch.internal */ public class IngestService implements ClusterStateApplier, ReportingService { diff --git a/server/src/main/java/org/opensearch/ingest/IngestStats.java b/server/src/main/java/org/opensearch/ingest/IngestStats.java index c1b08cb7e62f9..115ae66113462 100644 --- a/server/src/main/java/org/opensearch/ingest/IngestStats.java +++ b/server/src/main/java/org/opensearch/ingest/IngestStats.java @@ -49,6 +49,11 @@ import java.util.Objects; import java.util.concurrent.TimeUnit; +/** + * Stats for an ingest processor pipeline + * + * @opensearch.internal + */ public class IngestStats implements Writeable, ToXContentFragment { private final Stats totalStats; private final List pipelineStats; diff --git a/server/src/main/java/org/opensearch/ingest/Pipeline.java b/server/src/main/java/org/opensearch/ingest/Pipeline.java index 7447213257c24..9b3725fd65d9d 100644 --- a/server/src/main/java/org/opensearch/ingest/Pipeline.java +++ b/server/src/main/java/org/opensearch/ingest/Pipeline.java @@ -47,6 +47,8 @@ /** * A pipeline is a list of {@link Processor} instances grouped under a unique id. + * + * @opensearch.internal */ public final class Pipeline { diff --git a/server/src/main/java/org/opensearch/ingest/PipelineConfiguration.java b/server/src/main/java/org/opensearch/ingest/PipelineConfiguration.java index 0e58cea3c9904..5bc4abd83d6b2 100644 --- a/server/src/main/java/org/opensearch/ingest/PipelineConfiguration.java +++ b/server/src/main/java/org/opensearch/ingest/PipelineConfiguration.java @@ -52,6 +52,8 @@ /** * Encapsulates a pipeline's id and configuration as a blob + * + * @opensearch.internal */ public final class PipelineConfiguration extends AbstractDiffable implements ToXContentObject { diff --git a/server/src/main/java/org/opensearch/ingest/PipelineProcessor.java b/server/src/main/java/org/opensearch/ingest/PipelineProcessor.java index 5bb651e84bc0b..62226ef7682cb 100644 --- a/server/src/main/java/org/opensearch/ingest/PipelineProcessor.java +++ b/server/src/main/java/org/opensearch/ingest/PipelineProcessor.java @@ -37,6 +37,11 @@ import java.util.Map; import java.util.function.BiConsumer; +/** + * Processes an ingest pipeline + * + * @opensearch.internal + */ public class PipelineProcessor extends AbstractProcessor { public static final String TYPE = "pipeline"; diff --git a/server/src/main/java/org/opensearch/ingest/Processor.java b/server/src/main/java/org/opensearch/ingest/Processor.java index 84fa0e9496bd7..e0f196dfcb115 100644 --- a/server/src/main/java/org/opensearch/ingest/Processor.java +++ b/server/src/main/java/org/opensearch/ingest/Processor.java @@ -50,6 +50,8 @@ * Whether changes are made and what exactly is modified is up to the implementation. * * Processors may get called concurrently and thus need to be thread-safe. + * + * @opensearch.internal */ public interface Processor { diff --git a/server/src/main/java/org/opensearch/ingest/ProcessorInfo.java b/server/src/main/java/org/opensearch/ingest/ProcessorInfo.java index b4ea371f8e3ba..eb8add867c2ac 100644 --- a/server/src/main/java/org/opensearch/ingest/ProcessorInfo.java +++ b/server/src/main/java/org/opensearch/ingest/ProcessorInfo.java @@ -41,6 +41,11 @@ import java.io.IOException; +/** + * Information about an ingest processor + * + * @opensearch.internal + */ public class ProcessorInfo implements Writeable, ToXContentObject, Comparable { private final String type; diff --git a/server/src/main/java/org/opensearch/ingest/TrackingResultProcessor.java b/server/src/main/java/org/opensearch/ingest/TrackingResultProcessor.java index efcb3b8d9840f..0362922617eee 100644 --- a/server/src/main/java/org/opensearch/ingest/TrackingResultProcessor.java +++ b/server/src/main/java/org/opensearch/ingest/TrackingResultProcessor.java @@ -44,6 +44,8 @@ /** * Processor to be used within Simulate API to keep track of processors executed in pipeline. + * + * @opensearch.internal */ public final class TrackingResultProcessor implements Processor { diff --git a/server/src/main/java/org/opensearch/ingest/ValueSource.java b/server/src/main/java/org/opensearch/ingest/ValueSource.java index c5936b0fa4a1a..fefa535797e27 100644 --- a/server/src/main/java/org/opensearch/ingest/ValueSource.java +++ b/server/src/main/java/org/opensearch/ingest/ValueSource.java @@ -49,6 +49,8 @@ /** * Holds a value. If the value is requested a copy is made and optionally template snippets are resolved too. + * + * @opensearch.internal */ public interface ValueSource { diff --git a/server/src/main/java/org/opensearch/ingest/WrappingProcessor.java b/server/src/main/java/org/opensearch/ingest/WrappingProcessor.java index 33db293b510eb..b40ff7be3eb24 100644 --- a/server/src/main/java/org/opensearch/ingest/WrappingProcessor.java +++ b/server/src/main/java/org/opensearch/ingest/WrappingProcessor.java @@ -35,6 +35,8 @@ /** * A srapping processor is one that encapsulates an inner processor, or a processor that the wrapped processor enacts upon. All processors * that contain an "inner" processor should implement this interface, such that the actual processor can be obtained. + * + * @opensearch.internal */ public interface WrappingProcessor extends Processor { diff --git a/server/src/main/java/org/opensearch/lucene/queries/MinDocQuery.java b/server/src/main/java/org/opensearch/lucene/queries/MinDocQuery.java index a7dbadb32ccf2..2af0237e800c0 100644 --- a/server/src/main/java/org/opensearch/lucene/queries/MinDocQuery.java +++ b/server/src/main/java/org/opensearch/lucene/queries/MinDocQuery.java @@ -48,7 +48,10 @@ import java.util.Objects; /** A {@link Query} that only matches documents that are greater than or equal - * to a configured doc ID. */ + * to a configured doc ID. + * + * @opensearch.internal + */ public final class MinDocQuery extends Query { // Matching documents depend on the sequence of segments that the index reader diff --git a/server/src/main/java/org/opensearch/lucene/queries/SearchAfterSortedDocQuery.java b/server/src/main/java/org/opensearch/lucene/queries/SearchAfterSortedDocQuery.java index 70cc73d2108cc..e417a2eaa7cf4 100644 --- a/server/src/main/java/org/opensearch/lucene/queries/SearchAfterSortedDocQuery.java +++ b/server/src/main/java/org/opensearch/lucene/queries/SearchAfterSortedDocQuery.java @@ -56,6 +56,7 @@ /** * A {@link Query} that only matches documents that are greater than the provided {@link FieldDoc}. * This works only if the index is sorted according to the given search {@link Sort}. + * @opensearch.internal */ public class SearchAfterSortedDocQuery extends Query { private final Sort sort; diff --git a/server/src/main/java/org/opensearch/node/AdaptiveSelectionStats.java b/server/src/main/java/org/opensearch/node/AdaptiveSelectionStats.java index 5102d78523abe..8501987e5bb8d 100644 --- a/server/src/main/java/org/opensearch/node/AdaptiveSelectionStats.java +++ b/server/src/main/java/org/opensearch/node/AdaptiveSelectionStats.java @@ -52,6 +52,8 @@ * Class representing statistics about adaptive replica selection. This includes * EWMA of queue size, service time, and response time, as well as outgoing * searches to each node and the "rank" based on the ARS formula. + * + * @opensearch.internal */ public class AdaptiveSelectionStats implements Writeable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/node/InternalSettingsPreparer.java b/server/src/main/java/org/opensearch/node/InternalSettingsPreparer.java index 0879b498ac41c..31af9163da59f 100644 --- a/server/src/main/java/org/opensearch/node/InternalSettingsPreparer.java +++ b/server/src/main/java/org/opensearch/node/InternalSettingsPreparer.java @@ -48,6 +48,11 @@ import org.opensearch.common.settings.SettingsException; import org.opensearch.env.Environment; +/** + * Prepares internal settings + * + * @opensearch.internal + */ public class InternalSettingsPreparer { private static final String SECRET_PROMPT_VALUE = "${prompt.secret}"; diff --git a/server/src/main/java/org/opensearch/node/Node.java b/server/src/main/java/org/opensearch/node/Node.java index b01e9cbaa2b66..a980878feec85 100644 --- a/server/src/main/java/org/opensearch/node/Node.java +++ b/server/src/main/java/org/opensearch/node/Node.java @@ -224,6 +224,8 @@ /** * A node represent a node within a cluster ({@code cluster.name}). The {@link #client()} can be used * in order to use a {@link Client} to perform actions/operations against the cluster. + * + * @opensearch.internal */ public class Node implements Closeable { public static final Setting WRITE_PORTS_FILE_SETTING = Setting.boolSetting("node.portsfile", false, Property.NodeScope); diff --git a/server/src/main/java/org/opensearch/node/NodeClosedException.java b/server/src/main/java/org/opensearch/node/NodeClosedException.java index f2b15cf301525..a62a8a4a23684 100644 --- a/server/src/main/java/org/opensearch/node/NodeClosedException.java +++ b/server/src/main/java/org/opensearch/node/NodeClosedException.java @@ -41,7 +41,7 @@ /** * An exception indicating that node is closed. * - * + * @opensearch.internal */ public class NodeClosedException extends OpenSearchException { diff --git a/server/src/main/java/org/opensearch/node/NodeRoleSettings.java b/server/src/main/java/org/opensearch/node/NodeRoleSettings.java index d690cfa4caa69..6caf859ee6bd3 100644 --- a/server/src/main/java/org/opensearch/node/NodeRoleSettings.java +++ b/server/src/main/java/org/opensearch/node/NodeRoleSettings.java @@ -40,6 +40,11 @@ import java.util.List; import java.util.stream.Collectors; +/** + * Settings for a node role + * + * @opensearch.internal + */ public class NodeRoleSettings { public static final Setting> NODE_ROLES_SETTING = Setting.listSetting( diff --git a/server/src/main/java/org/opensearch/node/NodeService.java b/server/src/main/java/org/opensearch/node/NodeService.java index cf79b1e1ebe22..ab98b47c7287b 100644 --- a/server/src/main/java/org/opensearch/node/NodeService.java +++ b/server/src/main/java/org/opensearch/node/NodeService.java @@ -60,6 +60,11 @@ import java.io.IOException; import java.util.concurrent.TimeUnit; +/** + * Services exposed to nodes + * + * @opensearch.internal + */ public class NodeService implements Closeable { private final Settings settings; private final ThreadPool threadPool; diff --git a/server/src/main/java/org/opensearch/node/NodeValidationException.java b/server/src/main/java/org/opensearch/node/NodeValidationException.java index a50c52176ea02..ef1500f1e4ede 100644 --- a/server/src/main/java/org/opensearch/node/NodeValidationException.java +++ b/server/src/main/java/org/opensearch/node/NodeValidationException.java @@ -41,6 +41,8 @@ * begins accepting network requests in * {@link Node#validateNodeBeforeAcceptingRequests(org.opensearch.bootstrap.BootstrapContext, BoundTransportAddress, List)}. * This exception is a checked exception that is declared as thrown from this method for the purpose of bubbling up to the user. + * + * @opensearch.internal */ public class NodeValidationException extends Exception { diff --git a/server/src/main/java/org/opensearch/node/ReportingService.java b/server/src/main/java/org/opensearch/node/ReportingService.java index 3d81a0f8976a5..97d4b2a1bafaa 100644 --- a/server/src/main/java/org/opensearch/node/ReportingService.java +++ b/server/src/main/java/org/opensearch/node/ReportingService.java @@ -35,6 +35,11 @@ import org.opensearch.common.io.stream.Writeable; import org.opensearch.common.xcontent.ToXContent; +/** + * Node reporting service + * + * @opensearch.internal + */ public interface ReportingService { I info(); diff --git a/server/src/main/java/org/opensearch/node/ResponseCollectorService.java b/server/src/main/java/org/opensearch/node/ResponseCollectorService.java index 869d84bc6e6b4..fd246a4ccb25e 100644 --- a/server/src/main/java/org/opensearch/node/ResponseCollectorService.java +++ b/server/src/main/java/org/opensearch/node/ResponseCollectorService.java @@ -53,6 +53,8 @@ * Collects statistics about queue size, response time, and service time of * tasks executed on each node, making the EWMA of the values available to the * coordinating node. + * + * @opensearch.internal */ public final class ResponseCollectorService implements ClusterStateListener { From 2002912e619e53c5a050701dda949c94a6c58a55 Mon Sep 17 00:00:00 2001 From: Tianli Feng Date: Fri, 6 May 2022 09:52:45 -0700 Subject: [PATCH 128/514] Add bwc version 1.3.3 (#3221) Signed-off-by: Tianli Feng --- .ci/bwcVersions | 1 + server/src/main/java/org/opensearch/Version.java | 1 + 2 files changed, 2 insertions(+) diff --git a/.ci/bwcVersions b/.ci/bwcVersions index 7b317d170d54c..f59bab9ad2270 100644 --- a/.ci/bwcVersions +++ b/.ci/bwcVersions @@ -39,4 +39,5 @@ BWC_VERSION: - "1.3.0" - "1.3.1" - "1.3.2" + - "1.3.3" - "2.0.0" diff --git a/server/src/main/java/org/opensearch/Version.java b/server/src/main/java/org/opensearch/Version.java index 405f5340dd505..ee0d9ba32a8e5 100644 --- a/server/src/main/java/org/opensearch/Version.java +++ b/server/src/main/java/org/opensearch/Version.java @@ -86,6 +86,7 @@ public class Version implements Comparable, ToXContentFragment { public static final Version V_1_3_0 = new Version(1030099, org.apache.lucene.util.Version.LUCENE_8_10_1); public static final Version V_1_3_1 = new Version(1030199, org.apache.lucene.util.Version.LUCENE_8_10_1); public static final Version V_1_3_2 = new Version(1030299, org.apache.lucene.util.Version.LUCENE_8_10_1); + public static final Version V_1_3_3 = new Version(1030399, org.apache.lucene.util.Version.LUCENE_8_10_1); public static final Version V_2_0_0 = new Version(2000099, org.apache.lucene.util.Version.LUCENE_9_1_0); public static final Version V_2_1_0 = new Version(2010099, org.apache.lucene.util.Version.LUCENE_9_1_0); public static final Version CURRENT = V_2_1_0; From 6519ad6171ebc883c8d0a46e1aff853fa4d59df1 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Fri, 6 May 2022 13:01:28 -0400 Subject: [PATCH 129/514] Bump HdrHistogram from 2.1.9 to 2.1.12 in /server (#2135) (#3200) * Bump HdrHistogram from 2.1.9 to 2.1.12 in /server Bumps [HdrHistogram](https://github.com/HdrHistogram/HdrHistogram) from 2.1.9 to 2.1.12. - [Release notes](https://github.com/HdrHistogram/HdrHistogram/releases) - [Commits](https://github.com/HdrHistogram/HdrHistogram/compare/HdrHistogram-2.1.9...HdrHistogram-2.1.12) --- updated-dependencies: - dependency-name: org.hdrhistogram:HdrHistogram dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Updating SHAs Signed-off-by: dependabot[bot] * Update test to match new behavior of HdrHistogram There was a [change in behavior in HdrHistogram][1] that causes the tests to fail with the new version. The fix here is to add another value in the test data set for the failing test, which has the result of making both versions of HdrHistogram agree on the percentile values. [1]: https://github.com/HdrHistogram/HdrHistogram/commit/5c7226c4ffc0e603390e4c70de3f1df35ce61a66 Signed-off-by: Andrew Ross * Remove unnecessary exclusion on third party audit Signed-off-by: Andrew Ross Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] Co-authored-by: Andrew Ross (cherry picked from commit bce7f499442f8ca1f89fb4d41abcc3c5d075d80e) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../190_percentiles_hdr_metric.yml | 18 ++++++++++++++---- server/build.gradle | 6 +----- server/licenses/HdrHistogram-2.1.12.jar.sha1 | 1 + server/licenses/HdrHistogram-2.1.9.jar.sha1 | 1 - 4 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 server/licenses/HdrHistogram-2.1.12.jar.sha1 delete mode 100644 server/licenses/HdrHistogram-2.1.9.jar.sha1 diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/190_percentiles_hdr_metric.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/190_percentiles_hdr_metric.yml index 32c349c5e46b6..fd7e17306abd9 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/190_percentiles_hdr_metric.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/190_percentiles_hdr_metric.yml @@ -160,6 +160,16 @@ setup: --- "Filtered test": + - do: + bulk: + refresh: true + body: + - index: + _index: test_1 + _id: 5 + - int_field: 126 + double_field: 126.0 + string_field: foo - do: search: rest_total_hits_as_int: true @@ -180,14 +190,14 @@ setup: field: double_field hdr: {} - - match: { hits.total: 3 } - - length: { hits.hits: 3 } + - match: { hits.total: 4 } + - length: { hits.hits: 4 } - match: { aggregations.percentiles_int.values.1\.0: 51.0 } - match: { aggregations.percentiles_int.values.5\.0: 51.0 } - match: { aggregations.percentiles_int.values.25\.0: 51.0 } - match: { aggregations.percentiles_int.values.50\.0: 101.03125 } - - match: { aggregations.percentiles_int.values.75\.0: 101.03125 } + - match: { aggregations.percentiles_int.values.75\.0: 126.03125 } - match: { aggregations.percentiles_int.values.95\.0: 151.09375 } - match: { aggregations.percentiles_int.values.99\.0: 151.09375 } @@ -195,7 +205,7 @@ setup: - match: { aggregations.percentiles_double.values.5\.0: 51.0 } - match: { aggregations.percentiles_double.values.25\.0: 51.0 } - match: { aggregations.percentiles_double.values.50\.0: 101.03125 } - - match: { aggregations.percentiles_double.values.75\.0: 101.03125 } + - match: { aggregations.percentiles_double.values.75\.0: 126.03125 } - match: { aggregations.percentiles_double.values.95\.0: 151.09375 } - match: { aggregations.percentiles_double.values.99\.0: 151.09375 } diff --git a/server/build.gradle b/server/build.gradle index 45ec2300008f2..4490b2ea170cf 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -121,7 +121,7 @@ dependencies { // percentiles aggregation api 'com.tdunning:t-digest:3.2' // precentil ranks aggregation - api 'org.hdrhistogram:HdrHistogram:2.1.9' + api 'org.hdrhistogram:HdrHistogram:2.1.12' // lucene spatial api "org.locationtech.spatial4j:spatial4j:${versions.spatial4j}", optional @@ -317,10 +317,6 @@ tasks.named("thirdPartyAudit").configure { 'com.google.common.geometry.S2$Metric', 'com.google.common.geometry.S2LatLng' ) - - if (BuildParams.runtimeJavaVersion > JavaVersion.VERSION_1_8) { - ignoreMissingClasses 'javax.xml.bind.DatatypeConverter' - } } tasks.named("dependencyLicenses").configure { diff --git a/server/licenses/HdrHistogram-2.1.12.jar.sha1 b/server/licenses/HdrHistogram-2.1.12.jar.sha1 new file mode 100644 index 0000000000000..9d20fa0e5f22d --- /dev/null +++ b/server/licenses/HdrHistogram-2.1.12.jar.sha1 @@ -0,0 +1 @@ +6eb7552156e0d517ae80cc2247be1427c8d90452 \ No newline at end of file diff --git a/server/licenses/HdrHistogram-2.1.9.jar.sha1 b/server/licenses/HdrHistogram-2.1.9.jar.sha1 deleted file mode 100644 index 2378df07b2c0c..0000000000000 --- a/server/licenses/HdrHistogram-2.1.9.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -e4631ce165eb400edecfa32e03d3f1be53dee754 \ No newline at end of file From c613e9014e012dea2f6e9eead45c4cbfc140024d Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Fri, 6 May 2022 11:01:52 -0700 Subject: [PATCH 130/514] Fixing plugin installation URL to consume build qualifier (#3193) (#3215) * Fixing the installation URL to consume build qualifier Signed-off-by: Sarat Vemulapalli * Fixing spotless Signed-off-by: Sarat Vemulapalli (cherry picked from commit ba6dc5d28bb16e49e067b379545c5f20c74945d2) Co-authored-by: Sarat Vemulapalli --- .../plugins/InstallPluginCommand.java | 7 ++++++- .../plugins/InstallPluginCommandTests.java | 20 +++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/distribution/tools/plugin-cli/src/main/java/org/opensearch/plugins/InstallPluginCommand.java b/distribution/tools/plugin-cli/src/main/java/org/opensearch/plugins/InstallPluginCommand.java index 8acf137043a92..cfb7dad780a6c 100644 --- a/distribution/tools/plugin-cli/src/main/java/org/opensearch/plugins/InstallPluginCommand.java +++ b/distribution/tools/plugin-cli/src/main/java/org/opensearch/plugins/InstallPluginCommand.java @@ -374,7 +374,12 @@ private String getOpenSearchUrl( stagingHash ); } else { - baseUrl = String.format(Locale.ROOT, "https://artifacts.opensearch.org/releases/plugins/%s/%s", pluginId, version); + baseUrl = String.format( + Locale.ROOT, + "https://artifacts.opensearch.org/releases/plugins/%s/%s", + pluginId, + Build.CURRENT.getQualifiedVersion() + ); } final String platformUrl = String.format( Locale.ROOT, diff --git a/distribution/tools/plugin-cli/src/test/java/org/opensearch/plugins/InstallPluginCommandTests.java b/distribution/tools/plugin-cli/src/test/java/org/opensearch/plugins/InstallPluginCommandTests.java index c1b4568759f4d..a5afe85152cc6 100644 --- a/distribution/tools/plugin-cli/src/test/java/org/opensearch/plugins/InstallPluginCommandTests.java +++ b/distribution/tools/plugin-cli/src/test/java/org/opensearch/plugins/InstallPluginCommandTests.java @@ -1049,7 +1049,7 @@ public void assertInstallPluginFromUrl( public void testOfficialPlugin() throws Exception { String url = "https://artifacts.opensearch.org/releases/plugins/analysis-icu/" - + Version.CURRENT + + Build.CURRENT.getQualifiedVersion() + "/analysis-icu-" + Build.CURRENT.getQualifiedVersion() + ".zip"; @@ -1093,7 +1093,7 @@ public void testOfficialPluginStaging() throws Exception { public void testOfficialPlatformPlugin() throws Exception { String url = "https://artifacts.opensearch.org/releases/plugins/analysis-icu/" - + Version.CURRENT + + Build.CURRENT.getQualifiedVersion() + "/analysis-icu-" + Platforms.PLATFORM_NAME + "-" @@ -1159,7 +1159,7 @@ public void testMavenChecksumWithoutFilename() throws Exception { public void testOfficialChecksumWithoutFilename() throws Exception { String url = "https://artifacts.opensearch.org/releases/plugins/analysis-icu/" - + Version.CURRENT + + Build.CURRENT.getQualifiedVersion() + "/analysis-icu-" + Build.CURRENT.getQualifiedVersion() + ".zip"; @@ -1184,7 +1184,7 @@ public void testOfficialChecksumWithoutFilename() throws Exception { public void testOfficialShaMissing() throws Exception { String url = "https://artifacts.opensearch.org/releases/plugins/analysis-icu/" - + Version.CURRENT + + Build.CURRENT.getQualifiedVersion() + "/analysis-icu-" + Build.CURRENT.getQualifiedVersion() + ".zip"; @@ -1229,7 +1229,7 @@ public void testMavenShaMissing() throws Exception { public void testInvalidShaFileMissingFilename() throws Exception { String url = "https://artifacts.opensearch.org/releases/plugins/analysis-icu/" - + Version.CURRENT + + Build.CURRENT.getQualifiedVersion() + "/analysis-icu-" + Build.CURRENT.getQualifiedVersion() + ".zip"; @@ -1254,7 +1254,7 @@ public void testInvalidShaFileMissingFilename() throws Exception { public void testInvalidShaFileMismatchFilename() throws Exception { String url = "https://artifacts.opensearch.org/releases/plugins/analysis-icu/" - + Version.CURRENT + + Build.CURRENT.getQualifiedVersion() + "/analysis-icu-" + Build.CURRENT.getQualifiedVersion() + ".zip"; @@ -1279,7 +1279,7 @@ public void testInvalidShaFileMismatchFilename() throws Exception { public void testInvalidShaFileContainingExtraLine() throws Exception { String url = "https://artifacts.opensearch.org/releases/plugins/analysis-icu/" - + Version.CURRENT + + Build.CURRENT.getQualifiedVersion() + "/analysis-icu-" + Build.CURRENT.getQualifiedVersion() + ".zip"; @@ -1304,7 +1304,7 @@ public void testInvalidShaFileContainingExtraLine() throws Exception { public void testSha512Mismatch() throws Exception { String url = "https://artifacts.opensearch.org/releases/plugins/analysis-icu/" - + Version.CURRENT + + Build.CURRENT.getQualifiedVersion() + "/analysis-icu-" + Build.CURRENT.getQualifiedVersion() + ".zip"; @@ -1349,7 +1349,7 @@ public void testSha1Mismatch() throws Exception { public void testPublicKeyIdMismatchToExpectedPublicKeyId() throws Exception { final String icu = "analysis-icu"; final String url = "https://artifacts.opensearch.org/releases/plugins/analysis-icu/" - + Version.CURRENT + + Build.CURRENT.getQualifiedVersion() + "/" + icu + "-" @@ -1386,7 +1386,7 @@ public void testPublicKeyIdMismatchToExpectedPublicKeyId() throws Exception { public void testFailedSignatureVerification() throws Exception { final String icu = "analysis-icu"; final String url = "https://artifacts.opensearch.org/releases/plugins/analysis-icu/" - + Version.CURRENT + + Build.CURRENT.getQualifiedVersion() + "/" + icu + "-" From 1d0be6d7bb6eadd828dae6e0e11ccadefa676f33 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Fri, 6 May 2022 12:00:38 -0700 Subject: [PATCH 131/514] Adding reta to codeowners (#2967) (#3229) Signed-off-by: Vacha Shah (cherry picked from commit 8033183c469fbc2a97ee32095b3dcd46f3dfc983) Co-authored-by: Vacha Shah --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 5dfa9099866d1..8b63b291a8a54 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,3 +1,3 @@ # This should match the owning team set up in https://github.com/orgs/opensearch-project/teams -* @opensearch-project/opensearch-core +* @opensearch-project/opensearch-core @reta From 7b56bf4ae21323aaa75bb0b97acf5bef52255055 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Fri, 6 May 2022 17:58:19 -0400 Subject: [PATCH 132/514] [Javadocs] add to o.o.rest, snapshots, and tasks packages (#3219) (#3230) Adds javadocs to org.opensearch.rest, snapshots, and tasks packages. Signed-off-by: Nicholas Walter Knize (cherry picked from commit 15161a86491569d94642f3a88174e1389218b303) Co-authored-by: Nick Knize --- .../java/org/opensearch/rest/AbstractRestChannel.java | 5 +++++ .../main/java/org/opensearch/rest/BaseRestHandler.java | 2 ++ .../main/java/org/opensearch/rest/BytesRestResponse.java | 5 +++++ .../java/org/opensearch/rest/DeprecationRestHandler.java | 2 ++ .../src/main/java/org/opensearch/rest/MethodHandlers.java | 2 ++ server/src/main/java/org/opensearch/rest/RestChannel.java | 2 ++ .../src/main/java/org/opensearch/rest/RestController.java | 5 +++++ server/src/main/java/org/opensearch/rest/RestHandler.java | 2 ++ .../java/org/opensearch/rest/RestHeaderDefinition.java | 2 ++ server/src/main/java/org/opensearch/rest/RestRequest.java | 5 +++++ .../main/java/org/opensearch/rest/RestRequestFilter.java | 2 ++ .../src/main/java/org/opensearch/rest/RestResponse.java | 5 +++++ server/src/main/java/org/opensearch/rest/RestStatus.java | 5 +++++ server/src/main/java/org/opensearch/rest/RestUtils.java | 5 +++++ .../org/opensearch/rest/action/RestActionListener.java | 2 ++ .../main/java/org/opensearch/rest/action/RestActions.java | 5 +++++ .../org/opensearch/rest/action/RestBuilderListener.java | 2 ++ .../opensearch/rest/action/RestCancellableNodeClient.java | 2 ++ .../rest/action/RestFieldCapabilitiesAction.java | 5 +++++ .../java/org/opensearch/rest/action/RestMainAction.java | 5 +++++ .../org/opensearch/rest/action/RestResponseListener.java | 2 ++ .../rest/action/RestStatusToXContentListener.java | 2 ++ .../opensearch/rest/action/RestToXContentListener.java | 2 ++ .../admin/cluster/RestAddVotingConfigExclusionAction.java | 5 +++++ .../rest/action/admin/cluster/RestCancelTasksAction.java | 5 +++++ .../action/admin/cluster/RestCleanupRepositoryAction.java | 2 ++ .../cluster/RestClearVotingConfigExclusionsAction.java | 5 +++++ .../action/admin/cluster/RestCloneSnapshotAction.java | 2 ++ .../admin/cluster/RestClusterAllocationExplainAction.java | 2 ++ .../admin/cluster/RestClusterGetSettingsAction.java | 5 +++++ .../action/admin/cluster/RestClusterHealthAction.java | 5 +++++ .../action/admin/cluster/RestClusterRerouteAction.java | 5 +++++ .../admin/cluster/RestClusterSearchShardsAction.java | 5 +++++ .../rest/action/admin/cluster/RestClusterStateAction.java | 5 +++++ .../rest/action/admin/cluster/RestClusterStatsAction.java | 5 +++++ .../admin/cluster/RestClusterUpdateSettingsAction.java | 5 +++++ .../action/admin/cluster/RestCreateSnapshotAction.java | 2 ++ .../action/admin/cluster/RestDeleteRepositoryAction.java | 2 ++ .../action/admin/cluster/RestDeleteSnapshotAction.java | 2 ++ .../admin/cluster/RestDeleteStoredScriptAction.java | 5 +++++ .../action/admin/cluster/RestGetRepositoriesAction.java | 2 ++ .../action/admin/cluster/RestGetScriptContextAction.java | 5 +++++ .../action/admin/cluster/RestGetScriptLanguageAction.java | 5 +++++ .../rest/action/admin/cluster/RestGetSnapshotsAction.java | 2 ++ .../action/admin/cluster/RestGetStoredScriptAction.java | 5 +++++ .../rest/action/admin/cluster/RestGetTaskAction.java | 5 +++++ .../rest/action/admin/cluster/RestListTasksAction.java | 5 +++++ .../action/admin/cluster/RestNodesHotThreadsAction.java | 5 +++++ .../rest/action/admin/cluster/RestNodesInfoAction.java | 5 +++++ .../rest/action/admin/cluster/RestNodesStatsAction.java | 5 +++++ .../rest/action/admin/cluster/RestNodesUsageAction.java | 5 +++++ .../admin/cluster/RestPendingClusterTasksAction.java | 5 +++++ .../action/admin/cluster/RestPutRepositoryAction.java | 2 ++ .../action/admin/cluster/RestPutStoredScriptAction.java | 5 +++++ .../admin/cluster/RestReloadSecureSettingsAction.java | 5 +++++ .../action/admin/cluster/RestRemoteClusterInfoAction.java | 5 +++++ .../action/admin/cluster/RestRestoreSnapshotAction.java | 2 ++ .../action/admin/cluster/RestSnapshotsStatusAction.java | 2 ++ .../action/admin/cluster/RestVerifyRepositoryAction.java | 5 +++++ .../cluster/dangling/RestDeleteDanglingIndexAction.java | 5 +++++ .../cluster/dangling/RestImportDanglingIndexAction.java | 5 +++++ .../cluster/dangling/RestListDanglingIndicesAction.java | 5 +++++ .../action/admin/indices/AliasesNotFoundException.java | 5 +++++ .../action/admin/indices/RestAddIndexBlockAction.java | 5 +++++ .../rest/action/admin/indices/RestAnalyzeAction.java | 5 +++++ .../action/admin/indices/RestClearIndicesCacheAction.java | 5 +++++ .../rest/action/admin/indices/RestCloseIndexAction.java | 5 +++++ .../action/admin/indices/RestCreateDataStreamAction.java | 5 +++++ .../rest/action/admin/indices/RestCreateIndexAction.java | 5 +++++ .../action/admin/indices/RestDataStreamsStatsAction.java | 5 +++++ .../admin/indices/RestDeleteComponentTemplateAction.java | 5 +++++ .../indices/RestDeleteComposableIndexTemplateAction.java | 5 +++++ .../action/admin/indices/RestDeleteDataStreamAction.java | 5 +++++ .../rest/action/admin/indices/RestDeleteIndexAction.java | 5 +++++ .../admin/indices/RestDeleteIndexTemplateAction.java | 5 +++++ .../rest/action/admin/indices/RestFlushAction.java | 5 +++++ .../rest/action/admin/indices/RestForceMergeAction.java | 5 +++++ .../rest/action/admin/indices/RestGetAliasesAction.java | 2 ++ .../admin/indices/RestGetComponentTemplateAction.java | 5 +++++ .../indices/RestGetComposableIndexTemplateAction.java | 5 +++++ .../action/admin/indices/RestGetDataStreamsAction.java | 5 +++++ .../action/admin/indices/RestGetFieldMappingAction.java | 5 +++++ .../action/admin/indices/RestGetIndexTemplateAction.java | 2 ++ .../rest/action/admin/indices/RestGetIndicesAction.java | 2 ++ .../rest/action/admin/indices/RestGetMappingAction.java | 5 +++++ .../rest/action/admin/indices/RestGetSettingsAction.java | 5 +++++ .../admin/indices/RestIndexDeleteAliasesAction.java | 5 +++++ .../action/admin/indices/RestIndexPutAliasAction.java | 5 +++++ .../action/admin/indices/RestIndicesAliasesAction.java | 5 +++++ .../action/admin/indices/RestIndicesSegmentsAction.java | 5 +++++ .../admin/indices/RestIndicesShardStoresAction.java | 2 ++ .../rest/action/admin/indices/RestIndicesStatsAction.java | 5 +++++ .../rest/action/admin/indices/RestOpenIndexAction.java | 5 +++++ .../admin/indices/RestPutComponentTemplateAction.java | 5 +++++ .../indices/RestPutComposableIndexTemplateAction.java | 5 +++++ .../action/admin/indices/RestPutIndexTemplateAction.java | 5 +++++ .../rest/action/admin/indices/RestPutMappingAction.java | 5 +++++ .../rest/action/admin/indices/RestRecoveryAction.java | 2 ++ .../rest/action/admin/indices/RestRefreshAction.java | 5 +++++ .../rest/action/admin/indices/RestResizeHandler.java | 5 +++++ .../rest/action/admin/indices/RestResolveIndexAction.java | 5 +++++ .../action/admin/indices/RestRolloverIndexAction.java | 5 +++++ .../admin/indices/RestSimulateIndexTemplateAction.java | 5 +++++ .../action/admin/indices/RestSimulateTemplateAction.java | 5 +++++ .../rest/action/admin/indices/RestSyncedFlushAction.java | 8 ++++++++ .../action/admin/indices/RestUpdateSettingsAction.java | 5 +++++ .../rest/action/admin/indices/RestUpgradeAction.java | 5 +++++ .../action/admin/indices/RestUpgradeStatusAction.java | 5 +++++ .../action/admin/indices/RestValidateQueryAction.java | 5 +++++ .../org/opensearch/rest/action/cat/AbstractCatAction.java | 5 +++++ .../org/opensearch/rest/action/cat/RestAliasAction.java | 5 +++++ .../opensearch/rest/action/cat/RestAllocationAction.java | 5 +++++ .../org/opensearch/rest/action/cat/RestCatAction.java | 5 +++++ .../opensearch/rest/action/cat/RestCatRecoveryAction.java | 2 ++ .../org/opensearch/rest/action/cat/RestCountAction.java | 5 +++++ .../opensearch/rest/action/cat/RestFielddataAction.java | 2 ++ .../org/opensearch/rest/action/cat/RestHealthAction.java | 5 +++++ .../org/opensearch/rest/action/cat/RestIndicesAction.java | 5 +++++ .../org/opensearch/rest/action/cat/RestMasterAction.java | 5 +++++ .../opensearch/rest/action/cat/RestNodeAttrsAction.java | 5 +++++ .../org/opensearch/rest/action/cat/RestNodesAction.java | 5 +++++ .../rest/action/cat/RestPendingClusterTasksAction.java | 5 +++++ .../org/opensearch/rest/action/cat/RestPluginsAction.java | 5 +++++ .../rest/action/cat/RestRepositoriesAction.java | 2 ++ .../opensearch/rest/action/cat/RestSegmentsAction.java | 5 +++++ .../org/opensearch/rest/action/cat/RestShardsAction.java | 5 +++++ .../opensearch/rest/action/cat/RestSnapshotAction.java | 2 ++ .../java/org/opensearch/rest/action/cat/RestTable.java | 5 +++++ .../org/opensearch/rest/action/cat/RestTasksAction.java | 5 +++++ .../opensearch/rest/action/cat/RestTemplatesAction.java | 5 +++++ .../opensearch/rest/action/cat/RestThreadPoolAction.java | 5 +++++ .../opensearch/rest/action/document/RestBulkAction.java | 2 ++ .../opensearch/rest/action/document/RestDeleteAction.java | 5 +++++ .../opensearch/rest/action/document/RestGetAction.java | 5 +++++ .../rest/action/document/RestGetSourceAction.java | 2 ++ .../opensearch/rest/action/document/RestIndexAction.java | 5 +++++ .../rest/action/document/RestMultiGetAction.java | 5 +++++ .../rest/action/document/RestMultiTermVectorsAction.java | 5 +++++ .../rest/action/document/RestTermVectorsAction.java | 2 ++ .../opensearch/rest/action/document/RestUpdateAction.java | 5 +++++ .../rest/action/ingest/RestDeletePipelineAction.java | 5 +++++ .../rest/action/ingest/RestGetPipelineAction.java | 5 +++++ .../rest/action/ingest/RestPutPipelineAction.java | 5 +++++ .../rest/action/ingest/RestSimulatePipelineAction.java | 5 +++++ .../rest/action/search/RestClearScrollAction.java | 5 +++++ .../opensearch/rest/action/search/RestCountAction.java | 5 +++++ .../opensearch/rest/action/search/RestExplainAction.java | 2 ++ .../rest/action/search/RestMultiSearchAction.java | 5 +++++ .../opensearch/rest/action/search/RestSearchAction.java | 5 +++++ .../rest/action/search/RestSearchScrollAction.java | 5 +++++ .../java/org/opensearch/script/AbstractSortScript.java | 5 +++++ .../opensearch/snapshots/AbortedSnapshotException.java | 5 +++++ .../snapshots/ConcurrentSnapshotExecutionException.java | 2 ++ .../opensearch/snapshots/EmptySnapshotsInfoService.java | 5 +++++ .../opensearch/snapshots/InFlightShardSnapshotStates.java | 2 ++ .../snapshots/InvalidSnapshotNameException.java | 2 ++ .../main/java/org/opensearch/snapshots/RestoreInfo.java | 2 ++ .../java/org/opensearch/snapshots/RestoreService.java | 2 ++ .../src/main/java/org/opensearch/snapshots/Snapshot.java | 2 ++ .../opensearch/snapshots/SnapshotCreationException.java | 2 ++ .../java/org/opensearch/snapshots/SnapshotException.java | 2 ++ .../main/java/org/opensearch/snapshots/SnapshotId.java | 2 ++ .../opensearch/snapshots/SnapshotInProgressException.java | 2 ++ .../main/java/org/opensearch/snapshots/SnapshotInfo.java | 2 ++ .../opensearch/snapshots/SnapshotMissingException.java | 2 ++ .../opensearch/snapshots/SnapshotRestoreException.java | 2 ++ .../org/opensearch/snapshots/SnapshotShardFailure.java | 2 ++ .../org/opensearch/snapshots/SnapshotShardSizeInfo.java | 5 +++++ .../org/opensearch/snapshots/SnapshotShardsService.java | 2 ++ .../main/java/org/opensearch/snapshots/SnapshotState.java | 2 ++ .../main/java/org/opensearch/snapshots/SnapshotUtils.java | 2 ++ .../org/opensearch/snapshots/SnapshotsInfoService.java | 5 +++++ .../java/org/opensearch/snapshots/SnapshotsService.java | 2 ++ .../snapshots/UpdateIndexShardSnapshotStatusRequest.java | 2 ++ .../snapshots/UpdateIndexShardSnapshotStatusResponse.java | 5 +++++ .../main/java/org/opensearch/tasks/CancellableTask.java | 2 ++ .../java/org/opensearch/tasks/LoggingTaskListener.java | 2 ++ .../src/main/java/org/opensearch/tasks/RawTaskStatus.java | 2 ++ .../src/main/java/org/opensearch/tasks/ResourceStats.java | 2 ++ .../main/java/org/opensearch/tasks/ResourceStatsType.java | 6 +++++- .../main/java/org/opensearch/tasks/ResourceUsageInfo.java | 2 ++ .../java/org/opensearch/tasks/ResourceUsageMetric.java | 5 +++++ server/src/main/java/org/opensearch/tasks/Task.java | 2 ++ .../main/java/org/opensearch/tasks/TaskAwareRequest.java | 2 ++ .../org/opensearch/tasks/TaskCancellationService.java | 5 +++++ .../java/org/opensearch/tasks/TaskCancelledException.java | 2 ++ server/src/main/java/org/opensearch/tasks/TaskId.java | 2 ++ server/src/main/java/org/opensearch/tasks/TaskInfo.java | 2 ++ .../src/main/java/org/opensearch/tasks/TaskListener.java | 2 ++ .../src/main/java/org/opensearch/tasks/TaskManager.java | 2 ++ .../main/java/org/opensearch/tasks/TaskResourceStats.java | 2 ++ .../main/java/org/opensearch/tasks/TaskResourceUsage.java | 2 ++ server/src/main/java/org/opensearch/tasks/TaskResult.java | 2 ++ .../java/org/opensearch/tasks/TaskResultsService.java | 2 ++ .../java/org/opensearch/tasks/ThreadResourceInfo.java | 2 ++ .../java/org/opensearch/threadpool/ExecutorBuilder.java | 2 +- 196 files changed, 760 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/opensearch/rest/AbstractRestChannel.java b/server/src/main/java/org/opensearch/rest/AbstractRestChannel.java index eb5fcccee3868..389841100afef 100644 --- a/server/src/main/java/org/opensearch/rest/AbstractRestChannel.java +++ b/server/src/main/java/org/opensearch/rest/AbstractRestChannel.java @@ -47,6 +47,11 @@ import static java.util.stream.Collectors.toSet; +/** + * Base REST channel + * + * @opensearch.api + */ public abstract class AbstractRestChannel implements RestChannel { private static final Predicate INCLUDE_FILTER = f -> f.charAt(0) != '-'; diff --git a/server/src/main/java/org/opensearch/rest/BaseRestHandler.java b/server/src/main/java/org/opensearch/rest/BaseRestHandler.java index bf2fe0f16cb0d..9838c4072e02e 100644 --- a/server/src/main/java/org/opensearch/rest/BaseRestHandler.java +++ b/server/src/main/java/org/opensearch/rest/BaseRestHandler.java @@ -66,6 +66,8 @@ * the transport requests executed by the associated client. While the context is fully copied over, not all the headers * are copied, but a selected few. It is possible to control what headers are copied over by returning them in * {@link ActionPlugin#getRestHeaders()}. + * + * @opensearch.api */ public abstract class BaseRestHandler implements RestHandler { diff --git a/server/src/main/java/org/opensearch/rest/BytesRestResponse.java b/server/src/main/java/org/opensearch/rest/BytesRestResponse.java index 7d2b49f3f0171..68b3cc664fcb1 100644 --- a/server/src/main/java/org/opensearch/rest/BytesRestResponse.java +++ b/server/src/main/java/org/opensearch/rest/BytesRestResponse.java @@ -52,6 +52,11 @@ import static org.opensearch.OpenSearchException.REST_EXCEPTION_SKIP_STACK_TRACE_DEFAULT; import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +/** + * REST response in bytes + * + * @opensearch.api + */ public class BytesRestResponse extends RestResponse { public static final String TEXT_CONTENT_TYPE = "text/plain; charset=UTF-8"; diff --git a/server/src/main/java/org/opensearch/rest/DeprecationRestHandler.java b/server/src/main/java/org/opensearch/rest/DeprecationRestHandler.java index 85a7f0f0281c5..e4e0acb2123eb 100644 --- a/server/src/main/java/org/opensearch/rest/DeprecationRestHandler.java +++ b/server/src/main/java/org/opensearch/rest/DeprecationRestHandler.java @@ -40,6 +40,8 @@ /** * {@code DeprecationRestHandler} provides a proxy for any existing {@link RestHandler} so that usage of the handler can be * logged using the {@link DeprecationLogger}. + * + * @opensearch.api */ public class DeprecationRestHandler implements RestHandler { diff --git a/server/src/main/java/org/opensearch/rest/MethodHandlers.java b/server/src/main/java/org/opensearch/rest/MethodHandlers.java index d8f5488dc2ee3..8c29bf2e66036 100644 --- a/server/src/main/java/org/opensearch/rest/MethodHandlers.java +++ b/server/src/main/java/org/opensearch/rest/MethodHandlers.java @@ -40,6 +40,8 @@ /** * Encapsulate multiple handlers for the same path, allowing different handlers for different HTTP verbs. + * + * @opensearch.api */ final class MethodHandlers { diff --git a/server/src/main/java/org/opensearch/rest/RestChannel.java b/server/src/main/java/org/opensearch/rest/RestChannel.java index e3108b6ca4b20..6d136a6cb6a7c 100644 --- a/server/src/main/java/org/opensearch/rest/RestChannel.java +++ b/server/src/main/java/org/opensearch/rest/RestChannel.java @@ -41,6 +41,8 @@ /** * A channel used to construct bytes / builder based outputs, and send responses. + * + * @opensearch.api */ public interface RestChannel { diff --git a/server/src/main/java/org/opensearch/rest/RestController.java b/server/src/main/java/org/opensearch/rest/RestController.java index f2030eb83a581..b576f8b83e5a0 100644 --- a/server/src/main/java/org/opensearch/rest/RestController.java +++ b/server/src/main/java/org/opensearch/rest/RestController.java @@ -75,6 +75,11 @@ import static org.opensearch.rest.RestStatus.NOT_ACCEPTABLE; import static org.opensearch.rest.RestStatus.OK; +/** + * OpenSearch REST controller + * + * @opensearch.api + */ public class RestController implements HttpServerTransport.Dispatcher { private static final Logger logger = LogManager.getLogger(RestController.class); diff --git a/server/src/main/java/org/opensearch/rest/RestHandler.java b/server/src/main/java/org/opensearch/rest/RestHandler.java index 9afa2d94b2044..14f54d371632d 100644 --- a/server/src/main/java/org/opensearch/rest/RestHandler.java +++ b/server/src/main/java/org/opensearch/rest/RestHandler.java @@ -43,6 +43,8 @@ /** * Handler for REST requests + * + * @opensearch.api */ @FunctionalInterface public interface RestHandler { diff --git a/server/src/main/java/org/opensearch/rest/RestHeaderDefinition.java b/server/src/main/java/org/opensearch/rest/RestHeaderDefinition.java index 7e7b851a42d6e..9bea8055077fe 100644 --- a/server/src/main/java/org/opensearch/rest/RestHeaderDefinition.java +++ b/server/src/main/java/org/opensearch/rest/RestHeaderDefinition.java @@ -35,6 +35,8 @@ /** * A definition for an http header that should be copied to the {@link org.opensearch.common.util.concurrent.ThreadContext} when * reading the request on the rest layer. + * + * @opensearch.api */ public final class RestHeaderDefinition { private final String name; diff --git a/server/src/main/java/org/opensearch/rest/RestRequest.java b/server/src/main/java/org/opensearch/rest/RestRequest.java index 7d11da7e122cd..65ba5b61eeddd 100644 --- a/server/src/main/java/org/opensearch/rest/RestRequest.java +++ b/server/src/main/java/org/opensearch/rest/RestRequest.java @@ -67,6 +67,11 @@ import static org.opensearch.common.unit.ByteSizeValue.parseBytesSizeValue; import static org.opensearch.common.unit.TimeValue.parseTimeValue; +/** + * REST Request + * + * @opensearch.api + */ public class RestRequest implements ToXContent.Params { // tchar pattern as defined by RFC7230 section 3.2.6 diff --git a/server/src/main/java/org/opensearch/rest/RestRequestFilter.java b/server/src/main/java/org/opensearch/rest/RestRequestFilter.java index 9b17dd4432552..e457ace80c8f7 100644 --- a/server/src/main/java/org/opensearch/rest/RestRequestFilter.java +++ b/server/src/main/java/org/opensearch/rest/RestRequestFilter.java @@ -48,6 +48,8 @@ /** * Identifies an object that supplies a filter for the content of a {@link RestRequest}. This interface should be implemented by a * {@link org.opensearch.rest.RestHandler} that expects there will be sensitive content in the body of the request such as a password + * + * @opensearch.api */ public interface RestRequestFilter { diff --git a/server/src/main/java/org/opensearch/rest/RestResponse.java b/server/src/main/java/org/opensearch/rest/RestResponse.java index 80d80cec3b30b..bbf6e5d34bd01 100644 --- a/server/src/main/java/org/opensearch/rest/RestResponse.java +++ b/server/src/main/java/org/opensearch/rest/RestResponse.java @@ -42,6 +42,11 @@ import java.util.Map; import java.util.Set; +/** + * OpenSearch REST response + * + * @opensearch.api + */ public abstract class RestResponse { private Map> customHeaders; diff --git a/server/src/main/java/org/opensearch/rest/RestStatus.java b/server/src/main/java/org/opensearch/rest/RestStatus.java index 5f50559ef0f51..0b0fdeb22fa03 100644 --- a/server/src/main/java/org/opensearch/rest/RestStatus.java +++ b/server/src/main/java/org/opensearch/rest/RestStatus.java @@ -42,6 +42,11 @@ import static java.util.Collections.unmodifiableMap; +/** + * OpenSearch REST status + * + * @opensearch.api + */ public enum RestStatus { /** * The client SHOULD continue with its request. This interim response is used to inform the client that the diff --git a/server/src/main/java/org/opensearch/rest/RestUtils.java b/server/src/main/java/org/opensearch/rest/RestUtils.java index 913910cead210..da2a14126d53c 100644 --- a/server/src/main/java/org/opensearch/rest/RestUtils.java +++ b/server/src/main/java/org/opensearch/rest/RestUtils.java @@ -42,6 +42,11 @@ import java.util.Map; import java.util.regex.Pattern; +/** + * REST utility class + * + * @opensearch.api + */ public class RestUtils { /** diff --git a/server/src/main/java/org/opensearch/rest/action/RestActionListener.java b/server/src/main/java/org/opensearch/rest/action/RestActionListener.java index d0e897ea811e0..d1c1c98b1b827 100644 --- a/server/src/main/java/org/opensearch/rest/action/RestActionListener.java +++ b/server/src/main/java/org/opensearch/rest/action/RestActionListener.java @@ -43,6 +43,8 @@ /** * An action listener that requires {@link #processResponse(Object)} to be implemented * and will automatically handle failures. + * + * @opensearch.api */ public abstract class RestActionListener implements ActionListener { diff --git a/server/src/main/java/org/opensearch/rest/action/RestActions.java b/server/src/main/java/org/opensearch/rest/action/RestActions.java index 7c5aaf4e763c3..59446eca33906 100644 --- a/server/src/main/java/org/opensearch/rest/action/RestActions.java +++ b/server/src/main/java/org/opensearch/rest/action/RestActions.java @@ -61,6 +61,11 @@ import static org.opensearch.index.query.AbstractQueryBuilder.parseInnerQueryBuilder; +/** + * REST actions + * + * @opensearch.api + */ public class RestActions { public static final ParseField _SHARDS_FIELD = new ParseField("_shards"); diff --git a/server/src/main/java/org/opensearch/rest/action/RestBuilderListener.java b/server/src/main/java/org/opensearch/rest/action/RestBuilderListener.java index 03e70388660de..07d1dcf180f0a 100644 --- a/server/src/main/java/org/opensearch/rest/action/RestBuilderListener.java +++ b/server/src/main/java/org/opensearch/rest/action/RestBuilderListener.java @@ -38,6 +38,8 @@ /** * A REST action listener that builds an {@link XContentBuilder} based response. + * + * @opensearch.api */ public abstract class RestBuilderListener extends RestResponseListener { diff --git a/server/src/main/java/org/opensearch/rest/action/RestCancellableNodeClient.java b/server/src/main/java/org/opensearch/rest/action/RestCancellableNodeClient.java index 046fb060733bf..ad84b6db0ed3e 100644 --- a/server/src/main/java/org/opensearch/rest/action/RestCancellableNodeClient.java +++ b/server/src/main/java/org/opensearch/rest/action/RestCancellableNodeClient.java @@ -58,6 +58,8 @@ /** * A {@linkplain Client} that cancels tasks executed locally when the provided {@link HttpChannel} * is closed before completion. + * + * @opensearch.api */ public class RestCancellableNodeClient extends FilterClient { private static final Map httpChannels = new ConcurrentHashMap<>(); diff --git a/server/src/main/java/org/opensearch/rest/action/RestFieldCapabilitiesAction.java b/server/src/main/java/org/opensearch/rest/action/RestFieldCapabilitiesAction.java index dea8e80687ed3..2c1087327776c 100644 --- a/server/src/main/java/org/opensearch/rest/action/RestFieldCapabilitiesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/RestFieldCapabilitiesAction.java @@ -47,6 +47,11 @@ import static org.opensearch.rest.RestRequest.Method.GET; import static org.opensearch.rest.RestRequest.Method.POST; +/** + * Transport action to get field capabilities + * + * @opensearch.api + */ public class RestFieldCapabilitiesAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/RestMainAction.java b/server/src/main/java/org/opensearch/rest/action/RestMainAction.java index a3a37ba7699d8..7c4ca1aabbcea 100644 --- a/server/src/main/java/org/opensearch/rest/action/RestMainAction.java +++ b/server/src/main/java/org/opensearch/rest/action/RestMainAction.java @@ -51,6 +51,11 @@ import static org.opensearch.rest.RestRequest.Method.GET; import static org.opensearch.rest.RestRequest.Method.HEAD; +/** + * Main OpenSearch Transport action + * + * @opensearch.api + */ public class RestMainAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/RestResponseListener.java b/server/src/main/java/org/opensearch/rest/action/RestResponseListener.java index 63d5400041265..4dd1aa912dd40 100644 --- a/server/src/main/java/org/opensearch/rest/action/RestResponseListener.java +++ b/server/src/main/java/org/opensearch/rest/action/RestResponseListener.java @@ -38,6 +38,8 @@ /** * A REST enabled action listener that has a basic onFailure implementation, and requires * sub classes to only implement {@link #buildResponse(Object)}. + * + * @opensearch.api */ public abstract class RestResponseListener extends RestActionListener { diff --git a/server/src/main/java/org/opensearch/rest/action/RestStatusToXContentListener.java b/server/src/main/java/org/opensearch/rest/action/RestStatusToXContentListener.java index ade2ed6c3bd65..6416c61140c8f 100644 --- a/server/src/main/java/org/opensearch/rest/action/RestStatusToXContentListener.java +++ b/server/src/main/java/org/opensearch/rest/action/RestStatusToXContentListener.java @@ -42,6 +42,8 @@ /** * Content listener that extracts that {@link RestStatus} from the response. + * + * @opensearch.api */ public class RestStatusToXContentListener extends RestToXContentListener { private final Function extractLocation; diff --git a/server/src/main/java/org/opensearch/rest/action/RestToXContentListener.java b/server/src/main/java/org/opensearch/rest/action/RestToXContentListener.java index 8ea55a4ccf493..cba79b0bc99d5 100644 --- a/server/src/main/java/org/opensearch/rest/action/RestToXContentListener.java +++ b/server/src/main/java/org/opensearch/rest/action/RestToXContentListener.java @@ -43,6 +43,8 @@ /** * A REST based action listener that assumes the response is of type {@link ToXContent} and automatically * builds an XContent based response (wrapping the toXContent in startObject/endObject). + * + * @opensearch.api */ public class RestToXContentListener extends RestResponseListener { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestAddVotingConfigExclusionAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestAddVotingConfigExclusionAction.java index c5f9d168a725c..f04985886084b 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestAddVotingConfigExclusionAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestAddVotingConfigExclusionAction.java @@ -49,6 +49,11 @@ import static org.opensearch.rest.RestRequest.Method.POST; +/** + * Transport action to add voting config exclusions + * + * @opensearch.api + */ public class RestAddVotingConfigExclusionAction extends BaseRestHandler { private static final TimeValue DEFAULT_TIMEOUT = TimeValue.timeValueSeconds(30L); private static final Logger logger = LogManager.getLogger(RestAddVotingConfigExclusionAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCancelTasksAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCancelTasksAction.java index 5415ad260b9e8..779d172b5d723 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCancelTasksAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCancelTasksAction.java @@ -49,6 +49,11 @@ import static org.opensearch.rest.RestRequest.Method.POST; import static org.opensearch.rest.action.admin.cluster.RestListTasksAction.listTasksResponseListener; +/** + * Transport action to cancel tasks + * + * @opensearch.api + */ public class RestCancelTasksAction extends BaseRestHandler { private final Supplier nodesInCluster; diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCleanupRepositoryAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCleanupRepositoryAction.java index befd643167238..c2112aa28f7ce 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCleanupRepositoryAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCleanupRepositoryAction.java @@ -48,6 +48,8 @@ /** * Cleans up a repository + * + * @opensearch.api */ public class RestCleanupRepositoryAction extends BaseRestHandler { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClearVotingConfigExclusionsAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClearVotingConfigExclusionsAction.java index 73a5a0c321b28..aa8a4879da5ca 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClearVotingConfigExclusionsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClearVotingConfigExclusionsAction.java @@ -45,6 +45,11 @@ import static java.util.Collections.singletonList; import static org.opensearch.rest.RestRequest.Method.DELETE; +/** + * Transport action to clear voting config exclusions + * + * @opensearch.api + */ public class RestClearVotingConfigExclusionsAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCloneSnapshotAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCloneSnapshotAction.java index 4aa8bd44c3620..416528271b1b7 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCloneSnapshotAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCloneSnapshotAction.java @@ -50,6 +50,8 @@ /** * Clones indices from one snapshot into another snapshot in the same repository + * + * @opensearch.api */ public class RestCloneSnapshotAction extends BaseRestHandler { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterAllocationExplainAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterAllocationExplainAction.java index b059e75870e87..a592b45eba805 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterAllocationExplainAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterAllocationExplainAction.java @@ -55,6 +55,8 @@ /** * Class handling cluster allocation explanation at the REST level + * + * @opensearch.api */ public class RestClusterAllocationExplainAction extends BaseRestHandler { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterGetSettingsAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterGetSettingsAction.java index 3917505c42496..a6d61c7771051 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterGetSettingsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterGetSettingsAction.java @@ -58,6 +58,11 @@ import static java.util.Collections.singletonList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * Transport action to get settings + * + * @opensearch.api + */ public class RestClusterGetSettingsAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestClusterGetSettingsAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterHealthAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterHealthAction.java index b00db3a7f6daf..29d26dd4e68fb 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterHealthAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterHealthAction.java @@ -55,6 +55,11 @@ import static org.opensearch.client.Requests.clusterHealthRequest; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * Transport action to get cluster health + * + * @opensearch.api + */ public class RestClusterHealthAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestClusterHealthAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterRerouteAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterRerouteAction.java index f375b572ef110..e1a4cab582f6b 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterRerouteAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterRerouteAction.java @@ -58,6 +58,11 @@ import static java.util.Collections.singletonList; import static org.opensearch.rest.RestRequest.Method.POST; +/** + * Transport action to reroute documents + * + * @opensearch.api + */ public class RestClusterRerouteAction extends BaseRestHandler { private static final ObjectParser PARSER = new ObjectParser<>("cluster_reroute"); static { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterSearchShardsAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterSearchShardsAction.java index 20cd11e0308fe..e1b1389c47891 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterSearchShardsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterSearchShardsAction.java @@ -49,6 +49,11 @@ import static org.opensearch.rest.RestRequest.Method.GET; import static org.opensearch.rest.RestRequest.Method.POST; +/** + * Transport action to search shards + * + * @opensearch.api + */ public class RestClusterSearchShardsAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterStateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterStateAction.java index d97d1a0a30e28..9f5133b62e478 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterStateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterStateAction.java @@ -64,6 +64,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * Transport action to get cluster state + * + * @opensearch.api + */ public class RestClusterStateAction extends BaseRestHandler { private final SettingsFilter settingsFilter; diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterStatsAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterStatsAction.java index 9bbabcdba146b..0766e838210fa 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterStatsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterStatsAction.java @@ -45,6 +45,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * Transport action to get cluster stats + * + * @opensearch.api + */ public class RestClusterStatsAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterUpdateSettingsAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterUpdateSettingsAction.java index f42abcfbc6e29..01805ec85fce0 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterUpdateSettingsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestClusterUpdateSettingsAction.java @@ -50,6 +50,11 @@ import static java.util.Collections.singletonList; import static org.opensearch.rest.RestRequest.Method.PUT; +/** + * Transport action to update cluster settings + * + * @opensearch.api + */ public class RestClusterUpdateSettingsAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestClusterUpdateSettingsAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCreateSnapshotAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCreateSnapshotAction.java index 78c19732b5475..eb6694f63becd 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCreateSnapshotAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestCreateSnapshotAction.java @@ -50,6 +50,8 @@ /** * Creates a new snapshot + * + * @opensearch.api */ public class RestCreateSnapshotAction extends BaseRestHandler { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteRepositoryAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteRepositoryAction.java index 7c8a797b9c924..448f6ef85b085 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteRepositoryAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteRepositoryAction.java @@ -48,6 +48,8 @@ /** * Unregisters a repository + * + * @opensearch.api */ public class RestDeleteRepositoryAction extends BaseRestHandler { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteSnapshotAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteSnapshotAction.java index 380a04dbcd387..4aff95eb600d8 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteSnapshotAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteSnapshotAction.java @@ -49,6 +49,8 @@ /** * Deletes a snapshot + * + * @opensearch.api */ public class RestDeleteSnapshotAction extends BaseRestHandler { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteStoredScriptAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteStoredScriptAction.java index e1e705383e66b..652285f1f46b9 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteStoredScriptAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestDeleteStoredScriptAction.java @@ -44,6 +44,11 @@ import static java.util.Collections.singletonList; import static org.opensearch.rest.RestRequest.Method.DELETE; +/** + * Transport action to delete stored script + * + * @opensearch.api + */ public class RestDeleteStoredScriptAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestDeleteStoredScriptAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetRepositoriesAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetRepositoriesAction.java index ddbad64cfd3dc..721f188da1077 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetRepositoriesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetRepositoriesAction.java @@ -53,6 +53,8 @@ /** * Returns repository information + * + * @opensearch.api */ public class RestGetRepositoriesAction extends BaseRestHandler { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetScriptContextAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetScriptContextAction.java index bc619b31a1d6a..5111397316b4c 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetScriptContextAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetScriptContextAction.java @@ -45,6 +45,11 @@ import static java.util.Collections.singletonList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * Transport action to get script context + * + * @opensearch.api + */ public class RestGetScriptContextAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetScriptLanguageAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetScriptLanguageAction.java index 4066781e8bb89..eacb9052ccab0 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetScriptLanguageAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetScriptLanguageAction.java @@ -45,6 +45,11 @@ import static java.util.Collections.singletonList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * Transport action to get script language + * + * @opensearch.api + */ public class RestGetScriptLanguageAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetSnapshotsAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetSnapshotsAction.java index 355071720c4ac..1932ae204624b 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetSnapshotsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetSnapshotsAction.java @@ -49,6 +49,8 @@ /** * Returns information about snapshot + * + * @opensearch.api */ public class RestGetSnapshotsAction extends BaseRestHandler { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetStoredScriptAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetStoredScriptAction.java index 43d386a4f3852..81cddb2cf01ca 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetStoredScriptAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetStoredScriptAction.java @@ -44,6 +44,11 @@ import static java.util.Collections.singletonList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * Transport action to get stored script + * + * @opensearch.api + */ public class RestGetStoredScriptAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestGetStoredScriptAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetTaskAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetTaskAction.java index 39ed666e71696..963ab43acef48 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetTaskAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestGetTaskAction.java @@ -46,6 +46,11 @@ import static java.util.Collections.singletonList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * Transport action to get task + * + * @opensearch.api + */ public class RestGetTaskAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestListTasksAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestListTasksAction.java index 058a822ab5f42..cb255b3dd2f2f 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestListTasksAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestListTasksAction.java @@ -57,6 +57,11 @@ import static java.util.Collections.singletonList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * Transport action to list tasks + * + * @opensearch.api + */ public class RestListTasksAction extends BaseRestHandler { private final Supplier nodesInCluster; diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestNodesHotThreadsAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestNodesHotThreadsAction.java index 880791d2fb7e2..3c9321a8abaa4 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestNodesHotThreadsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestNodesHotThreadsAction.java @@ -53,6 +53,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * Transport action to get hot threads + * + * @opensearch.api + */ public class RestNodesHotThreadsAction extends BaseRestHandler { private static final String formatDeprecatedMessageWithoutNodeID = "[%s] is a deprecated endpoint. " diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestNodesInfoAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestNodesInfoAction.java index dbb3ef68226f6..534ae087c0e9b 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestNodesInfoAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestNodesInfoAction.java @@ -50,6 +50,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * Transport action to get node info + * + * @opensearch.api + */ public class RestNodesInfoAction extends BaseRestHandler { static final Set ALLOWED_METRICS = NodesInfoRequest.Metric.allMetrics(); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestNodesStatsAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestNodesStatsAction.java index 3c66b0740536f..c0e956fc419d3 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestNodesStatsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestNodesStatsAction.java @@ -55,6 +55,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * Transport action to get nodes stats + * + * @opensearch.api + */ public class RestNodesStatsAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestNodesUsageAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestNodesUsageAction.java index f873a963ace30..bfa4181cb6e32 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestNodesUsageAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestNodesUsageAction.java @@ -54,6 +54,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * Transport action to get nodes usage + * + * @opensearch.api + */ public class RestNodesUsageAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPendingClusterTasksAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPendingClusterTasksAction.java index c6091adf9a57c..c8365ad4b8a2c 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPendingClusterTasksAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPendingClusterTasksAction.java @@ -45,6 +45,11 @@ import static java.util.Collections.singletonList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * Transport action to get pending cluster tasks + * + * @opensearch.api + */ public class RestPendingClusterTasksAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestPendingClusterTasksAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPutRepositoryAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPutRepositoryAction.java index 87aea07767b40..92dfa43a2cab6 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPutRepositoryAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPutRepositoryAction.java @@ -51,6 +51,8 @@ /** * Registers repositories + * + * @opensearch.api */ public class RestPutRepositoryAction extends BaseRestHandler { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPutStoredScriptAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPutStoredScriptAction.java index 4b5979d566b8c..9f11494a174ad 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPutStoredScriptAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestPutStoredScriptAction.java @@ -49,6 +49,11 @@ import static org.opensearch.rest.RestRequest.Method.POST; import static org.opensearch.rest.RestRequest.Method.PUT; +/** + * Transport action to put stored script + * + * @opensearch.api + */ public class RestPutStoredScriptAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestPutStoredScriptAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestReloadSecureSettingsAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestReloadSecureSettingsAction.java index 2d5db335ef939..5d8312d9fa2b2 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestReloadSecureSettingsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestReloadSecureSettingsAction.java @@ -59,6 +59,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.POST; +/** + * Transport action to reload secure settings + * + * @opensearch.api + */ public final class RestReloadSecureSettingsAction extends BaseRestHandler implements RestRequestFilter { static final ObjectParser PARSER = new ObjectParser<>( diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestRemoteClusterInfoAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestRemoteClusterInfoAction.java index ea6b0cd79eac9..28edba4db387d 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestRemoteClusterInfoAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestRemoteClusterInfoAction.java @@ -44,6 +44,11 @@ import static java.util.Collections.singletonList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * Transport action to get remote cluster information + * + * @opensearch.api + */ public final class RestRemoteClusterInfoAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestRestoreSnapshotAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestRestoreSnapshotAction.java index 091e1abdbe2ab..ce942cf84b056 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestRestoreSnapshotAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestRestoreSnapshotAction.java @@ -48,6 +48,8 @@ /** * Restores a snapshot + * + * @opensearch.api */ public class RestRestoreSnapshotAction extends BaseRestHandler { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestSnapshotsStatusAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestSnapshotsStatusAction.java index 78caad8f18522..e9a06647fbb19 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestSnapshotsStatusAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestSnapshotsStatusAction.java @@ -50,6 +50,8 @@ /** * Returns status of currently running snapshot + * + * @opensearch.api */ public class RestSnapshotsStatusAction extends BaseRestHandler { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestVerifyRepositoryAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestVerifyRepositoryAction.java index ee6d24119ca41..31e465d6002cf 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestVerifyRepositoryAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/RestVerifyRepositoryAction.java @@ -46,6 +46,11 @@ import static org.opensearch.client.Requests.verifyRepositoryRequest; import static org.opensearch.rest.RestRequest.Method.POST; +/** + * Transport action to verify a repository + * + * @opensearch.api + */ public class RestVerifyRepositoryAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestVerifyRepositoryAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/dangling/RestDeleteDanglingIndexAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/dangling/RestDeleteDanglingIndexAction.java index 40fbd028bde7a..eb57d0ca5b268 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/dangling/RestDeleteDanglingIndexAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/dangling/RestDeleteDanglingIndexAction.java @@ -48,6 +48,11 @@ import static org.opensearch.rest.RestRequest.Method.DELETE; import static org.opensearch.rest.RestStatus.ACCEPTED; +/** + * Transport action to delete dangling index + * + * @opensearch.api + */ public class RestDeleteDanglingIndexAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestDeleteDanglingIndexAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/dangling/RestImportDanglingIndexAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/dangling/RestImportDanglingIndexAction.java index 74c7340c2a7c5..222890f777573 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/dangling/RestImportDanglingIndexAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/dangling/RestImportDanglingIndexAction.java @@ -48,6 +48,11 @@ import org.opensearch.rest.RestStatus; import org.opensearch.rest.action.RestToXContentListener; +/** + * Transport action to import dangling index + * + * @opensearch.api + */ public class RestImportDanglingIndexAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestImportDanglingIndexAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/cluster/dangling/RestListDanglingIndicesAction.java b/server/src/main/java/org/opensearch/rest/action/admin/cluster/dangling/RestListDanglingIndicesAction.java index 13b13ac29ce01..c7c18fdf3f021 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/cluster/dangling/RestListDanglingIndicesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/cluster/dangling/RestListDanglingIndicesAction.java @@ -44,6 +44,11 @@ import static java.util.Collections.singletonList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * Transport action to list dangling index + * + * @opensearch.api + */ public class RestListDanglingIndicesAction extends BaseRestHandler { @Override public List routes() { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/AliasesNotFoundException.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/AliasesNotFoundException.java index dc86cb360783c..595b6a4b2ed70 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/AliasesNotFoundException.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/AliasesNotFoundException.java @@ -37,6 +37,11 @@ import java.io.IOException; import java.util.Arrays; +/** + * Exception thrown if an alias is not found + * + * @opensearch.api + */ public class AliasesNotFoundException extends ResourceNotFoundException { public AliasesNotFoundException(String... names) { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestAddIndexBlockAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestAddIndexBlockAction.java index 0df8721543a2c..b9b648e5bf3b4 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestAddIndexBlockAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestAddIndexBlockAction.java @@ -48,6 +48,11 @@ import static org.opensearch.rest.RestRequest.Method.PUT; +/** + * Transport action to add index block + * + * @opensearch.api + */ public class RestAddIndexBlockAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestAddIndexBlockAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestAnalyzeAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestAnalyzeAction.java index f5b8ad7bb1864..f61cf8ddbbd59 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestAnalyzeAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestAnalyzeAction.java @@ -47,6 +47,11 @@ import static org.opensearch.rest.RestRequest.Method.GET; import static org.opensearch.rest.RestRequest.Method.POST; +/** + * Transport action to analyze an action + * + * @opensearch.api + */ public class RestAnalyzeAction extends BaseRestHandler { public static class Fields { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestClearIndicesCacheAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestClearIndicesCacheAction.java index 603786c99a256..e4f0d7d006d87 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestClearIndicesCacheAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestClearIndicesCacheAction.java @@ -47,6 +47,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.POST; +/** + * Transport action to clear indices cache + * + * @opensearch.api + */ public class RestClearIndicesCacheAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestCloseIndexAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestCloseIndexAction.java index 98d75782bc741..f993f991e17a5 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestCloseIndexAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestCloseIndexAction.java @@ -49,6 +49,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.POST; +/** + * Transport action to close index + * + * @opensearch.api + */ public class RestCloseIndexAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestCloseIndexAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestCreateDataStreamAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestCreateDataStreamAction.java index 92662bb78e255..a65665b99138e 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestCreateDataStreamAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestCreateDataStreamAction.java @@ -41,6 +41,11 @@ import java.util.Collections; import java.util.List; +/** + * Transport action to create a data stream + * + * @opensearch.api + */ public class RestCreateDataStreamAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestCreateIndexAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestCreateIndexAction.java index 3c634106e68f1..247c8b5d591ad 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestCreateIndexAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestCreateIndexAction.java @@ -52,6 +52,11 @@ import static java.util.Collections.singletonMap; import static org.opensearch.rest.RestRequest.Method.PUT; +/** + * Transport action to create an index + * + * @opensearch.api + */ public class RestCreateIndexAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestIndexPutAliasAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDataStreamsStatsAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDataStreamsStatsAction.java index 2c7f27c5515a9..741be5c5ffc9c 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDataStreamsStatsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDataStreamsStatsAction.java @@ -44,6 +44,11 @@ import java.util.Arrays; import java.util.List; +/** + * Transport action to get data stream stats + * + * @opensearch.api + */ public class RestDataStreamsStatsAction extends BaseRestHandler { @Override public String getName() { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteComponentTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteComponentTemplateAction.java index 4486b090ec333..ab61c1ab8487e 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteComponentTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteComponentTemplateAction.java @@ -45,6 +45,11 @@ import static org.opensearch.rest.RestRequest.Method.DELETE; +/** + * Transport action to delete component template + * + * @opensearch.api + */ public class RestDeleteComponentTemplateAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestDeleteComponentTemplateAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteComposableIndexTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteComposableIndexTemplateAction.java index 69db0b273ca73..6c02d6b112240 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteComposableIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteComposableIndexTemplateAction.java @@ -45,6 +45,11 @@ import static org.opensearch.rest.RestRequest.Method.DELETE; +/** + * Transport action to delete composable index template + * + * @opensearch.api + */ public class RestDeleteComposableIndexTemplateAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestDeleteComposableIndexTemplateAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteDataStreamAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteDataStreamAction.java index 40e1add973b82..2665609511676 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteDataStreamAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteDataStreamAction.java @@ -42,6 +42,11 @@ import java.util.Collections; import java.util.List; +/** + * Transport action to delete data stream + * + * @opensearch.api + */ public class RestDeleteDataStreamAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteIndexAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteIndexAction.java index 50673e12fa623..c671c01eac24d 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteIndexAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteIndexAction.java @@ -48,6 +48,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.DELETE; +/** + * Transport action to delete index + * + * @opensearch.api + */ public class RestDeleteIndexAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestDeleteIndexAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteIndexTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteIndexTemplateAction.java index d17214d41b75c..db99e32fcb70d 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestDeleteIndexTemplateAction.java @@ -44,6 +44,11 @@ import static java.util.Collections.singletonList; import static org.opensearch.rest.RestRequest.Method.DELETE; +/** + * Transport action to delete index template + * + * @opensearch.api + */ public class RestDeleteIndexTemplateAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestDeleteIndexTemplateAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestFlushAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestFlushAction.java index 9fd88c0f4558d..03c91bced293f 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestFlushAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestFlushAction.java @@ -48,6 +48,11 @@ import static org.opensearch.rest.RestRequest.Method.GET; import static org.opensearch.rest.RestRequest.Method.POST; +/** + * Transport action to flush + * + * @opensearch.api + */ public class RestFlushAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestForceMergeAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestForceMergeAction.java index 6e2699228012e..e684cd27570b4 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestForceMergeAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestForceMergeAction.java @@ -48,6 +48,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.POST; +/** + * Transport action to force merge + * + * @opensearch.api + */ public class RestForceMergeAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestForceMergeAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetAliasesAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetAliasesAction.java index 44e2ace0f7cf4..7f74db57bf573 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetAliasesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetAliasesAction.java @@ -66,6 +66,8 @@ /** * The REST handler for get alias and head alias APIs. + * + * @opensearch.api */ public class RestGetAliasesAction extends BaseRestHandler { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetComponentTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetComponentTemplateAction.java index 69e983d547a1f..43db1d1706aa1 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetComponentTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetComponentTemplateAction.java @@ -51,6 +51,11 @@ import static org.opensearch.rest.RestStatus.NOT_FOUND; import static org.opensearch.rest.RestStatus.OK; +/** + * Transport action to get component template + * + * @opensearch.api + */ public class RestGetComponentTemplateAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestGetComponentTemplateAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetComposableIndexTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetComposableIndexTemplateAction.java index 8f3e58fd2298a..958b963ee59b6 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetComposableIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetComposableIndexTemplateAction.java @@ -51,6 +51,11 @@ import static org.opensearch.rest.RestStatus.NOT_FOUND; import static org.opensearch.rest.RestStatus.OK; +/** + * Transport action to get composable index template + * + * @opensearch.api + */ public class RestGetComposableIndexTemplateAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestGetComposableIndexTemplateAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetDataStreamsAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetDataStreamsAction.java index 539ad671e5fd3..3cf27e324a336 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetDataStreamsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetDataStreamsAction.java @@ -41,6 +41,11 @@ import java.io.IOException; import java.util.List; +/** + * Transport action to get data streams + * + * @opensearch.api + */ public class RestGetDataStreamsAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetFieldMappingAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetFieldMappingAction.java index c35f417795377..dce688f32d0fd 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetFieldMappingAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetFieldMappingAction.java @@ -59,6 +59,11 @@ import static org.opensearch.rest.RestStatus.NOT_FOUND; import static org.opensearch.rest.RestStatus.OK; +/** + * Transport action to get field mapping + * + * @opensearch.api + */ public class RestGetFieldMappingAction extends BaseRestHandler { private static final Logger logger = LogManager.getLogger(RestGetFieldMappingAction.class); private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(logger.getName()); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetIndexTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetIndexTemplateAction.java index 617695f572817..486652086a865 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetIndexTemplateAction.java @@ -56,6 +56,8 @@ /** * The REST handler for get template and head template APIs. + * + * @opensearch.api */ public class RestGetIndexTemplateAction extends BaseRestHandler { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetIndicesAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetIndicesAction.java index d2ae85c32a3ef..e16c4c3865859 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetIndicesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetIndicesAction.java @@ -53,6 +53,8 @@ /** * The REST handler for get index and head index APIs. + * + * @opensearch.api */ public class RestGetIndicesAction extends BaseRestHandler { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetMappingAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetMappingAction.java index 8d00528c9c60e..381561c12ce35 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetMappingAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetMappingAction.java @@ -58,6 +58,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * Transport action to get mapping + * + * @opensearch.api + */ public class RestGetMappingAction extends BaseRestHandler { private final ThreadPool threadPool; diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetSettingsAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetSettingsAction.java index 81d98b9bc9cc1..70b1cd80d499e 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetSettingsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestGetSettingsAction.java @@ -48,6 +48,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * Transport action to get settings + * + * @opensearch.api + */ public class RestGetSettingsAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestGetSettingsAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndexDeleteAliasesAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndexDeleteAliasesAction.java index 44422c910d367..5321cf7442c7e 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndexDeleteAliasesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndexDeleteAliasesAction.java @@ -47,6 +47,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.DELETE; +/** + * Transport action to delete index aliases + * + * @opensearch.api + */ public class RestIndexDeleteAliasesAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestIndexPutAliasAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndexPutAliasAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndexPutAliasAction.java index f53a1c6d5b71a..8a70c739731dd 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndexPutAliasAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndexPutAliasAction.java @@ -50,6 +50,11 @@ import static org.opensearch.rest.RestRequest.Method.POST; import static org.opensearch.rest.RestRequest.Method.PUT; +/** + * Transport action to put alias(es) + * + * @opensearch.api + */ public class RestIndexPutAliasAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestIndexPutAliasAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndicesAliasesAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndicesAliasesAction.java index 9524428f172ea..46b986d03e254 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndicesAliasesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndicesAliasesAction.java @@ -46,6 +46,11 @@ import static java.util.Collections.singletonList; import static org.opensearch.rest.RestRequest.Method.POST; +/** + * Transport action to list alias(es) + * + * @opensearch.api + */ public class RestIndicesAliasesAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestIndicesAliasesAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndicesSegmentsAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndicesSegmentsAction.java index c635c8928bafd..3906c48295b4f 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndicesSegmentsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndicesSegmentsAction.java @@ -47,6 +47,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * Transport action to get segment information + * + * @opensearch.api + */ public class RestIndicesSegmentsAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndicesShardStoresAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndicesShardStoresAction.java index 6030fad4e8501..7f6ba57f5d55d 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndicesShardStoresAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndicesShardStoresAction.java @@ -55,6 +55,8 @@ /** * Rest action for {@link IndicesShardStoresAction} + * + * @opensearch.api */ public class RestIndicesShardStoresAction extends BaseRestHandler { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndicesStatsAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndicesStatsAction.java index eabe14a7614ac..ba1407b36bfd9 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndicesStatsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestIndicesStatsAction.java @@ -56,6 +56,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * Transport action to get indices stats + * + * @opensearch.api + */ public class RestIndicesStatsAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestOpenIndexAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestOpenIndexAction.java index 4193a12807b32..4a1445ab7d9fe 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestOpenIndexAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestOpenIndexAction.java @@ -49,6 +49,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.POST; +/** + * Transport action to open an index + * + * @opensearch.api + */ public class RestOpenIndexAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestOpenIndexAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutComponentTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutComponentTemplateAction.java index f7b4200dc5307..95a5cb9da4d72 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutComponentTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutComponentTemplateAction.java @@ -47,6 +47,11 @@ import static org.opensearch.rest.RestRequest.Method.POST; import static org.opensearch.rest.RestRequest.Method.PUT; +/** + * Transport action to put component template + * + * @opensearch.api + */ public class RestPutComponentTemplateAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestPutComponentTemplateAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutComposableIndexTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutComposableIndexTemplateAction.java index 23a527a368d7d..397e67d285d63 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutComposableIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutComposableIndexTemplateAction.java @@ -47,6 +47,11 @@ import static org.opensearch.rest.RestRequest.Method.POST; import static org.opensearch.rest.RestRequest.Method.PUT; +/** + * Transport action to put composable index templates + * + * @opensearch.api + */ public class RestPutComposableIndexTemplateAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestPutComposableIndexTemplateAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutIndexTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutIndexTemplateAction.java index ffd18356d0f5e..742161a4c1d06 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutIndexTemplateAction.java @@ -52,6 +52,11 @@ import static org.opensearch.rest.RestRequest.Method.POST; import static org.opensearch.rest.RestRequest.Method.PUT; +/** + * Transport action to put index template + * + * @opensearch.api + */ public class RestPutIndexTemplateAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestPutIndexTemplateAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutMappingAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutMappingAction.java index 9290e313fd939..fe489e4043815 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutMappingAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestPutMappingAction.java @@ -53,6 +53,11 @@ import static org.opensearch.rest.RestRequest.Method.POST; import static org.opensearch.rest.RestRequest.Method.PUT; +/** + * Transport action to put mapping + * + * @opensearch.api + */ public class RestPutMappingAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestPutMappingAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestRecoveryAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestRecoveryAction.java index 75e3bcc97c68e..33c7b239e27ce 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestRecoveryAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestRecoveryAction.java @@ -49,6 +49,8 @@ /** * REST handler to report on index recoveries. + * + * @opensearch.api */ public class RestRecoveryAction extends BaseRestHandler { diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestRefreshAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestRefreshAction.java index 28acfce57e3f3..2dc4c280956b5 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestRefreshAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestRefreshAction.java @@ -50,6 +50,11 @@ import static org.opensearch.rest.RestRequest.Method.GET; import static org.opensearch.rest.RestRequest.Method.POST; +/** + * Transport action to refresh + * + * @opensearch.api + */ public class RestRefreshAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestResizeHandler.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestResizeHandler.java index 3cdb63aa389be..b11535240b912 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestResizeHandler.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestResizeHandler.java @@ -53,6 +53,11 @@ import static org.opensearch.rest.RestRequest.Method.POST; import static org.opensearch.rest.RestRequest.Method.PUT; +/** + * Transport handler to resize indices + * + * @opensearch.api + */ public abstract class RestResizeHandler extends BaseRestHandler { private static final Logger logger = LogManager.getLogger(RestResizeHandler.class); private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(logger.getName()); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestResolveIndexAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestResolveIndexAction.java index c4d96ca74492d..687ff554bd8d4 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestResolveIndexAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestResolveIndexAction.java @@ -43,6 +43,11 @@ import java.io.IOException; import java.util.List; +/** + * Transport action to resolve index + * + * @opensearch.api + */ public class RestResolveIndexAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestRolloverIndexAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestRolloverIndexAction.java index f57ec5d0e6606..b5d327ca5e2d7 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestRolloverIndexAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestRolloverIndexAction.java @@ -47,6 +47,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.POST; +/** + * Transport action to rollover index + * + * @opensearch.api + */ public class RestRolloverIndexAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestRolloverIndexAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestSimulateIndexTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestSimulateIndexTemplateAction.java index 064fb686a1f67..a3e7ea5175fa8 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestSimulateIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestSimulateIndexTemplateAction.java @@ -47,6 +47,11 @@ import static org.opensearch.rest.RestRequest.Method.POST; +/** + * Transport action to simulate an index template + * + * @opensearch.api + */ public class RestSimulateIndexTemplateAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestSimulateIndexTemplateAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestSimulateTemplateAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestSimulateTemplateAction.java index 09ea8795b750f..812edaf542d4e 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestSimulateTemplateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestSimulateTemplateAction.java @@ -47,6 +47,11 @@ import static org.opensearch.rest.RestRequest.Method.POST; +/** + * Transport action to simulate a template + * + * @opensearch.api + */ public class RestSimulateTemplateAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestSimulateTemplateAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestSyncedFlushAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestSyncedFlushAction.java index 726fd69dc29c1..8d67aab6c474b 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestSyncedFlushAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestSyncedFlushAction.java @@ -55,6 +55,14 @@ import static org.opensearch.rest.RestRequest.Method.GET; import static org.opensearch.rest.RestRequest.Method.POST; +/** + * Transport action to execute a synced flush + * + * @opensearch.api + * + * @deprecated remove since synced flush is removed + */ +@Deprecated public class RestSyncedFlushAction extends BaseRestHandler { private static final DeprecationLogger DEPRECATION_LOGGER = DeprecationLogger.getLogger(RestSyncedFlushAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestUpdateSettingsAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestUpdateSettingsAction.java index a616a86cee2bc..50c1c9f84b5a5 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestUpdateSettingsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestUpdateSettingsAction.java @@ -51,6 +51,11 @@ import static org.opensearch.client.Requests.updateSettingsRequest; import static org.opensearch.rest.RestRequest.Method.PUT; +/** + * Transport action to update settings + * + * @opensearch.api + */ public class RestUpdateSettingsAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestUpdateSettingsAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestUpgradeAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestUpgradeAction.java index ba9dc76517852..1c925f030f582 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestUpgradeAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestUpgradeAction.java @@ -47,6 +47,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.POST; +/** + * Transport action to upgrade an index + * + * @opensearch.api + */ public class RestUpgradeAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestUpgradeStatusAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestUpgradeStatusAction.java index d5582fa5c4414..a05b52b708770 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestUpgradeStatusAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestUpgradeStatusAction.java @@ -47,6 +47,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * Transport action to get an upgrade status + * + * @opensearch.api + */ public class RestUpgradeStatusAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestValidateQueryAction.java b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestValidateQueryAction.java index bf300d5395b79..19bb559364385 100644 --- a/server/src/main/java/org/opensearch/rest/action/admin/indices/RestValidateQueryAction.java +++ b/server/src/main/java/org/opensearch/rest/action/admin/indices/RestValidateQueryAction.java @@ -56,6 +56,11 @@ import static org.opensearch.rest.RestRequest.Method.POST; import static org.opensearch.rest.RestStatus.OK; +/** + * Transport action to validate a query + * + * @opensearch.api + */ public class RestValidateQueryAction extends BaseRestHandler { @Override public List routes() { diff --git a/server/src/main/java/org/opensearch/rest/action/cat/AbstractCatAction.java b/server/src/main/java/org/opensearch/rest/action/cat/AbstractCatAction.java index d82a32cfc2c5d..abc08b9318ac1 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/AbstractCatAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/AbstractCatAction.java @@ -50,6 +50,11 @@ import static org.opensearch.rest.action.cat.RestTable.buildHelpWidths; import static org.opensearch.rest.action.cat.RestTable.pad; +/** + * Base Transport action class for _cat API + * + * @opensearch.api + */ public abstract class AbstractCatAction extends BaseRestHandler { protected abstract RestChannelConsumer doCatRequest(RestRequest request, NodeClient client); diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestAliasAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestAliasAction.java index 78e0134fe0bda..7aa91c175dbf0 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestAliasAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestAliasAction.java @@ -49,6 +49,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * _cat API action to list aliases + * + * @opensearch.api + */ public class RestAliasAction extends AbstractCatAction { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestAllocationAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestAllocationAction.java index 400fcb7cf0039..fc2837c068835 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestAllocationAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestAllocationAction.java @@ -57,6 +57,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * _cat API action to list shard allocations + * + * @opensearch.api + */ public class RestAllocationAction extends AbstractCatAction { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestAllocationAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestCatAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestCatAction.java index 2aaccdbdf6bf5..b0fd6dd03fe4e 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestCatAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestCatAction.java @@ -44,6 +44,11 @@ import static java.util.Collections.singletonList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * Base _cat API endpoint + * + * @opensearch.api + */ public class RestCatAction extends BaseRestHandler { private static final String CAT = "=^.^="; diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestCatRecoveryAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestCatRecoveryAction.java index 2dd7a2fddbf58..f18ace993599d 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestCatRecoveryAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestCatRecoveryAction.java @@ -60,6 +60,8 @@ * RestRecoveryAction provides information about the status of replica recovery * in a string format, designed to be used at the command line. An Index can * be specified to limit output to a particular index or indices. + * + * @opensearch.api */ public class RestCatRecoveryAction extends AbstractCatAction { diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestCountAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestCountAction.java index 033c9a278cabc..a35c0047a03bf 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestCountAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestCountAction.java @@ -53,6 +53,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * _cat API action to count documents in an index + * + * @opensearch.api + */ public class RestCountAction extends AbstractCatAction { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestFielddataAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestFielddataAction.java index 02de5f7301425..df70ee5943aad 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestFielddataAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestFielddataAction.java @@ -51,6 +51,8 @@ /** * Cat API class to display information about the size of fielddata fields per node + * + * @opensearch.api */ public class RestFielddataAction extends AbstractCatAction { diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestHealthAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestHealthAction.java index c05b0b9c77129..717df832d5d73 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestHealthAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestHealthAction.java @@ -46,6 +46,11 @@ import static java.util.Collections.singletonList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * _cat API action to get cluster health + * + * @opensearch.api + */ public class RestHealthAction extends AbstractCatAction { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestIndicesAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestIndicesAction.java index ed075d2ce7908..6468d93dd6478 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestIndicesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestIndicesAction.java @@ -80,6 +80,11 @@ import static org.opensearch.action.support.master.MasterNodeRequest.DEFAULT_MASTER_NODE_TIMEOUT; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * _cat API action to list indices + * + * @opensearch.api + */ public class RestIndicesAction extends AbstractCatAction { private static final DateFormatter STRICT_DATE_TIME_FORMATTER = DateFormatter.forPattern("strict_date_time"); diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java index 0826aa2cabb8d..f5245e88897c2 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java @@ -48,6 +48,11 @@ import static java.util.Collections.singletonList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * _cat API action to list cluster_manager information + * + * @opensearch.api + */ public class RestMasterAction extends AbstractCatAction { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestMasterAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestNodeAttrsAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestNodeAttrsAction.java index b8291c43183f0..9f8ab747e7674 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestNodeAttrsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestNodeAttrsAction.java @@ -55,6 +55,11 @@ import static java.util.Collections.singletonList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * _cat API action to get node attributes + * + * @opensearch.api + */ public class RestNodeAttrsAction extends AbstractCatAction { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestNodeAttrsAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestNodesAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestNodesAction.java index 39e9c445c1e38..445267d772827 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestNodesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestNodesAction.java @@ -82,6 +82,11 @@ import static java.util.Collections.singletonList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * _cat API action to get node information + * + * @opensearch.api + */ public class RestNodesAction extends AbstractCatAction { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestNodesAction.class); static final String LOCAL_DEPRECATED_MESSAGE = "Deprecated parameter [local] used. This parameter does not cause this API to act " diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestPendingClusterTasksAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestPendingClusterTasksAction.java index 27aa4c81d1dcc..9bcc5e357d383 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestPendingClusterTasksAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestPendingClusterTasksAction.java @@ -47,6 +47,11 @@ import static java.util.Collections.singletonList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * _cat API action to get pending cluster tasks + * + * @opensearch.api + */ public class RestPendingClusterTasksAction extends AbstractCatAction { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestPendingClusterTasksAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestPluginsAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestPluginsAction.java index f6a63baddbbe0..bcaab610f4aec 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestPluginsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestPluginsAction.java @@ -54,6 +54,11 @@ import static java.util.Collections.singletonList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * _cat API action to get plugin information + * + * @opensearch.api + */ public class RestPluginsAction extends AbstractCatAction { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestPluginsAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestRepositoriesAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestRepositoriesAction.java index 65c01ab16a99e..c41e84d7aaf06 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestRepositoriesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestRepositoriesAction.java @@ -49,6 +49,8 @@ /** * Cat API class to display information about snapshot repositories + * + * @opensearch.api */ public class RestRepositoriesAction extends AbstractCatAction { diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestSegmentsAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestSegmentsAction.java index 3adcce989ebe0..d07d895fd97eb 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestSegmentsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestSegmentsAction.java @@ -57,6 +57,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * _cat API action to get segments information + * + * @opensearch.api + */ public class RestSegmentsAction extends AbstractCatAction { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestSegmentsAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestShardsAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestShardsAction.java index 7ca8d053e19cf..7e6a157ca6885 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestShardsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestShardsAction.java @@ -74,6 +74,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * _cat API action to get shard information + * + * @opensearch.api + */ public class RestShardsAction extends AbstractCatAction { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestShardsAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestSnapshotAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestSnapshotAction.java index c1a0b2773a7f5..134b4a4b6d96e 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestSnapshotAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestSnapshotAction.java @@ -56,6 +56,8 @@ /** * Cat API class to display information about snapshots + * + * @opensearch.api */ public class RestSnapshotAction extends AbstractCatAction { diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestTable.java b/server/src/main/java/org/opensearch/rest/action/cat/RestTable.java index 542c428901475..43f28218bddcd 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestTable.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestTable.java @@ -60,6 +60,11 @@ import java.util.Map; import java.util.Set; +/** + * a REST table + * + * @opensearch.api + */ public class RestTable { public static RestResponse buildResponse(Table table, RestChannel channel) throws Exception { diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestTasksAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestTasksAction.java index a6624c2f8cfdc..d30086fb8cd55 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestTasksAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestTasksAction.java @@ -62,6 +62,11 @@ import static org.opensearch.rest.RestRequest.Method.GET; import static org.opensearch.rest.action.admin.cluster.RestListTasksAction.generateListTasksRequest; +/** + * _cat API action to get tasks information + * + * @opensearch.api + */ public class RestTasksAction extends AbstractCatAction { private final Supplier nodesInCluster; diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestTemplatesAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestTemplatesAction.java index b18f81a939682..9cbec0314d3e0 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestTemplatesAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestTemplatesAction.java @@ -53,6 +53,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * _cat API action to get template information + * + * @opensearch.api + */ public class RestTemplatesAction extends AbstractCatAction { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestTemplatesAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestThreadPoolAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestThreadPoolAction.java index dbfe12288940d..57dfca147f393 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestThreadPoolAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestThreadPoolAction.java @@ -67,6 +67,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * _cat API action to get threadpool information + * + * @opensearch.api + */ public class RestThreadPoolAction extends AbstractCatAction { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestThreadPoolAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/document/RestBulkAction.java b/server/src/main/java/org/opensearch/rest/action/document/RestBulkAction.java index c140514e3c92c..3fc02db0a8365 100644 --- a/server/src/main/java/org/opensearch/rest/action/document/RestBulkAction.java +++ b/server/src/main/java/org/opensearch/rest/action/document/RestBulkAction.java @@ -60,6 +60,8 @@ * { "create" : { "_index" : "test", "_id" : "1" } * { "type1" : { "field1" : "value1" } } * + * + * @opensearch.api */ public class RestBulkAction extends BaseRestHandler { diff --git a/server/src/main/java/org/opensearch/rest/action/document/RestDeleteAction.java b/server/src/main/java/org/opensearch/rest/action/document/RestDeleteAction.java index f9f5933a44c95..6b882369a883a 100644 --- a/server/src/main/java/org/opensearch/rest/action/document/RestDeleteAction.java +++ b/server/src/main/java/org/opensearch/rest/action/document/RestDeleteAction.java @@ -48,6 +48,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.DELETE; +/** + * Transport action to delete a document + * + * @opensearch.api + */ public class RestDeleteAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/document/RestGetAction.java b/server/src/main/java/org/opensearch/rest/action/document/RestGetAction.java index a0ec48ee55451..87bec22ac2d73 100644 --- a/server/src/main/java/org/opensearch/rest/action/document/RestGetAction.java +++ b/server/src/main/java/org/opensearch/rest/action/document/RestGetAction.java @@ -54,6 +54,11 @@ import static org.opensearch.rest.RestStatus.NOT_FOUND; import static org.opensearch.rest.RestStatus.OK; +/** + * Transport action to get a document + * + * @opensearch.api + */ public class RestGetAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/document/RestGetSourceAction.java b/server/src/main/java/org/opensearch/rest/action/document/RestGetSourceAction.java index 801ab85039d2d..ecd97ceada0fc 100644 --- a/server/src/main/java/org/opensearch/rest/action/document/RestGetSourceAction.java +++ b/server/src/main/java/org/opensearch/rest/action/document/RestGetSourceAction.java @@ -60,6 +60,8 @@ /** * The REST handler for get source and head source APIs. + * + * @opensearch.api */ public class RestGetSourceAction extends BaseRestHandler { diff --git a/server/src/main/java/org/opensearch/rest/action/document/RestIndexAction.java b/server/src/main/java/org/opensearch/rest/action/document/RestIndexAction.java index 75f3967c32ba7..ba3558f6fe80c 100644 --- a/server/src/main/java/org/opensearch/rest/action/document/RestIndexAction.java +++ b/server/src/main/java/org/opensearch/rest/action/document/RestIndexAction.java @@ -54,6 +54,11 @@ import static org.opensearch.rest.RestRequest.Method.POST; import static org.opensearch.rest.RestRequest.Method.PUT; +/** + * Transport action to index a document + * + * @opensearch.api + */ public class RestIndexAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/document/RestMultiGetAction.java b/server/src/main/java/org/opensearch/rest/action/document/RestMultiGetAction.java index 6713bddfd837d..e676cdf6f1beb 100644 --- a/server/src/main/java/org/opensearch/rest/action/document/RestMultiGetAction.java +++ b/server/src/main/java/org/opensearch/rest/action/document/RestMultiGetAction.java @@ -50,6 +50,11 @@ import static org.opensearch.rest.RestRequest.Method.GET; import static org.opensearch.rest.RestRequest.Method.POST; +/** + * Transport action to perform a multi get + * + * @opensearch.api + */ public class RestMultiGetAction extends BaseRestHandler { private final boolean allowExplicitIndex; diff --git a/server/src/main/java/org/opensearch/rest/action/document/RestMultiTermVectorsAction.java b/server/src/main/java/org/opensearch/rest/action/document/RestMultiTermVectorsAction.java index 66b0c004b9fb4..c453094f33120 100644 --- a/server/src/main/java/org/opensearch/rest/action/document/RestMultiTermVectorsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/document/RestMultiTermVectorsAction.java @@ -48,6 +48,11 @@ import static org.opensearch.rest.RestRequest.Method.GET; import static org.opensearch.rest.RestRequest.Method.POST; +/** + * Transport action to get a multi term vector + * + * @opensearch.api + */ public class RestMultiTermVectorsAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/document/RestTermVectorsAction.java b/server/src/main/java/org/opensearch/rest/action/document/RestTermVectorsAction.java index 727b90474082e..e2b14629e75f4 100644 --- a/server/src/main/java/org/opensearch/rest/action/document/RestTermVectorsAction.java +++ b/server/src/main/java/org/opensearch/rest/action/document/RestTermVectorsAction.java @@ -55,6 +55,8 @@ /** * This class parses the json request and translates it into a * TermVectorsRequest. + * + * @opensearch.api */ public class RestTermVectorsAction extends BaseRestHandler { public static final String TYPES_DEPRECATION_MESSAGE = "[types removal] " + "Specifying types in term vector requests is deprecated."; diff --git a/server/src/main/java/org/opensearch/rest/action/document/RestUpdateAction.java b/server/src/main/java/org/opensearch/rest/action/document/RestUpdateAction.java index 832d8da4a8fdd..b3683e7b49fd7 100644 --- a/server/src/main/java/org/opensearch/rest/action/document/RestUpdateAction.java +++ b/server/src/main/java/org/opensearch/rest/action/document/RestUpdateAction.java @@ -52,6 +52,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.POST; +/** + * Transport action to update a document + * + * @opensearch.api + */ public class RestUpdateAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/ingest/RestDeletePipelineAction.java b/server/src/main/java/org/opensearch/rest/action/ingest/RestDeletePipelineAction.java index 2e7c99fc89f5f..6a876e7c22d61 100644 --- a/server/src/main/java/org/opensearch/rest/action/ingest/RestDeletePipelineAction.java +++ b/server/src/main/java/org/opensearch/rest/action/ingest/RestDeletePipelineAction.java @@ -45,6 +45,11 @@ import static java.util.Collections.singletonList; import static org.opensearch.rest.RestRequest.Method.DELETE; +/** + * Transport action to delete an ingest pipeline + * + * @opensearch.api + */ public class RestDeletePipelineAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestDeletePipelineAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/ingest/RestGetPipelineAction.java b/server/src/main/java/org/opensearch/rest/action/ingest/RestGetPipelineAction.java index e652f45b95180..2463cc8e153c8 100644 --- a/server/src/main/java/org/opensearch/rest/action/ingest/RestGetPipelineAction.java +++ b/server/src/main/java/org/opensearch/rest/action/ingest/RestGetPipelineAction.java @@ -47,6 +47,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.GET; +/** + * Transport action to get an ingest pipeline + * + * @opensearch.api + */ public class RestGetPipelineAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestGetPipelineAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/ingest/RestPutPipelineAction.java b/server/src/main/java/org/opensearch/rest/action/ingest/RestPutPipelineAction.java index d044f3cfd6e58..5a2a320d2e6ab 100644 --- a/server/src/main/java/org/opensearch/rest/action/ingest/RestPutPipelineAction.java +++ b/server/src/main/java/org/opensearch/rest/action/ingest/RestPutPipelineAction.java @@ -48,6 +48,11 @@ import static java.util.Collections.singletonList; import static org.opensearch.rest.RestRequest.Method.PUT; +/** + * Transport action to put a pipeline + * + * @opensearch.api + */ public class RestPutPipelineAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestPutPipelineAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/ingest/RestSimulatePipelineAction.java b/server/src/main/java/org/opensearch/rest/action/ingest/RestSimulatePipelineAction.java index 1f8d9edce6eab..eb193edda3373 100644 --- a/server/src/main/java/org/opensearch/rest/action/ingest/RestSimulatePipelineAction.java +++ b/server/src/main/java/org/opensearch/rest/action/ingest/RestSimulatePipelineAction.java @@ -49,6 +49,11 @@ import static org.opensearch.rest.RestRequest.Method.GET; import static org.opensearch.rest.RestRequest.Method.POST; +/** + * Transport action to simulate an ingest pipeline + * + * @opensearch.api + */ public class RestSimulatePipelineAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/search/RestClearScrollAction.java b/server/src/main/java/org/opensearch/rest/action/search/RestClearScrollAction.java index 6bdbb47033859..b9f57feab4296 100644 --- a/server/src/main/java/org/opensearch/rest/action/search/RestClearScrollAction.java +++ b/server/src/main/java/org/opensearch/rest/action/search/RestClearScrollAction.java @@ -46,6 +46,11 @@ import static java.util.Collections.unmodifiableList; import static org.opensearch.rest.RestRequest.Method.DELETE; +/** + * Transport action to clear a scroll + * + * @opensearch.api + */ public class RestClearScrollAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/search/RestCountAction.java b/server/src/main/java/org/opensearch/rest/action/search/RestCountAction.java index 6cb00633de441..a4a8b2c3b5e56 100644 --- a/server/src/main/java/org/opensearch/rest/action/search/RestCountAction.java +++ b/server/src/main/java/org/opensearch/rest/action/search/RestCountAction.java @@ -57,6 +57,11 @@ import static org.opensearch.rest.action.RestActions.buildBroadcastShardsHeader; import static org.opensearch.search.internal.SearchContext.DEFAULT_TERMINATE_AFTER; +/** + * Transport action to count documents + * + * @opensearch.api + */ public class RestCountAction extends BaseRestHandler { @Override diff --git a/server/src/main/java/org/opensearch/rest/action/search/RestExplainAction.java b/server/src/main/java/org/opensearch/rest/action/search/RestExplainAction.java index 2b73e145cf5ca..bf29e0edfd2ab 100644 --- a/server/src/main/java/org/opensearch/rest/action/search/RestExplainAction.java +++ b/server/src/main/java/org/opensearch/rest/action/search/RestExplainAction.java @@ -52,6 +52,8 @@ /** * Rest action for computing a score explanation for specific documents. + * + * @opensearch.api */ public class RestExplainAction extends BaseRestHandler { diff --git a/server/src/main/java/org/opensearch/rest/action/search/RestMultiSearchAction.java b/server/src/main/java/org/opensearch/rest/action/search/RestMultiSearchAction.java index 8262f8199a704..c5af10e5ce681 100644 --- a/server/src/main/java/org/opensearch/rest/action/search/RestMultiSearchAction.java +++ b/server/src/main/java/org/opensearch/rest/action/search/RestMultiSearchAction.java @@ -66,6 +66,11 @@ import static org.opensearch.rest.RestRequest.Method.GET; import static org.opensearch.rest.RestRequest.Method.POST; +/** + * Transport action to perform a multi search + * + * @opensearch.api + */ public class RestMultiSearchAction extends BaseRestHandler { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestMultiSearchAction.class); diff --git a/server/src/main/java/org/opensearch/rest/action/search/RestSearchAction.java b/server/src/main/java/org/opensearch/rest/action/search/RestSearchAction.java index b84200407462f..2db131723bc57 100644 --- a/server/src/main/java/org/opensearch/rest/action/search/RestSearchAction.java +++ b/server/src/main/java/org/opensearch/rest/action/search/RestSearchAction.java @@ -74,6 +74,11 @@ import static org.opensearch.rest.RestRequest.Method.POST; import static org.opensearch.search.suggest.SuggestBuilders.termSuggestion; +/** + * Transport action to perform a search + * + * @opensearch.api + */ public class RestSearchAction extends BaseRestHandler { /** * Indicates whether hits.total should be rendered as an integer or an object diff --git a/server/src/main/java/org/opensearch/rest/action/search/RestSearchScrollAction.java b/server/src/main/java/org/opensearch/rest/action/search/RestSearchScrollAction.java index bb725c35e8799..28dc5f64763c2 100644 --- a/server/src/main/java/org/opensearch/rest/action/search/RestSearchScrollAction.java +++ b/server/src/main/java/org/opensearch/rest/action/search/RestSearchScrollAction.java @@ -50,6 +50,11 @@ import static org.opensearch.rest.RestRequest.Method.GET; import static org.opensearch.rest.RestRequest.Method.POST; +/** + * Transport action to perform a search scroll + * + * @opensearch.api + */ public class RestSearchScrollAction extends BaseRestHandler { private static final Set RESPONSE_PARAMS = Collections.singleton(RestSearchAction.TOTAL_HITS_AS_INT_PARAM); diff --git a/server/src/main/java/org/opensearch/script/AbstractSortScript.java b/server/src/main/java/org/opensearch/script/AbstractSortScript.java index d1a1b321b0ace..c72717f8bc927 100644 --- a/server/src/main/java/org/opensearch/script/AbstractSortScript.java +++ b/server/src/main/java/org/opensearch/script/AbstractSortScript.java @@ -46,6 +46,11 @@ import java.util.Map; import java.util.function.Function; +/** + * Base sort script + * + * @opensearch.internal + */ abstract class AbstractSortScript implements ScorerAware { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(DynamicMap.class); diff --git a/server/src/main/java/org/opensearch/snapshots/AbortedSnapshotException.java b/server/src/main/java/org/opensearch/snapshots/AbortedSnapshotException.java index 6aa75ee49bd1e..930d9408552bc 100644 --- a/server/src/main/java/org/opensearch/snapshots/AbortedSnapshotException.java +++ b/server/src/main/java/org/opensearch/snapshots/AbortedSnapshotException.java @@ -31,6 +31,11 @@ package org.opensearch.snapshots; +/** + * Exception thrown when there is an aborted snapshot + * + * @opensearch.internal + */ public final class AbortedSnapshotException extends RuntimeException { public AbortedSnapshotException() { super("aborted"); diff --git a/server/src/main/java/org/opensearch/snapshots/ConcurrentSnapshotExecutionException.java b/server/src/main/java/org/opensearch/snapshots/ConcurrentSnapshotExecutionException.java index 1bdf09c32ebd2..aa2c0ab42e42e 100644 --- a/server/src/main/java/org/opensearch/snapshots/ConcurrentSnapshotExecutionException.java +++ b/server/src/main/java/org/opensearch/snapshots/ConcurrentSnapshotExecutionException.java @@ -39,6 +39,8 @@ /** * Thrown when a user tries to multiple conflicting snapshot/restore operations at the same time. + * + * @opensearch.internal */ public class ConcurrentSnapshotExecutionException extends SnapshotException { diff --git a/server/src/main/java/org/opensearch/snapshots/EmptySnapshotsInfoService.java b/server/src/main/java/org/opensearch/snapshots/EmptySnapshotsInfoService.java index c29d39966dc9c..8629790bc9cbb 100644 --- a/server/src/main/java/org/opensearch/snapshots/EmptySnapshotsInfoService.java +++ b/server/src/main/java/org/opensearch/snapshots/EmptySnapshotsInfoService.java @@ -34,6 +34,11 @@ import org.opensearch.common.collect.ImmutableOpenMap; +/** + * Service for getting information about empty snapshots + * + * @opensearch.internal + */ public class EmptySnapshotsInfoService implements SnapshotsInfoService { public static final EmptySnapshotsInfoService INSTANCE = new EmptySnapshotsInfoService(); diff --git a/server/src/main/java/org/opensearch/snapshots/InFlightShardSnapshotStates.java b/server/src/main/java/org/opensearch/snapshots/InFlightShardSnapshotStates.java index 469b57562284f..17d77fcc0695b 100644 --- a/server/src/main/java/org/opensearch/snapshots/InFlightShardSnapshotStates.java +++ b/server/src/main/java/org/opensearch/snapshots/InFlightShardSnapshotStates.java @@ -53,6 +53,8 @@ * as well as the latest written shard generation per shard in case there is a shard generation for a shard that has * been cleanly written out to the repository but not yet made part of the current {@link org.opensearch.repositories.RepositoryData} * through a snapshot finalization. + * + * @opensearch.internal */ public final class InFlightShardSnapshotStates { diff --git a/server/src/main/java/org/opensearch/snapshots/InvalidSnapshotNameException.java b/server/src/main/java/org/opensearch/snapshots/InvalidSnapshotNameException.java index 8fe321a4fe74b..5af529c72458c 100644 --- a/server/src/main/java/org/opensearch/snapshots/InvalidSnapshotNameException.java +++ b/server/src/main/java/org/opensearch/snapshots/InvalidSnapshotNameException.java @@ -39,6 +39,8 @@ /** * Thrown on the attempt to create a snapshot with invalid name + * + * @opensearch.internal */ public class InvalidSnapshotNameException extends SnapshotException { diff --git a/server/src/main/java/org/opensearch/snapshots/RestoreInfo.java b/server/src/main/java/org/opensearch/snapshots/RestoreInfo.java index fbcd54fd5d6d1..b8ee09ff53fea 100644 --- a/server/src/main/java/org/opensearch/snapshots/RestoreInfo.java +++ b/server/src/main/java/org/opensearch/snapshots/RestoreInfo.java @@ -51,6 +51,8 @@ * Information about successfully completed restore operation. *

    * Returned as part of {@link org.opensearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse} + * + * @opensearch.internal */ public class RestoreInfo implements ToXContentObject, Writeable { diff --git a/server/src/main/java/org/opensearch/snapshots/RestoreService.java b/server/src/main/java/org/opensearch/snapshots/RestoreService.java index 4e9f13408e547..a95c711870e9b 100644 --- a/server/src/main/java/org/opensearch/snapshots/RestoreService.java +++ b/server/src/main/java/org/opensearch/snapshots/RestoreService.java @@ -136,6 +136,8 @@ * At the end of the successful restore process {@code RestoreService} calls {@link #cleanupRestoreState(ClusterChangedEvent)}, * which removes {@link RestoreInProgress} when all shards are completed. In case of * restore failure a normal recovery fail-over process kicks in. + * + * @opensearch.internal */ public class RestoreService implements ClusterStateApplier { diff --git a/server/src/main/java/org/opensearch/snapshots/Snapshot.java b/server/src/main/java/org/opensearch/snapshots/Snapshot.java index 0733ccd6be6f1..d084fad1c2b21 100644 --- a/server/src/main/java/org/opensearch/snapshots/Snapshot.java +++ b/server/src/main/java/org/opensearch/snapshots/Snapshot.java @@ -41,6 +41,8 @@ /** * Basic information about a snapshot - a SnapshotId and the repository that the snapshot belongs to. + * + * @opensearch.internal */ public final class Snapshot implements Writeable { diff --git a/server/src/main/java/org/opensearch/snapshots/SnapshotCreationException.java b/server/src/main/java/org/opensearch/snapshots/SnapshotCreationException.java index 6857b38aaecba..184fcd5ceb9f8 100644 --- a/server/src/main/java/org/opensearch/snapshots/SnapshotCreationException.java +++ b/server/src/main/java/org/opensearch/snapshots/SnapshotCreationException.java @@ -38,6 +38,8 @@ /** * Thrown when snapshot creation fails completely + * + * @opensearch.internal */ public class SnapshotCreationException extends SnapshotException { diff --git a/server/src/main/java/org/opensearch/snapshots/SnapshotException.java b/server/src/main/java/org/opensearch/snapshots/SnapshotException.java index 641addad169bb..9c78834907e85 100644 --- a/server/src/main/java/org/opensearch/snapshots/SnapshotException.java +++ b/server/src/main/java/org/opensearch/snapshots/SnapshotException.java @@ -41,6 +41,8 @@ /** * Generic snapshot exception + * + * @opensearch.internal */ public class SnapshotException extends OpenSearchException { diff --git a/server/src/main/java/org/opensearch/snapshots/SnapshotId.java b/server/src/main/java/org/opensearch/snapshots/SnapshotId.java index cbad6ddbb92a6..40efc5051449b 100644 --- a/server/src/main/java/org/opensearch/snapshots/SnapshotId.java +++ b/server/src/main/java/org/opensearch/snapshots/SnapshotId.java @@ -43,6 +43,8 @@ /** * SnapshotId - snapshot name + snapshot UUID + * + * @opensearch.internal */ public final class SnapshotId implements Comparable, Writeable, ToXContentObject { diff --git a/server/src/main/java/org/opensearch/snapshots/SnapshotInProgressException.java b/server/src/main/java/org/opensearch/snapshots/SnapshotInProgressException.java index 4dc1c49ab3fcc..cd202ea7e5f98 100644 --- a/server/src/main/java/org/opensearch/snapshots/SnapshotInProgressException.java +++ b/server/src/main/java/org/opensearch/snapshots/SnapshotInProgressException.java @@ -41,6 +41,8 @@ /** * Thrown on the attempt to execute an action that requires * that no snapshot is in progress. + * + * @opensearch.internal */ public class SnapshotInProgressException extends OpenSearchException { diff --git a/server/src/main/java/org/opensearch/snapshots/SnapshotInfo.java b/server/src/main/java/org/opensearch/snapshots/SnapshotInfo.java index a7c96b88469b7..f08a52a4e7523 100644 --- a/server/src/main/java/org/opensearch/snapshots/SnapshotInfo.java +++ b/server/src/main/java/org/opensearch/snapshots/SnapshotInfo.java @@ -64,6 +64,8 @@ /** * Information about a snapshot + * + * @opensearch.internal */ public final class SnapshotInfo implements Comparable, ToXContent, Writeable { diff --git a/server/src/main/java/org/opensearch/snapshots/SnapshotMissingException.java b/server/src/main/java/org/opensearch/snapshots/SnapshotMissingException.java index ac8b733526b7c..2508ab89108eb 100644 --- a/server/src/main/java/org/opensearch/snapshots/SnapshotMissingException.java +++ b/server/src/main/java/org/opensearch/snapshots/SnapshotMissingException.java @@ -39,6 +39,8 @@ /** * Thrown if requested snapshot doesn't exist + * + * @opensearch.internal */ public class SnapshotMissingException extends SnapshotException { diff --git a/server/src/main/java/org/opensearch/snapshots/SnapshotRestoreException.java b/server/src/main/java/org/opensearch/snapshots/SnapshotRestoreException.java index ff4d5fa53a857..8afd64571c0ac 100644 --- a/server/src/main/java/org/opensearch/snapshots/SnapshotRestoreException.java +++ b/server/src/main/java/org/opensearch/snapshots/SnapshotRestoreException.java @@ -38,6 +38,8 @@ /** * Snapshot restore exception + * + * @opensearch.internal */ public class SnapshotRestoreException extends SnapshotException { public SnapshotRestoreException(final String repositoryName, final String snapshotName, final String message) { diff --git a/server/src/main/java/org/opensearch/snapshots/SnapshotShardFailure.java b/server/src/main/java/org/opensearch/snapshots/SnapshotShardFailure.java index e0318641003f8..5c94ab65b60c3 100644 --- a/server/src/main/java/org/opensearch/snapshots/SnapshotShardFailure.java +++ b/server/src/main/java/org/opensearch/snapshots/SnapshotShardFailure.java @@ -51,6 +51,8 @@ /** * Stores information about failures that occurred during shard snapshotting process + * + * @opensearch.internal */ public class SnapshotShardFailure extends ShardOperationFailedException { diff --git a/server/src/main/java/org/opensearch/snapshots/SnapshotShardSizeInfo.java b/server/src/main/java/org/opensearch/snapshots/SnapshotShardSizeInfo.java index 9c8a8fb76fb23..6c951078e59e6 100644 --- a/server/src/main/java/org/opensearch/snapshots/SnapshotShardSizeInfo.java +++ b/server/src/main/java/org/opensearch/snapshots/SnapshotShardSizeInfo.java @@ -36,6 +36,11 @@ import org.opensearch.cluster.routing.ShardRouting; import org.opensearch.common.collect.ImmutableOpenMap; +/** + * Information about a snapshot shard size + * + * @opensearch.internal + */ public class SnapshotShardSizeInfo { public static final SnapshotShardSizeInfo EMPTY = new SnapshotShardSizeInfo(ImmutableOpenMap.of()); diff --git a/server/src/main/java/org/opensearch/snapshots/SnapshotShardsService.java b/server/src/main/java/org/opensearch/snapshots/SnapshotShardsService.java index 385f3eda2170b..9295cff5c1f54 100644 --- a/server/src/main/java/org/opensearch/snapshots/SnapshotShardsService.java +++ b/server/src/main/java/org/opensearch/snapshots/SnapshotShardsService.java @@ -87,6 +87,8 @@ * This service runs on data nodes and controls currently running shard snapshots on these nodes. It is responsible for * starting and stopping shard level snapshots. * See package level documentation of {@link org.opensearch.snapshots} for details. + * + * @opensearch.internal */ public class SnapshotShardsService extends AbstractLifecycleComponent implements ClusterStateListener, IndexEventListener { private static final Logger logger = LogManager.getLogger(SnapshotShardsService.class); diff --git a/server/src/main/java/org/opensearch/snapshots/SnapshotState.java b/server/src/main/java/org/opensearch/snapshots/SnapshotState.java index 75718481edce6..dd1b3ebb8404d 100644 --- a/server/src/main/java/org/opensearch/snapshots/SnapshotState.java +++ b/server/src/main/java/org/opensearch/snapshots/SnapshotState.java @@ -34,6 +34,8 @@ /** * Represents the state that a snapshot can be in + * + * @opensearch.internal */ public enum SnapshotState { /** diff --git a/server/src/main/java/org/opensearch/snapshots/SnapshotUtils.java b/server/src/main/java/org/opensearch/snapshots/SnapshotUtils.java index 4515671a9fd10..073e4f7723077 100644 --- a/server/src/main/java/org/opensearch/snapshots/SnapshotUtils.java +++ b/server/src/main/java/org/opensearch/snapshots/SnapshotUtils.java @@ -45,6 +45,8 @@ /** * Snapshot utilities + * + * @opensearch.internal */ public class SnapshotUtils { diff --git a/server/src/main/java/org/opensearch/snapshots/SnapshotsInfoService.java b/server/src/main/java/org/opensearch/snapshots/SnapshotsInfoService.java index 376bd5e05742f..5f16b6e20d3af 100644 --- a/server/src/main/java/org/opensearch/snapshots/SnapshotsInfoService.java +++ b/server/src/main/java/org/opensearch/snapshots/SnapshotsInfoService.java @@ -32,6 +32,11 @@ package org.opensearch.snapshots; +/** + * Base interface for shard information + * + * @opensearch.internal + */ @FunctionalInterface public interface SnapshotsInfoService { SnapshotShardSizeInfo snapshotShardSizes(); diff --git a/server/src/main/java/org/opensearch/snapshots/SnapshotsService.java b/server/src/main/java/org/opensearch/snapshots/SnapshotsService.java index 746cccef8e596..106359c485f86 100644 --- a/server/src/main/java/org/opensearch/snapshots/SnapshotsService.java +++ b/server/src/main/java/org/opensearch/snapshots/SnapshotsService.java @@ -137,6 +137,8 @@ * Service responsible for creating snapshots. This service runs all the steps executed on the cluster-manager node during snapshot creation and * deletion. * See package level documentation of {@link org.opensearch.snapshots} for details. + * + * @opensearch.internal */ public class SnapshotsService extends AbstractLifecycleComponent implements ClusterStateApplier { diff --git a/server/src/main/java/org/opensearch/snapshots/UpdateIndexShardSnapshotStatusRequest.java b/server/src/main/java/org/opensearch/snapshots/UpdateIndexShardSnapshotStatusRequest.java index f4f629970ccfa..7eac935825783 100644 --- a/server/src/main/java/org/opensearch/snapshots/UpdateIndexShardSnapshotStatusRequest.java +++ b/server/src/main/java/org/opensearch/snapshots/UpdateIndexShardSnapshotStatusRequest.java @@ -44,6 +44,8 @@ /** * Internal request that is used to send changes in snapshot status to master + * + * @opensearch.internal */ public class UpdateIndexShardSnapshotStatusRequest extends MasterNodeRequest { private final Snapshot snapshot; diff --git a/server/src/main/java/org/opensearch/snapshots/UpdateIndexShardSnapshotStatusResponse.java b/server/src/main/java/org/opensearch/snapshots/UpdateIndexShardSnapshotStatusResponse.java index 55b299c7832c8..d1df715ba629a 100644 --- a/server/src/main/java/org/opensearch/snapshots/UpdateIndexShardSnapshotStatusResponse.java +++ b/server/src/main/java/org/opensearch/snapshots/UpdateIndexShardSnapshotStatusResponse.java @@ -36,6 +36,11 @@ import java.io.IOException; +/** + * Response sent when updating an index shard status + * + * @opensearch.internal + */ class UpdateIndexShardSnapshotStatusResponse extends ActionResponse { public static final UpdateIndexShardSnapshotStatusResponse INSTANCE = new UpdateIndexShardSnapshotStatusResponse(); diff --git a/server/src/main/java/org/opensearch/tasks/CancellableTask.java b/server/src/main/java/org/opensearch/tasks/CancellableTask.java index 1eef8bb47abef..439be2b630e84 100644 --- a/server/src/main/java/org/opensearch/tasks/CancellableTask.java +++ b/server/src/main/java/org/opensearch/tasks/CancellableTask.java @@ -42,6 +42,8 @@ /** * A task that can be canceled + * + * @opensearch.internal */ public abstract class CancellableTask extends Task { diff --git a/server/src/main/java/org/opensearch/tasks/LoggingTaskListener.java b/server/src/main/java/org/opensearch/tasks/LoggingTaskListener.java index 3a0c4eb560afc..88eaae4a480f8 100644 --- a/server/src/main/java/org/opensearch/tasks/LoggingTaskListener.java +++ b/server/src/main/java/org/opensearch/tasks/LoggingTaskListener.java @@ -39,6 +39,8 @@ /** * A TaskListener that just logs the response at the info level. Used when we * need a listener but aren't returning the result to the user. + * + * @opensearch.internal */ public final class LoggingTaskListener implements TaskListener { private static final Logger logger = LogManager.getLogger(LoggingTaskListener.class); diff --git a/server/src/main/java/org/opensearch/tasks/RawTaskStatus.java b/server/src/main/java/org/opensearch/tasks/RawTaskStatus.java index f9b4ce23f1ae1..6ec91b1741f37 100644 --- a/server/src/main/java/org/opensearch/tasks/RawTaskStatus.java +++ b/server/src/main/java/org/opensearch/tasks/RawTaskStatus.java @@ -48,6 +48,8 @@ /** * Raw, unparsed status from the task results index. + * + * @opensearch.internal */ public class RawTaskStatus implements Task.Status { public static final String NAME = "raw"; diff --git a/server/src/main/java/org/opensearch/tasks/ResourceStats.java b/server/src/main/java/org/opensearch/tasks/ResourceStats.java index aab103ad08dcf..31c129b7b2ff9 100644 --- a/server/src/main/java/org/opensearch/tasks/ResourceStats.java +++ b/server/src/main/java/org/opensearch/tasks/ResourceStats.java @@ -10,6 +10,8 @@ /** * Different resource stats are defined. + * + * @opensearch.internal */ public enum ResourceStats { CPU("cpu_time_in_nanos"), diff --git a/server/src/main/java/org/opensearch/tasks/ResourceStatsType.java b/server/src/main/java/org/opensearch/tasks/ResourceStatsType.java index c670ac5ba689c..138c74e128d70 100644 --- a/server/src/main/java/org/opensearch/tasks/ResourceStatsType.java +++ b/server/src/main/java/org/opensearch/tasks/ResourceStatsType.java @@ -8,7 +8,11 @@ package org.opensearch.tasks; -/** Defines the different types of resource stats. */ +/** + * Defines the different types of resource stats. + * + * @opensearch.internal + */ public enum ResourceStatsType { // resource stats of the worker thread reported directly from runnable. WORKER_STATS("worker_stats", false); diff --git a/server/src/main/java/org/opensearch/tasks/ResourceUsageInfo.java b/server/src/main/java/org/opensearch/tasks/ResourceUsageInfo.java index ae58f712b63c2..652562e3f9e7a 100644 --- a/server/src/main/java/org/opensearch/tasks/ResourceUsageInfo.java +++ b/server/src/main/java/org/opensearch/tasks/ResourceUsageInfo.java @@ -21,6 +21,8 @@ *

    * It captures the resource usage information like memory, CPU about a particular execution of thread * for a specific stats type. + * + * @opensearch.internal */ public class ResourceUsageInfo { private static final Logger logger = LogManager.getLogger(ResourceUsageInfo.class); diff --git a/server/src/main/java/org/opensearch/tasks/ResourceUsageMetric.java b/server/src/main/java/org/opensearch/tasks/ResourceUsageMetric.java index 0d13ffe6ec01a..931e3aa00d736 100644 --- a/server/src/main/java/org/opensearch/tasks/ResourceUsageMetric.java +++ b/server/src/main/java/org/opensearch/tasks/ResourceUsageMetric.java @@ -8,6 +8,11 @@ package org.opensearch.tasks; +/** + * Information about resource usage + * + * @opensearch.internal + */ public class ResourceUsageMetric { private final ResourceStats stats; private final long value; diff --git a/server/src/main/java/org/opensearch/tasks/Task.java b/server/src/main/java/org/opensearch/tasks/Task.java index 62453d08724ce..522ecac5ef698 100644 --- a/server/src/main/java/org/opensearch/tasks/Task.java +++ b/server/src/main/java/org/opensearch/tasks/Task.java @@ -50,6 +50,8 @@ /** * Current task information + * + * @opensearch.internal */ public class Task { diff --git a/server/src/main/java/org/opensearch/tasks/TaskAwareRequest.java b/server/src/main/java/org/opensearch/tasks/TaskAwareRequest.java index b10e85ae35dc6..baf2d1d94ea04 100644 --- a/server/src/main/java/org/opensearch/tasks/TaskAwareRequest.java +++ b/server/src/main/java/org/opensearch/tasks/TaskAwareRequest.java @@ -36,6 +36,8 @@ /** * An interface for a request that can be used to register a task manager task + * + * @opensearch.internal */ public interface TaskAwareRequest { /** diff --git a/server/src/main/java/org/opensearch/tasks/TaskCancellationService.java b/server/src/main/java/org/opensearch/tasks/TaskCancellationService.java index aebd91b0041ac..4073a48bcde0d 100644 --- a/server/src/main/java/org/opensearch/tasks/TaskCancellationService.java +++ b/server/src/main/java/org/opensearch/tasks/TaskCancellationService.java @@ -57,6 +57,11 @@ import java.util.Collection; import java.util.List; +/** + * Service used to cancel a task + * + * @opensearch.internal + */ public class TaskCancellationService { public static final String BAN_PARENT_ACTION_NAME = "internal:admin/tasks/ban"; private static final Logger logger = LogManager.getLogger(TaskCancellationService.class); diff --git a/server/src/main/java/org/opensearch/tasks/TaskCancelledException.java b/server/src/main/java/org/opensearch/tasks/TaskCancelledException.java index f9863a10639e0..5f43837c02e7f 100644 --- a/server/src/main/java/org/opensearch/tasks/TaskCancelledException.java +++ b/server/src/main/java/org/opensearch/tasks/TaskCancelledException.java @@ -38,6 +38,8 @@ /** * A generic exception that can be thrown by a task when it's cancelled by the task manager API + * + * @opensearch.internal */ public class TaskCancelledException extends OpenSearchException { diff --git a/server/src/main/java/org/opensearch/tasks/TaskId.java b/server/src/main/java/org/opensearch/tasks/TaskId.java index e98df346b7041..46fb491dcc15f 100644 --- a/server/src/main/java/org/opensearch/tasks/TaskId.java +++ b/server/src/main/java/org/opensearch/tasks/TaskId.java @@ -44,6 +44,8 @@ /** * Task id that consists of node id and id of the task on the node + * + * @opensearch.internal */ public final class TaskId implements Writeable { diff --git a/server/src/main/java/org/opensearch/tasks/TaskInfo.java b/server/src/main/java/org/opensearch/tasks/TaskInfo.java index b6814282b5db4..fc6280cc643c0 100644 --- a/server/src/main/java/org/opensearch/tasks/TaskInfo.java +++ b/server/src/main/java/org/opensearch/tasks/TaskInfo.java @@ -62,6 +62,8 @@ * references as well as mutable state. That makes it impractical to send tasks over transport channels * and use in APIs. Instead, immutable and writeable TaskInfo objects are used to represent * snapshot information about currently running tasks. + * + * @opensearch.internal */ public final class TaskInfo implements Writeable, ToXContentFragment { private final TaskId taskId; diff --git a/server/src/main/java/org/opensearch/tasks/TaskListener.java b/server/src/main/java/org/opensearch/tasks/TaskListener.java index e5581ad08d226..97df8eacee584 100644 --- a/server/src/main/java/org/opensearch/tasks/TaskListener.java +++ b/server/src/main/java/org/opensearch/tasks/TaskListener.java @@ -34,6 +34,8 @@ /** * Listener for Task success or failure. + * + * @opensearch.internal */ public interface TaskListener { /** diff --git a/server/src/main/java/org/opensearch/tasks/TaskManager.java b/server/src/main/java/org/opensearch/tasks/TaskManager.java index 1f6169768f245..9bb931ea7f0aa 100644 --- a/server/src/main/java/org/opensearch/tasks/TaskManager.java +++ b/server/src/main/java/org/opensearch/tasks/TaskManager.java @@ -82,6 +82,8 @@ /** * Task Manager service for keeping track of currently running tasks on the nodes + * + * @opensearch.internal */ public class TaskManager implements ClusterStateApplier { diff --git a/server/src/main/java/org/opensearch/tasks/TaskResourceStats.java b/server/src/main/java/org/opensearch/tasks/TaskResourceStats.java index c35e08ebb34ec..64fe4d73d498a 100644 --- a/server/src/main/java/org/opensearch/tasks/TaskResourceStats.java +++ b/server/src/main/java/org/opensearch/tasks/TaskResourceStats.java @@ -26,6 +26,8 @@ *

    * Writeable TaskResourceStats objects are used to represent resource * snapshot information about currently running task. + * + * @opensearch.internal */ public class TaskResourceStats implements Writeable, ToXContentFragment { private final Map resourceUsage; diff --git a/server/src/main/java/org/opensearch/tasks/TaskResourceUsage.java b/server/src/main/java/org/opensearch/tasks/TaskResourceUsage.java index 6af3de2b78c06..2786f7ca59c05 100644 --- a/server/src/main/java/org/opensearch/tasks/TaskResourceUsage.java +++ b/server/src/main/java/org/opensearch/tasks/TaskResourceUsage.java @@ -28,6 +28,8 @@ *

    * Writeable TaskResourceUsage objects are used to represent resource usage * information of running tasks. + * + * @opensearch.internal */ public class TaskResourceUsage implements Writeable, ToXContentFragment { private static final ParseField CPU_TIME_IN_NANOS = new ParseField("cpu_time_in_nanos"); diff --git a/server/src/main/java/org/opensearch/tasks/TaskResult.java b/server/src/main/java/org/opensearch/tasks/TaskResult.java index 8e10b2eaa1cdf..247cc645ef8a3 100644 --- a/server/src/main/java/org/opensearch/tasks/TaskResult.java +++ b/server/src/main/java/org/opensearch/tasks/TaskResult.java @@ -61,6 +61,8 @@ /** * Information about a running task or a task that stored its result. Running tasks just have a {@link #getTask()} while * tasks with stored result will have either a {@link #getError()} or {@link #getResponse()}. + * + * @opensearch.internal */ public final class TaskResult implements Writeable, ToXContentObject { private final boolean completed; diff --git a/server/src/main/java/org/opensearch/tasks/TaskResultsService.java b/server/src/main/java/org/opensearch/tasks/TaskResultsService.java index e22793e057c6a..66d3aeb748cf7 100644 --- a/server/src/main/java/org/opensearch/tasks/TaskResultsService.java +++ b/server/src/main/java/org/opensearch/tasks/TaskResultsService.java @@ -73,6 +73,8 @@ /** * Service that can store task results. + * + * @opensearch.internal */ public class TaskResultsService { diff --git a/server/src/main/java/org/opensearch/tasks/ThreadResourceInfo.java b/server/src/main/java/org/opensearch/tasks/ThreadResourceInfo.java index 8b45c38c8fb63..a0b38649b6420 100644 --- a/server/src/main/java/org/opensearch/tasks/ThreadResourceInfo.java +++ b/server/src/main/java/org/opensearch/tasks/ThreadResourceInfo.java @@ -13,6 +13,8 @@ *

    * It captures the resource usage information about a particular execution of thread * for a specific stats type like worker_stats or response_stats etc., + * + * @opensearch.internal */ public class ThreadResourceInfo { private volatile boolean isActive = true; diff --git a/server/src/main/java/org/opensearch/threadpool/ExecutorBuilder.java b/server/src/main/java/org/opensearch/threadpool/ExecutorBuilder.java index 5229afb0ec71c..d26131484ba71 100644 --- a/server/src/main/java/org/opensearch/threadpool/ExecutorBuilder.java +++ b/server/src/main/java/org/opensearch/threadpool/ExecutorBuilder.java @@ -44,7 +44,7 @@ * * @param the underlying type of the executor settings * - * @opensearch.internal + * @opensearch.internal */ public abstract class ExecutorBuilder { From 95b29ad49392bb1f99c916cc28630fee9caeca96 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Fri, 6 May 2022 18:06:28 -0400 Subject: [PATCH 133/514] Adding @Bukhtawar to OpenSearch maintainers. (#3231) (#3232) Signed-off-by: dblock (cherry picked from commit 781fc6eb2ed31ad34ab969ab8dcc651f15ea977d) Co-authored-by: Daniel Doubrovkine (dB.) --- MAINTAINERS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS.md b/MAINTAINERS.md index 988823682b6c1..94e649a634c7f 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -9,6 +9,7 @@ | Anas Alkouz | [anasalkouz](https://github.com/anasalkouz) | Amazon | | Andrew Ross | [andrross](https://github.com/andrross)| Amazon | | Andriy Redko | [reta](https://github.com/reta) | Aiven | +| Bukhtawar Khan | [Bukhtawar](https://github.com/Bukhtawar) | Amazon | | Charlotte Henkle | [CEHENKLE](https://github.com/CEHENKLE) | Amazon | | Daniel "dB." Doubrovkine | [dblock](https://github.com/dblock) | Amazon | | Himanshu Setia | [setiah](https://github.com/setiah) | Amazon | From 2e339dfdbf6c52ff2a66b8844c0ba73b4b460a57 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Sat, 7 May 2022 12:23:12 -0400 Subject: [PATCH 134/514] Gradle plugin `opensearch.pluginzip` Add implicit dependency. (#3189) (#3211) * Add implicit dependency Signed-off-by: pgodithi * Add implicit dependency Signed-off-by: pgodithi * Add implicit dependency Signed-off-by: pgodithi * Add implicit dependency Signed-off-by: pgodithi * Add implicit dependency Signed-off-by: pgodithi * Add implicit dependency Signed-off-by: pgodithi * Add dependsOn Signed-off-by: pgodithi (cherry picked from commit 2fe2e37a44616155bdd2a5b2a0c13f215c8a61f6) Co-authored-by: Prudhvi Godithi --- .../org/opensearch/gradle/PublishPlugin.java | 8 ++++---- .../opensearch/gradle/pluginzip/Publish.java | 18 +++++++++++++----- .../gradle/pluginzip/PublishTests.java | 9 ++++++++- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/buildSrc/src/main/java/org/opensearch/gradle/PublishPlugin.java b/buildSrc/src/main/java/org/opensearch/gradle/PublishPlugin.java index 2a0521b17d55e..a28015784c4be 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/PublishPlugin.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/PublishPlugin.java @@ -135,11 +135,11 @@ public String call() throws Exception { publication.artifact(project.getTasks().getByName("sourcesJar")); publication.artifact(project.getTasks().getByName("javadocJar")); } - - generatePomTask.configure( - t -> t.dependsOn(String.format("generatePomFileFor%sPublication", Util.capitalize(publication.getName()))) - ); } + + generatePomTask.configure( + t -> t.dependsOn(String.format("generatePomFileFor%sPublication", Util.capitalize(publication.getName()))) + ); }); } diff --git a/buildSrc/src/main/java/org/opensearch/gradle/pluginzip/Publish.java b/buildSrc/src/main/java/org/opensearch/gradle/pluginzip/Publish.java index e8b4ecec7a56d..0a3b198b4d32f 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/pluginzip/Publish.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/pluginzip/Publish.java @@ -14,6 +14,7 @@ import org.gradle.api.publish.maven.MavenPublication; import org.gradle.api.publish.maven.plugins.MavenPublishPlugin; import java.nio.file.Path; +import org.gradle.api.Task; public class Publish implements Plugin { private Project project; @@ -63,12 +64,19 @@ static String getProperty(String name, Project project) { @Override public void apply(Project project) { this.project = project; - project.afterEvaluate(evaluatedProject -> { configMaven(project); }); - project.getGradle().getTaskGraph().whenReady(graph -> { - if (graph.hasTask(LOCALMAVEN)) { - project.getTasks().getByName(PLUGIN_ZIP_PUBLISH_POM_TASK).setEnabled(false); + project.afterEvaluate(evaluatedProject -> { + configMaven(project); + Task validatePluginZipPom = project.getTasks().findByName("validatePluginZipPom"); + if (validatePluginZipPom != null) { + project.getTasks().getByName("validatePluginZipPom").dependsOn("generatePomFileForNebulaPublication"); + } + Task publishPluginZipPublicationToZipStagingRepository = project.getTasks() + .findByName("publishPluginZipPublicationToZipStagingRepository"); + if (validatePluginZipPom != null) { + project.getTasks() + .getByName("publishPluginZipPublicationToZipStagingRepository") + .dependsOn("generatePomFileForNebulaPublication"); } - }); } } diff --git a/buildSrc/src/test/java/org/opensearch/gradle/pluginzip/PublishTests.java b/buildSrc/src/test/java/org/opensearch/gradle/pluginzip/PublishTests.java index ae94ace55e637..f5a00d795c0cd 100644 --- a/buildSrc/src/test/java/org/opensearch/gradle/pluginzip/PublishTests.java +++ b/buildSrc/src/test/java/org/opensearch/gradle/pluginzip/PublishTests.java @@ -28,6 +28,8 @@ import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import java.io.FileReader; import org.gradle.api.tasks.bundling.Zip; +import java.util.List; +import java.util.ArrayList; public class PublishTests extends GradleUnitTestCase { @@ -56,6 +58,7 @@ public void testZipPublish() throws IOException, XmlPullParserException { writeString(new File(projectDir, "settings.gradle"), ""); // Generate the build.gradle file String buildFileContent = "apply plugin: 'maven-publish' \n" + + "apply plugin: 'java' \n" + "publishing {\n" + " repositories {\n" + " maven {\n" @@ -74,10 +77,13 @@ public void testZipPublish() throws IOException, XmlPullParserException { + "}"; writeString(new File(projectDir, "build.gradle"), buildFileContent); // Execute the task publishPluginZipPublicationToZipStagingRepository + List allArguments = new ArrayList(); + allArguments.add("build"); + allArguments.add(zipPublishTask); GradleRunner runner = GradleRunner.create(); runner.forwardOutput(); runner.withPluginClasspath(); - runner.withArguments(zipPublishTask); + runner.withArguments(allArguments); runner.withProjectDir(projectDir); BuildResult result = runner.build(); // Check if task publishMavenzipPublicationToZipstagingRepository has ran well @@ -87,6 +93,7 @@ public void testZipPublish() throws IOException, XmlPullParserException { new File("build/functionalTest/local-staging-repo/org/opensearch/plugin/sample-plugin/2.0.0.0/sample-plugin-2.0.0.0.zip") .exists() ); + assertEquals(SUCCESS, result.task(":" + "build").getOutcome()); // Parse the maven file and validate the groupID to org.opensearch.plugin MavenXpp3Reader reader = new MavenXpp3Reader(); Model model = reader.read( From f24566065106d3d591ab8292c18f19723bc44e2d Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Sat, 7 May 2022 14:21:38 -0400 Subject: [PATCH 135/514] [Remove] TypeFieldMapper (#3196) (#3198) Removes last trace of TypeFieldMapper since types have been removed and NestedPathFieldMapper is now available. Signed-off-by: Nicholas Walter Knize (cherry picked from commit 741445a574d0df94fdf3406df44d5e9fc4e4a284) Co-authored-by: Nick Knize --- .../common/lucene/search/Queries.java | 6 +- .../index/mapper/TypeFieldMapper.java | 187 ------------------ 2 files changed, 1 insertion(+), 192 deletions(-) delete mode 100644 server/src/main/java/org/opensearch/index/mapper/TypeFieldMapper.java diff --git a/server/src/main/java/org/opensearch/common/lucene/search/Queries.java b/server/src/main/java/org/opensearch/common/lucene/search/Queries.java index 2f500efba9e8e..ac77420a79f73 100644 --- a/server/src/main/java/org/opensearch/common/lucene/search/Queries.java +++ b/server/src/main/java/org/opensearch/common/lucene/search/Queries.java @@ -33,7 +33,6 @@ package org.opensearch.common.lucene.search; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.Term; import org.apache.lucene.queries.ExtendedCommonTermsQuery; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanClause.Occur; @@ -43,17 +42,14 @@ import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.MatchNoDocsQuery; -import org.apache.lucene.search.PrefixQuery; import org.apache.lucene.search.Query; import org.apache.lucene.search.QueryVisitor; import org.apache.lucene.search.ScoreMode; import org.apache.lucene.search.Scorer; import org.apache.lucene.search.Weight; -import org.apache.lucene.util.BytesRef; import org.opensearch.OpenSearchException; import org.opensearch.common.Nullable; import org.opensearch.index.mapper.SeqNoFieldMapper; -import org.opensearch.index.mapper.TypeFieldMapper; import java.io.IOException; import java.util.Collection; @@ -87,7 +83,7 @@ public static Query newLenientFieldQuery(String field, RuntimeException e) { } public static Query newNestedFilter() { - return new PrefixQuery(new Term(TypeFieldMapper.NAME, new BytesRef("__"))); + return not(newNonNestedFilter()); } /** diff --git a/server/src/main/java/org/opensearch/index/mapper/TypeFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/TypeFieldMapper.java deleted file mode 100644 index 8d3f1df677040..0000000000000 --- a/server/src/main/java/org/opensearch/index/mapper/TypeFieldMapper.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.index.mapper; - -import org.apache.lucene.document.Field; -import org.apache.lucene.document.FieldType; -import org.apache.lucene.document.SortedSetDocValuesField; -import org.apache.lucene.index.IndexOptions; -import org.apache.lucene.search.MatchAllDocsQuery; -import org.apache.lucene.search.MatchNoDocsQuery; -import org.apache.lucene.search.Query; -import org.apache.lucene.util.BytesRef; -import org.opensearch.common.geo.ShapeRelation; -import org.opensearch.common.regex.Regex; -import org.opensearch.common.time.DateMathParser; -import org.opensearch.index.fielddata.IndexFieldData; -import org.opensearch.index.fielddata.plain.ConstantIndexFieldData; -import org.opensearch.index.query.QueryShardContext; -import org.opensearch.search.aggregations.support.CoreValuesSourceType; -import org.opensearch.search.lookup.SearchLookup; - -import java.time.ZoneId; -import java.util.Collections; -import java.util.Objects; -import java.util.function.Supplier; - -// Todo: Remove TypeFieldMapper once we have NestedFieldMapper implementation -public class TypeFieldMapper extends MetadataFieldMapper { - - public static final String NAME = "_type"; - - public static final String CONTENT_TYPE = "_type"; - - public static final TypeParser PARSER = new FixedTypeParser(c -> new TypeFieldMapper()); - - public static class Defaults { - - public static final FieldType NESTED_FIELD_TYPE = new FieldType(); - - static { - NESTED_FIELD_TYPE.setIndexOptions(IndexOptions.DOCS); - NESTED_FIELD_TYPE.setTokenized(false); - NESTED_FIELD_TYPE.setStored(false); - NESTED_FIELD_TYPE.setOmitNorms(true); - NESTED_FIELD_TYPE.freeze(); - } - } - - public static final class TypeFieldType extends ConstantFieldType { - - private final String type; - - public TypeFieldType(String type) { - super(NAME, Collections.emptyMap()); - this.type = type; - } - - @Override - public String typeName() { - return CONTENT_TYPE; - } - - @Override - public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName, Supplier searchLookup) { - return new ConstantIndexFieldData.Builder(type, name(), CoreValuesSourceType.BYTES); - } - - @Override - public ValueFetcher valueFetcher(QueryShardContext context, SearchLookup lookup, String format) { - throw new UnsupportedOperationException("Cannot fetch values for internal field [" + name() + "]."); - } - - @Override - public Query existsQuery(QueryShardContext context) { - return new MatchAllDocsQuery(); - } - - @Override - protected boolean matches(String pattern, boolean caseInsensitive, QueryShardContext context) { - if (type == null) { - return false; - } - return Regex.simpleMatch(pattern, type, caseInsensitive); - } - - @Override - public Query rangeQuery( - Object lowerTerm, - Object upperTerm, - boolean includeLower, - boolean includeUpper, - ShapeRelation relation, - ZoneId timeZone, - DateMathParser parser, - QueryShardContext context - ) { - BytesRef lower = (BytesRef) lowerTerm; - BytesRef upper = (BytesRef) upperTerm; - if (includeLower) { - if (lower.utf8ToString().compareTo(type) > 0) { - return new MatchNoDocsQuery(); - } - } else { - if (lower.utf8ToString().compareTo(type) >= 0) { - return new MatchNoDocsQuery(); - } - } - if (includeUpper) { - if (upper.utf8ToString().compareTo(type) < 0) { - return new MatchNoDocsQuery(); - } - } else { - if (upper.utf8ToString().compareTo(type) <= 0) { - return new MatchNoDocsQuery(); - } - } - return new MatchAllDocsQuery(); - } - - /** - * Build a type filter - * - * This does not emit a deprecation warning, as it is only called when a type - * has been specified in a REST request and warnings will have already been - * emitted at the REST layer. - */ - public Query typeFilter(String[] types) { - for (String t : types) { - if (Objects.equals(this.type, t)) { - return new MatchAllDocsQuery(); - } - } - return new MatchNoDocsQuery(); - } - } - - private TypeFieldMapper() { - super(new TypeFieldType(null)); - } - - @Override - public void preParse(ParseContext context) { - if (fieldType.indexOptions() == IndexOptions.NONE && !fieldType.stored()) { - return; - } - context.doc().add(new Field(fieldType().name(), MapperService.SINGLE_MAPPING_NAME, fieldType)); - if (fieldType().hasDocValues()) { - context.doc().add(new SortedSetDocValuesField(fieldType().name(), new BytesRef(MapperService.SINGLE_MAPPING_NAME))); - } - } - - @Override - protected String contentType() { - return CONTENT_TYPE; - } - -} From d2fb921eac2b74d0b7dfb20403ff8db9c1db8389 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Sat, 7 May 2022 14:22:20 -0400 Subject: [PATCH 136/514] [Javadocs] add to o.o.transport (#3220) (#3224) Adds javadocs to the org.opensearch.transport package. Signed-off-by: Nicholas Walter Knize (cherry picked from commit a7715ab6cedebc8c86ad620f6a250a2994eae4c8) Co-authored-by: Nick Knize --- .../transport/ActionNotFoundTransportException.java | 2 +- .../org/opensearch/transport/ActionTransportException.java | 2 +- .../org/opensearch/transport/BindTransportException.java | 5 +++++ .../java/org/opensearch/transport/BytesTransportRequest.java | 2 ++ .../java/org/opensearch/transport/CloseableConnection.java | 2 ++ .../org/opensearch/transport/ClusterConnectionManager.java | 2 ++ .../opensearch/transport/CompressibleBytesOutputStream.java | 2 ++ .../org/opensearch/transport/ConnectTransportException.java | 5 +++++ .../java/org/opensearch/transport/ConnectionManager.java | 5 +++++ .../java/org/opensearch/transport/ConnectionProfile.java | 2 ++ .../opensearch/transport/EmptyTransportResponseHandler.java | 5 +++++ .../opensearch/transport/FutureTransportResponseHandler.java | 2 ++ server/src/main/java/org/opensearch/transport/Header.java | 5 +++++ .../java/org/opensearch/transport/InboundAggregator.java | 5 +++++ .../main/java/org/opensearch/transport/InboundDecoder.java | 5 +++++ .../main/java/org/opensearch/transport/InboundHandler.java | 5 +++++ .../main/java/org/opensearch/transport/InboundMessage.java | 5 +++++ .../main/java/org/opensearch/transport/InboundPipeline.java | 5 +++++ .../main/java/org/opensearch/transport/NetworkMessage.java | 2 ++ .../org/opensearch/transport/NoSeedNodeLeftException.java | 2 ++ .../opensearch/transport/NoSuchRemoteClusterException.java | 2 ++ .../org/opensearch/transport/NodeDisconnectedException.java | 5 +++++ .../org/opensearch/transport/NodeNotConnectedException.java | 2 +- .../opensearch/transport/NodeShouldNotConnectException.java | 5 +++++ .../transport/NotSerializableTransportException.java | 5 +++++ .../main/java/org/opensearch/transport/OutboundHandler.java | 5 +++++ .../main/java/org/opensearch/transport/OutboundMessage.java | 5 +++++ .../java/org/opensearch/transport/PlainTransportFuture.java | 5 +++++ .../org/opensearch/transport/ProxyConnectionStrategy.java | 5 +++++ .../transport/ReceiveTimeoutTransportException.java | 5 +++++ .../java/org/opensearch/transport/RemoteClusterAware.java | 2 ++ .../org/opensearch/transport/RemoteClusterAwareClient.java | 5 +++++ .../org/opensearch/transport/RemoteClusterAwareRequest.java | 5 +++++ .../org/opensearch/transport/RemoteClusterConnection.java | 2 ++ .../java/org/opensearch/transport/RemoteClusterService.java | 2 ++ .../java/org/opensearch/transport/RemoteConnectionInfo.java | 2 ++ .../org/opensearch/transport/RemoteConnectionManager.java | 5 +++++ .../org/opensearch/transport/RemoteConnectionStrategy.java | 5 +++++ .../org/opensearch/transport/RemoteTransportException.java | 2 +- .../transport/ResponseHandlerFailureTransportException.java | 2 ++ .../opensearch/transport/SendRequestTransportException.java | 5 +++++ .../org/opensearch/transport/SniffConnectionStrategy.java | 5 +++++ .../java/org/opensearch/transport/TaskTransportChannel.java | 5 +++++ .../src/main/java/org/opensearch/transport/TcpChannel.java | 2 ++ server/src/main/java/org/opensearch/transport/TcpHeader.java | 5 +++++ .../main/java/org/opensearch/transport/TcpServerChannel.java | 2 ++ .../src/main/java/org/opensearch/transport/TcpTransport.java | 5 +++++ .../java/org/opensearch/transport/TcpTransportChannel.java | 5 +++++ server/src/main/java/org/opensearch/transport/Transport.java | 5 +++++ .../java/org/opensearch/transport/TransportActionProxy.java | 2 ++ .../main/java/org/opensearch/transport/TransportChannel.java | 2 ++ .../opensearch/transport/TransportConnectionListener.java | 2 ++ .../java/org/opensearch/transport/TransportDecompressor.java | 5 +++++ .../java/org/opensearch/transport/TransportException.java | 5 +++++ .../main/java/org/opensearch/transport/TransportFuture.java | 5 +++++ .../java/org/opensearch/transport/TransportHandshaker.java | 2 ++ .../main/java/org/opensearch/transport/TransportInfo.java | 5 +++++ .../java/org/opensearch/transport/TransportInterceptor.java | 2 ++ .../java/org/opensearch/transport/TransportKeepAlive.java | 2 ++ .../main/java/org/opensearch/transport/TransportLogger.java | 5 +++++ .../main/java/org/opensearch/transport/TransportMessage.java | 5 +++++ .../org/opensearch/transport/TransportMessageListener.java | 5 +++++ .../main/java/org/opensearch/transport/TransportRequest.java | 5 +++++ .../opensearch/transport/TransportRequestDeduplicator.java | 2 ++ .../org/opensearch/transport/TransportRequestHandler.java | 5 +++++ .../org/opensearch/transport/TransportRequestOptions.java | 5 +++++ .../java/org/opensearch/transport/TransportResponse.java | 5 +++++ .../org/opensearch/transport/TransportResponseHandler.java | 5 +++++ .../transport/TransportSerializationException.java | 5 +++++ .../main/java/org/opensearch/transport/TransportService.java | 5 +++++ .../java/org/opensearch/transport/TransportSettings.java | 5 +++++ .../main/java/org/opensearch/transport/TransportStats.java | 5 +++++ .../main/java/org/opensearch/transport/TransportStatus.java | 5 +++++ .../src/main/java/org/opensearch/transport/Transports.java | 5 +++++ 74 files changed, 285 insertions(+), 4 deletions(-) diff --git a/server/src/main/java/org/opensearch/transport/ActionNotFoundTransportException.java b/server/src/main/java/org/opensearch/transport/ActionNotFoundTransportException.java index c9d064261cc30..0f12c63a1b58e 100644 --- a/server/src/main/java/org/opensearch/transport/ActionNotFoundTransportException.java +++ b/server/src/main/java/org/opensearch/transport/ActionNotFoundTransportException.java @@ -40,7 +40,7 @@ /** * An exception indicating that a transport action was not found. * - * + * @opensearch.internal */ public class ActionNotFoundTransportException extends TransportException { diff --git a/server/src/main/java/org/opensearch/transport/ActionTransportException.java b/server/src/main/java/org/opensearch/transport/ActionTransportException.java index 387f150710645..c9fbddec941b3 100644 --- a/server/src/main/java/org/opensearch/transport/ActionTransportException.java +++ b/server/src/main/java/org/opensearch/transport/ActionTransportException.java @@ -41,7 +41,7 @@ /** * An action invocation failure. * - * + * @opensearch.internal */ public class ActionTransportException extends TransportException { diff --git a/server/src/main/java/org/opensearch/transport/BindTransportException.java b/server/src/main/java/org/opensearch/transport/BindTransportException.java index 827a45ba0161d..918906e2b4759 100644 --- a/server/src/main/java/org/opensearch/transport/BindTransportException.java +++ b/server/src/main/java/org/opensearch/transport/BindTransportException.java @@ -36,6 +36,11 @@ import java.io.IOException; +/** + * A transport binding failure. + * + * @opensearch.internal + */ public class BindTransportException extends TransportException { public BindTransportException(StreamInput in) throws IOException { diff --git a/server/src/main/java/org/opensearch/transport/BytesTransportRequest.java b/server/src/main/java/org/opensearch/transport/BytesTransportRequest.java index 75e35a1cdcce2..cb623adf1c26b 100644 --- a/server/src/main/java/org/opensearch/transport/BytesTransportRequest.java +++ b/server/src/main/java/org/opensearch/transport/BytesTransportRequest.java @@ -42,6 +42,8 @@ /** * A specialized, bytes only request, that can potentially be optimized on the network * layer, specifically for the same large buffer send to several nodes. + * + * @opensearch.internal */ public class BytesTransportRequest extends TransportRequest { diff --git a/server/src/main/java/org/opensearch/transport/CloseableConnection.java b/server/src/main/java/org/opensearch/transport/CloseableConnection.java index 7d59279e1bac7..b612f2bd17e0f 100644 --- a/server/src/main/java/org/opensearch/transport/CloseableConnection.java +++ b/server/src/main/java/org/opensearch/transport/CloseableConnection.java @@ -37,6 +37,8 @@ /** * Abstract Transport.Connection that provides common close logic. + * + * @opensearch.internal */ public abstract class CloseableConnection implements Transport.Connection { diff --git a/server/src/main/java/org/opensearch/transport/ClusterConnectionManager.java b/server/src/main/java/org/opensearch/transport/ClusterConnectionManager.java index c44b3cf11c14d..5616980254adf 100644 --- a/server/src/main/java/org/opensearch/transport/ClusterConnectionManager.java +++ b/server/src/main/java/org/opensearch/transport/ClusterConnectionManager.java @@ -55,6 +55,8 @@ * This class manages node connections within a cluster. The connection is opened by the underlying transport. * Once the connection is opened, this class manages the connection. This includes closing the connection when * the connection manager is closed. + * + * @opensearch.internal */ public class ClusterConnectionManager implements ConnectionManager { diff --git a/server/src/main/java/org/opensearch/transport/CompressibleBytesOutputStream.java b/server/src/main/java/org/opensearch/transport/CompressibleBytesOutputStream.java index 3d2af65127362..5c11694431fc5 100644 --- a/server/src/main/java/org/opensearch/transport/CompressibleBytesOutputStream.java +++ b/server/src/main/java/org/opensearch/transport/CompressibleBytesOutputStream.java @@ -55,6 +55,8 @@ * * {@link CompressibleBytesOutputStream#close()} will NOT close the underlying stream. The byte stream passed * in the constructor must be closed individually. + * + * @opensearch.internal */ final class CompressibleBytesOutputStream extends StreamOutput { diff --git a/server/src/main/java/org/opensearch/transport/ConnectTransportException.java b/server/src/main/java/org/opensearch/transport/ConnectTransportException.java index 5c5ce933647c6..0267cab686264 100644 --- a/server/src/main/java/org/opensearch/transport/ConnectTransportException.java +++ b/server/src/main/java/org/opensearch/transport/ConnectTransportException.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Transport connection exception + * + * @opensearch.internal + */ public class ConnectTransportException extends ActionTransportException { private final DiscoveryNode node; diff --git a/server/src/main/java/org/opensearch/transport/ConnectionManager.java b/server/src/main/java/org/opensearch/transport/ConnectionManager.java index dfac5acfc9230..3fcd05029a4c9 100644 --- a/server/src/main/java/org/opensearch/transport/ConnectionManager.java +++ b/server/src/main/java/org/opensearch/transport/ConnectionManager.java @@ -39,6 +39,11 @@ import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; +/** + * Transport connection manager. + * + * @opensearch.internal + */ public interface ConnectionManager extends Closeable { void addListener(TransportConnectionListener listener); diff --git a/server/src/main/java/org/opensearch/transport/ConnectionProfile.java b/server/src/main/java/org/opensearch/transport/ConnectionProfile.java index 61129565b23f3..5b657efcabd3e 100644 --- a/server/src/main/java/org/opensearch/transport/ConnectionProfile.java +++ b/server/src/main/java/org/opensearch/transport/ConnectionProfile.java @@ -48,6 +48,8 @@ /** * A connection profile describes how many connection are established to specific node for each of the available request types. * ({@link org.opensearch.transport.TransportRequestOptions.Type}). This allows to tailor a connection towards a specific usage. + * + * @opensearch.internal */ public final class ConnectionProfile { diff --git a/server/src/main/java/org/opensearch/transport/EmptyTransportResponseHandler.java b/server/src/main/java/org/opensearch/transport/EmptyTransportResponseHandler.java index b76ede361cada..c4fd78fd72ef4 100644 --- a/server/src/main/java/org/opensearch/transport/EmptyTransportResponseHandler.java +++ b/server/src/main/java/org/opensearch/transport/EmptyTransportResponseHandler.java @@ -35,6 +35,11 @@ import org.opensearch.common.io.stream.StreamInput; import org.opensearch.threadpool.ThreadPool; +/** + * Handler for empty transport response + * + * @opensearch.internal + */ public class EmptyTransportResponseHandler implements TransportResponseHandler { public static final EmptyTransportResponseHandler INSTANCE_SAME = new EmptyTransportResponseHandler(ThreadPool.Names.SAME); diff --git a/server/src/main/java/org/opensearch/transport/FutureTransportResponseHandler.java b/server/src/main/java/org/opensearch/transport/FutureTransportResponseHandler.java index 4d8bca6d99a9a..71651274ede40 100644 --- a/server/src/main/java/org/opensearch/transport/FutureTransportResponseHandler.java +++ b/server/src/main/java/org/opensearch/transport/FutureTransportResponseHandler.java @@ -36,6 +36,8 @@ /** * A response handler to be used when all interaction will be done through the {@link TransportFuture}. + * + * @opensearch.internal */ public abstract class FutureTransportResponseHandler implements TransportResponseHandler { diff --git a/server/src/main/java/org/opensearch/transport/Header.java b/server/src/main/java/org/opensearch/transport/Header.java index 009a362527e9c..f73d3fcc74e72 100644 --- a/server/src/main/java/org/opensearch/transport/Header.java +++ b/server/src/main/java/org/opensearch/transport/Header.java @@ -44,6 +44,11 @@ import java.util.Set; import java.util.TreeSet; +/** + * Transport Header + * + * @opensearch.internal + */ public class Header { private static final String RESPONSE_NAME = "NO_ACTION_NAME_FOR_RESPONSES"; diff --git a/server/src/main/java/org/opensearch/transport/InboundAggregator.java b/server/src/main/java/org/opensearch/transport/InboundAggregator.java index a6e8ce6e14aa7..321db13751906 100644 --- a/server/src/main/java/org/opensearch/transport/InboundAggregator.java +++ b/server/src/main/java/org/opensearch/transport/InboundAggregator.java @@ -48,6 +48,11 @@ import java.util.function.Predicate; import java.util.function.Supplier; +/** + * Aggregates inbound data + * + * @opensearch.internal + */ public class InboundAggregator implements Releasable { private final Supplier circuitBreaker; diff --git a/server/src/main/java/org/opensearch/transport/InboundDecoder.java b/server/src/main/java/org/opensearch/transport/InboundDecoder.java index 9cfb4a79161e7..e857c1a967f50 100644 --- a/server/src/main/java/org/opensearch/transport/InboundDecoder.java +++ b/server/src/main/java/org/opensearch/transport/InboundDecoder.java @@ -43,6 +43,11 @@ import java.io.IOException; import java.util.function.Consumer; +/** + * Decodes inbound data off the wire + * + * @opensearch.internal + */ public class InboundDecoder implements Releasable { static final Object PING = new Object(); diff --git a/server/src/main/java/org/opensearch/transport/InboundHandler.java b/server/src/main/java/org/opensearch/transport/InboundHandler.java index 6aa319934b478..21a23461c1b8a 100644 --- a/server/src/main/java/org/opensearch/transport/InboundHandler.java +++ b/server/src/main/java/org/opensearch/transport/InboundHandler.java @@ -52,6 +52,11 @@ import java.net.InetSocketAddress; import java.nio.ByteBuffer; +/** + * Handler for inbound data + * + * @opensearch.internal + */ public class InboundHandler { private static final Logger logger = LogManager.getLogger(InboundHandler.class); diff --git a/server/src/main/java/org/opensearch/transport/InboundMessage.java b/server/src/main/java/org/opensearch/transport/InboundMessage.java index 7835771ec4d8e..815f77779d139 100644 --- a/server/src/main/java/org/opensearch/transport/InboundMessage.java +++ b/server/src/main/java/org/opensearch/transport/InboundMessage.java @@ -40,6 +40,11 @@ import java.io.IOException; +/** + * Inbound data as a message + * + * @opensearch.internal + */ public class InboundMessage implements Releasable { private final Header header; diff --git a/server/src/main/java/org/opensearch/transport/InboundPipeline.java b/server/src/main/java/org/opensearch/transport/InboundPipeline.java index 924b9f995eccf..aeb2e228d125c 100644 --- a/server/src/main/java/org/opensearch/transport/InboundPipeline.java +++ b/server/src/main/java/org/opensearch/transport/InboundPipeline.java @@ -48,6 +48,11 @@ import java.util.function.LongSupplier; import java.util.function.Supplier; +/** + * Pipeline for receiving inbound messages + * + * @opensearch.internal + */ public class InboundPipeline implements Releasable { private static final ThreadLocal> fragmentList = ThreadLocal.withInitial(ArrayList::new); diff --git a/server/src/main/java/org/opensearch/transport/NetworkMessage.java b/server/src/main/java/org/opensearch/transport/NetworkMessage.java index 8dd6c740d72e4..6b53935a863dd 100644 --- a/server/src/main/java/org/opensearch/transport/NetworkMessage.java +++ b/server/src/main/java/org/opensearch/transport/NetworkMessage.java @@ -38,6 +38,8 @@ /** * Represents a transport message sent over the network. Subclasses implement serialization and * deserialization. + * + * @opensearch.internal */ public abstract class NetworkMessage { diff --git a/server/src/main/java/org/opensearch/transport/NoSeedNodeLeftException.java b/server/src/main/java/org/opensearch/transport/NoSeedNodeLeftException.java index fb3978b346275..4a75889d08e17 100644 --- a/server/src/main/java/org/opensearch/transport/NoSeedNodeLeftException.java +++ b/server/src/main/java/org/opensearch/transport/NoSeedNodeLeftException.java @@ -39,6 +39,8 @@ /** * Thrown after failed to connect to all seed nodes of the remote cluster. + * + * @opensearch.internal */ public class NoSeedNodeLeftException extends OpenSearchException { diff --git a/server/src/main/java/org/opensearch/transport/NoSuchRemoteClusterException.java b/server/src/main/java/org/opensearch/transport/NoSuchRemoteClusterException.java index 9a91d19d70f5d..cc6c349191b8f 100644 --- a/server/src/main/java/org/opensearch/transport/NoSuchRemoteClusterException.java +++ b/server/src/main/java/org/opensearch/transport/NoSuchRemoteClusterException.java @@ -40,6 +40,8 @@ /** * An exception that remote cluster is missing or * connectivity to the remote connection is failing + * + * @opensearch.internal */ public final class NoSuchRemoteClusterException extends ResourceNotFoundException { diff --git a/server/src/main/java/org/opensearch/transport/NodeDisconnectedException.java b/server/src/main/java/org/opensearch/transport/NodeDisconnectedException.java index d43fe105dcd43..e12f84a5de70c 100644 --- a/server/src/main/java/org/opensearch/transport/NodeDisconnectedException.java +++ b/server/src/main/java/org/opensearch/transport/NodeDisconnectedException.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Exception thrown if a node disconnects + * + * @opensearch.internal + */ public class NodeDisconnectedException extends ConnectTransportException { public NodeDisconnectedException(DiscoveryNode node, String action) { diff --git a/server/src/main/java/org/opensearch/transport/NodeNotConnectedException.java b/server/src/main/java/org/opensearch/transport/NodeNotConnectedException.java index 134c1f7c08a3c..a94adb0ec5678 100644 --- a/server/src/main/java/org/opensearch/transport/NodeNotConnectedException.java +++ b/server/src/main/java/org/opensearch/transport/NodeNotConnectedException.java @@ -40,7 +40,7 @@ /** * An exception indicating that a message is sent to a node that is not connected. * - * + * @opensearch.internal */ public class NodeNotConnectedException extends ConnectTransportException { diff --git a/server/src/main/java/org/opensearch/transport/NodeShouldNotConnectException.java b/server/src/main/java/org/opensearch/transport/NodeShouldNotConnectException.java index 263f4311b399f..7f6521716411b 100644 --- a/server/src/main/java/org/opensearch/transport/NodeShouldNotConnectException.java +++ b/server/src/main/java/org/opensearch/transport/NodeShouldNotConnectException.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Exception thrown if a node should not disconnect + * + * @opensearch.internal + */ public class NodeShouldNotConnectException extends NodeNotConnectedException { public NodeShouldNotConnectException(DiscoveryNode fromNode, DiscoveryNode node) { diff --git a/server/src/main/java/org/opensearch/transport/NotSerializableTransportException.java b/server/src/main/java/org/opensearch/transport/NotSerializableTransportException.java index 91003dc07059e..6cec3da191a49 100644 --- a/server/src/main/java/org/opensearch/transport/NotSerializableTransportException.java +++ b/server/src/main/java/org/opensearch/transport/NotSerializableTransportException.java @@ -36,6 +36,11 @@ import java.io.IOException; +/** + * Exception thrown if data is not serializable + * + * @opensearch.internal + */ public class NotSerializableTransportException extends TransportException { public NotSerializableTransportException(Throwable t) { diff --git a/server/src/main/java/org/opensearch/transport/OutboundHandler.java b/server/src/main/java/org/opensearch/transport/OutboundHandler.java index 4b9ce7eabb6ce..726fb940ee3e0 100644 --- a/server/src/main/java/org/opensearch/transport/OutboundHandler.java +++ b/server/src/main/java/org/opensearch/transport/OutboundHandler.java @@ -55,6 +55,11 @@ import java.io.IOException; import java.util.Set; +/** + * Outbound data handler + * + * @opensearch.internal + */ final class OutboundHandler { private static final Logger logger = LogManager.getLogger(OutboundHandler.class); diff --git a/server/src/main/java/org/opensearch/transport/OutboundMessage.java b/server/src/main/java/org/opensearch/transport/OutboundMessage.java index 51d0da2c25439..2747a93420282 100644 --- a/server/src/main/java/org/opensearch/transport/OutboundMessage.java +++ b/server/src/main/java/org/opensearch/transport/OutboundMessage.java @@ -43,6 +43,11 @@ import java.io.IOException; import java.util.Set; +/** + * Outbound data as a message + * + * @opensearch.internal + */ abstract class OutboundMessage extends NetworkMessage { private final Writeable message; diff --git a/server/src/main/java/org/opensearch/transport/PlainTransportFuture.java b/server/src/main/java/org/opensearch/transport/PlainTransportFuture.java index 097b5bd7dd573..f09cbc1c89eee 100644 --- a/server/src/main/java/org/opensearch/transport/PlainTransportFuture.java +++ b/server/src/main/java/org/opensearch/transport/PlainTransportFuture.java @@ -42,6 +42,11 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +/** + * Future for transporting data + * + * @opensearch.internal + */ public class PlainTransportFuture extends BaseFuture implements TransportFuture, diff --git a/server/src/main/java/org/opensearch/transport/ProxyConnectionStrategy.java b/server/src/main/java/org/opensearch/transport/ProxyConnectionStrategy.java index 46ae93b62ebd6..c1b35ca00a92b 100644 --- a/server/src/main/java/org/opensearch/transport/ProxyConnectionStrategy.java +++ b/server/src/main/java/org/opensearch/transport/ProxyConnectionStrategy.java @@ -60,6 +60,11 @@ import static org.opensearch.common.settings.Setting.intSetting; +/** + * Connect through a proxy + * + * @opensearch.internal + */ public class ProxyConnectionStrategy extends RemoteConnectionStrategy { /** diff --git a/server/src/main/java/org/opensearch/transport/ReceiveTimeoutTransportException.java b/server/src/main/java/org/opensearch/transport/ReceiveTimeoutTransportException.java index eb14434c951b3..a8985d2175024 100644 --- a/server/src/main/java/org/opensearch/transport/ReceiveTimeoutTransportException.java +++ b/server/src/main/java/org/opensearch/transport/ReceiveTimeoutTransportException.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Thrown when receiving a timeout + * + * @opensearch.internal + */ public class ReceiveTimeoutTransportException extends ActionTransportException { public ReceiveTimeoutTransportException(DiscoveryNode node, String action, String msg) { diff --git a/server/src/main/java/org/opensearch/transport/RemoteClusterAware.java b/server/src/main/java/org/opensearch/transport/RemoteClusterAware.java index d8641bc6f536d..ad8f59f7af6aa 100644 --- a/server/src/main/java/org/opensearch/transport/RemoteClusterAware.java +++ b/server/src/main/java/org/opensearch/transport/RemoteClusterAware.java @@ -47,6 +47,8 @@ /** * Base class for all services and components that need up-to-date information about the registered remote clusters + * + * @opensearch.internal */ public abstract class RemoteClusterAware { diff --git a/server/src/main/java/org/opensearch/transport/RemoteClusterAwareClient.java b/server/src/main/java/org/opensearch/transport/RemoteClusterAwareClient.java index 17dfad6a1b9ac..ac79b21d73f69 100644 --- a/server/src/main/java/org/opensearch/transport/RemoteClusterAwareClient.java +++ b/server/src/main/java/org/opensearch/transport/RemoteClusterAwareClient.java @@ -42,6 +42,11 @@ import org.opensearch.common.settings.Settings; import org.opensearch.threadpool.ThreadPool; +/** + * Client that is aware of remote clusters + * + * @opensearch.internal + */ final class RemoteClusterAwareClient extends AbstractClient { private final TransportService service; diff --git a/server/src/main/java/org/opensearch/transport/RemoteClusterAwareRequest.java b/server/src/main/java/org/opensearch/transport/RemoteClusterAwareRequest.java index aa2da7ac5c288..727519f6ba9e5 100644 --- a/server/src/main/java/org/opensearch/transport/RemoteClusterAwareRequest.java +++ b/server/src/main/java/org/opensearch/transport/RemoteClusterAwareRequest.java @@ -34,6 +34,11 @@ import org.opensearch.cluster.node.DiscoveryNode; +/** + * Request for remote clusters + * + * @opensearch.internal + */ public interface RemoteClusterAwareRequest { /** diff --git a/server/src/main/java/org/opensearch/transport/RemoteClusterConnection.java b/server/src/main/java/org/opensearch/transport/RemoteClusterConnection.java index ff4a2cd7701f8..906513ca62249 100644 --- a/server/src/main/java/org/opensearch/transport/RemoteClusterConnection.java +++ b/server/src/main/java/org/opensearch/transport/RemoteClusterConnection.java @@ -61,6 +61,8 @@ * In the case of a disconnection, this class will issue a re-connect task to establish at most * {@link SniffConnectionStrategy#REMOTE_CONNECTIONS_PER_CLUSTER} until either all eligible nodes are exhausted or the maximum number of * connections per cluster has been reached. + * + * @opensearch.internal */ final class RemoteClusterConnection implements Closeable { diff --git a/server/src/main/java/org/opensearch/transport/RemoteClusterService.java b/server/src/main/java/org/opensearch/transport/RemoteClusterService.java index 8791a322b2c59..fcdeec36f865c 100644 --- a/server/src/main/java/org/opensearch/transport/RemoteClusterService.java +++ b/server/src/main/java/org/opensearch/transport/RemoteClusterService.java @@ -74,6 +74,8 @@ /** * Basic service for accessing remote clusters via gateway nodes + * + * @opensearch.internal */ public final class RemoteClusterService extends RemoteClusterAware implements Closeable { diff --git a/server/src/main/java/org/opensearch/transport/RemoteConnectionInfo.java b/server/src/main/java/org/opensearch/transport/RemoteConnectionInfo.java index c23287de4e444..7ca1d646a9507 100644 --- a/server/src/main/java/org/opensearch/transport/RemoteConnectionInfo.java +++ b/server/src/main/java/org/opensearch/transport/RemoteConnectionInfo.java @@ -54,6 +54,8 @@ /** * This class encapsulates all remote cluster information to be rendered on * {@code _remote/info} requests. + * + * @opensearch.internal */ public final class RemoteConnectionInfo implements ToXContentFragment, Writeable { diff --git a/server/src/main/java/org/opensearch/transport/RemoteConnectionManager.java b/server/src/main/java/org/opensearch/transport/RemoteConnectionManager.java index 67ca7e9c753ce..4da23175c4a0e 100644 --- a/server/src/main/java/org/opensearch/transport/RemoteConnectionManager.java +++ b/server/src/main/java/org/opensearch/transport/RemoteConnectionManager.java @@ -42,6 +42,11 @@ import java.util.Set; import java.util.concurrent.atomic.AtomicLong; +/** + * Manager for connecting to remote nodes + * + * @opensearch.internal + */ public class RemoteConnectionManager implements ConnectionManager { private final String clusterAlias; diff --git a/server/src/main/java/org/opensearch/transport/RemoteConnectionStrategy.java b/server/src/main/java/org/opensearch/transport/RemoteConnectionStrategy.java index 3903baff3a9bb..8d5727858ec6f 100644 --- a/server/src/main/java/org/opensearch/transport/RemoteConnectionStrategy.java +++ b/server/src/main/java/org/opensearch/transport/RemoteConnectionStrategy.java @@ -68,6 +68,11 @@ import java.util.stream.Collectors; import java.util.stream.Stream; +/** + * Strategy to connect to remote nodes + * + * @opensearch.internal + */ public abstract class RemoteConnectionStrategy implements TransportConnectionListener, Closeable { enum ConnectionStrategy { diff --git a/server/src/main/java/org/opensearch/transport/RemoteTransportException.java b/server/src/main/java/org/opensearch/transport/RemoteTransportException.java index b07cada0edb1b..a02f470c3a4ae 100644 --- a/server/src/main/java/org/opensearch/transport/RemoteTransportException.java +++ b/server/src/main/java/org/opensearch/transport/RemoteTransportException.java @@ -42,7 +42,7 @@ * A remote exception for an action. A wrapper exception around the actual remote cause and does not fill the * stack trace. * - * + * @opensearch.internal */ public class RemoteTransportException extends ActionTransportException implements OpenSearchWrapperException { diff --git a/server/src/main/java/org/opensearch/transport/ResponseHandlerFailureTransportException.java b/server/src/main/java/org/opensearch/transport/ResponseHandlerFailureTransportException.java index 984235738a45d..9de4ad04d6ed0 100644 --- a/server/src/main/java/org/opensearch/transport/ResponseHandlerFailureTransportException.java +++ b/server/src/main/java/org/opensearch/transport/ResponseHandlerFailureTransportException.java @@ -38,6 +38,8 @@ /** * A failure to handle the response of a transaction action. + * + * @opensearch.internal */ public class ResponseHandlerFailureTransportException extends TransportException { diff --git a/server/src/main/java/org/opensearch/transport/SendRequestTransportException.java b/server/src/main/java/org/opensearch/transport/SendRequestTransportException.java index 5cf079ea9872c..929292a2cea58 100644 --- a/server/src/main/java/org/opensearch/transport/SendRequestTransportException.java +++ b/server/src/main/java/org/opensearch/transport/SendRequestTransportException.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Thrown when an error occurs while sending a request + * + * @opensearch.internal + */ public class SendRequestTransportException extends ActionTransportException implements OpenSearchWrapperException { public SendRequestTransportException(DiscoveryNode node, String action, Throwable cause) { diff --git a/server/src/main/java/org/opensearch/transport/SniffConnectionStrategy.java b/server/src/main/java/org/opensearch/transport/SniffConnectionStrategy.java index 5d2b2d3ac684f..c84c5599bb746 100644 --- a/server/src/main/java/org/opensearch/transport/SniffConnectionStrategy.java +++ b/server/src/main/java/org/opensearch/transport/SniffConnectionStrategy.java @@ -74,6 +74,11 @@ import static org.opensearch.common.settings.Setting.intSetting; +/** + * Sniff for initial seed nodes + * + * @opensearch.internal + */ public class SniffConnectionStrategy extends RemoteConnectionStrategy { /** diff --git a/server/src/main/java/org/opensearch/transport/TaskTransportChannel.java b/server/src/main/java/org/opensearch/transport/TaskTransportChannel.java index 5faf12c3b991f..4dceee4c48d4d 100644 --- a/server/src/main/java/org/opensearch/transport/TaskTransportChannel.java +++ b/server/src/main/java/org/opensearch/transport/TaskTransportChannel.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Transport channel for tasks + * + * @opensearch.internal + */ public class TaskTransportChannel implements TransportChannel { private final TransportChannel channel; diff --git a/server/src/main/java/org/opensearch/transport/TcpChannel.java b/server/src/main/java/org/opensearch/transport/TcpChannel.java index 1b07c963890d6..4202b906ce161 100644 --- a/server/src/main/java/org/opensearch/transport/TcpChannel.java +++ b/server/src/main/java/org/opensearch/transport/TcpChannel.java @@ -43,6 +43,8 @@ * This is a tcp channel representing a single channel connection to another node. It is the base channel * abstraction used by the {@link TcpTransport} and {@link TransportService}. All tcp transport * implementations must return channels that adhere to the required method contracts. + * + * @opensearch.internal */ public interface TcpChannel extends CloseableChannel { diff --git a/server/src/main/java/org/opensearch/transport/TcpHeader.java b/server/src/main/java/org/opensearch/transport/TcpHeader.java index 514ebfff6f8f6..747968ffc8fef 100644 --- a/server/src/main/java/org/opensearch/transport/TcpHeader.java +++ b/server/src/main/java/org/opensearch/transport/TcpHeader.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Header for TCP messages + * + * @opensearch.internal + */ public class TcpHeader { public static final Version VERSION_WITH_HEADER_SIZE = LegacyESVersion.V_7_6_0; diff --git a/server/src/main/java/org/opensearch/transport/TcpServerChannel.java b/server/src/main/java/org/opensearch/transport/TcpServerChannel.java index fa3d6499d7d62..7d61b8c7d699c 100644 --- a/server/src/main/java/org/opensearch/transport/TcpServerChannel.java +++ b/server/src/main/java/org/opensearch/transport/TcpServerChannel.java @@ -40,6 +40,8 @@ * This is a tcp channel representing a server channel listening for new connections. It is the server * channel abstraction used by the {@link TcpTransport} and {@link TransportService}. All tcp transport * implementations must return server channels that adhere to the required method contracts. + * + * @opensearch.internal */ public interface TcpServerChannel extends CloseableChannel { diff --git a/server/src/main/java/org/opensearch/transport/TcpTransport.java b/server/src/main/java/org/opensearch/transport/TcpTransport.java index c2a0584721148..76a0671a40c3e 100644 --- a/server/src/main/java/org/opensearch/transport/TcpTransport.java +++ b/server/src/main/java/org/opensearch/transport/TcpTransport.java @@ -109,6 +109,11 @@ import static org.opensearch.common.transport.NetworkExceptionHelper.isConnectException; import static org.opensearch.common.util.concurrent.ConcurrentCollections.newConcurrentMap; +/** + * The TCP Transport layer + * + * @opensearch.internal + */ public abstract class TcpTransport extends AbstractLifecycleComponent implements Transport { private static final Logger logger = LogManager.getLogger(TcpTransport.class); diff --git a/server/src/main/java/org/opensearch/transport/TcpTransportChannel.java b/server/src/main/java/org/opensearch/transport/TcpTransportChannel.java index 9c91cd3df8c89..e25003648794d 100644 --- a/server/src/main/java/org/opensearch/transport/TcpTransportChannel.java +++ b/server/src/main/java/org/opensearch/transport/TcpTransportChannel.java @@ -40,6 +40,11 @@ import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; +/** + * Channel for a TCP connection + * + * @opensearch.internal + */ public final class TcpTransportChannel implements TransportChannel { private final AtomicBoolean released = new AtomicBoolean(); diff --git a/server/src/main/java/org/opensearch/transport/Transport.java b/server/src/main/java/org/opensearch/transport/Transport.java index 0946d9c8ec626..cf917d2a532dc 100644 --- a/server/src/main/java/org/opensearch/transport/Transport.java +++ b/server/src/main/java/org/opensearch/transport/Transport.java @@ -53,6 +53,11 @@ import java.util.concurrent.atomic.AtomicLong; import java.util.function.Predicate; +/** + * OpenSearch Transport Interface + * + * @opensearch.internal + */ public interface Transport extends LifecycleComponent { /** diff --git a/server/src/main/java/org/opensearch/transport/TransportActionProxy.java b/server/src/main/java/org/opensearch/transport/TransportActionProxy.java index 1776ab24d465c..b7cf18e88d924 100644 --- a/server/src/main/java/org/opensearch/transport/TransportActionProxy.java +++ b/server/src/main/java/org/opensearch/transport/TransportActionProxy.java @@ -46,6 +46,8 @@ * TransportActionProxy allows an arbitrary action to be executed on a defined target node while the initial request is sent to a second * node that acts as a request proxy to the target node. This is useful if a node is not directly connected to a target node but is * connected to an intermediate node that establishes a transitive connection. + * + * @opensearch.internal */ public final class TransportActionProxy { diff --git a/server/src/main/java/org/opensearch/transport/TransportChannel.java b/server/src/main/java/org/opensearch/transport/TransportChannel.java index 92d1d07865e52..b660db029c0b2 100644 --- a/server/src/main/java/org/opensearch/transport/TransportChannel.java +++ b/server/src/main/java/org/opensearch/transport/TransportChannel.java @@ -41,6 +41,8 @@ /** * A transport channel allows to send a response to a request on the channel. + * + * @opensearch.internal */ public interface TransportChannel { diff --git a/server/src/main/java/org/opensearch/transport/TransportConnectionListener.java b/server/src/main/java/org/opensearch/transport/TransportConnectionListener.java index 43bfd3f6d0be0..7acb1e9ae09e9 100644 --- a/server/src/main/java/org/opensearch/transport/TransportConnectionListener.java +++ b/server/src/main/java/org/opensearch/transport/TransportConnectionListener.java @@ -38,6 +38,8 @@ * A listener interface that allows to react on transport events. All methods may be * executed on network threads. Consumers must fork in the case of long running or blocking * operations. + * + * @opensearch.internal */ public interface TransportConnectionListener { diff --git a/server/src/main/java/org/opensearch/transport/TransportDecompressor.java b/server/src/main/java/org/opensearch/transport/TransportDecompressor.java index 262438ed75463..7690bfdf35d8a 100644 --- a/server/src/main/java/org/opensearch/transport/TransportDecompressor.java +++ b/server/src/main/java/org/opensearch/transport/TransportDecompressor.java @@ -47,6 +47,11 @@ import java.util.zip.DataFormatException; import java.util.zip.Inflater; +/** + * Decompresses data over the transport wire + * + * @opensearch.internal + */ public class TransportDecompressor implements Closeable { private final Inflater inflater; diff --git a/server/src/main/java/org/opensearch/transport/TransportException.java b/server/src/main/java/org/opensearch/transport/TransportException.java index 00efe52e06ed2..38d1d5d76c644 100644 --- a/server/src/main/java/org/opensearch/transport/TransportException.java +++ b/server/src/main/java/org/opensearch/transport/TransportException.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Thrown for any transport errors + * + * @opensearch.internal + */ public class TransportException extends OpenSearchException { public TransportException(Throwable cause) { super(cause); diff --git a/server/src/main/java/org/opensearch/transport/TransportFuture.java b/server/src/main/java/org/opensearch/transport/TransportFuture.java index 09759c498fc89..d2abf8c20d34e 100644 --- a/server/src/main/java/org/opensearch/transport/TransportFuture.java +++ b/server/src/main/java/org/opensearch/transport/TransportFuture.java @@ -35,6 +35,11 @@ import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; +/** + * Future for transport operations + * + * @opensearch.internal + */ public interface TransportFuture extends Future { /** diff --git a/server/src/main/java/org/opensearch/transport/TransportHandshaker.java b/server/src/main/java/org/opensearch/transport/TransportHandshaker.java index c85a8eebd8fbd..ba2cb4d67b777 100644 --- a/server/src/main/java/org/opensearch/transport/TransportHandshaker.java +++ b/server/src/main/java/org/opensearch/transport/TransportHandshaker.java @@ -52,6 +52,8 @@ /** * Sends and receives transport-level connection handshakes. This class will send the initial handshake, * manage state/timeouts while the handshake is in transit, and handle the eventual response. + * + * @opensearch.internal */ final class TransportHandshaker { diff --git a/server/src/main/java/org/opensearch/transport/TransportInfo.java b/server/src/main/java/org/opensearch/transport/TransportInfo.java index a65b95661bbf1..dcf745039fbf0 100644 --- a/server/src/main/java/org/opensearch/transport/TransportInfo.java +++ b/server/src/main/java/org/opensearch/transport/TransportInfo.java @@ -48,6 +48,11 @@ import static org.opensearch.common.Booleans.parseBoolean; +/** + * Transport information + * + * @opensearch.internal + */ public class TransportInfo implements ReportingService.Info { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(TransportInfo.class); diff --git a/server/src/main/java/org/opensearch/transport/TransportInterceptor.java b/server/src/main/java/org/opensearch/transport/TransportInterceptor.java index ae76bd4899127..755f307f64bb8 100644 --- a/server/src/main/java/org/opensearch/transport/TransportInterceptor.java +++ b/server/src/main/java/org/opensearch/transport/TransportInterceptor.java @@ -37,6 +37,8 @@ /** * This interface allows plugins to intercept requests on both the sender and the receiver side. + * + * @opensearch.internal */ public interface TransportInterceptor { /** diff --git a/server/src/main/java/org/opensearch/transport/TransportKeepAlive.java b/server/src/main/java/org/opensearch/transport/TransportKeepAlive.java index 1874b0f803b78..b90355cf5e775 100644 --- a/server/src/main/java/org/opensearch/transport/TransportKeepAlive.java +++ b/server/src/main/java/org/opensearch/transport/TransportKeepAlive.java @@ -56,6 +56,8 @@ * Implements the scheduling and sending of keep alive pings. Client channels send keep alive pings to the * server and server channels respond. Pings are only sent at the scheduled time if the channel did not send * and receive a message since the last ping. + * + * @opensearch.internal */ final class TransportKeepAlive implements Closeable { diff --git a/server/src/main/java/org/opensearch/transport/TransportLogger.java b/server/src/main/java/org/opensearch/transport/TransportLogger.java index 6de285473c73a..d7eca7e6bc5b0 100644 --- a/server/src/main/java/org/opensearch/transport/TransportLogger.java +++ b/server/src/main/java/org/opensearch/transport/TransportLogger.java @@ -43,6 +43,11 @@ import java.io.IOException; +/** + * Logs transport activity + * + * @opensearch.internal + */ public final class TransportLogger { private static final Logger logger = LogManager.getLogger(TransportLogger.class); diff --git a/server/src/main/java/org/opensearch/transport/TransportMessage.java b/server/src/main/java/org/opensearch/transport/TransportMessage.java index 0862e25205261..f40d8526df818 100644 --- a/server/src/main/java/org/opensearch/transport/TransportMessage.java +++ b/server/src/main/java/org/opensearch/transport/TransportMessage.java @@ -36,6 +36,11 @@ import org.opensearch.common.io.stream.Writeable; import org.opensearch.common.transport.TransportAddress; +/** + * Message over the transport interface + * + * @opensearch.internal + */ public abstract class TransportMessage implements Writeable { private TransportAddress remoteAddress; diff --git a/server/src/main/java/org/opensearch/transport/TransportMessageListener.java b/server/src/main/java/org/opensearch/transport/TransportMessageListener.java index fd5ca057ba9bb..8a7612d3bd99a 100644 --- a/server/src/main/java/org/opensearch/transport/TransportMessageListener.java +++ b/server/src/main/java/org/opensearch/transport/TransportMessageListener.java @@ -33,6 +33,11 @@ import org.opensearch.cluster.node.DiscoveryNode; +/** + * Listens for transport messages + * + * @opensearch.internal + */ public interface TransportMessageListener { TransportMessageListener NOOP_LISTENER = new TransportMessageListener() { diff --git a/server/src/main/java/org/opensearch/transport/TransportRequest.java b/server/src/main/java/org/opensearch/transport/TransportRequest.java index 4dd18102e4c06..6d599f9faf927 100644 --- a/server/src/main/java/org/opensearch/transport/TransportRequest.java +++ b/server/src/main/java/org/opensearch/transport/TransportRequest.java @@ -39,6 +39,11 @@ import java.io.IOException; +/** + * A transport request + * + * @opensearch.internal + */ public abstract class TransportRequest extends TransportMessage implements TaskAwareRequest { public static class Empty extends TransportRequest { public static final Empty INSTANCE = new Empty(); diff --git a/server/src/main/java/org/opensearch/transport/TransportRequestDeduplicator.java b/server/src/main/java/org/opensearch/transport/TransportRequestDeduplicator.java index ba58bb37d8d48..eec0310557690 100644 --- a/server/src/main/java/org/opensearch/transport/TransportRequestDeduplicator.java +++ b/server/src/main/java/org/opensearch/transport/TransportRequestDeduplicator.java @@ -44,6 +44,8 @@ * Deduplicator for {@link TransportRequest}s that keeps track of {@link TransportRequest}s that should * not be sent in parallel. * @param Transport Request Class + * + * @opensearch.internal */ public final class TransportRequestDeduplicator { diff --git a/server/src/main/java/org/opensearch/transport/TransportRequestHandler.java b/server/src/main/java/org/opensearch/transport/TransportRequestHandler.java index 5e6cb1e6c4007..54ee1b68fc9aa 100644 --- a/server/src/main/java/org/opensearch/transport/TransportRequestHandler.java +++ b/server/src/main/java/org/opensearch/transport/TransportRequestHandler.java @@ -34,6 +34,11 @@ import org.opensearch.tasks.Task; +/** + * Handles transport requests + * + * @opensearch.internal + */ public interface TransportRequestHandler { void messageReceived(T request, TransportChannel channel, Task task) throws Exception; diff --git a/server/src/main/java/org/opensearch/transport/TransportRequestOptions.java b/server/src/main/java/org/opensearch/transport/TransportRequestOptions.java index 8b8638da6c524..082d4dc3dd8a5 100644 --- a/server/src/main/java/org/opensearch/transport/TransportRequestOptions.java +++ b/server/src/main/java/org/opensearch/transport/TransportRequestOptions.java @@ -34,6 +34,11 @@ import org.opensearch.common.unit.TimeValue; +/** + * Options for transport requests + * + * @opensearch.internal + */ public class TransportRequestOptions { private final TimeValue timeout; diff --git a/server/src/main/java/org/opensearch/transport/TransportResponse.java b/server/src/main/java/org/opensearch/transport/TransportResponse.java index 7369f5475926b..aeef9c71499fb 100644 --- a/server/src/main/java/org/opensearch/transport/TransportResponse.java +++ b/server/src/main/java/org/opensearch/transport/TransportResponse.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Response over the transport interface + * + * @opensearch.internal + */ public abstract class TransportResponse extends TransportMessage { /** diff --git a/server/src/main/java/org/opensearch/transport/TransportResponseHandler.java b/server/src/main/java/org/opensearch/transport/TransportResponseHandler.java index 8d6129b98390b..40bac6fb8440e 100644 --- a/server/src/main/java/org/opensearch/transport/TransportResponseHandler.java +++ b/server/src/main/java/org/opensearch/transport/TransportResponseHandler.java @@ -38,6 +38,11 @@ import java.io.IOException; import java.util.function.Function; +/** + * Handles transport responses + * + * @opensearch.internal + */ public interface TransportResponseHandler extends Writeable.Reader { void handleResponse(T response); diff --git a/server/src/main/java/org/opensearch/transport/TransportSerializationException.java b/server/src/main/java/org/opensearch/transport/TransportSerializationException.java index 964d24adc11f4..5ce651a5030c8 100644 --- a/server/src/main/java/org/opensearch/transport/TransportSerializationException.java +++ b/server/src/main/java/org/opensearch/transport/TransportSerializationException.java @@ -36,6 +36,11 @@ import java.io.IOException; +/** + * Thrown if there is an error serializing data for transport + * + * @opensearch.internal + */ public class TransportSerializationException extends TransportException { public TransportSerializationException(StreamInput in) throws IOException { diff --git a/server/src/main/java/org/opensearch/transport/TransportService.java b/server/src/main/java/org/opensearch/transport/TransportService.java index ad46ed742c806..4d8773dcfbf9f 100644 --- a/server/src/main/java/org/opensearch/transport/TransportService.java +++ b/server/src/main/java/org/opensearch/transport/TransportService.java @@ -87,6 +87,11 @@ import java.util.function.Predicate; import java.util.function.Supplier; +/** + * The main OpenSearch transport service + * + * @opensearch.internal + */ public class TransportService extends AbstractLifecycleComponent implements ReportingService, diff --git a/server/src/main/java/org/opensearch/transport/TransportSettings.java b/server/src/main/java/org/opensearch/transport/TransportSettings.java index cacdbce60c365..b4d72ab40409b 100644 --- a/server/src/main/java/org/opensearch/transport/TransportSettings.java +++ b/server/src/main/java/org/opensearch/transport/TransportSettings.java @@ -49,6 +49,11 @@ import static org.opensearch.common.settings.Setting.listSetting; import static org.opensearch.common.settings.Setting.timeSetting; +/** + * Settings for transport config + * + * @opensearch.internal + */ public final class TransportSettings { public static final String DEFAULT_PROFILE = "default"; diff --git a/server/src/main/java/org/opensearch/transport/TransportStats.java b/server/src/main/java/org/opensearch/transport/TransportStats.java index e83de2f599b37..9c708a8fdc65a 100644 --- a/server/src/main/java/org/opensearch/transport/TransportStats.java +++ b/server/src/main/java/org/opensearch/transport/TransportStats.java @@ -42,6 +42,11 @@ import java.io.IOException; +/** + * Stats for transport activity + * + * @opensearch.internal + */ public class TransportStats implements Writeable, ToXContentFragment { private final long serverOpen; diff --git a/server/src/main/java/org/opensearch/transport/TransportStatus.java b/server/src/main/java/org/opensearch/transport/TransportStatus.java index 2622b1d67b458..dab572949e688 100644 --- a/server/src/main/java/org/opensearch/transport/TransportStatus.java +++ b/server/src/main/java/org/opensearch/transport/TransportStatus.java @@ -32,6 +32,11 @@ package org.opensearch.transport; +/** + * Status for transport activity + * + * @opensearch.internal + */ public final class TransportStatus { private static final byte STATUS_REQRES = 1 << 0; diff --git a/server/src/main/java/org/opensearch/transport/Transports.java b/server/src/main/java/org/opensearch/transport/Transports.java index 7d9f013db5338..e6e9b7e5edb7e 100644 --- a/server/src/main/java/org/opensearch/transport/Transports.java +++ b/server/src/main/java/org/opensearch/transport/Transports.java @@ -38,6 +38,11 @@ import java.util.Arrays; +/** + * Utility class for transport + * + * @opensearch.internal + */ public enum Transports { ; From d8639b933886445bddf9d2ac9f266e5e398b4bf9 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Sat, 7 May 2022 16:09:09 -0400 Subject: [PATCH 137/514] [Javadocs] add to o.o.index and indices (#3209) (#3213) Adds javadocs to org.opensearch.index and indices packages. Signed-off-by: Nicholas Walter Knize (cherry picked from commit 7b75fb425f9df2b96049dac8c7dc13273f5026fd) Co-authored-by: Nick Knize --- .../java/org/opensearch/index/AbstractIndexComponent.java | 5 +++++ .../org/opensearch/index/CompositeIndexEventListener.java | 2 ++ server/src/main/java/org/opensearch/index/Index.java | 2 ++ .../main/java/org/opensearch/index/IndexComponent.java | 5 +++++ .../src/main/java/org/opensearch/index/IndexModule.java | 2 ++ .../java/org/opensearch/index/IndexNotFoundException.java | 5 +++++ .../src/main/java/org/opensearch/index/IndexService.java | 5 +++++ .../src/main/java/org/opensearch/index/IndexSettings.java | 2 ++ .../main/java/org/opensearch/index/IndexSortConfig.java | 1 + .../src/main/java/org/opensearch/index/IndexWarmer.java | 5 +++++ .../main/java/org/opensearch/index/IndexingPressure.java | 5 +++++ .../org/opensearch/index/IndexingPressureService.java | 2 ++ .../main/java/org/opensearch/index/IndexingSlowLog.java | 5 +++++ .../main/java/org/opensearch/index/MergePolicyConfig.java | 2 ++ .../java/org/opensearch/index/MergeSchedulerConfig.java | 2 ++ .../org/opensearch/index/OpenSearchTieredMergePolicy.java | 2 ++ .../src/main/java/org/opensearch/index/SearchSlowLog.java | 5 +++++ .../java/org/opensearch/index/ShardIndexingPressure.java | 2 ++ .../index/ShardIndexingPressureMemoryManager.java | 1 + .../opensearch/index/ShardIndexingPressureSettings.java | 2 ++ .../org/opensearch/index/ShardIndexingPressureStore.java | 1 + .../opensearch/index/ShardIndexingPressureTracker.java | 2 ++ .../src/main/java/org/opensearch/index/SlowLogLevel.java | 5 +++++ .../src/main/java/org/opensearch/index/VersionType.java | 5 +++++ .../index/analysis/AbstractCharFilterFactory.java | 5 +++++ .../index/analysis/AbstractIndexAnalyzerProvider.java | 5 +++++ .../index/analysis/AbstractTokenFilterFactory.java | 5 +++++ .../index/analysis/AbstractTokenizerFactory.java | 5 +++++ .../main/java/org/opensearch/index/analysis/Analysis.java | 5 +++++ .../java/org/opensearch/index/analysis/AnalysisMode.java | 2 ++ .../org/opensearch/index/analysis/AnalysisRegistry.java | 2 ++ .../org/opensearch/index/analysis/AnalyzerComponents.java | 2 ++ .../index/analysis/AnalyzerComponentsProvider.java | 2 ++ .../org/opensearch/index/analysis/AnalyzerProvider.java | 5 +++++ .../java/org/opensearch/index/analysis/AnalyzerScope.java | 5 +++++ .../org/opensearch/index/analysis/CharFilterFactory.java | 5 +++++ .../org/opensearch/index/analysis/CustomAnalyzer.java | 5 +++++ .../opensearch/index/analysis/CustomAnalyzerProvider.java | 2 ++ .../index/analysis/CustomNormalizerProvider.java | 2 ++ .../org/opensearch/index/analysis/FieldNameAnalyzer.java | 5 +++++ .../index/analysis/HunspellTokenFilterFactory.java | 5 +++++ .../org/opensearch/index/analysis/IndexAnalyzers.java | 2 ++ .../index/analysis/KeywordAnalyzerProvider.java | 5 +++++ .../opensearch/index/analysis/LowercaseNormalizer.java | 6 +++++- .../index/analysis/LowercaseNormalizerProvider.java | 2 ++ .../org/opensearch/index/analysis/NameOrDefinition.java | 5 +++++ .../java/org/opensearch/index/analysis/NamedAnalyzer.java | 2 ++ .../index/analysis/NormalizingCharFilterFactory.java | 2 ++ .../index/analysis/NormalizingTokenFilterFactory.java | 2 ++ .../index/analysis/PreBuiltAnalyzerProvider.java | 5 +++++ .../index/analysis/PreBuiltAnalyzerProviderFactory.java | 5 +++++ .../index/analysis/PreConfiguredAnalysisComponent.java | 2 ++ .../index/analysis/PreConfiguredCharFilter.java | 2 ++ .../index/analysis/PreConfiguredTokenFilter.java | 2 ++ .../opensearch/index/analysis/PreConfiguredTokenizer.java | 2 ++ .../index/analysis/ReloadableCustomAnalyzer.java | 5 +++++ .../index/analysis/ShingleTokenFilterFactory.java | 5 +++++ .../opensearch/index/analysis/SimpleAnalyzerProvider.java | 5 +++++ .../index/analysis/StandardAnalyzerProvider.java | 5 +++++ .../index/analysis/StandardTokenizerFactory.java | 5 +++++ .../opensearch/index/analysis/StopAnalyzerProvider.java | 5 +++++ .../opensearch/index/analysis/StopTokenFilterFactory.java | 5 +++++ .../org/opensearch/index/analysis/TokenFilterFactory.java | 5 +++++ .../org/opensearch/index/analysis/TokenizerFactory.java | 5 +++++ .../index/analysis/WhitespaceAnalyzerProvider.java | 5 +++++ .../main/java/org/opensearch/index/cache/IndexCache.java | 5 +++++ .../opensearch/index/cache/bitset/BitsetFilterCache.java | 2 ++ .../index/cache/bitset/ShardBitsetFilterCache.java | 5 +++++ .../opensearch/index/cache/query/DisabledQueryCache.java | 5 +++++ .../org/opensearch/index/cache/query/IndexQueryCache.java | 2 ++ .../java/org/opensearch/index/cache/query/QueryCache.java | 5 +++++ .../org/opensearch/index/cache/query/QueryCacheStats.java | 5 +++++ .../opensearch/index/cache/request/RequestCacheStats.java | 5 +++++ .../opensearch/index/cache/request/ShardRequestCache.java | 2 ++ .../java/org/opensearch/index/codec/CodecService.java | 2 ++ .../org/opensearch/index/codec/CodecServiceConfig.java | 2 ++ .../org/opensearch/index/codec/CodecServiceFactory.java | 2 ++ .../index/codec/PerFieldMappingPostingFormatCodec.java | 2 ++ .../opensearch/index/engine/CombinedDeletionPolicy.java | 2 ++ .../org/opensearch/index/engine/CombinedDocValues.java | 5 +++++ .../java/org/opensearch/index/engine/CommitStats.java | 6 +++++- .../org/opensearch/index/engine/CompletionStatsCache.java | 5 +++++ .../org/opensearch/index/engine/DeleteVersionValue.java | 6 +++++- .../opensearch/index/engine/DocumentMissingException.java | 5 +++++ .../index/engine/DocumentSourceMissingException.java | 5 +++++ .../src/main/java/org/opensearch/index/engine/Engine.java | 5 +++++ .../java/org/opensearch/index/engine/EngineConfig.java | 4 +++- .../org/opensearch/index/engine/EngineConfigFactory.java | 2 ++ .../index/engine/EngineCreationFailureException.java | 2 +- .../java/org/opensearch/index/engine/EngineException.java | 5 +++++ .../java/org/opensearch/index/engine/EngineFactory.java | 2 ++ .../index/engine/FlushFailedEngineException.java | 5 +++++ .../org/opensearch/index/engine/IndexVersionValue.java | 5 +++++ .../java/org/opensearch/index/engine/InternalEngine.java | 5 +++++ .../opensearch/index/engine/InternalEngineFactory.java | 5 +++++ .../java/org/opensearch/index/engine/LiveVersionMap.java | 6 +++++- .../opensearch/index/engine/LuceneChangesSnapshot.java | 2 ++ .../index/engine/MissingHistoryOperationsException.java | 2 ++ .../main/java/org/opensearch/index/engine/NoOpEngine.java | 2 ++ .../index/engine/OpenSearchConcurrentMergeScheduler.java | 2 ++ .../opensearch/index/engine/OpenSearchReaderManager.java | 1 + .../opensearch/index/engine/PrunePostingsMergePolicy.java | 2 ++ .../java/org/opensearch/index/engine/ReadOnlyEngine.java | 2 ++ .../opensearch/index/engine/RecoveryEngineException.java | 3 +++ .../index/engine/RecoverySourcePruneMergePolicy.java | 5 +++++ .../index/engine/RefreshFailedEngineException.java | 5 +++++ .../java/org/opensearch/index/engine/SafeCommitInfo.java | 2 ++ .../main/java/org/opensearch/index/engine/Segment.java | 5 +++++ .../java/org/opensearch/index/engine/SegmentsStats.java | 5 +++++ .../index/engine/SnapshotFailedEngineException.java | 5 +++++ .../org/opensearch/index/engine/SoftDeletesPolicy.java | 2 ++ .../org/opensearch/index/engine/TranslogLeafReader.java | 2 ++ .../index/engine/VersionConflictEngineException.java | 5 +++++ .../java/org/opensearch/index/engine/VersionValue.java | 5 +++++ .../index/fielddata/AbstractBinaryDocValues.java | 2 ++ .../index/fielddata/AbstractNumericDocValues.java | 2 ++ .../index/fielddata/AbstractSortedDocValues.java | 2 ++ .../index/fielddata/AbstractSortedNumericDocValues.java | 2 ++ .../index/fielddata/AbstractSortedSetDocValues.java | 2 ++ .../index/fielddata/AbstractSortingNumericDocValues.java | 2 ++ .../java/org/opensearch/index/fielddata/DocValueBits.java | 5 +++++ .../java/org/opensearch/index/fielddata/FieldData.java | 2 ++ .../org/opensearch/index/fielddata/FieldDataStats.java | 5 +++++ .../org/opensearch/index/fielddata/GeoPointValues.java | 2 ++ .../org/opensearch/index/fielddata/HistogramValue.java | 2 ++ .../org/opensearch/index/fielddata/HistogramValues.java | 2 ++ .../org/opensearch/index/fielddata/IndexFieldData.java | 2 ++ .../opensearch/index/fielddata/IndexFieldDataCache.java | 2 ++ .../opensearch/index/fielddata/IndexFieldDataService.java | 5 +++++ .../index/fielddata/IndexGeoPointFieldData.java | 2 ++ .../index/fielddata/IndexHistogramFieldData.java | 2 ++ .../opensearch/index/fielddata/IndexNumericFieldData.java | 2 ++ .../index/fielddata/IndexOrdinalsFieldData.java | 2 ++ .../org/opensearch/index/fielddata/LeafFieldData.java | 2 ++ .../opensearch/index/fielddata/LeafGeoPointFieldData.java | 2 ++ .../index/fielddata/LeafHistogramFieldData.java | 2 ++ .../opensearch/index/fielddata/LeafNumericFieldData.java | 2 ++ .../opensearch/index/fielddata/LeafOrdinalsFieldData.java | 2 ++ .../opensearch/index/fielddata/MultiGeoPointValues.java | 2 ++ .../opensearch/index/fielddata/NumericDoubleValues.java | 2 ++ .../index/fielddata/RamAccountingTermsEnum.java | 2 ++ .../org/opensearch/index/fielddata/ScriptDocValues.java | 2 ++ .../org/opensearch/index/fielddata/ShardFieldData.java | 5 +++++ .../index/fielddata/SingletonMultiGeoPointValues.java | 5 +++++ .../index/fielddata/SingletonSortedBinaryDocValues.java | 5 +++++ .../fielddata/SingletonSortedNumericDoubleValues.java | 2 ++ .../index/fielddata/SortableLongBitsNumericDocValues.java | 2 ++ .../fielddata/SortableLongBitsSortedNumericDocValues.java | 2 ++ .../fielddata/SortableLongBitsToNumericDoubleValues.java | 2 ++ .../SortableLongBitsToSortedNumericDoubleValues.java | 2 ++ .../opensearch/index/fielddata/SortedBinaryDocValues.java | 2 ++ .../index/fielddata/SortedNumericDoubleValues.java | 2 ++ .../index/fielddata/SortingBinaryDocValues.java | 2 ++ .../index/fielddata/SortingNumericDocValues.java | 2 ++ .../index/fielddata/SortingNumericDoubleValues.java | 2 ++ .../fieldcomparator/BytesRefFieldComparatorSource.java | 2 ++ .../fieldcomparator/DoubleValuesComparatorSource.java | 2 ++ .../fieldcomparator/FloatValuesComparatorSource.java | 2 ++ .../fieldcomparator/LongValuesComparatorSource.java | 2 ++ .../index/fielddata/ordinals/GlobalOrdinalMapping.java | 2 ++ .../index/fielddata/ordinals/GlobalOrdinalsBuilder.java | 2 ++ .../fielddata/ordinals/GlobalOrdinalsIndexFieldData.java | 2 ++ .../index/fielddata/ordinals/MultiOrdinals.java | 2 ++ .../org/opensearch/index/fielddata/ordinals/Ordinals.java | 2 ++ .../index/fielddata/ordinals/OrdinalsBuilder.java | 2 ++ .../index/fielddata/ordinals/SinglePackedOrdinals.java | 7 ++++++- .../fielddata/plain/AbstractBinaryDVLeafFieldData.java | 5 +++++ .../fielddata/plain/AbstractIndexOrdinalsFieldData.java | 5 +++++ .../plain/AbstractLatLonPointIndexFieldData.java | 5 +++++ .../fielddata/plain/AbstractLeafGeoPointFieldData.java | 5 +++++ .../fielddata/plain/AbstractLeafOrdinalsFieldData.java | 5 +++++ .../index/fielddata/plain/BinaryDVLeafFieldData.java | 6 +++++- .../index/fielddata/plain/BinaryIndexFieldData.java | 5 +++++ .../index/fielddata/plain/BytesBinaryDVLeafFieldData.java | 5 +++++ .../index/fielddata/plain/BytesBinaryIndexFieldData.java | 5 +++++ .../index/fielddata/plain/ConstantIndexFieldData.java | 5 +++++ .../index/fielddata/plain/LatLonPointDVLeafFieldData.java | 5 +++++ .../index/fielddata/plain/LeafDoubleFieldData.java | 2 ++ .../index/fielddata/plain/LeafLongFieldData.java | 2 ++ .../index/fielddata/plain/PagedBytesIndexFieldData.java | 5 +++++ .../index/fielddata/plain/PagedBytesLeafFieldData.java | 5 +++++ .../fielddata/plain/SortedNumericIndexFieldData.java | 2 ++ .../fielddata/plain/SortedSetBytesLeafFieldData.java | 2 ++ .../fielddata/plain/SortedSetOrdinalsIndexFieldData.java | 5 +++++ .../fielddata/plain/StringBinaryDVLeafFieldData.java | 5 +++++ .../index/fielddata/plain/StringBinaryIndexFieldData.java | 5 +++++ .../index/fieldvisitor/CustomFieldsVisitor.java | 2 ++ .../org/opensearch/index/fieldvisitor/FieldsVisitor.java | 2 ++ .../opensearch/index/fieldvisitor/IdOnlyFieldVisitor.java | 5 +++++ .../index/fieldvisitor/SingleFieldsVisitor.java | 2 ++ .../main/java/org/opensearch/index/flush/FlushStats.java | 5 +++++ .../src/main/java/org/opensearch/index/get/GetResult.java | 5 +++++ .../src/main/java/org/opensearch/index/get/GetStats.java | 5 +++++ .../java/org/opensearch/index/get/ShardGetService.java | 5 +++++ .../index/mapper/AbstractGeometryFieldMapper.java | 2 ++ .../index/mapper/AbstractPointGeometryFieldMapper.java | 6 +++++- .../index/mapper/AbstractShapeGeometryFieldMapper.java | 2 ++ .../opensearch/index/mapper/ArraySourceValueFetcher.java | 2 ++ .../org/opensearch/index/mapper/BinaryFieldMapper.java | 5 +++++ .../java/org/opensearch/index/mapper/BinaryRangeUtil.java | 5 +++++ .../org/opensearch/index/mapper/BooleanFieldMapper.java | 2 ++ .../opensearch/index/mapper/CompletionFieldMapper.java | 2 ++ .../org/opensearch/index/mapper/ConstantFieldType.java | 2 ++ .../java/org/opensearch/index/mapper/ContentPath.java | 5 +++++ .../org/opensearch/index/mapper/CustomDocValuesField.java | 8 +++++++- .../opensearch/index/mapper/DataStreamFieldMapper.java | 5 +++++ .../java/org/opensearch/index/mapper/DateFieldMapper.java | 6 +++++- .../java/org/opensearch/index/mapper/DocValueFetcher.java | 2 ++ .../java/org/opensearch/index/mapper/DocumentMapper.java | 5 +++++ .../opensearch/index/mapper/DocumentMapperForType.java | 8 ++++++++ .../org/opensearch/index/mapper/DocumentMapperParser.java | 5 +++++ .../java/org/opensearch/index/mapper/DocumentParser.java | 6 +++++- .../opensearch/index/mapper/DynamicKeyFieldMapper.java | 2 ++ .../index/mapper/DynamicKeyFieldTypeLookup.java | 2 ++ .../java/org/opensearch/index/mapper/DynamicTemplate.java | 5 +++++ .../org/opensearch/index/mapper/FieldAliasMapper.java | 2 ++ .../java/org/opensearch/index/mapper/FieldMapper.java | 5 +++++ .../opensearch/index/mapper/FieldNamesFieldMapper.java | 2 ++ .../java/org/opensearch/index/mapper/FieldTypeLookup.java | 2 ++ .../org/opensearch/index/mapper/GeoPointFieldMapper.java | 2 ++ .../org/opensearch/index/mapper/GeoShapeFieldMapper.java | 2 ++ .../java/org/opensearch/index/mapper/GeoShapeIndexer.java | 2 ++ .../java/org/opensearch/index/mapper/GeoShapeParser.java | 5 +++++ .../org/opensearch/index/mapper/GeoShapeQueryable.java | 2 ++ .../java/org/opensearch/index/mapper/IdFieldMapper.java | 2 ++ .../org/opensearch/index/mapper/IgnoredFieldMapper.java | 2 ++ .../org/opensearch/index/mapper/IndexFieldMapper.java | 5 +++++ .../java/org/opensearch/index/mapper/IpFieldMapper.java | 6 +++++- .../org/opensearch/index/mapper/KeywordFieldMapper.java | 2 ++ .../index/mapper/LegacyGeoShapeFieldMapper.java | 2 ++ .../opensearch/index/mapper/LegacyGeoShapeIndexer.java | 8 ++++++++ .../java/org/opensearch/index/mapper/MappedFieldType.java | 2 ++ .../src/main/java/org/opensearch/index/mapper/Mapper.java | 5 +++++ .../java/org/opensearch/index/mapper/MapperException.java | 5 +++++ .../opensearch/index/mapper/MapperParsingException.java | 5 +++++ .../java/org/opensearch/index/mapper/MapperService.java | 5 +++++ .../main/java/org/opensearch/index/mapper/Mapping.java | 2 ++ .../java/org/opensearch/index/mapper/MappingLookup.java | 5 +++++ .../org/opensearch/index/mapper/MetadataFieldMapper.java | 2 ++ .../opensearch/index/mapper/NestedPathFieldMapper.java | 5 +++++ .../org/opensearch/index/mapper/NumberFieldMapper.java | 6 +++++- .../java/org/opensearch/index/mapper/ObjectMapper.java | 5 +++++ .../opensearch/index/mapper/ParametrizedFieldMapper.java | 2 ++ .../java/org/opensearch/index/mapper/ParseContext.java | 5 +++++ .../java/org/opensearch/index/mapper/ParsedDocument.java | 2 ++ .../org/opensearch/index/mapper/RangeFieldMapper.java | 6 +++++- .../main/java/org/opensearch/index/mapper/RangeType.java | 6 +++++- .../org/opensearch/index/mapper/RootObjectMapper.java | 5 +++++ .../org/opensearch/index/mapper/RoutingFieldMapper.java | 5 +++++ .../org/opensearch/index/mapper/SeqNoFieldMapper.java | 3 ++- .../opensearch/index/mapper/SimpleMappedFieldType.java | 2 ++ .../org/opensearch/index/mapper/SourceFieldMapper.java | 5 +++++ .../java/org/opensearch/index/mapper/SourceToParse.java | 5 +++++ .../org/opensearch/index/mapper/SourceValueFetcher.java | 2 ++ .../index/mapper/StrictDynamicMappingException.java | 5 +++++ .../java/org/opensearch/index/mapper/StringFieldType.java | 5 ++++- .../org/opensearch/index/mapper/TermBasedFieldType.java | 5 ++++- .../java/org/opensearch/index/mapper/TextFieldMapper.java | 6 +++++- .../main/java/org/opensearch/index/mapper/TextParams.java | 2 ++ .../java/org/opensearch/index/mapper/TextSearchInfo.java | 2 ++ .../java/org/opensearch/index/mapper/TypeParsers.java | 5 +++++ server/src/main/java/org/opensearch/index/mapper/Uid.java | 5 +++++ .../java/org/opensearch/index/mapper/ValueFetcher.java | 2 ++ .../org/opensearch/index/mapper/VersionFieldMapper.java | 6 +++++- .../main/java/org/opensearch/index/merge/MergeStats.java | 5 +++++ .../java/org/opensearch/index/merge/OnGoingMerge.java | 2 ++ .../index/query/AbstractGeometryQueryBuilder.java | 2 ++ .../org/opensearch/index/query/AbstractQueryBuilder.java | 2 ++ .../org/opensearch/index/query/BaseTermQueryBuilder.java | 5 +++++ .../java/org/opensearch/index/query/BoolQueryBuilder.java | 2 ++ .../org/opensearch/index/query/BoostingQueryBuilder.java | 2 ++ .../opensearch/index/query/CommonTermsQueryBuilder.java | 2 ++ .../opensearch/index/query/ConstantScoreQueryBuilder.java | 2 ++ .../index/query/DateRangeIncludingNowQuery.java | 2 ++ .../org/opensearch/index/query/DisMaxQueryBuilder.java | 2 ++ .../index/query/DistanceFeatureQueryBuilder.java | 2 ++ .../org/opensearch/index/query/ExistsQueryBuilder.java | 2 ++ .../index/query/FieldMaskingSpanQueryBuilder.java | 5 +++++ .../org/opensearch/index/query/FuzzyQueryBuilder.java | 2 ++ .../index/query/GeoBoundingBoxQueryBuilder.java | 2 ++ .../opensearch/index/query/GeoDistanceQueryBuilder.java | 2 ++ .../main/java/org/opensearch/index/query/GeoExecType.java | 6 +++++- .../opensearch/index/query/GeoPolygonQueryBuilder.java | 5 +++++ .../org/opensearch/index/query/GeoShapeQueryBuilder.java | 2 ++ .../org/opensearch/index/query/GeoValidationMethod.java | 4 +++- .../java/org/opensearch/index/query/IdsQueryBuilder.java | 2 ++ .../java/org/opensearch/index/query/InnerHitBuilder.java | 3 +++ .../opensearch/index/query/InnerHitContextBuilder.java | 2 ++ .../java/org/opensearch/index/query/IntervalBuilder.java | 2 ++ .../org/opensearch/index/query/IntervalFilterScript.java | 2 ++ .../java/org/opensearch/index/query/IntervalMode.java | 5 +++++ .../org/opensearch/index/query/IntervalQueryBuilder.java | 2 ++ .../opensearch/index/query/IntervalsSourceProvider.java | 2 ++ .../index/query/LegacyGeoShapeQueryProcessor.java | 8 ++++++++ .../org/opensearch/index/query/MatchAllQueryBuilder.java | 2 ++ .../index/query/MatchBoolPrefixQueryBuilder.java | 2 ++ .../org/opensearch/index/query/MatchNoneQueryBuilder.java | 2 ++ .../index/query/MatchPhrasePrefixQueryBuilder.java | 2 ++ .../opensearch/index/query/MatchPhraseQueryBuilder.java | 2 ++ .../org/opensearch/index/query/MatchQueryBuilder.java | 2 ++ .../opensearch/index/query/MoreLikeThisQueryBuilder.java | 2 ++ .../opensearch/index/query/MultiMatchQueryBuilder.java | 2 ++ .../org/opensearch/index/query/MultiTermQueryBuilder.java | 5 +++++ .../org/opensearch/index/query/NestedQueryBuilder.java | 5 +++++ .../main/java/org/opensearch/index/query/Operator.java | 5 +++++ .../main/java/org/opensearch/index/query/ParsedQuery.java | 2 ++ .../org/opensearch/index/query/PrefixQueryBuilder.java | 2 ++ .../java/org/opensearch/index/query/QueryBuilder.java | 5 +++++ .../java/org/opensearch/index/query/QueryBuilders.java | 2 ++ .../main/java/org/opensearch/index/query/QueryParser.java | 2 ++ .../org/opensearch/index/query/QueryRewriteContext.java | 2 ++ .../org/opensearch/index/query/QueryShardContext.java | 2 ++ .../org/opensearch/index/query/QueryShardException.java | 2 ++ .../opensearch/index/query/QueryStringQueryBuilder.java | 2 ++ .../opensearch/index/query/QueryValidationException.java | 2 ++ .../org/opensearch/index/query/RangeQueryBuilder.java | 2 ++ .../main/java/org/opensearch/index/query/RegexpFlag.java | 2 ++ .../org/opensearch/index/query/RegexpQueryBuilder.java | 2 ++ .../main/java/org/opensearch/index/query/Rewriteable.java | 2 ++ .../org/opensearch/index/query/ScriptQueryBuilder.java | 5 +++++ .../opensearch/index/query/SearchIndexNameMatcher.java | 2 ++ .../opensearch/index/query/SimpleQueryStringBuilder.java | 1 + .../org/opensearch/index/query/SimpleQueryStringFlag.java | 2 ++ .../index/query/SpanContainingQueryBuilder.java | 2 ++ .../org/opensearch/index/query/SpanFirstQueryBuilder.java | 5 +++++ .../opensearch/index/query/SpanMultiTermQueryBuilder.java | 2 ++ .../org/opensearch/index/query/SpanNearQueryBuilder.java | 2 ++ .../org/opensearch/index/query/SpanNotQueryBuilder.java | 5 +++++ .../org/opensearch/index/query/SpanOrQueryBuilder.java | 2 ++ .../java/org/opensearch/index/query/SpanQueryBuilder.java | 2 ++ .../org/opensearch/index/query/SpanTermQueryBuilder.java | 2 ++ .../opensearch/index/query/SpanWithinQueryBuilder.java | 2 ++ .../java/org/opensearch/index/query/TermQueryBuilder.java | 2 ++ .../org/opensearch/index/query/TermsQueryBuilder.java | 2 ++ .../org/opensearch/index/query/TermsSetQueryBuilder.java | 5 +++++ .../index/query/VectorGeoPointShapeQueryProcessor.java | 5 +++++ .../index/query/VectorGeoShapeQueryProcessor.java | 5 +++++ .../org/opensearch/index/query/WildcardQueryBuilder.java | 2 ++ .../org/opensearch/index/query/WrapperQueryBuilder.java | 2 ++ .../index/query/functionscore/DecayFunction.java | 1 + .../index/query/functionscore/DecayFunctionBuilder.java | 5 +++++ .../index/query/functionscore/DecayFunctionParser.java | 2 ++ .../functionscore/ExponentialDecayFunctionBuilder.java | 5 +++++ .../functionscore/FieldValueFactorFunctionBuilder.java | 2 ++ .../query/functionscore/FunctionScoreQueryBuilder.java | 2 ++ .../query/functionscore/GaussDecayFunctionBuilder.java | 5 +++++ .../query/functionscore/LinearDecayFunctionBuilder.java | 5 +++++ .../query/functionscore/RandomScoreFunctionBuilder.java | 2 ++ .../index/query/functionscore/ScoreFunctionBuilder.java | 5 +++++ .../index/query/functionscore/ScoreFunctionBuilders.java | 2 ++ .../index/query/functionscore/ScoreFunctionParser.java | 2 ++ .../query/functionscore/ScriptScoreFunctionBuilder.java | 2 ++ .../query/functionscore/ScriptScoreQueryBuilder.java | 2 ++ .../index/query/functionscore/WeightBuilder.java | 2 ++ .../org/opensearch/index/query/support/NestedScope.java | 2 ++ .../org/opensearch/index/query/support/QueryParsers.java | 5 +++++ .../java/org/opensearch/index/recovery/RecoveryStats.java | 2 ++ .../java/org/opensearch/index/refresh/RefreshStats.java | 5 +++++ .../index/reindex/AbstractBulkByScrollRequest.java | 5 +++++ .../index/reindex/AbstractBulkByScrollRequestBuilder.java | 5 +++++ .../index/reindex/AbstractBulkIndexByScrollRequest.java | 5 +++++ .../reindex/AbstractBulkIndexByScrollRequestBuilder.java | 5 +++++ .../opensearch/index/reindex/BulkByScrollResponse.java | 2 ++ .../index/reindex/BulkByScrollResponseBuilder.java | 2 ++ .../org/opensearch/index/reindex/BulkByScrollTask.java | 2 ++ .../index/reindex/ClientScrollableHitSource.java | 2 ++ .../org/opensearch/index/reindex/DeleteByQueryAction.java | 5 +++++ .../opensearch/index/reindex/DeleteByQueryRequest.java | 2 ++ .../index/reindex/DeleteByQueryRequestBuilder.java | 5 +++++ .../index/reindex/LeaderBulkByScrollTaskState.java | 2 ++ .../java/org/opensearch/index/reindex/ReindexAction.java | 5 +++++ .../java/org/opensearch/index/reindex/ReindexRequest.java | 2 ++ .../opensearch/index/reindex/ReindexRequestBuilder.java | 5 +++++ .../index/reindex/RejectAwareActionListener.java | 5 +++++ .../java/org/opensearch/index/reindex/RemoteInfo.java | 5 +++++ .../java/org/opensearch/index/reindex/RetryListener.java | 5 +++++ .../org/opensearch/index/reindex/ScrollableHitSource.java | 2 ++ .../opensearch/index/reindex/SuccessfullyProcessed.java | 2 ++ .../org/opensearch/index/reindex/UpdateByQueryAction.java | 5 +++++ .../opensearch/index/reindex/UpdateByQueryRequest.java | 2 ++ .../index/reindex/UpdateByQueryRequestBuilder.java | 5 +++++ .../index/reindex/WorkerBulkByScrollTaskState.java | 2 ++ .../main/java/org/opensearch/index/search/MatchQuery.java | 5 +++++ .../java/org/opensearch/index/search/MultiMatchQuery.java | 5 +++++ .../java/org/opensearch/index/search/NestedHelper.java | 5 ++++- .../index/search/OpenSearchToParentBlockJoinQuery.java | 6 +++++- .../org/opensearch/index/search/QueryParserHelper.java | 2 ++ .../opensearch/index/search/QueryStringQueryParser.java | 2 ++ .../index/search/SimpleQueryStringQueryParser.java | 2 ++ .../org/opensearch/index/search/stats/SearchStats.java | 5 +++++ .../opensearch/index/search/stats/ShardSearchStats.java | 5 +++++ .../java/org/opensearch/index/seqno/CountedBitSet.java | 2 ++ .../index/seqno/GlobalCheckpointSyncAction.java | 2 ++ .../opensearch/index/seqno/LocalCheckpointTracker.java | 2 ++ .../org/opensearch/index/seqno/ReplicationTracker.java | 2 ++ .../java/org/opensearch/index/seqno/RetentionLease.java | 2 ++ .../org/opensearch/index/seqno/RetentionLeaseActions.java | 2 ++ .../index/seqno/RetentionLeaseAlreadyExistsException.java | 5 +++++ .../index/seqno/RetentionLeaseBackgroundSyncAction.java | 2 ++ .../RetentionLeaseInvalidRetainingSeqNoException.java | 5 +++++ .../index/seqno/RetentionLeaseNotFoundException.java | 5 +++++ .../org/opensearch/index/seqno/RetentionLeaseStats.java | 2 ++ .../opensearch/index/seqno/RetentionLeaseSyncAction.java | 2 ++ .../org/opensearch/index/seqno/RetentionLeaseSyncer.java | 5 +++++ .../java/org/opensearch/index/seqno/RetentionLeases.java | 2 ++ .../main/java/org/opensearch/index/seqno/SeqNoStats.java | 5 +++++ .../java/org/opensearch/index/seqno/SequenceNumbers.java | 2 ++ .../index/shard/AbstractIndexShardComponent.java | 5 +++++ .../main/java/org/opensearch/index/shard/DocsStats.java | 5 +++++ .../opensearch/index/shard/GlobalCheckpointListeners.java | 2 ++ .../index/shard/IllegalIndexShardStateException.java | 5 +++++ .../org/opensearch/index/shard/IndexEventListener.java | 2 ++ .../org/opensearch/index/shard/IndexSettingProvider.java | 2 ++ .../main/java/org/opensearch/index/shard/IndexShard.java | 5 +++++ .../opensearch/index/shard/IndexShardClosedException.java | 5 +++++ .../org/opensearch/index/shard/IndexShardComponent.java | 5 +++++ .../index/shard/IndexShardNotRecoveringException.java | 5 +++++ .../index/shard/IndexShardNotStartedException.java | 5 +++++ .../index/shard/IndexShardOperationPermits.java | 2 ++ .../index/shard/IndexShardRecoveringException.java | 5 +++++ .../index/shard/IndexShardRecoveryException.java | 5 +++++ .../index/shard/IndexShardRelocatedException.java | 5 +++++ .../index/shard/IndexShardStartedException.java | 5 +++++ .../java/org/opensearch/index/shard/IndexShardState.java | 3 +++ .../opensearch/index/shard/IndexingOperationListener.java | 2 ++ .../java/org/opensearch/index/shard/IndexingStats.java | 5 +++++ .../org/opensearch/index/shard/InternalIndexingStats.java | 2 ++ .../org/opensearch/index/shard/LocalShardSnapshot.java | 5 +++++ .../org/opensearch/index/shard/OpenSearchMergePolicy.java | 2 ++ .../org/opensearch/index/shard/PrimaryReplicaSyncer.java | 5 +++++ .../java/org/opensearch/index/shard/RefreshListeners.java | 2 ++ .../index/shard/RemoveCorruptedLuceneSegmentsAction.java | 2 ++ .../index/shard/RemoveCorruptedShardDataCommand.java | 5 +++++ .../java/org/opensearch/index/shard/ReplicationGroup.java | 2 ++ .../opensearch/index/shard/SearchOperationListener.java | 2 ++ .../src/main/java/org/opensearch/index/shard/ShardId.java | 2 ++ .../opensearch/index/shard/ShardNotFoundException.java | 5 +++++ .../index/shard/ShardNotInPrimaryModeException.java | 5 +++++ .../main/java/org/opensearch/index/shard/ShardPath.java | 5 +++++ .../org/opensearch/index/shard/ShardSplittingQuery.java | 2 ++ .../org/opensearch/index/shard/ShardStateMetadata.java | 5 +++++ .../java/org/opensearch/index/shard/ShardToolCli.java | 2 ++ .../main/java/org/opensearch/index/shard/ShardUtils.java | 5 +++++ .../java/org/opensearch/index/shard/StoreRecovery.java | 2 ++ .../index/similarity/NonNegativeScoresSimilarity.java | 2 ++ .../opensearch/index/similarity/ScriptedSimilarity.java | 2 ++ .../index/similarity/ScriptedSimilarityProvider.java | 6 +++++- .../opensearch/index/similarity/SimilarityProvider.java | 2 ++ .../opensearch/index/similarity/SimilarityProviders.java | 5 +++++ .../opensearch/index/similarity/SimilarityService.java | 5 +++++ .../index/snapshots/IndexShardRestoreException.java | 2 ++ .../index/snapshots/IndexShardRestoreFailedException.java | 2 ++ .../index/snapshots/IndexShardSnapshotException.java | 2 ++ .../snapshots/IndexShardSnapshotFailedException.java | 2 ++ .../index/snapshots/IndexShardSnapshotStatus.java | 2 ++ .../snapshots/blobstore/BlobStoreIndexShardSnapshot.java | 2 ++ .../snapshots/blobstore/BlobStoreIndexShardSnapshots.java | 2 ++ .../snapshots/blobstore/RateLimitingInputStream.java | 2 ++ .../index/snapshots/blobstore/SlicedInputStream.java | 2 ++ .../index/snapshots/blobstore/SnapshotFiles.java | 2 ++ .../index/stats/IndexingPressurePerShardStats.java | 5 +++++ .../org/opensearch/index/stats/IndexingPressureStats.java | 5 +++++ .../index/stats/ShardIndexingPressureStats.java | 5 +++++ .../opensearch/index/store/ByteSizeCachingDirectory.java | 5 +++++ .../org/opensearch/index/store/FsDirectoryFactory.java | 5 +++++ .../src/main/java/org/opensearch/index/store/Store.java | 2 ++ .../org/opensearch/index/store/StoreFileMetadata.java | 5 +++++ .../main/java/org/opensearch/index/store/StoreStats.java | 5 +++++ .../org/opensearch/index/store/VerifyingIndexOutput.java | 2 ++ .../opensearch/index/termvectors/TermVectorsService.java | 5 +++++ .../org/opensearch/index/translog/BaseTranslogReader.java | 2 ++ .../index/translog/BufferedChecksumStreamInput.java | 2 ++ .../index/translog/BufferedChecksumStreamOutput.java | 2 ++ .../org/opensearch/index/translog/ChannelFactory.java | 2 ++ .../java/org/opensearch/index/translog/Checkpoint.java | 5 +++++ .../index/translog/DefaultTranslogDeletionPolicy.java | 2 ++ .../java/org/opensearch/index/translog/MultiSnapshot.java | 2 ++ .../opensearch/index/translog/TragicExceptionHolder.java | 5 +++++ .../main/java/org/opensearch/index/translog/Translog.java | 2 ++ .../org/opensearch/index/translog/TranslogConfig.java | 4 +++- .../index/translog/TranslogCorruptedException.java | 5 +++++ .../opensearch/index/translog/TranslogDeletionPolicy.java | 5 +++++ .../index/translog/TranslogDeletionPolicyFactory.java | 5 +++++ .../org/opensearch/index/translog/TranslogException.java | 5 +++++ .../org/opensearch/index/translog/TranslogHeader.java | 2 ++ .../org/opensearch/index/translog/TranslogReader.java | 2 ++ .../org/opensearch/index/translog/TranslogSnapshot.java | 5 +++++ .../java/org/opensearch/index/translog/TranslogStats.java | 5 +++++ .../org/opensearch/index/translog/TranslogWriter.java | 5 +++++ .../opensearch/index/translog/TruncateTranslogAction.java | 5 +++++ .../index/translog/TruncatedTranslogException.java | 5 +++++ .../opensearch/index/warmer/ShardIndexWarmerService.java | 5 +++++ .../java/org/opensearch/index/warmer/WarmerStats.java | 5 +++++ .../opensearch/indices/AbstractIndexShardCacheEntity.java | 2 ++ .../opensearch/indices/AliasFilterParsingException.java | 5 +++++ .../java/org/opensearch/indices/IndexClosedException.java | 2 ++ .../org/opensearch/indices/IndexCreationException.java | 5 +++++ .../indices/IndexPrimaryShardNotAllocatedException.java | 2 ++ .../opensearch/indices/IndexTemplateMissingException.java | 5 +++++ .../org/opensearch/indices/IndexingMemoryController.java | 5 +++++ .../main/java/org/opensearch/indices/IndicesModule.java | 2 ++ .../java/org/opensearch/indices/IndicesQueryCache.java | 5 +++++ .../java/org/opensearch/indices/IndicesRequestCache.java | 2 ++ .../main/java/org/opensearch/indices/IndicesService.java | 5 +++++ .../org/opensearch/indices/InvalidAliasNameException.java | 5 +++++ .../org/opensearch/indices/InvalidIndexNameException.java | 5 +++++ .../opensearch/indices/InvalidIndexTemplateException.java | 5 +++++ .../org/opensearch/indices/InvalidTypeNameException.java | 5 +++++ .../java/org/opensearch/indices/NodeIndicesStats.java | 2 ++ .../java/org/opensearch/indices/ShardLimitValidator.java | 2 ++ .../org/opensearch/indices/SystemIndexDescriptor.java | 2 ++ .../main/java/org/opensearch/indices/SystemIndices.java | 2 ++ .../src/main/java/org/opensearch/indices/TermsLookup.java | 2 ++ .../java/org/opensearch/indices/TypeMissingException.java | 8 ++++++++ .../org/opensearch/indices/analysis/AnalysisModule.java | 2 ++ .../org/opensearch/indices/analysis/HunspellService.java | 2 ++ .../opensearch/indices/analysis/PreBuiltAnalyzers.java | 5 +++++ .../opensearch/indices/analysis/PreBuiltCacheFactory.java | 5 +++++ .../opensearch/indices/analysis/PreBuiltTokenizers.java | 5 +++++ .../indices/breaker/AllCircuitBreakerStats.java | 2 ++ .../org/opensearch/indices/breaker/BreakerSettings.java | 2 ++ .../opensearch/indices/breaker/CircuitBreakerService.java | 2 ++ .../opensearch/indices/breaker/CircuitBreakerStats.java | 2 ++ .../indices/breaker/HierarchyCircuitBreakerService.java | 2 ++ .../indices/breaker/NoneCircuitBreakerService.java | 2 ++ .../indices/cluster/IndicesClusterStateService.java | 5 +++++ .../indices/fielddata/cache/IndicesFieldDataCache.java | 5 +++++ .../org/opensearch/indices/mapper/MapperRegistry.java | 2 ++ .../indices/recovery/DelayRecoveryException.java | 2 +- .../opensearch/indices/recovery/MultiChunkTransfer.java | 2 ++ .../org/opensearch/indices/recovery/MultiFileWriter.java | 5 +++++ .../opensearch/indices/recovery/PeerRecoveryNotFound.java | 5 +++++ .../indices/recovery/PeerRecoverySourceService.java | 2 ++ .../indices/recovery/PeerRecoveryTargetService.java | 2 ++ .../indices/recovery/RecoverFilesRecoveryException.java | 5 +++++ .../opensearch/indices/recovery/RecoveriesCollection.java | 2 ++ .../indices/recovery/RecoveryCleanFilesRequest.java | 5 +++++ .../indices/recovery/RecoveryFailedException.java | 5 +++++ .../indices/recovery/RecoveryFileChunkRequest.java | 5 +++++ .../indices/recovery/RecoveryFilesInfoRequest.java | 5 +++++ .../indices/recovery/RecoveryFinalizeRecoveryRequest.java | 5 +++++ .../recovery/RecoveryHandoffPrimaryContextRequest.java | 2 ++ .../RecoveryPrepareForTranslogOperationsRequest.java | 5 +++++ .../indices/recovery/RecoveryRequestTracker.java | 5 +++++ .../org/opensearch/indices/recovery/RecoveryResponse.java | 5 +++++ .../org/opensearch/indices/recovery/RecoverySettings.java | 5 +++++ .../indices/recovery/RecoverySourceHandler.java | 2 ++ .../org/opensearch/indices/recovery/RecoveryState.java | 2 ++ .../org/opensearch/indices/recovery/RecoveryTarget.java | 2 ++ .../indices/recovery/RecoveryTargetHandler.java | 5 +++++ .../recovery/RecoveryTranslogOperationsRequest.java | 5 +++++ .../recovery/RecoveryTranslogOperationsResponse.java | 5 +++++ .../indices/recovery/RecoveryTransportRequest.java | 5 +++++ .../indices/recovery/ReestablishRecoveryRequest.java | 2 ++ .../indices/recovery/RemoteRecoveryTargetHandler.java | 5 +++++ .../opensearch/indices/recovery/StartRecoveryRequest.java | 2 ++ .../indices/replication/common/ReplicationTimer.java | 2 ++ .../indices/replication/common/ReplicationType.java | 2 ++ .../java/org/opensearch/indices/store/IndicesStore.java | 5 +++++ 559 files changed, 1896 insertions(+), 28 deletions(-) diff --git a/server/src/main/java/org/opensearch/index/AbstractIndexComponent.java b/server/src/main/java/org/opensearch/index/AbstractIndexComponent.java index e63216494a5b2..88809156174c0 100644 --- a/server/src/main/java/org/opensearch/index/AbstractIndexComponent.java +++ b/server/src/main/java/org/opensearch/index/AbstractIndexComponent.java @@ -36,6 +36,11 @@ import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.common.logging.Loggers; +/** + * A base class for new index components + * + * @opensearch.internal + */ public abstract class AbstractIndexComponent implements IndexComponent { protected final Logger logger; diff --git a/server/src/main/java/org/opensearch/index/CompositeIndexEventListener.java b/server/src/main/java/org/opensearch/index/CompositeIndexEventListener.java index 79c97d1126e93..3b5ff7798e0de 100644 --- a/server/src/main/java/org/opensearch/index/CompositeIndexEventListener.java +++ b/server/src/main/java/org/opensearch/index/CompositeIndexEventListener.java @@ -51,6 +51,8 @@ /** * A composite {@link IndexEventListener} that forwards all callbacks to an immutable list of IndexEventListener + * + * @opensearch.internal */ final class CompositeIndexEventListener implements IndexEventListener { diff --git a/server/src/main/java/org/opensearch/index/Index.java b/server/src/main/java/org/opensearch/index/Index.java index 5284bc7d23c71..db620592d1ede 100644 --- a/server/src/main/java/org/opensearch/index/Index.java +++ b/server/src/main/java/org/opensearch/index/Index.java @@ -47,6 +47,8 @@ /** * A value class representing the basic required properties of an OpenSearch index. + * + * @opensearch.internal */ public class Index implements Writeable, ToXContentObject { diff --git a/server/src/main/java/org/opensearch/index/IndexComponent.java b/server/src/main/java/org/opensearch/index/IndexComponent.java index 16387e7cfb80c..2a4555b66df13 100644 --- a/server/src/main/java/org/opensearch/index/IndexComponent.java +++ b/server/src/main/java/org/opensearch/index/IndexComponent.java @@ -32,6 +32,11 @@ package org.opensearch.index; +/** + * Actions that can be executed on an Index Component + * + * @opensearch.internal + */ public interface IndexComponent { Index index(); diff --git a/server/src/main/java/org/opensearch/index/IndexModule.java b/server/src/main/java/org/opensearch/index/IndexModule.java index 61f6c9689308f..acceee7562068 100644 --- a/server/src/main/java/org/opensearch/index/IndexModule.java +++ b/server/src/main/java/org/opensearch/index/IndexModule.java @@ -109,6 +109,8 @@ *

  • Settings update listener - Custom settings update listener can be registered via * {@link #addSettingsUpdateConsumer(Setting, Consumer)}
  • * + * + * @opensearch.internal */ public final class IndexModule { diff --git a/server/src/main/java/org/opensearch/index/IndexNotFoundException.java b/server/src/main/java/org/opensearch/index/IndexNotFoundException.java index f4c8f38844efd..120e7f955cd9c 100644 --- a/server/src/main/java/org/opensearch/index/IndexNotFoundException.java +++ b/server/src/main/java/org/opensearch/index/IndexNotFoundException.java @@ -36,6 +36,11 @@ import java.io.IOException; +/** + * Exception thrown if an index is not found + * + * @opensearch.internal + */ public final class IndexNotFoundException extends ResourceNotFoundException { /** * Construct with a custom message. diff --git a/server/src/main/java/org/opensearch/index/IndexService.java b/server/src/main/java/org/opensearch/index/IndexService.java index 1b301e85365ba..54aa7f5097d61 100644 --- a/server/src/main/java/org/opensearch/index/IndexService.java +++ b/server/src/main/java/org/opensearch/index/IndexService.java @@ -122,6 +122,11 @@ import static java.util.Collections.unmodifiableMap; import static org.opensearch.common.collect.MapBuilder.newMapBuilder; +/** + * The main OpenSearch index service + * + * @opensearch.internal + */ public class IndexService extends AbstractIndexComponent implements IndicesClusterStateService.AllocatedIndex { private final IndexEventListener eventListener; diff --git a/server/src/main/java/org/opensearch/index/IndexSettings.java b/server/src/main/java/org/opensearch/index/IndexSettings.java index 8ba9c47902115..e40acb94ee498 100644 --- a/server/src/main/java/org/opensearch/index/IndexSettings.java +++ b/server/src/main/java/org/opensearch/index/IndexSettings.java @@ -69,6 +69,8 @@ * the latest updated settings instance. Classes that need to listen to settings updates can register * a settings consumer at index creation via {@link IndexModule#addSettingsUpdateConsumer(Setting, Consumer)} that will * be called for each settings update. + * + * @opensearch.internal */ public final class IndexSettings { public static final Setting> DEFAULT_FIELD_SETTING = Setting.listSetting( diff --git a/server/src/main/java/org/opensearch/index/IndexSortConfig.java b/server/src/main/java/org/opensearch/index/IndexSortConfig.java index 99cf5d2d6091c..3acc80e519785 100644 --- a/server/src/main/java/org/opensearch/index/IndexSortConfig.java +++ b/server/src/main/java/org/opensearch/index/IndexSortConfig.java @@ -69,6 +69,7 @@ * * * + * @opensearch.internal **/ public final class IndexSortConfig { /** diff --git a/server/src/main/java/org/opensearch/index/IndexWarmer.java b/server/src/main/java/org/opensearch/index/IndexWarmer.java index 8a728101fb78c..5251b49539ecb 100644 --- a/server/src/main/java/org/opensearch/index/IndexWarmer.java +++ b/server/src/main/java/org/opensearch/index/IndexWarmer.java @@ -54,6 +54,11 @@ import java.util.concurrent.Executor; import java.util.concurrent.TimeUnit; +/** + * The main opensearch index warmer + * + * @opensearch.internal + */ public final class IndexWarmer { private static final Logger logger = LogManager.getLogger(IndexWarmer.class); diff --git a/server/src/main/java/org/opensearch/index/IndexingPressure.java b/server/src/main/java/org/opensearch/index/IndexingPressure.java index af5c1827e3c6b..a100f0b76f996 100644 --- a/server/src/main/java/org/opensearch/index/IndexingPressure.java +++ b/server/src/main/java/org/opensearch/index/IndexingPressure.java @@ -45,6 +45,11 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; +/** + * Tracks indexing memory pressure + * + * @opensearch.internal + */ public class IndexingPressure { public static final Setting MAX_INDEXING_BYTES = Setting.memorySizeSetting( diff --git a/server/src/main/java/org/opensearch/index/IndexingPressureService.java b/server/src/main/java/org/opensearch/index/IndexingPressureService.java index 9044c5942e8cb..8abc0172d7c6f 100644 --- a/server/src/main/java/org/opensearch/index/IndexingPressureService.java +++ b/server/src/main/java/org/opensearch/index/IndexingPressureService.java @@ -18,6 +18,8 @@ /** * Sets up classes for node/shard level indexing pressure. * Provides abstraction and orchestration for indexing pressure interfaces when called from Transport Actions or for Stats. + * + * @opensearch.internal */ public class IndexingPressureService { diff --git a/server/src/main/java/org/opensearch/index/IndexingSlowLog.java b/server/src/main/java/org/opensearch/index/IndexingSlowLog.java index b77e7639152fb..c45d3f6b34d65 100644 --- a/server/src/main/java/org/opensearch/index/IndexingSlowLog.java +++ b/server/src/main/java/org/opensearch/index/IndexingSlowLog.java @@ -55,6 +55,11 @@ import java.util.Map; import java.util.concurrent.TimeUnit; +/** + * The indexing slowlog implementation + * + * @opensearch.internal + */ public final class IndexingSlowLog implements IndexingOperationListener { public static final String INDEX_INDEXING_SLOWLOG_PREFIX = "index.indexing.slowlog"; public static final Setting INDEX_INDEXING_SLOWLOG_THRESHOLD_INDEX_WARN_SETTING = Setting.timeSetting( diff --git a/server/src/main/java/org/opensearch/index/MergePolicyConfig.java b/server/src/main/java/org/opensearch/index/MergePolicyConfig.java index 26d2588e3f240..9ff19a94bbabd 100644 --- a/server/src/main/java/org/opensearch/index/MergePolicyConfig.java +++ b/server/src/main/java/org/opensearch/index/MergePolicyConfig.java @@ -121,6 +121,8 @@ * indices segments API to see the segments that an index has, and * possibly either increase the max_merged_segment or issue an optimize * call for the index (try and aim to issue it on a low traffic time). + * + * @opensearch.internal */ public final class MergePolicyConfig { diff --git a/server/src/main/java/org/opensearch/index/MergeSchedulerConfig.java b/server/src/main/java/org/opensearch/index/MergeSchedulerConfig.java index df3c76fea0ea6..9e170b448d641 100644 --- a/server/src/main/java/org/opensearch/index/MergeSchedulerConfig.java +++ b/server/src/main/java/org/opensearch/index/MergeSchedulerConfig.java @@ -63,6 +63,8 @@ * throttled, while an application doing heavy indexing will see the throttle * move higher to allow merges to keep up with ongoing indexing. * + * + * @opensearch.internal */ public final class MergeSchedulerConfig { diff --git a/server/src/main/java/org/opensearch/index/OpenSearchTieredMergePolicy.java b/server/src/main/java/org/opensearch/index/OpenSearchTieredMergePolicy.java index 0289e96b356be..637282374de73 100644 --- a/server/src/main/java/org/opensearch/index/OpenSearchTieredMergePolicy.java +++ b/server/src/main/java/org/opensearch/index/OpenSearchTieredMergePolicy.java @@ -44,6 +44,8 @@ * Wrapper around {@link TieredMergePolicy} which doesn't respect * {@link TieredMergePolicy#setMaxMergedSegmentMB(double)} on forced merges. * See https://issues.apache.org/jira/browse/LUCENE-7976. + * + * @opensearch.internal */ final class OpenSearchTieredMergePolicy extends FilterMergePolicy { diff --git a/server/src/main/java/org/opensearch/index/SearchSlowLog.java b/server/src/main/java/org/opensearch/index/SearchSlowLog.java index 37413388215c8..c48c122580579 100644 --- a/server/src/main/java/org/opensearch/index/SearchSlowLog.java +++ b/server/src/main/java/org/opensearch/index/SearchSlowLog.java @@ -53,6 +53,11 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Stream; +/** + * The search time slow log implementation + * + * @opensearch.internal + */ public final class SearchSlowLog implements SearchOperationListener { private static final Charset UTF_8 = Charset.forName("UTF-8"); diff --git a/server/src/main/java/org/opensearch/index/ShardIndexingPressure.java b/server/src/main/java/org/opensearch/index/ShardIndexingPressure.java index 881ede2f6903f..59dde20c9a904 100644 --- a/server/src/main/java/org/opensearch/index/ShardIndexingPressure.java +++ b/server/src/main/java/org/opensearch/index/ShardIndexingPressure.java @@ -39,6 +39,8 @@ * 1. Memory Accounting at shard level. This can be enabled/disabled based on dynamic setting. * 2. Memory Accounting at Node level. Tracking is done using the IndexingPressure artefacts to support feature seamless toggling. * 3. Interfaces to access the statistics for shard trackers. + * + * @opensearch.internal */ public class ShardIndexingPressure extends IndexingPressure { diff --git a/server/src/main/java/org/opensearch/index/ShardIndexingPressureMemoryManager.java b/server/src/main/java/org/opensearch/index/ShardIndexingPressureMemoryManager.java index fff0649a4327f..d64740488ce31 100644 --- a/server/src/main/java/org/opensearch/index/ShardIndexingPressureMemoryManager.java +++ b/server/src/main/java/org/opensearch/index/ShardIndexingPressureMemoryManager.java @@ -52,6 +52,7 @@ * goes above operating_factor.upper of current shard limits. MemoryManager attempts to update the new shard limit such that the new value * remains withing the operating_factor.optimal range of current shard utilization. * + * @opensearch.internal */ public class ShardIndexingPressureMemoryManager { private static final Logger logger = LogManager.getLogger(ShardIndexingPressureMemoryManager.class); diff --git a/server/src/main/java/org/opensearch/index/ShardIndexingPressureSettings.java b/server/src/main/java/org/opensearch/index/ShardIndexingPressureSettings.java index b1fa1f0bd3b65..35e93162788b5 100644 --- a/server/src/main/java/org/opensearch/index/ShardIndexingPressureSettings.java +++ b/server/src/main/java/org/opensearch/index/ShardIndexingPressureSettings.java @@ -14,6 +14,8 @@ * This class contains all the settings which are required and owned by {TODO link ShardIndexingPressure}. These will be * referenced/used in ShardIndexingPressure, as well as its dependent components, i.e. * {TODO link ShardIndexingPressureMemoryManager} and {TODO link ShardIndexingPressureStore} + * + * @opensearch.internal */ public final class ShardIndexingPressureSettings { diff --git a/server/src/main/java/org/opensearch/index/ShardIndexingPressureStore.java b/server/src/main/java/org/opensearch/index/ShardIndexingPressureStore.java index bcc883a569f25..f634365676b18 100644 --- a/server/src/main/java/org/opensearch/index/ShardIndexingPressureStore.java +++ b/server/src/main/java/org/opensearch/index/ShardIndexingPressureStore.java @@ -44,6 +44,7 @@ * update and evict operations can be abstracted out to support any other strategy such as LRU, if * discovered a need later. * + * @opensearch.internal */ public class ShardIndexingPressureStore { diff --git a/server/src/main/java/org/opensearch/index/ShardIndexingPressureTracker.java b/server/src/main/java/org/opensearch/index/ShardIndexingPressureTracker.java index e63425eef825c..c6031d80fa0a8 100644 --- a/server/src/main/java/org/opensearch/index/ShardIndexingPressureTracker.java +++ b/server/src/main/java/org/opensearch/index/ShardIndexingPressureTracker.java @@ -31,6 +31,8 @@ * increase the complexity of handling shard-lister events and handling other race scenarios such as request-draining etc. * To prefer simplicity we have modelled by keeping explicit fields for different operation tracking, while tracker by itself is * agnostic of the actual shard role. + * + * @opensearch.internal */ public class ShardIndexingPressureTracker { diff --git a/server/src/main/java/org/opensearch/index/SlowLogLevel.java b/server/src/main/java/org/opensearch/index/SlowLogLevel.java index ca628aba14d18..0a28edd59d491 100644 --- a/server/src/main/java/org/opensearch/index/SlowLogLevel.java +++ b/server/src/main/java/org/opensearch/index/SlowLogLevel.java @@ -33,6 +33,11 @@ import java.util.Locale; +/** + * Levels for the slow logs + * + * @opensearch.internal + */ public enum SlowLogLevel { WARN(3), // most specific - little logging INFO(2), diff --git a/server/src/main/java/org/opensearch/index/VersionType.java b/server/src/main/java/org/opensearch/index/VersionType.java index 54ad2c7292eb7..0eb6dfa8fc53a 100644 --- a/server/src/main/java/org/opensearch/index/VersionType.java +++ b/server/src/main/java/org/opensearch/index/VersionType.java @@ -39,6 +39,11 @@ import java.io.IOException; import java.util.Locale; +/** + * Types of index versions + * + * @opensearch.internal + */ public enum VersionType implements Writeable { INTERNAL((byte) 0) { @Override diff --git a/server/src/main/java/org/opensearch/index/analysis/AbstractCharFilterFactory.java b/server/src/main/java/org/opensearch/index/analysis/AbstractCharFilterFactory.java index d632b3db3dcb4..dcc03252e4901 100644 --- a/server/src/main/java/org/opensearch/index/analysis/AbstractCharFilterFactory.java +++ b/server/src/main/java/org/opensearch/index/analysis/AbstractCharFilterFactory.java @@ -35,6 +35,11 @@ import org.opensearch.index.AbstractIndexComponent; import org.opensearch.index.IndexSettings; +/** + * Base character filter factory used in analysis chain + * + * @opensearch.internal + */ public abstract class AbstractCharFilterFactory extends AbstractIndexComponent implements CharFilterFactory { private final String name; diff --git a/server/src/main/java/org/opensearch/index/analysis/AbstractIndexAnalyzerProvider.java b/server/src/main/java/org/opensearch/index/analysis/AbstractIndexAnalyzerProvider.java index e1c5fd0ba3c64..b21c972944d4f 100644 --- a/server/src/main/java/org/opensearch/index/analysis/AbstractIndexAnalyzerProvider.java +++ b/server/src/main/java/org/opensearch/index/analysis/AbstractIndexAnalyzerProvider.java @@ -37,6 +37,11 @@ import org.opensearch.index.AbstractIndexComponent; import org.opensearch.index.IndexSettings; +/** + * Base analyzer component + * + * @opensearch.internal + */ public abstract class AbstractIndexAnalyzerProvider extends AbstractIndexComponent implements AnalyzerProvider { private final String name; diff --git a/server/src/main/java/org/opensearch/index/analysis/AbstractTokenFilterFactory.java b/server/src/main/java/org/opensearch/index/analysis/AbstractTokenFilterFactory.java index fb465eb273382..e5ccd9a0c3f1a 100644 --- a/server/src/main/java/org/opensearch/index/analysis/AbstractTokenFilterFactory.java +++ b/server/src/main/java/org/opensearch/index/analysis/AbstractTokenFilterFactory.java @@ -36,6 +36,11 @@ import org.opensearch.index.AbstractIndexComponent; import org.opensearch.index.IndexSettings; +/** + * Base tokenfilter factory used in analysis chain + * + * @opensearch.internal + */ public abstract class AbstractTokenFilterFactory extends AbstractIndexComponent implements TokenFilterFactory { private final String name; diff --git a/server/src/main/java/org/opensearch/index/analysis/AbstractTokenizerFactory.java b/server/src/main/java/org/opensearch/index/analysis/AbstractTokenizerFactory.java index 9a0f4196bab16..fce420a5e424d 100644 --- a/server/src/main/java/org/opensearch/index/analysis/AbstractTokenizerFactory.java +++ b/server/src/main/java/org/opensearch/index/analysis/AbstractTokenizerFactory.java @@ -36,6 +36,11 @@ import org.opensearch.index.AbstractIndexComponent; import org.opensearch.index.IndexSettings; +/** + * Base tokenizer factory used in analysis chain + * + * @opensearch.internal + */ public abstract class AbstractTokenizerFactory extends AbstractIndexComponent implements TokenizerFactory { private final String name; diff --git a/server/src/main/java/org/opensearch/index/analysis/Analysis.java b/server/src/main/java/org/opensearch/index/analysis/Analysis.java index 90bb21cfc0a4b..9fe5abcb3ea9d 100644 --- a/server/src/main/java/org/opensearch/index/analysis/Analysis.java +++ b/server/src/main/java/org/opensearch/index/analysis/Analysis.java @@ -88,6 +88,11 @@ import static java.util.Collections.unmodifiableMap; +/** + * Core analysis class + * + * @opensearch.internal + */ public class Analysis { public static CharArraySet parseStemExclusion(Settings settings, CharArraySet defaultStemExclusion) { diff --git a/server/src/main/java/org/opensearch/index/analysis/AnalysisMode.java b/server/src/main/java/org/opensearch/index/analysis/AnalysisMode.java index a94820499040e..4385680d9eb93 100644 --- a/server/src/main/java/org/opensearch/index/analysis/AnalysisMode.java +++ b/server/src/main/java/org/opensearch/index/analysis/AnalysisMode.java @@ -36,6 +36,8 @@ * Enum representing the mode in which token filters and analyzers are allowed to operate. * While most token filters are allowed both in index and search time analyzers, some are * restricted to be used only at index time, others at search time. + * + * @opensearch.internal */ public enum AnalysisMode { diff --git a/server/src/main/java/org/opensearch/index/analysis/AnalysisRegistry.java b/server/src/main/java/org/opensearch/index/analysis/AnalysisRegistry.java index dc0e7b13eeb7e..07041978c812c 100644 --- a/server/src/main/java/org/opensearch/index/analysis/AnalysisRegistry.java +++ b/server/src/main/java/org/opensearch/index/analysis/AnalysisRegistry.java @@ -67,6 +67,8 @@ /** * An internal registry for tokenizer, token filter, char filter and analyzer. * This class exists per node and allows to create per-index {@link IndexAnalyzers} via {@link #build(IndexSettings)} + * + * @opensearch.internal */ public final class AnalysisRegistry implements Closeable { public static final String INDEX_ANALYSIS_CHAR_FILTER = "index.analysis.char_filter"; diff --git a/server/src/main/java/org/opensearch/index/analysis/AnalyzerComponents.java b/server/src/main/java/org/opensearch/index/analysis/AnalyzerComponents.java index 9fd36fdee4c6c..97e31c480572a 100644 --- a/server/src/main/java/org/opensearch/index/analysis/AnalyzerComponents.java +++ b/server/src/main/java/org/opensearch/index/analysis/AnalyzerComponents.java @@ -41,6 +41,8 @@ /** * A class that groups analysis components necessary to produce a custom analyzer. * See {@link ReloadableCustomAnalyzer} for an example usage. + * + * @opensearch.internal */ public final class AnalyzerComponents { diff --git a/server/src/main/java/org/opensearch/index/analysis/AnalyzerComponentsProvider.java b/server/src/main/java/org/opensearch/index/analysis/AnalyzerComponentsProvider.java index 305fc84178c19..0fe720a01e5a6 100644 --- a/server/src/main/java/org/opensearch/index/analysis/AnalyzerComponentsProvider.java +++ b/server/src/main/java/org/opensearch/index/analysis/AnalyzerComponentsProvider.java @@ -34,6 +34,8 @@ /** * Analyzers that provide access to their token filters should implement this + * + * @opensearch.internal */ public interface AnalyzerComponentsProvider { diff --git a/server/src/main/java/org/opensearch/index/analysis/AnalyzerProvider.java b/server/src/main/java/org/opensearch/index/analysis/AnalyzerProvider.java index e4a0c8b73b7f1..24ddabca16f1e 100644 --- a/server/src/main/java/org/opensearch/index/analysis/AnalyzerProvider.java +++ b/server/src/main/java/org/opensearch/index/analysis/AnalyzerProvider.java @@ -35,6 +35,11 @@ import org.apache.lucene.analysis.Analyzer; import org.opensearch.common.inject.Provider; +/** + * Base interface for all analyzer providers + * + * @opensearch.internal + */ public interface AnalyzerProvider extends Provider { String name(); diff --git a/server/src/main/java/org/opensearch/index/analysis/AnalyzerScope.java b/server/src/main/java/org/opensearch/index/analysis/AnalyzerScope.java index c61c1283c160f..0ee51b32aab46 100644 --- a/server/src/main/java/org/opensearch/index/analysis/AnalyzerScope.java +++ b/server/src/main/java/org/opensearch/index/analysis/AnalyzerScope.java @@ -32,6 +32,11 @@ package org.opensearch.index.analysis; +/** + * Enum to identify the scope of an analyzer + * + * @opensearch.internal + */ public enum AnalyzerScope { INDEX, INDICES, diff --git a/server/src/main/java/org/opensearch/index/analysis/CharFilterFactory.java b/server/src/main/java/org/opensearch/index/analysis/CharFilterFactory.java index 6d0ce067e5c48..dc9d3704b1a3c 100644 --- a/server/src/main/java/org/opensearch/index/analysis/CharFilterFactory.java +++ b/server/src/main/java/org/opensearch/index/analysis/CharFilterFactory.java @@ -34,6 +34,11 @@ import java.io.Reader; +/** + * Base character filter factory behavior used in analysis chain + * + * @opensearch.internal + */ public interface CharFilterFactory { String name(); diff --git a/server/src/main/java/org/opensearch/index/analysis/CustomAnalyzer.java b/server/src/main/java/org/opensearch/index/analysis/CustomAnalyzer.java index 5971516520bbf..8db5c89d75808 100644 --- a/server/src/main/java/org/opensearch/index/analysis/CustomAnalyzer.java +++ b/server/src/main/java/org/opensearch/index/analysis/CustomAnalyzer.java @@ -39,6 +39,11 @@ import java.io.Reader; +/** + * Custom analyzer chain + * + * @opensearch.internal + */ public final class CustomAnalyzer extends Analyzer implements AnalyzerComponentsProvider { private final AnalyzerComponents components; diff --git a/server/src/main/java/org/opensearch/index/analysis/CustomAnalyzerProvider.java b/server/src/main/java/org/opensearch/index/analysis/CustomAnalyzerProvider.java index f300d7ad4330f..f339b6fc302bf 100644 --- a/server/src/main/java/org/opensearch/index/analysis/CustomAnalyzerProvider.java +++ b/server/src/main/java/org/opensearch/index/analysis/CustomAnalyzerProvider.java @@ -44,6 +44,8 @@ /** * A custom analyzer that is built out of a single {@link org.apache.lucene.analysis.Tokenizer} and a list * of {@link org.apache.lucene.analysis.TokenFilter}s. + * + * @opensearch.internal */ public class CustomAnalyzerProvider extends AbstractIndexAnalyzerProvider { diff --git a/server/src/main/java/org/opensearch/index/analysis/CustomNormalizerProvider.java b/server/src/main/java/org/opensearch/index/analysis/CustomNormalizerProvider.java index 4957ff4471f38..69c0cf418eece 100644 --- a/server/src/main/java/org/opensearch/index/analysis/CustomNormalizerProvider.java +++ b/server/src/main/java/org/opensearch/index/analysis/CustomNormalizerProvider.java @@ -43,6 +43,8 @@ * A custom normalizer that is built out of a char and token filters. On the * contrary to analyzers, it does not support tokenizers and only supports a * subset of char and token filters. + * + * @opensearch.internal */ public final class CustomNormalizerProvider extends AbstractIndexAnalyzerProvider { diff --git a/server/src/main/java/org/opensearch/index/analysis/FieldNameAnalyzer.java b/server/src/main/java/org/opensearch/index/analysis/FieldNameAnalyzer.java index 26d1bf3ce73ca..14d4e89ab33b7 100644 --- a/server/src/main/java/org/opensearch/index/analysis/FieldNameAnalyzer.java +++ b/server/src/main/java/org/opensearch/index/analysis/FieldNameAnalyzer.java @@ -38,6 +38,11 @@ import java.util.Map; +/** + * Analysis chain for field names + * + * @opensearch.internal + */ public final class FieldNameAnalyzer extends DelegatingAnalyzerWrapper { private final Map analyzers; diff --git a/server/src/main/java/org/opensearch/index/analysis/HunspellTokenFilterFactory.java b/server/src/main/java/org/opensearch/index/analysis/HunspellTokenFilterFactory.java index d195cbb57810a..dcfb77a90481d 100644 --- a/server/src/main/java/org/opensearch/index/analysis/HunspellTokenFilterFactory.java +++ b/server/src/main/java/org/opensearch/index/analysis/HunspellTokenFilterFactory.java @@ -40,6 +40,11 @@ import java.util.Locale; +/** + * The token filter factory for the hunspell analyzer + * + * @opensearch.internal + */ public class HunspellTokenFilterFactory extends AbstractTokenFilterFactory { private final Dictionary dictionary; diff --git a/server/src/main/java/org/opensearch/index/analysis/IndexAnalyzers.java b/server/src/main/java/org/opensearch/index/analysis/IndexAnalyzers.java index a1c8f02765155..07be53d668b5e 100644 --- a/server/src/main/java/org/opensearch/index/analysis/IndexAnalyzers.java +++ b/server/src/main/java/org/opensearch/index/analysis/IndexAnalyzers.java @@ -51,6 +51,8 @@ * access to individual tokenizers, char or token filter. * * @see AnalysisRegistry + * + * @opensearch.internal */ public final class IndexAnalyzers implements Closeable { private final Map analyzers; diff --git a/server/src/main/java/org/opensearch/index/analysis/KeywordAnalyzerProvider.java b/server/src/main/java/org/opensearch/index/analysis/KeywordAnalyzerProvider.java index 61580d07e1ba7..04ed3cf74f0ec 100644 --- a/server/src/main/java/org/opensearch/index/analysis/KeywordAnalyzerProvider.java +++ b/server/src/main/java/org/opensearch/index/analysis/KeywordAnalyzerProvider.java @@ -37,6 +37,11 @@ import org.opensearch.env.Environment; import org.opensearch.index.IndexSettings; +/** + * Provider for the keyword analyzer + * + * @opensearch.internal + */ public class KeywordAnalyzerProvider extends AbstractIndexAnalyzerProvider { private final KeywordAnalyzer keywordAnalyzer; diff --git a/server/src/main/java/org/opensearch/index/analysis/LowercaseNormalizer.java b/server/src/main/java/org/opensearch/index/analysis/LowercaseNormalizer.java index 4e9f1acfc530a..ca90244366da8 100644 --- a/server/src/main/java/org/opensearch/index/analysis/LowercaseNormalizer.java +++ b/server/src/main/java/org/opensearch/index/analysis/LowercaseNormalizer.java @@ -38,7 +38,11 @@ import org.apache.lucene.analysis.Tokenizer; import org.apache.lucene.analysis.core.KeywordTokenizer; -/** Normalizer used to lowercase values */ +/** + * Normalizer used to lowercase values + * + * @opensearch.internal + */ public final class LowercaseNormalizer extends Analyzer { @Override diff --git a/server/src/main/java/org/opensearch/index/analysis/LowercaseNormalizerProvider.java b/server/src/main/java/org/opensearch/index/analysis/LowercaseNormalizerProvider.java index 6b1f63b08ac70..bd6dce7ba69e9 100644 --- a/server/src/main/java/org/opensearch/index/analysis/LowercaseNormalizerProvider.java +++ b/server/src/main/java/org/opensearch/index/analysis/LowercaseNormalizerProvider.java @@ -38,6 +38,8 @@ /** * Builds an analyzer for normalization that lowercases terms. + * + * @opensearch.internal */ public class LowercaseNormalizerProvider extends AbstractIndexAnalyzerProvider { diff --git a/server/src/main/java/org/opensearch/index/analysis/NameOrDefinition.java b/server/src/main/java/org/opensearch/index/analysis/NameOrDefinition.java index c10a1ea66ac85..905c4c18589e3 100644 --- a/server/src/main/java/org/opensearch/index/analysis/NameOrDefinition.java +++ b/server/src/main/java/org/opensearch/index/analysis/NameOrDefinition.java @@ -45,6 +45,11 @@ import java.util.Map; import java.util.Objects; +/** + * Provides the name and settings for an analyzer + * + * @opensearch.internal + */ public class NameOrDefinition implements Writeable, ToXContentFragment { // exactly one of these two members is not null public final String name; diff --git a/server/src/main/java/org/opensearch/index/analysis/NamedAnalyzer.java b/server/src/main/java/org/opensearch/index/analysis/NamedAnalyzer.java index 5ee904f196e2c..2a88d375a7df8 100644 --- a/server/src/main/java/org/opensearch/index/analysis/NamedAnalyzer.java +++ b/server/src/main/java/org/opensearch/index/analysis/NamedAnalyzer.java @@ -43,6 +43,8 @@ /** * Named analyzer is an analyzer wrapper around an actual analyzer ({@link #analyzer} that is associated * with a name ({@link #name()}. + * + * @opensearch.internal */ public class NamedAnalyzer extends DelegatingAnalyzerWrapper { diff --git a/server/src/main/java/org/opensearch/index/analysis/NormalizingCharFilterFactory.java b/server/src/main/java/org/opensearch/index/analysis/NormalizingCharFilterFactory.java index e907800896dd3..ab8d23339029c 100644 --- a/server/src/main/java/org/opensearch/index/analysis/NormalizingCharFilterFactory.java +++ b/server/src/main/java/org/opensearch/index/analysis/NormalizingCharFilterFactory.java @@ -39,6 +39,8 @@ * * The default implementation of {@link #normalize(Reader)} delegates to * {@link #create(Reader)} + * + * @opensearch.internal */ public interface NormalizingCharFilterFactory extends CharFilterFactory { diff --git a/server/src/main/java/org/opensearch/index/analysis/NormalizingTokenFilterFactory.java b/server/src/main/java/org/opensearch/index/analysis/NormalizingTokenFilterFactory.java index 3cd6b6e0afd5d..be761aee0d36c 100644 --- a/server/src/main/java/org/opensearch/index/analysis/NormalizingTokenFilterFactory.java +++ b/server/src/main/java/org/opensearch/index/analysis/NormalizingTokenFilterFactory.java @@ -39,6 +39,8 @@ * * The default implementation delegates {@link #normalize(TokenStream)} to * {@link #create(TokenStream)}}. + * + * @opensearch.internal */ public interface NormalizingTokenFilterFactory extends TokenFilterFactory { diff --git a/server/src/main/java/org/opensearch/index/analysis/PreBuiltAnalyzerProvider.java b/server/src/main/java/org/opensearch/index/analysis/PreBuiltAnalyzerProvider.java index ababa4a616efb..a6b4540760653 100644 --- a/server/src/main/java/org/opensearch/index/analysis/PreBuiltAnalyzerProvider.java +++ b/server/src/main/java/org/opensearch/index/analysis/PreBuiltAnalyzerProvider.java @@ -34,6 +34,11 @@ import org.apache.lucene.analysis.Analyzer; +/** + * Provider for all prebuilt analyzers + * + * @opensearch.internal + */ public class PreBuiltAnalyzerProvider implements AnalyzerProvider { private final NamedAnalyzer analyzer; diff --git a/server/src/main/java/org/opensearch/index/analysis/PreBuiltAnalyzerProviderFactory.java b/server/src/main/java/org/opensearch/index/analysis/PreBuiltAnalyzerProviderFactory.java index d2c5384153bd2..ce1489d5de70c 100644 --- a/server/src/main/java/org/opensearch/index/analysis/PreBuiltAnalyzerProviderFactory.java +++ b/server/src/main/java/org/opensearch/index/analysis/PreBuiltAnalyzerProviderFactory.java @@ -49,6 +49,11 @@ import java.util.function.Supplier; import java.util.stream.Collectors; +/** + * Factory to create the providers for all prebuilt analyzers + * + * @opensearch.internal + */ public class PreBuiltAnalyzerProviderFactory extends PreConfiguredAnalysisComponent> implements Closeable { private final Function create; diff --git a/server/src/main/java/org/opensearch/index/analysis/PreConfiguredAnalysisComponent.java b/server/src/main/java/org/opensearch/index/analysis/PreConfiguredAnalysisComponent.java index 95437a2a8ef30..a9c3c95c7bb77 100644 --- a/server/src/main/java/org/opensearch/index/analysis/PreConfiguredAnalysisComponent.java +++ b/server/src/main/java/org/opensearch/index/analysis/PreConfiguredAnalysisComponent.java @@ -43,6 +43,8 @@ /** * Shared implementation for pre-configured analysis components. + * + * @opensearch.internal */ public abstract class PreConfiguredAnalysisComponent implements AnalysisModule.AnalysisProvider { protected final String name; diff --git a/server/src/main/java/org/opensearch/index/analysis/PreConfiguredCharFilter.java b/server/src/main/java/org/opensearch/index/analysis/PreConfiguredCharFilter.java index a7faba4e4a7d8..6ba23ed67beed 100644 --- a/server/src/main/java/org/opensearch/index/analysis/PreConfiguredCharFilter.java +++ b/server/src/main/java/org/opensearch/index/analysis/PreConfiguredCharFilter.java @@ -43,6 +43,8 @@ /** * Provides pre-configured, shared {@link CharFilter}s. + * + * @opensearch.internal */ public class PreConfiguredCharFilter extends PreConfiguredAnalysisComponent { /** diff --git a/server/src/main/java/org/opensearch/index/analysis/PreConfiguredTokenFilter.java b/server/src/main/java/org/opensearch/index/analysis/PreConfiguredTokenFilter.java index 23621f6c6480d..9fb8623994162 100644 --- a/server/src/main/java/org/opensearch/index/analysis/PreConfiguredTokenFilter.java +++ b/server/src/main/java/org/opensearch/index/analysis/PreConfiguredTokenFilter.java @@ -43,6 +43,8 @@ /** * Provides pre-configured, shared {@link TokenFilter}s. + * + * @opensearch.internal */ public final class PreConfiguredTokenFilter extends PreConfiguredAnalysisComponent { /** diff --git a/server/src/main/java/org/opensearch/index/analysis/PreConfiguredTokenizer.java b/server/src/main/java/org/opensearch/index/analysis/PreConfiguredTokenizer.java index 428f386526813..50ff0a55add77 100644 --- a/server/src/main/java/org/opensearch/index/analysis/PreConfiguredTokenizer.java +++ b/server/src/main/java/org/opensearch/index/analysis/PreConfiguredTokenizer.java @@ -42,6 +42,8 @@ /** * Provides pre-configured, shared {@link Tokenizer}s. + * + * @opensearch.internal */ public final class PreConfiguredTokenizer extends PreConfiguredAnalysisComponent { /** diff --git a/server/src/main/java/org/opensearch/index/analysis/ReloadableCustomAnalyzer.java b/server/src/main/java/org/opensearch/index/analysis/ReloadableCustomAnalyzer.java index bd12f15693fbd..ba8996eb9c17b 100644 --- a/server/src/main/java/org/opensearch/index/analysis/ReloadableCustomAnalyzer.java +++ b/server/src/main/java/org/opensearch/index/analysis/ReloadableCustomAnalyzer.java @@ -42,6 +42,11 @@ import java.io.Reader; import java.util.Map; +/** + * A custom analyzer that is reloadable + * + * @opensearch.internal + */ public final class ReloadableCustomAnalyzer extends Analyzer implements AnalyzerComponentsProvider { private volatile AnalyzerComponents components; diff --git a/server/src/main/java/org/opensearch/index/analysis/ShingleTokenFilterFactory.java b/server/src/main/java/org/opensearch/index/analysis/ShingleTokenFilterFactory.java index 863c4b2611d66..953479e3e0a19 100644 --- a/server/src/main/java/org/opensearch/index/analysis/ShingleTokenFilterFactory.java +++ b/server/src/main/java/org/opensearch/index/analysis/ShingleTokenFilterFactory.java @@ -41,6 +41,11 @@ import org.opensearch.env.Environment; import org.opensearch.index.IndexSettings; +/** + * Factory for shingle analyzer token filters + * + * @opensearch.internal + */ public class ShingleTokenFilterFactory extends AbstractTokenFilterFactory { private static final DeprecationLogger DEPRECATION_LOGGER = DeprecationLogger.getLogger(ShingleTokenFilterFactory.class); diff --git a/server/src/main/java/org/opensearch/index/analysis/SimpleAnalyzerProvider.java b/server/src/main/java/org/opensearch/index/analysis/SimpleAnalyzerProvider.java index 85d25aaa753e6..67b95a2849581 100644 --- a/server/src/main/java/org/opensearch/index/analysis/SimpleAnalyzerProvider.java +++ b/server/src/main/java/org/opensearch/index/analysis/SimpleAnalyzerProvider.java @@ -37,6 +37,11 @@ import org.opensearch.env.Environment; import org.opensearch.index.IndexSettings; +/** + * Provider class for the simple analyzer + * + * @opensearch.internal + */ public class SimpleAnalyzerProvider extends AbstractIndexAnalyzerProvider { private final SimpleAnalyzer simpleAnalyzer; diff --git a/server/src/main/java/org/opensearch/index/analysis/StandardAnalyzerProvider.java b/server/src/main/java/org/opensearch/index/analysis/StandardAnalyzerProvider.java index 1cdcb5af12c78..d7fe1bd9987b3 100644 --- a/server/src/main/java/org/opensearch/index/analysis/StandardAnalyzerProvider.java +++ b/server/src/main/java/org/opensearch/index/analysis/StandardAnalyzerProvider.java @@ -38,6 +38,11 @@ import org.opensearch.env.Environment; import org.opensearch.index.IndexSettings; +/** + * Provider for the standard analyzer + * + * @opensearch.internal + */ public class StandardAnalyzerProvider extends AbstractIndexAnalyzerProvider { private final StandardAnalyzer standardAnalyzer; diff --git a/server/src/main/java/org/opensearch/index/analysis/StandardTokenizerFactory.java b/server/src/main/java/org/opensearch/index/analysis/StandardTokenizerFactory.java index 4cb5b52280dfb..076be2497b98c 100644 --- a/server/src/main/java/org/opensearch/index/analysis/StandardTokenizerFactory.java +++ b/server/src/main/java/org/opensearch/index/analysis/StandardTokenizerFactory.java @@ -39,6 +39,11 @@ import org.opensearch.env.Environment; import org.opensearch.index.IndexSettings; +/** + * Tokenizer factory for the standard analyzer + * + * @opensearch.internal + */ public class StandardTokenizerFactory extends AbstractTokenizerFactory { private final int maxTokenLength; diff --git a/server/src/main/java/org/opensearch/index/analysis/StopAnalyzerProvider.java b/server/src/main/java/org/opensearch/index/analysis/StopAnalyzerProvider.java index 84381c21cb8b4..41044d2afccf8 100644 --- a/server/src/main/java/org/opensearch/index/analysis/StopAnalyzerProvider.java +++ b/server/src/main/java/org/opensearch/index/analysis/StopAnalyzerProvider.java @@ -39,6 +39,11 @@ import org.opensearch.env.Environment; import org.opensearch.index.IndexSettings; +/** + * Provider class for the stop word analyzer + * + * @opensearch.internal + */ public class StopAnalyzerProvider extends AbstractIndexAnalyzerProvider { private final StopAnalyzer stopAnalyzer; diff --git a/server/src/main/java/org/opensearch/index/analysis/StopTokenFilterFactory.java b/server/src/main/java/org/opensearch/index/analysis/StopTokenFilterFactory.java index 05787c1f4d95c..7ed0ec06a7c5f 100644 --- a/server/src/main/java/org/opensearch/index/analysis/StopTokenFilterFactory.java +++ b/server/src/main/java/org/opensearch/index/analysis/StopTokenFilterFactory.java @@ -43,6 +43,11 @@ import java.util.Set; +/** + * Token filter factory for the stop word analyzer + * + * @opensearch.internal + */ public class StopTokenFilterFactory extends AbstractTokenFilterFactory { private final CharArraySet stopWords; diff --git a/server/src/main/java/org/opensearch/index/analysis/TokenFilterFactory.java b/server/src/main/java/org/opensearch/index/analysis/TokenFilterFactory.java index 3468fca095ed6..1b9d781b177ce 100644 --- a/server/src/main/java/org/opensearch/index/analysis/TokenFilterFactory.java +++ b/server/src/main/java/org/opensearch/index/analysis/TokenFilterFactory.java @@ -39,6 +39,11 @@ import java.util.List; import java.util.function.Function; +/** + * Base token filter factory used in analysis chain + * + * @opensearch.internal + */ public interface TokenFilterFactory { String name(); diff --git a/server/src/main/java/org/opensearch/index/analysis/TokenizerFactory.java b/server/src/main/java/org/opensearch/index/analysis/TokenizerFactory.java index d38c1f9c3027a..b667175e89b4a 100644 --- a/server/src/main/java/org/opensearch/index/analysis/TokenizerFactory.java +++ b/server/src/main/java/org/opensearch/index/analysis/TokenizerFactory.java @@ -36,6 +36,11 @@ import java.util.function.Supplier; +/** + * Base tokenizer factory used in analysis chain + * + * @opensearch.internal + */ public interface TokenizerFactory { String name(); diff --git a/server/src/main/java/org/opensearch/index/analysis/WhitespaceAnalyzerProvider.java b/server/src/main/java/org/opensearch/index/analysis/WhitespaceAnalyzerProvider.java index 63425af2d23f5..038b9168745da 100644 --- a/server/src/main/java/org/opensearch/index/analysis/WhitespaceAnalyzerProvider.java +++ b/server/src/main/java/org/opensearch/index/analysis/WhitespaceAnalyzerProvider.java @@ -37,6 +37,11 @@ import org.opensearch.env.Environment; import org.opensearch.index.IndexSettings; +/** + * Provider class for the whitespace analyzer + * + * @opensearch.internal + */ public class WhitespaceAnalyzerProvider extends AbstractIndexAnalyzerProvider { private final WhitespaceAnalyzer analyzer; diff --git a/server/src/main/java/org/opensearch/index/cache/IndexCache.java b/server/src/main/java/org/opensearch/index/cache/IndexCache.java index ff8be98cd8ab4..0423a0bfd2706 100644 --- a/server/src/main/java/org/opensearch/index/cache/IndexCache.java +++ b/server/src/main/java/org/opensearch/index/cache/IndexCache.java @@ -41,6 +41,11 @@ import java.io.Closeable; import java.io.IOException; +/** + * Wrapping class for the index cache + * + * @opensearch.internal + */ public class IndexCache extends AbstractIndexComponent implements Closeable { private final QueryCache queryCache; diff --git a/server/src/main/java/org/opensearch/index/cache/bitset/BitsetFilterCache.java b/server/src/main/java/org/opensearch/index/cache/bitset/BitsetFilterCache.java index 0bc77f0f0079b..12306f942d32f 100644 --- a/server/src/main/java/org/opensearch/index/cache/bitset/BitsetFilterCache.java +++ b/server/src/main/java/org/opensearch/index/cache/bitset/BitsetFilterCache.java @@ -84,6 +84,8 @@ * Use this cache with care, only components that require that a filter is to be materialized as a {@link BitDocIdSet} * and require that it should always be around should use this cache, otherwise the * {@link org.opensearch.index.cache.query.QueryCache} should be used instead. + * + * @opensearch.internal */ public final class BitsetFilterCache extends AbstractIndexComponent implements diff --git a/server/src/main/java/org/opensearch/index/cache/bitset/ShardBitsetFilterCache.java b/server/src/main/java/org/opensearch/index/cache/bitset/ShardBitsetFilterCache.java index 3ddadc0cdedba..025bfe6bab666 100644 --- a/server/src/main/java/org/opensearch/index/cache/bitset/ShardBitsetFilterCache.java +++ b/server/src/main/java/org/opensearch/index/cache/bitset/ShardBitsetFilterCache.java @@ -37,6 +37,11 @@ import org.opensearch.index.shard.AbstractIndexShardComponent; import org.opensearch.index.shard.ShardId; +/** + * Bitset Filter Cache for shards + * + * @opensearch.internal + */ public class ShardBitsetFilterCache extends AbstractIndexShardComponent { private final CounterMetric totalMetric = new CounterMetric(); diff --git a/server/src/main/java/org/opensearch/index/cache/query/DisabledQueryCache.java b/server/src/main/java/org/opensearch/index/cache/query/DisabledQueryCache.java index 8a25f731adb03..493d8a4bbcd98 100644 --- a/server/src/main/java/org/opensearch/index/cache/query/DisabledQueryCache.java +++ b/server/src/main/java/org/opensearch/index/cache/query/DisabledQueryCache.java @@ -37,6 +37,11 @@ import org.opensearch.index.AbstractIndexComponent; import org.opensearch.index.IndexSettings; +/** + * NoOp Implementation for a Disabled query cache + * + * @opensearch.internal + */ public class DisabledQueryCache extends AbstractIndexComponent implements QueryCache { public DisabledQueryCache(IndexSettings indexSettings) { diff --git a/server/src/main/java/org/opensearch/index/cache/query/IndexQueryCache.java b/server/src/main/java/org/opensearch/index/cache/query/IndexQueryCache.java index b410f8d83df8c..c69f0b8da068f 100644 --- a/server/src/main/java/org/opensearch/index/cache/query/IndexQueryCache.java +++ b/server/src/main/java/org/opensearch/index/cache/query/IndexQueryCache.java @@ -42,6 +42,8 @@ /** * The index-level query cache. This class mostly delegates to the node-level * query cache: {@link IndicesQueryCache}. + * + * @opensearch.internal */ public class IndexQueryCache extends AbstractIndexComponent implements QueryCache { diff --git a/server/src/main/java/org/opensearch/index/cache/query/QueryCache.java b/server/src/main/java/org/opensearch/index/cache/query/QueryCache.java index fe38c61dfe54c..384f66fcfc132 100644 --- a/server/src/main/java/org/opensearch/index/cache/query/QueryCache.java +++ b/server/src/main/java/org/opensearch/index/cache/query/QueryCache.java @@ -36,6 +36,11 @@ import java.io.Closeable; +/** + * Base interface for a query cache + * + * @opensearch.internal + */ public interface QueryCache extends IndexComponent, Closeable, org.apache.lucene.search.QueryCache { void clear(String reason); diff --git a/server/src/main/java/org/opensearch/index/cache/query/QueryCacheStats.java b/server/src/main/java/org/opensearch/index/cache/query/QueryCacheStats.java index 9dcae1f93d537..e9cc26c378749 100644 --- a/server/src/main/java/org/opensearch/index/cache/query/QueryCacheStats.java +++ b/server/src/main/java/org/opensearch/index/cache/query/QueryCacheStats.java @@ -43,6 +43,11 @@ import java.io.IOException; +/** + * Stats for the query cache + * + * @opensearch.internal + */ public class QueryCacheStats implements Writeable, ToXContentFragment { private long ramBytesUsed; diff --git a/server/src/main/java/org/opensearch/index/cache/request/RequestCacheStats.java b/server/src/main/java/org/opensearch/index/cache/request/RequestCacheStats.java index f48f442af1390..d03bfdad24226 100644 --- a/server/src/main/java/org/opensearch/index/cache/request/RequestCacheStats.java +++ b/server/src/main/java/org/opensearch/index/cache/request/RequestCacheStats.java @@ -41,6 +41,11 @@ import java.io.IOException; +/** + * Request for the query cache statistics + * + * @opensearch.internal + */ public class RequestCacheStats implements Writeable, ToXContentFragment { private long memorySize; diff --git a/server/src/main/java/org/opensearch/index/cache/request/ShardRequestCache.java b/server/src/main/java/org/opensearch/index/cache/request/ShardRequestCache.java index 5fb6d48c74c87..e0ab80777c82d 100644 --- a/server/src/main/java/org/opensearch/index/cache/request/ShardRequestCache.java +++ b/server/src/main/java/org/opensearch/index/cache/request/ShardRequestCache.java @@ -38,6 +38,8 @@ /** * Tracks the portion of the request cache in use for a particular shard. + * + * @opensearch.internal */ public final class ShardRequestCache { diff --git a/server/src/main/java/org/opensearch/index/codec/CodecService.java b/server/src/main/java/org/opensearch/index/codec/CodecService.java index e445ad88f497e..908330858399e 100644 --- a/server/src/main/java/org/opensearch/index/codec/CodecService.java +++ b/server/src/main/java/org/opensearch/index/codec/CodecService.java @@ -47,6 +47,8 @@ * codec layer that allows to use use-case specific file formats & * data-structures per field. OpenSearch exposes the full * {@link Codec} capabilities through this {@link CodecService}. + * + * @opensearch.internal */ public class CodecService { diff --git a/server/src/main/java/org/opensearch/index/codec/CodecServiceConfig.java b/server/src/main/java/org/opensearch/index/codec/CodecServiceConfig.java index 313c0d359bb02..5fa9261471acf 100644 --- a/server/src/main/java/org/opensearch/index/codec/CodecServiceConfig.java +++ b/server/src/main/java/org/opensearch/index/codec/CodecServiceConfig.java @@ -17,6 +17,8 @@ /** * The configuration parameters necessary for the {@link CodecService} instance construction. + * + * @opensearch.internal */ public final class CodecServiceConfig { private final IndexSettings indexSettings; diff --git a/server/src/main/java/org/opensearch/index/codec/CodecServiceFactory.java b/server/src/main/java/org/opensearch/index/codec/CodecServiceFactory.java index da28c5f06b035..8f60d1a045330 100644 --- a/server/src/main/java/org/opensearch/index/codec/CodecServiceFactory.java +++ b/server/src/main/java/org/opensearch/index/codec/CodecServiceFactory.java @@ -10,6 +10,8 @@ /** * A factory for creating new {@link CodecService} instance + * + * @opensearch.internal */ @FunctionalInterface public interface CodecServiceFactory { diff --git a/server/src/main/java/org/opensearch/index/codec/PerFieldMappingPostingFormatCodec.java b/server/src/main/java/org/opensearch/index/codec/PerFieldMappingPostingFormatCodec.java index fa01390d13419..52e940a25ddd6 100644 --- a/server/src/main/java/org/opensearch/index/codec/PerFieldMappingPostingFormatCodec.java +++ b/server/src/main/java/org/opensearch/index/codec/PerFieldMappingPostingFormatCodec.java @@ -50,6 +50,8 @@ * allows users to change the low level postings format for individual fields * per index in real time via the mapping API. If no specific postings format is * configured for a specific field the default postings format is used. + * + * @opensearch.internal */ public class PerFieldMappingPostingFormatCodec extends Lucene91Codec { private final Logger logger; diff --git a/server/src/main/java/org/opensearch/index/engine/CombinedDeletionPolicy.java b/server/src/main/java/org/opensearch/index/engine/CombinedDeletionPolicy.java index 09e6599b33409..8772724c2353d 100644 --- a/server/src/main/java/org/opensearch/index/engine/CombinedDeletionPolicy.java +++ b/server/src/main/java/org/opensearch/index/engine/CombinedDeletionPolicy.java @@ -56,6 +56,8 @@ *

    * In particular, this policy will delete index commits whose max sequence number is at most * the current global checkpoint except the index commit which has the highest max sequence number among those. + * + * @opensearch.internal */ public class CombinedDeletionPolicy extends IndexDeletionPolicy { private final Logger logger; diff --git a/server/src/main/java/org/opensearch/index/engine/CombinedDocValues.java b/server/src/main/java/org/opensearch/index/engine/CombinedDocValues.java index 043e4f2d5661f..0f8ca53429a81 100644 --- a/server/src/main/java/org/opensearch/index/engine/CombinedDocValues.java +++ b/server/src/main/java/org/opensearch/index/engine/CombinedDocValues.java @@ -41,6 +41,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Doc Values used in LuceneChangesSnapshot for recovery + * + * @opensearch.internal + */ final class CombinedDocValues { private final NumericDocValues versionDV; private final NumericDocValues seqNoDV; diff --git a/server/src/main/java/org/opensearch/index/engine/CommitStats.java b/server/src/main/java/org/opensearch/index/engine/CommitStats.java index 1220208d3a8f3..1faed2cd16713 100644 --- a/server/src/main/java/org/opensearch/index/engine/CommitStats.java +++ b/server/src/main/java/org/opensearch/index/engine/CommitStats.java @@ -44,7 +44,11 @@ import java.util.Base64; import java.util.Map; -/** a class the returns dynamic information with respect to the last commit point of this shard */ +/** + * a class the returns dynamic information with respect to the last commit point of this shard + * + * @opensearch.internal + */ public final class CommitStats implements Writeable, ToXContentFragment { private final Map userData; diff --git a/server/src/main/java/org/opensearch/index/engine/CompletionStatsCache.java b/server/src/main/java/org/opensearch/index/engine/CompletionStatsCache.java index b37572a280b4c..08ede10f3f6aa 100644 --- a/server/src/main/java/org/opensearch/index/engine/CompletionStatsCache.java +++ b/server/src/main/java/org/opensearch/index/engine/CompletionStatsCache.java @@ -49,6 +49,11 @@ import java.util.function.Supplier; +/** + * Cache to store engine completion stats + * + * @opensearch.internal + */ class CompletionStatsCache implements ReferenceManager.RefreshListener { private final Supplier searcherSupplier; diff --git a/server/src/main/java/org/opensearch/index/engine/DeleteVersionValue.java b/server/src/main/java/org/opensearch/index/engine/DeleteVersionValue.java index 8ee700428bcb4..9926f3762626f 100644 --- a/server/src/main/java/org/opensearch/index/engine/DeleteVersionValue.java +++ b/server/src/main/java/org/opensearch/index/engine/DeleteVersionValue.java @@ -34,7 +34,11 @@ import org.apache.lucene.util.RamUsageEstimator; -/** Holds a deleted version, which just adds a timestamp to {@link VersionValue} so we know when we can expire the deletion. */ +/** + * Holds a deleted version, which just adds a timestamp to {@link VersionValue} so we know when we can expire the deletion. + * + * @opensearch.internal + */ final class DeleteVersionValue extends VersionValue { diff --git a/server/src/main/java/org/opensearch/index/engine/DocumentMissingException.java b/server/src/main/java/org/opensearch/index/engine/DocumentMissingException.java index 9eb54292e13bd..7cb35b8279153 100644 --- a/server/src/main/java/org/opensearch/index/engine/DocumentMissingException.java +++ b/server/src/main/java/org/opensearch/index/engine/DocumentMissingException.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Exception thrown if a document is missing + * + * @opensearch.internal + */ public class DocumentMissingException extends EngineException { public DocumentMissingException(ShardId shardId, String id) { diff --git a/server/src/main/java/org/opensearch/index/engine/DocumentSourceMissingException.java b/server/src/main/java/org/opensearch/index/engine/DocumentSourceMissingException.java index 333abc3794a5c..b3826d9933776 100644 --- a/server/src/main/java/org/opensearch/index/engine/DocumentSourceMissingException.java +++ b/server/src/main/java/org/opensearch/index/engine/DocumentSourceMissingException.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Exception thrown if a document source is missing + * + * @opensearch.internal + */ public class DocumentSourceMissingException extends EngineException { public DocumentSourceMissingException(ShardId shardId, String id) { diff --git a/server/src/main/java/org/opensearch/index/engine/Engine.java b/server/src/main/java/org/opensearch/index/engine/Engine.java index 83da0ea6b52f3..06ceb34ab2065 100644 --- a/server/src/main/java/org/opensearch/index/engine/Engine.java +++ b/server/src/main/java/org/opensearch/index/engine/Engine.java @@ -112,6 +112,11 @@ import static org.opensearch.index.seqno.SequenceNumbers.UNASSIGNED_PRIMARY_TERM; import static org.opensearch.index.seqno.SequenceNumbers.UNASSIGNED_SEQ_NO; +/** + * Base OpenSearch Engine class + * + * @opensearch.internal + */ public abstract class Engine implements Closeable { public static final String SYNC_COMMIT_ID = "sync_id"; // TODO: remove sync_id in 3.0 diff --git a/server/src/main/java/org/opensearch/index/engine/EngineConfig.java b/server/src/main/java/org/opensearch/index/engine/EngineConfig.java index d1085b01a3707..52dff2826657b 100644 --- a/server/src/main/java/org/opensearch/index/engine/EngineConfig.java +++ b/server/src/main/java/org/opensearch/index/engine/EngineConfig.java @@ -62,10 +62,12 @@ import java.util.function.LongSupplier; import java.util.function.Supplier; -/* +/** * Holds all the configuration that is used to create an {@link Engine}. * Once {@link Engine} has been created with this object, changes to this * object will affect the {@link Engine} instance. + * + * @opensearch.internal */ public final class EngineConfig { private final ShardId shardId; diff --git a/server/src/main/java/org/opensearch/index/engine/EngineConfigFactory.java b/server/src/main/java/org/opensearch/index/engine/EngineConfigFactory.java index a78a5e5a4820a..afab57905a9a7 100644 --- a/server/src/main/java/org/opensearch/index/engine/EngineConfigFactory.java +++ b/server/src/main/java/org/opensearch/index/engine/EngineConfigFactory.java @@ -42,6 +42,8 @@ /** * A factory to create an EngineConfig based on custom plugin overrides + * + * @opensearch.internal */ public class EngineConfigFactory { private final CodecServiceFactory codecServiceFactory; diff --git a/server/src/main/java/org/opensearch/index/engine/EngineCreationFailureException.java b/server/src/main/java/org/opensearch/index/engine/EngineCreationFailureException.java index f228694cae7d4..b7ea337f271d1 100644 --- a/server/src/main/java/org/opensearch/index/engine/EngineCreationFailureException.java +++ b/server/src/main/java/org/opensearch/index/engine/EngineCreationFailureException.java @@ -40,7 +40,7 @@ /** * An exception indicating that an {@link Engine} creation failed. * - * + * @opensearch.internal */ public class EngineCreationFailureException extends EngineException { diff --git a/server/src/main/java/org/opensearch/index/engine/EngineException.java b/server/src/main/java/org/opensearch/index/engine/EngineException.java index bda9b433e5f40..309f287833bb9 100644 --- a/server/src/main/java/org/opensearch/index/engine/EngineException.java +++ b/server/src/main/java/org/opensearch/index/engine/EngineException.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Exception if there are any errors in the engine + * + * @opensearch.internal + */ public class EngineException extends OpenSearchException { public EngineException(ShardId shardId, String msg, Object... params) { diff --git a/server/src/main/java/org/opensearch/index/engine/EngineFactory.java b/server/src/main/java/org/opensearch/index/engine/EngineFactory.java index f38e5242e2f9c..ced02ab3041c9 100644 --- a/server/src/main/java/org/opensearch/index/engine/EngineFactory.java +++ b/server/src/main/java/org/opensearch/index/engine/EngineFactory.java @@ -33,6 +33,8 @@ /** * Simple Engine Factory + * + * @opensearch.internal */ @FunctionalInterface public interface EngineFactory { diff --git a/server/src/main/java/org/opensearch/index/engine/FlushFailedEngineException.java b/server/src/main/java/org/opensearch/index/engine/FlushFailedEngineException.java index 711fe50f3faee..35d8db66be9ff 100644 --- a/server/src/main/java/org/opensearch/index/engine/FlushFailedEngineException.java +++ b/server/src/main/java/org/opensearch/index/engine/FlushFailedEngineException.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Exception thrown if there is an error on flush + * + * @opensearch.internal + */ public class FlushFailedEngineException extends EngineException { public FlushFailedEngineException(ShardId shardId, Throwable t) { diff --git a/server/src/main/java/org/opensearch/index/engine/IndexVersionValue.java b/server/src/main/java/org/opensearch/index/engine/IndexVersionValue.java index 1b10385929380..803d106a2f25e 100644 --- a/server/src/main/java/org/opensearch/index/engine/IndexVersionValue.java +++ b/server/src/main/java/org/opensearch/index/engine/IndexVersionValue.java @@ -37,6 +37,11 @@ import java.util.Objects; +/** + * Encapsulates an Index Version in the translog + * + * @opensearch.internal + */ final class IndexVersionValue extends VersionValue { private static final long RAM_BYTES_USED = RamUsageEstimator.shallowSizeOfInstance(IndexVersionValue.class); diff --git a/server/src/main/java/org/opensearch/index/engine/InternalEngine.java b/server/src/main/java/org/opensearch/index/engine/InternalEngine.java index 8e5308973ae64..70165adb6da60 100644 --- a/server/src/main/java/org/opensearch/index/engine/InternalEngine.java +++ b/server/src/main/java/org/opensearch/index/engine/InternalEngine.java @@ -136,6 +136,11 @@ import java.util.stream.Collectors; import java.util.stream.Stream; +/** + * The default internal engine (can be overridden by plugins) + * + * @opensearch.internal + */ public class InternalEngine extends Engine { /** diff --git a/server/src/main/java/org/opensearch/index/engine/InternalEngineFactory.java b/server/src/main/java/org/opensearch/index/engine/InternalEngineFactory.java index 541c4bb047cd9..d17b417832313 100644 --- a/server/src/main/java/org/opensearch/index/engine/InternalEngineFactory.java +++ b/server/src/main/java/org/opensearch/index/engine/InternalEngineFactory.java @@ -32,6 +32,11 @@ package org.opensearch.index.engine; +/** + * Factory for creating an in InternalEngine instance + * + * @opensearch.internal + */ public class InternalEngineFactory implements EngineFactory { @Override public Engine newReadWriteEngine(EngineConfig config) { diff --git a/server/src/main/java/org/opensearch/index/engine/LiveVersionMap.java b/server/src/main/java/org/opensearch/index/engine/LiveVersionMap.java index 44715637fd791..943792171d2e5 100644 --- a/server/src/main/java/org/opensearch/index/engine/LiveVersionMap.java +++ b/server/src/main/java/org/opensearch/index/engine/LiveVersionMap.java @@ -46,7 +46,11 @@ import java.util.Map; import java.util.concurrent.atomic.AtomicLong; -/** Maps _uid value to its version information. */ +/** + * Maps _uid value to its version information. + * + * @opensearch.internal + */ final class LiveVersionMap implements ReferenceManager.RefreshListener, Accountable { private final KeyedLock keyedLock = new KeyedLock<>(); diff --git a/server/src/main/java/org/opensearch/index/engine/LuceneChangesSnapshot.java b/server/src/main/java/org/opensearch/index/engine/LuceneChangesSnapshot.java index 98da554a5a1b0..6b3a8d76defb5 100644 --- a/server/src/main/java/org/opensearch/index/engine/LuceneChangesSnapshot.java +++ b/server/src/main/java/org/opensearch/index/engine/LuceneChangesSnapshot.java @@ -64,6 +64,8 @@ /** * A {@link Translog.Snapshot} from changes in a Lucene index + * + * @opensearch.internal */ final class LuceneChangesSnapshot implements Translog.Snapshot { static final int DEFAULT_BATCH_SIZE = 1024; diff --git a/server/src/main/java/org/opensearch/index/engine/MissingHistoryOperationsException.java b/server/src/main/java/org/opensearch/index/engine/MissingHistoryOperationsException.java index 7c7a32a57bf9a..b14e488791f02 100644 --- a/server/src/main/java/org/opensearch/index/engine/MissingHistoryOperationsException.java +++ b/server/src/main/java/org/opensearch/index/engine/MissingHistoryOperationsException.java @@ -35,6 +35,8 @@ /** * Exception indicating that not all requested operations from {@link LuceneChangesSnapshot} * are available. + * + * @opensearch.internal */ public final class MissingHistoryOperationsException extends IllegalStateException { diff --git a/server/src/main/java/org/opensearch/index/engine/NoOpEngine.java b/server/src/main/java/org/opensearch/index/engine/NoOpEngine.java index 5db1bb05bbc24..3a16d884fd899 100644 --- a/server/src/main/java/org/opensearch/index/engine/NoOpEngine.java +++ b/server/src/main/java/org/opensearch/index/engine/NoOpEngine.java @@ -61,6 +61,8 @@ * index, get), throw {@link UnsupportedOperationException}. However, NoOpEngine * allows to trim any existing translog files through the usage of the * {{@link #trimUnreferencedTranslogFiles()}} method. + * + * @opensearch.internal */ public final class NoOpEngine extends ReadOnlyEngine { diff --git a/server/src/main/java/org/opensearch/index/engine/OpenSearchConcurrentMergeScheduler.java b/server/src/main/java/org/opensearch/index/engine/OpenSearchConcurrentMergeScheduler.java index 9deab15991f38..83794578ea2bf 100644 --- a/server/src/main/java/org/opensearch/index/engine/OpenSearchConcurrentMergeScheduler.java +++ b/server/src/main/java/org/opensearch/index/engine/OpenSearchConcurrentMergeScheduler.java @@ -59,6 +59,8 @@ /** * An extension to the {@link ConcurrentMergeScheduler} that provides tracking on merge times, total * and current merges. + * + * @opensearch.internal */ class OpenSearchConcurrentMergeScheduler extends ConcurrentMergeScheduler { diff --git a/server/src/main/java/org/opensearch/index/engine/OpenSearchReaderManager.java b/server/src/main/java/org/opensearch/index/engine/OpenSearchReaderManager.java index b83ce8bea567c..06e5ed3539142 100644 --- a/server/src/main/java/org/opensearch/index/engine/OpenSearchReaderManager.java +++ b/server/src/main/java/org/opensearch/index/engine/OpenSearchReaderManager.java @@ -48,6 +48,7 @@ * * @see SearcherManager * + * @opensearch.internal */ @SuppressForbidden(reason = "reference counting is required here") class OpenSearchReaderManager extends ReferenceManager { diff --git a/server/src/main/java/org/opensearch/index/engine/PrunePostingsMergePolicy.java b/server/src/main/java/org/opensearch/index/engine/PrunePostingsMergePolicy.java index 18f2799edc244..5b186b7a3d841 100644 --- a/server/src/main/java/org/opensearch/index/engine/PrunePostingsMergePolicy.java +++ b/server/src/main/java/org/opensearch/index/engine/PrunePostingsMergePolicy.java @@ -59,6 +59,8 @@ * soft deleted documents independent of the retention policy. Note, in order for this merge policy to be effective it needs to be added * before the {@link org.apache.lucene.index.SoftDeletesRetentionMergePolicy} because otherwise only documents that are deleted / removed * anyways will be pruned. + * + * @opensearch.internal */ final class PrunePostingsMergePolicy extends OneMergeWrappingMergePolicy { diff --git a/server/src/main/java/org/opensearch/index/engine/ReadOnlyEngine.java b/server/src/main/java/org/opensearch/index/engine/ReadOnlyEngine.java index a9037de730398..4314c8fbf87af 100644 --- a/server/src/main/java/org/opensearch/index/engine/ReadOnlyEngine.java +++ b/server/src/main/java/org/opensearch/index/engine/ReadOnlyEngine.java @@ -73,6 +73,8 @@ * engine. * * @see #ReadOnlyEngine(EngineConfig, SeqNoStats, TranslogStats, boolean, Function, boolean) + * + * @opensearch.internal */ public class ReadOnlyEngine extends Engine { diff --git a/server/src/main/java/org/opensearch/index/engine/RecoveryEngineException.java b/server/src/main/java/org/opensearch/index/engine/RecoveryEngineException.java index b473523ec2c4e..5894ed051eeed 100644 --- a/server/src/main/java/org/opensearch/index/engine/RecoveryEngineException.java +++ b/server/src/main/java/org/opensearch/index/engine/RecoveryEngineException.java @@ -38,6 +38,9 @@ import java.io.IOException; +/** + * Exception thrown if there is a problem during recovery + */ public class RecoveryEngineException extends EngineException { private final int phase; diff --git a/server/src/main/java/org/opensearch/index/engine/RecoverySourcePruneMergePolicy.java b/server/src/main/java/org/opensearch/index/engine/RecoverySourcePruneMergePolicy.java index 0a885f23629e6..fb907b3acd2a3 100644 --- a/server/src/main/java/org/opensearch/index/engine/RecoverySourcePruneMergePolicy.java +++ b/server/src/main/java/org/opensearch/index/engine/RecoverySourcePruneMergePolicy.java @@ -61,6 +61,11 @@ import java.util.Objects; import java.util.function.Supplier; +/** + * Merge Policy that prunes the recovery source + * + * @opensearch.internal + */ final class RecoverySourcePruneMergePolicy extends OneMergeWrappingMergePolicy { RecoverySourcePruneMergePolicy(String recoverySourceField, Supplier retainSourceQuerySupplier, MergePolicy in) { super(in, toWrap -> new OneMerge(toWrap.segments) { diff --git a/server/src/main/java/org/opensearch/index/engine/RefreshFailedEngineException.java b/server/src/main/java/org/opensearch/index/engine/RefreshFailedEngineException.java index 0f07e0e6199b7..2341466072f73 100644 --- a/server/src/main/java/org/opensearch/index/engine/RefreshFailedEngineException.java +++ b/server/src/main/java/org/opensearch/index/engine/RefreshFailedEngineException.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Exception thrown if refresh fails + * + * @opensearch.internal + */ public class RefreshFailedEngineException extends EngineException { public RefreshFailedEngineException(ShardId shardId, Throwable t) { diff --git a/server/src/main/java/org/opensearch/index/engine/SafeCommitInfo.java b/server/src/main/java/org/opensearch/index/engine/SafeCommitInfo.java index 8c76f735035cb..fcf1cb186269c 100644 --- a/server/src/main/java/org/opensearch/index/engine/SafeCommitInfo.java +++ b/server/src/main/java/org/opensearch/index/engine/SafeCommitInfo.java @@ -35,6 +35,8 @@ /** * Information about the safe commit, for making decisions about recoveries. + * + * @opensearch.internal */ public class SafeCommitInfo { diff --git a/server/src/main/java/org/opensearch/index/engine/Segment.java b/server/src/main/java/org/opensearch/index/engine/Segment.java index 4874d0a30196f..a341e73364356 100644 --- a/server/src/main/java/org/opensearch/index/engine/Segment.java +++ b/server/src/main/java/org/opensearch/index/engine/Segment.java @@ -52,6 +52,11 @@ import java.util.Map; import java.util.Objects; +/** + * A segment in the engine + * + * @opensearch.internal + */ public class Segment implements Writeable { private String name; diff --git a/server/src/main/java/org/opensearch/index/engine/SegmentsStats.java b/server/src/main/java/org/opensearch/index/engine/SegmentsStats.java index 880091c192034..af4a1dc6f4d6b 100644 --- a/server/src/main/java/org/opensearch/index/engine/SegmentsStats.java +++ b/server/src/main/java/org/opensearch/index/engine/SegmentsStats.java @@ -44,6 +44,11 @@ import java.io.IOException; +/** + * Tracker for segment stats + * + * @opensearch.internal + */ public class SegmentsStats implements Writeable, ToXContentFragment { private long count; diff --git a/server/src/main/java/org/opensearch/index/engine/SnapshotFailedEngineException.java b/server/src/main/java/org/opensearch/index/engine/SnapshotFailedEngineException.java index 77c05f62c3c26..7340c21dfb321 100644 --- a/server/src/main/java/org/opensearch/index/engine/SnapshotFailedEngineException.java +++ b/server/src/main/java/org/opensearch/index/engine/SnapshotFailedEngineException.java @@ -36,6 +36,11 @@ import java.io.IOException; +/** + * Exception thrown if snapshot fails the engine + * + * @opensearch.internal + */ public class SnapshotFailedEngineException extends EngineException { public SnapshotFailedEngineException(StreamInput in) throws IOException { diff --git a/server/src/main/java/org/opensearch/index/engine/SoftDeletesPolicy.java b/server/src/main/java/org/opensearch/index/engine/SoftDeletesPolicy.java index 72f44db2fa138..eef73f1d49a8e 100644 --- a/server/src/main/java/org/opensearch/index/engine/SoftDeletesPolicy.java +++ b/server/src/main/java/org/opensearch/index/engine/SoftDeletesPolicy.java @@ -48,6 +48,8 @@ /** * A policy that controls how many soft-deleted documents should be retained for peer-recovery and querying history changes purpose. + * + * @opensearch.internal */ final class SoftDeletesPolicy { private final LongSupplier globalCheckpointSupplier; diff --git a/server/src/main/java/org/opensearch/index/engine/TranslogLeafReader.java b/server/src/main/java/org/opensearch/index/engine/TranslogLeafReader.java index 09a670237a8a5..224c1dcab08ab 100644 --- a/server/src/main/java/org/opensearch/index/engine/TranslogLeafReader.java +++ b/server/src/main/java/org/opensearch/index/engine/TranslogLeafReader.java @@ -64,6 +64,8 @@ /** * Internal class that mocks a single doc read from the transaction log as a leaf reader. + * + * @opensearch.internal */ public final class TranslogLeafReader extends LeafReader { diff --git a/server/src/main/java/org/opensearch/index/engine/VersionConflictEngineException.java b/server/src/main/java/org/opensearch/index/engine/VersionConflictEngineException.java index c473f3db6dbf7..8b78b41fc3a70 100644 --- a/server/src/main/java/org/opensearch/index/engine/VersionConflictEngineException.java +++ b/server/src/main/java/org/opensearch/index/engine/VersionConflictEngineException.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Exception thrown if there is a version conflict + * + * @opensearch.internal + */ public class VersionConflictEngineException extends EngineException { public VersionConflictEngineException(ShardId shardId, Engine.Operation op, long currentVersion, boolean deleted) { diff --git a/server/src/main/java/org/opensearch/index/engine/VersionValue.java b/server/src/main/java/org/opensearch/index/engine/VersionValue.java index 99f9a83a9902c..a463137d13912 100644 --- a/server/src/main/java/org/opensearch/index/engine/VersionValue.java +++ b/server/src/main/java/org/opensearch/index/engine/VersionValue.java @@ -40,6 +40,11 @@ import java.util.Collection; import java.util.Collections; +/** + * Represents the version of a document in the index + * + * @opensearch.internal + */ abstract class VersionValue implements Accountable { private static final long BASE_RAM_BYTES_USED = RamUsageEstimator.shallowSizeOfInstance(VersionValue.class); diff --git a/server/src/main/java/org/opensearch/index/fielddata/AbstractBinaryDocValues.java b/server/src/main/java/org/opensearch/index/fielddata/AbstractBinaryDocValues.java index 6ce3277e3b344..b07033ed265b0 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/AbstractBinaryDocValues.java +++ b/server/src/main/java/org/opensearch/index/fielddata/AbstractBinaryDocValues.java @@ -42,6 +42,8 @@ * {@link DocIdSetIterator} APIs. This impl is safe to use for sorting and * aggregations, which only use {@link #advanceExact(int)} and * {@link #binaryValue()}. + * + * @opensearch.internal */ public abstract class AbstractBinaryDocValues extends BinaryDocValues { diff --git a/server/src/main/java/org/opensearch/index/fielddata/AbstractNumericDocValues.java b/server/src/main/java/org/opensearch/index/fielddata/AbstractNumericDocValues.java index 1bb016ef6546d..a2a70e280187a 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/AbstractNumericDocValues.java +++ b/server/src/main/java/org/opensearch/index/fielddata/AbstractNumericDocValues.java @@ -42,6 +42,8 @@ * {@link DocIdSetIterator} APIs. This impl is safe to use for sorting and * aggregations, which only use {@link #advanceExact(int)} and * {@link #longValue()}. + * + * @opensearch.internal */ public abstract class AbstractNumericDocValues extends NumericDocValues { diff --git a/server/src/main/java/org/opensearch/index/fielddata/AbstractSortedDocValues.java b/server/src/main/java/org/opensearch/index/fielddata/AbstractSortedDocValues.java index ff46b6feed465..b72ba837808a9 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/AbstractSortedDocValues.java +++ b/server/src/main/java/org/opensearch/index/fielddata/AbstractSortedDocValues.java @@ -42,6 +42,8 @@ * {@link DocIdSetIterator} APIs. This impl is safe to use for sorting and * aggregations, which only use {@link #advanceExact(int)} and * {@link #ordValue()}. + * + * @opensearch.internal */ public abstract class AbstractSortedDocValues extends SortedDocValues { diff --git a/server/src/main/java/org/opensearch/index/fielddata/AbstractSortedNumericDocValues.java b/server/src/main/java/org/opensearch/index/fielddata/AbstractSortedNumericDocValues.java index f911dc8b990bd..6379533069bc6 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/AbstractSortedNumericDocValues.java +++ b/server/src/main/java/org/opensearch/index/fielddata/AbstractSortedNumericDocValues.java @@ -42,6 +42,8 @@ * {@link DocIdSetIterator} APIs. This impl is safe to use for sorting and * aggregations, which only use {@link #advanceExact(int)} and * {@link #docValueCount()} and {@link #nextValue()}. + * + * @opensearch.internal */ public abstract class AbstractSortedNumericDocValues extends SortedNumericDocValues { diff --git a/server/src/main/java/org/opensearch/index/fielddata/AbstractSortedSetDocValues.java b/server/src/main/java/org/opensearch/index/fielddata/AbstractSortedSetDocValues.java index 42a3b440feaef..c7312f2074b9e 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/AbstractSortedSetDocValues.java +++ b/server/src/main/java/org/opensearch/index/fielddata/AbstractSortedSetDocValues.java @@ -42,6 +42,8 @@ * {@link DocIdSetIterator} APIs. This impl is safe to use for sorting and * aggregations, which only use {@link #advanceExact(int)} and * {@link #getValueCount()} and {@link #nextOrd()} and {@link #lookupOrd(long)}. + * + * @opensearch.internal */ public abstract class AbstractSortedSetDocValues extends SortedSetDocValues { diff --git a/server/src/main/java/org/opensearch/index/fielddata/AbstractSortingNumericDocValues.java b/server/src/main/java/org/opensearch/index/fielddata/AbstractSortingNumericDocValues.java index 6d93df9f17452..f37dcac740f6a 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/AbstractSortingNumericDocValues.java +++ b/server/src/main/java/org/opensearch/index/fielddata/AbstractSortingNumericDocValues.java @@ -42,6 +42,8 @@ * {@link DocIdSetIterator} APIs. This impl is safe to use for sorting and * aggregations, which only use {@link #advanceExact(int)} and * {@link #docValueCount()} and {@link #nextValue()}. + * + * @opensearch.internal */ public abstract class AbstractSortingNumericDocValues extends SortingNumericDocValues { diff --git a/server/src/main/java/org/opensearch/index/fielddata/DocValueBits.java b/server/src/main/java/org/opensearch/index/fielddata/DocValueBits.java index b94de0d529f96..18fa26bd10623 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/DocValueBits.java +++ b/server/src/main/java/org/opensearch/index/fielddata/DocValueBits.java @@ -34,6 +34,11 @@ import java.io.IOException; +/** + * Base class for doc value bit sets + * + * @opensearch.internal + */ public abstract class DocValueBits { /** diff --git a/server/src/main/java/org/opensearch/index/fielddata/FieldData.java b/server/src/main/java/org/opensearch/index/fielddata/FieldData.java index 93ae689a51f7b..a45cd79f68126 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/FieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/FieldData.java @@ -46,6 +46,8 @@ /** * Utility methods, similar to Lucene's {@link DocValues}. + * + * @opensearch.internal */ public enum FieldData { ; diff --git a/server/src/main/java/org/opensearch/index/fielddata/FieldDataStats.java b/server/src/main/java/org/opensearch/index/fielddata/FieldDataStats.java index fe27fccd1e3c9..8e6cbb3314637 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/FieldDataStats.java +++ b/server/src/main/java/org/opensearch/index/fielddata/FieldDataStats.java @@ -44,6 +44,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Encapsulates heap usage for field data + * + * @opensearch.internal + */ public class FieldDataStats implements Writeable, ToXContentFragment { private static final String FIELDDATA = "fielddata"; diff --git a/server/src/main/java/org/opensearch/index/fielddata/GeoPointValues.java b/server/src/main/java/org/opensearch/index/fielddata/GeoPointValues.java index 98bb9f0f11e74..ce11a015d2d5b 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/GeoPointValues.java +++ b/server/src/main/java/org/opensearch/index/fielddata/GeoPointValues.java @@ -38,6 +38,8 @@ /** * Per-document geo-point values. + * + * @opensearch.internal */ public abstract class GeoPointValues { diff --git a/server/src/main/java/org/opensearch/index/fielddata/HistogramValue.java b/server/src/main/java/org/opensearch/index/fielddata/HistogramValue.java index 4d3cf4f086429..bb7a89e2e783f 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/HistogramValue.java +++ b/server/src/main/java/org/opensearch/index/fielddata/HistogramValue.java @@ -37,6 +37,8 @@ /** * Per-document histogram value. Every value of the histogram consist on * a value and a count. + * + * @opensearch.internal */ public abstract class HistogramValue { diff --git a/server/src/main/java/org/opensearch/index/fielddata/HistogramValues.java b/server/src/main/java/org/opensearch/index/fielddata/HistogramValues.java index ed5e9b307f693..001d9fdb7b8eb 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/HistogramValues.java +++ b/server/src/main/java/org/opensearch/index/fielddata/HistogramValues.java @@ -36,6 +36,8 @@ /** * Per-segment histogram values. + * + * @opensearch.internal */ public abstract class HistogramValues { diff --git a/server/src/main/java/org/opensearch/index/fielddata/IndexFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/IndexFieldData.java index deda9081e0448..9b9258efb1cc3 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/IndexFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/IndexFieldData.java @@ -63,6 +63,8 @@ /** * Thread-safe utility class that allows to get per-segment values via the * {@link #load(LeafReaderContext)} method. + * + * @opensearch.internal */ public interface IndexFieldData { diff --git a/server/src/main/java/org/opensearch/index/fielddata/IndexFieldDataCache.java b/server/src/main/java/org/opensearch/index/fielddata/IndexFieldDataCache.java index 5d648038112a8..08aaadcac0d60 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/IndexFieldDataCache.java +++ b/server/src/main/java/org/opensearch/index/fielddata/IndexFieldDataCache.java @@ -39,6 +39,8 @@ /** * A simple field data cache abstraction on the *index* level. + * + * @opensearch.internal */ public interface IndexFieldDataCache { diff --git a/server/src/main/java/org/opensearch/index/fielddata/IndexFieldDataService.java b/server/src/main/java/org/opensearch/index/fielddata/IndexFieldDataService.java index 26fcbb7cc9621..46855b9a46833 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/IndexFieldDataService.java +++ b/server/src/main/java/org/opensearch/index/fielddata/IndexFieldDataService.java @@ -54,6 +54,11 @@ import java.util.Map; import java.util.function.Supplier; +/** + * Service for field data (cacheing, etc) + * + * @opensearch.internal + */ public class IndexFieldDataService extends AbstractIndexComponent implements Closeable { public static final String FIELDDATA_CACHE_VALUE_NODE = "node"; public static final String FIELDDATA_CACHE_KEY = "index.fielddata.cache"; diff --git a/server/src/main/java/org/opensearch/index/fielddata/IndexGeoPointFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/IndexGeoPointFieldData.java index 05a704ec2c785..bcee1cd112ab2 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/IndexGeoPointFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/IndexGeoPointFieldData.java @@ -34,5 +34,7 @@ /** * Specialization of {@link IndexFieldData} for geo points. + * + * @opensearch.internal */ public interface IndexGeoPointFieldData extends IndexFieldData {} diff --git a/server/src/main/java/org/opensearch/index/fielddata/IndexHistogramFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/IndexHistogramFieldData.java index a2ad4a14408d6..b9d205665d0c7 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/IndexHistogramFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/IndexHistogramFieldData.java @@ -36,6 +36,8 @@ /** * Specialization of {@link IndexFieldData} for histograms. + * + * @opensearch.internal */ public abstract class IndexHistogramFieldData implements IndexFieldData { protected final String fieldName; diff --git a/server/src/main/java/org/opensearch/index/fielddata/IndexNumericFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/IndexNumericFieldData.java index dd987e9f79546..e4beb46b451f2 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/IndexNumericFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/IndexNumericFieldData.java @@ -55,6 +55,8 @@ /** * Base class for numeric field data. + * + * @opensearch.internal */ public abstract class IndexNumericFieldData implements IndexFieldData { /** diff --git a/server/src/main/java/org/opensearch/index/fielddata/IndexOrdinalsFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/IndexOrdinalsFieldData.java index 93f08471bc84a..9831c69744908 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/IndexOrdinalsFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/IndexOrdinalsFieldData.java @@ -38,6 +38,8 @@ /** * Specialization of {@link IndexFieldData} for data that is indexed with ordinals. + * + * @opensearch.internal */ public interface IndexOrdinalsFieldData extends IndexFieldData.Global { diff --git a/server/src/main/java/org/opensearch/index/fielddata/LeafFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/LeafFieldData.java index 52517326e2b6d..2982363937710 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/LeafFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/LeafFieldData.java @@ -41,6 +41,8 @@ /** * The thread safe {@link org.apache.lucene.index.LeafReader} level cache of the data. + * + * @opensearch.internal */ public interface LeafFieldData extends Accountable, Releasable { diff --git a/server/src/main/java/org/opensearch/index/fielddata/LeafGeoPointFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/LeafGeoPointFieldData.java index 6048e4559b773..bc3a0cfd22516 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/LeafGeoPointFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/LeafGeoPointFieldData.java @@ -33,6 +33,8 @@ /** * {@link LeafFieldData} specialization for geo points. + * + * @opensearch.internal */ public interface LeafGeoPointFieldData extends LeafFieldData { diff --git a/server/src/main/java/org/opensearch/index/fielddata/LeafHistogramFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/LeafHistogramFieldData.java index 701ff3e553ac4..e968ecc1e0a38 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/LeafHistogramFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/LeafHistogramFieldData.java @@ -35,6 +35,8 @@ /** * {@link LeafFieldData} specialization for histogram data. + * + * @opensearch.internal */ public interface LeafHistogramFieldData extends LeafFieldData { diff --git a/server/src/main/java/org/opensearch/index/fielddata/LeafNumericFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/LeafNumericFieldData.java index 09dd424733ae0..d50da962ecd2a 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/LeafNumericFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/LeafNumericFieldData.java @@ -36,6 +36,8 @@ /** * Specialization of {@link LeafFieldData} for numeric data. + * + * @opensearch.internal */ public interface LeafNumericFieldData extends LeafFieldData { diff --git a/server/src/main/java/org/opensearch/index/fielddata/LeafOrdinalsFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/LeafOrdinalsFieldData.java index 09c45885e8ffe..c9b9cbe2796fc 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/LeafOrdinalsFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/LeafOrdinalsFieldData.java @@ -37,6 +37,8 @@ /** * Specialization of {@link LeafFieldData} for data that is indexed with * ordinals. + * + * @opensearch.internal */ public interface LeafOrdinalsFieldData extends LeafFieldData { diff --git a/server/src/main/java/org/opensearch/index/fielddata/MultiGeoPointValues.java b/server/src/main/java/org/opensearch/index/fielddata/MultiGeoPointValues.java index e6ac006f2b19f..2df4baeb8631b 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/MultiGeoPointValues.java +++ b/server/src/main/java/org/opensearch/index/fielddata/MultiGeoPointValues.java @@ -49,6 +49,8 @@ * * The set of values associated with a document might contain duplicates and * comes in a non-specified order. + * + * @opensearch.internal */ public abstract class MultiGeoPointValues { diff --git a/server/src/main/java/org/opensearch/index/fielddata/NumericDoubleValues.java b/server/src/main/java/org/opensearch/index/fielddata/NumericDoubleValues.java index ae6fcd514d310..94ea91849ff12 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/NumericDoubleValues.java +++ b/server/src/main/java/org/opensearch/index/fielddata/NumericDoubleValues.java @@ -39,6 +39,8 @@ /** * A per-document numeric value. + * + * @opensearch.internal */ public abstract class NumericDoubleValues extends DoubleValues { diff --git a/server/src/main/java/org/opensearch/index/fielddata/RamAccountingTermsEnum.java b/server/src/main/java/org/opensearch/index/fielddata/RamAccountingTermsEnum.java index 64fee22ac6302..cd858278afaa3 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/RamAccountingTermsEnum.java +++ b/server/src/main/java/org/opensearch/index/fielddata/RamAccountingTermsEnum.java @@ -43,6 +43,8 @@ * {@link TermsEnum} that takes a CircuitBreaker, increasing the breaker * every time {@code .next(...)} is called. Proxies all methods to the original * TermsEnum otherwise. + * + * @opensearch.internal */ public final class RamAccountingTermsEnum extends FilteredTermsEnum { diff --git a/server/src/main/java/org/opensearch/index/fielddata/ScriptDocValues.java b/server/src/main/java/org/opensearch/index/fielddata/ScriptDocValues.java index 4f0c8d7eb9764..5f2d899b9d1e8 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/ScriptDocValues.java +++ b/server/src/main/java/org/opensearch/index/fielddata/ScriptDocValues.java @@ -57,6 +57,8 @@ * Implementations should not internally re-use objects for the values that they * return as a single {@link ScriptDocValues} instance can be reused to return * values form multiple documents. + * + * @opensearch.internal */ public abstract class ScriptDocValues extends AbstractList { diff --git a/server/src/main/java/org/opensearch/index/fielddata/ShardFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/ShardFieldData.java index 235ec79f18ff2..f816ff7a436f2 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/ShardFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/ShardFieldData.java @@ -44,6 +44,11 @@ import java.util.Map; import java.util.concurrent.ConcurrentMap; +/** + * On heap field data for shards + * + * @opensearch.internal + */ public class ShardFieldData implements IndexFieldDataCache.Listener { private final CounterMetric evictionsMetric = new CounterMetric(); diff --git a/server/src/main/java/org/opensearch/index/fielddata/SingletonMultiGeoPointValues.java b/server/src/main/java/org/opensearch/index/fielddata/SingletonMultiGeoPointValues.java index cd0dd3f69f809..56a3a04eee5be 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/SingletonMultiGeoPointValues.java +++ b/server/src/main/java/org/opensearch/index/fielddata/SingletonMultiGeoPointValues.java @@ -36,6 +36,11 @@ import java.io.IOException; +/** + * Multiple geopoint doc value provider + * + * @opensearch.internal + */ final class SingletonMultiGeoPointValues extends MultiGeoPointValues { private final GeoPointValues in; diff --git a/server/src/main/java/org/opensearch/index/fielddata/SingletonSortedBinaryDocValues.java b/server/src/main/java/org/opensearch/index/fielddata/SingletonSortedBinaryDocValues.java index ff4cb72719c61..9496e6ec8a69d 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/SingletonSortedBinaryDocValues.java +++ b/server/src/main/java/org/opensearch/index/fielddata/SingletonSortedBinaryDocValues.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Provider for sorted binary docvalues + * + * @opensearch.internal + */ final class SingletonSortedBinaryDocValues extends SortedBinaryDocValues { private final BinaryDocValues in; diff --git a/server/src/main/java/org/opensearch/index/fielddata/SingletonSortedNumericDoubleValues.java b/server/src/main/java/org/opensearch/index/fielddata/SingletonSortedNumericDoubleValues.java index 2baac237035b3..4ee494ffb30aa 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/SingletonSortedNumericDoubleValues.java +++ b/server/src/main/java/org/opensearch/index/fielddata/SingletonSortedNumericDoubleValues.java @@ -39,6 +39,8 @@ *

    * This can be used if you want to have one multi-valued implementation * that works for single or multi-valued types. + * + * @opensearch.internal */ final class SingletonSortedNumericDoubleValues extends SortedNumericDoubleValues { private final NumericDoubleValues in; diff --git a/server/src/main/java/org/opensearch/index/fielddata/SortableLongBitsNumericDocValues.java b/server/src/main/java/org/opensearch/index/fielddata/SortableLongBitsNumericDocValues.java index 63600f400b844..39aca38c331ea 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/SortableLongBitsNumericDocValues.java +++ b/server/src/main/java/org/opensearch/index/fielddata/SortableLongBitsNumericDocValues.java @@ -41,6 +41,8 @@ * {@link NumericDocValues} instance that wraps a {@link NumericDoubleValues} * and converts the doubles to sortable long bits using * {@link NumericUtils#doubleToSortableLong(double)}. + * + * @opensearch.internal */ final class SortableLongBitsNumericDocValues extends AbstractNumericDocValues { diff --git a/server/src/main/java/org/opensearch/index/fielddata/SortableLongBitsSortedNumericDocValues.java b/server/src/main/java/org/opensearch/index/fielddata/SortableLongBitsSortedNumericDocValues.java index 702208fd3db58..ef2fcc6e2fa75 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/SortableLongBitsSortedNumericDocValues.java +++ b/server/src/main/java/org/opensearch/index/fielddata/SortableLongBitsSortedNumericDocValues.java @@ -41,6 +41,8 @@ * {@link SortedNumericDocValues} instance that wraps a {@link SortedNumericDoubleValues} * and converts the doubles to sortable long bits using * {@link NumericUtils#doubleToSortableLong(double)}. + * + * @opensearch.internal */ final class SortableLongBitsSortedNumericDocValues extends AbstractSortedNumericDocValues { diff --git a/server/src/main/java/org/opensearch/index/fielddata/SortableLongBitsToNumericDoubleValues.java b/server/src/main/java/org/opensearch/index/fielddata/SortableLongBitsToNumericDoubleValues.java index a585b90e86118..150e114d342de 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/SortableLongBitsToNumericDoubleValues.java +++ b/server/src/main/java/org/opensearch/index/fielddata/SortableLongBitsToNumericDoubleValues.java @@ -41,6 +41,8 @@ * {@link NumericDoubleValues} instance that wraps a {@link NumericDocValues} * and converts the doubles to sortable long bits using * {@link NumericUtils#sortableLongToDouble(long)}. + * + * @opensearch.internal */ final class SortableLongBitsToNumericDoubleValues extends NumericDoubleValues { diff --git a/server/src/main/java/org/opensearch/index/fielddata/SortableLongBitsToSortedNumericDoubleValues.java b/server/src/main/java/org/opensearch/index/fielddata/SortableLongBitsToSortedNumericDoubleValues.java index 1538fd089ea21..1bae845c9b0d2 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/SortableLongBitsToSortedNumericDoubleValues.java +++ b/server/src/main/java/org/opensearch/index/fielddata/SortableLongBitsToSortedNumericDoubleValues.java @@ -41,6 +41,8 @@ * {@link SortedNumericDoubleValues} instance that wraps a {@link SortedNumericDocValues} * and converts the doubles to sortable long bits using * {@link NumericUtils#sortableLongToDouble(long)}. + * + * @opensearch.internal */ final class SortableLongBitsToSortedNumericDoubleValues extends SortedNumericDoubleValues { diff --git a/server/src/main/java/org/opensearch/index/fielddata/SortedBinaryDocValues.java b/server/src/main/java/org/opensearch/index/fielddata/SortedBinaryDocValues.java index f448c24aa7dc7..bd66d1d94f33c 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/SortedBinaryDocValues.java +++ b/server/src/main/java/org/opensearch/index/fielddata/SortedBinaryDocValues.java @@ -40,6 +40,8 @@ * A list of per-document binary values, sorted * according to {@link BytesRef#compareTo(BytesRef)}. * There might be dups however. + * + * @opensearch.internal */ // TODO: Should it expose a count (current approach) or return null when there are no more values? public abstract class SortedBinaryDocValues { diff --git a/server/src/main/java/org/opensearch/index/fielddata/SortedNumericDoubleValues.java b/server/src/main/java/org/opensearch/index/fielddata/SortedNumericDoubleValues.java index 1fe1310e9f693..91d28113ae783 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/SortedNumericDoubleValues.java +++ b/server/src/main/java/org/opensearch/index/fielddata/SortedNumericDoubleValues.java @@ -38,6 +38,8 @@ /** * Clone of {@link SortedNumericDocValues} for double values. + * + * @opensearch.internal */ public abstract class SortedNumericDoubleValues { diff --git a/server/src/main/java/org/opensearch/index/fielddata/SortingBinaryDocValues.java b/server/src/main/java/org/opensearch/index/fielddata/SortingBinaryDocValues.java index 33efe556acef9..ba415e7bc0276 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/SortingBinaryDocValues.java +++ b/server/src/main/java/org/opensearch/index/fielddata/SortingBinaryDocValues.java @@ -43,6 +43,8 @@ /** * Base class for building {@link SortedBinaryDocValues} instances based on unsorted content. + * + * @opensearch.internal */ public abstract class SortingBinaryDocValues extends SortedBinaryDocValues { diff --git a/server/src/main/java/org/opensearch/index/fielddata/SortingNumericDocValues.java b/server/src/main/java/org/opensearch/index/fielddata/SortingNumericDocValues.java index 12b6eb4e39340..cdfb1e3252899 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/SortingNumericDocValues.java +++ b/server/src/main/java/org/opensearch/index/fielddata/SortingNumericDocValues.java @@ -41,6 +41,8 @@ /** * Base class for building {@link SortedNumericDocValues} instances based on unsorted content. + * + * @opensearch.internal */ public abstract class SortingNumericDocValues extends SortedNumericDocValues { diff --git a/server/src/main/java/org/opensearch/index/fielddata/SortingNumericDoubleValues.java b/server/src/main/java/org/opensearch/index/fielddata/SortingNumericDoubleValues.java index 28c72c722dd38..bb125dc600b74 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/SortingNumericDoubleValues.java +++ b/server/src/main/java/org/opensearch/index/fielddata/SortingNumericDoubleValues.java @@ -38,6 +38,8 @@ /** * Base class for building {@link SortedNumericDoubleValues} instances based on unsorted content. + * + * @opensearch.internal */ public abstract class SortingNumericDoubleValues extends SortedNumericDoubleValues { diff --git a/server/src/main/java/org/opensearch/index/fielddata/fieldcomparator/BytesRefFieldComparatorSource.java b/server/src/main/java/org/opensearch/index/fielddata/fieldcomparator/BytesRefFieldComparatorSource.java index d25443914ebaa..51dde57563ec6 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/fieldcomparator/BytesRefFieldComparatorSource.java +++ b/server/src/main/java/org/opensearch/index/fielddata/fieldcomparator/BytesRefFieldComparatorSource.java @@ -56,6 +56,8 @@ /** * Comparator source for string/binary values. + * + * @opensearch.internal */ public class BytesRefFieldComparatorSource extends IndexFieldData.XFieldComparatorSource { diff --git a/server/src/main/java/org/opensearch/index/fielddata/fieldcomparator/DoubleValuesComparatorSource.java b/server/src/main/java/org/opensearch/index/fielddata/fieldcomparator/DoubleValuesComparatorSource.java index 135101eae362d..f8af86c904f2c 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/fieldcomparator/DoubleValuesComparatorSource.java +++ b/server/src/main/java/org/opensearch/index/fielddata/fieldcomparator/DoubleValuesComparatorSource.java @@ -57,6 +57,8 @@ /** * Comparator source for double values. + * + * @opensearch.internal */ public class DoubleValuesComparatorSource extends IndexFieldData.XFieldComparatorSource { diff --git a/server/src/main/java/org/opensearch/index/fielddata/fieldcomparator/FloatValuesComparatorSource.java b/server/src/main/java/org/opensearch/index/fielddata/fieldcomparator/FloatValuesComparatorSource.java index f8371e8235070..686bef479c179 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/fieldcomparator/FloatValuesComparatorSource.java +++ b/server/src/main/java/org/opensearch/index/fielddata/fieldcomparator/FloatValuesComparatorSource.java @@ -56,6 +56,8 @@ /** * Comparator source for float values. + * + * @opensearch.internal */ public class FloatValuesComparatorSource extends IndexFieldData.XFieldComparatorSource { diff --git a/server/src/main/java/org/opensearch/index/fielddata/fieldcomparator/LongValuesComparatorSource.java b/server/src/main/java/org/opensearch/index/fielddata/fieldcomparator/LongValuesComparatorSource.java index 3871425f1255f..462092dca5110 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/fieldcomparator/LongValuesComparatorSource.java +++ b/server/src/main/java/org/opensearch/index/fielddata/fieldcomparator/LongValuesComparatorSource.java @@ -57,6 +57,8 @@ /** * Comparator source for long values. + * + * @opensearch.internal */ public class LongValuesComparatorSource extends IndexFieldData.XFieldComparatorSource { diff --git a/server/src/main/java/org/opensearch/index/fielddata/ordinals/GlobalOrdinalMapping.java b/server/src/main/java/org/opensearch/index/fielddata/ordinals/GlobalOrdinalMapping.java index be57ac0771ee5..8fc6eb1a74056 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/ordinals/GlobalOrdinalMapping.java +++ b/server/src/main/java/org/opensearch/index/fielddata/ordinals/GlobalOrdinalMapping.java @@ -42,6 +42,8 @@ /** * A {@link SortedSetDocValues} implementation that returns ordinals that are global. + * + * @opensearch.internal */ final class GlobalOrdinalMapping extends SortedSetDocValues { diff --git a/server/src/main/java/org/opensearch/index/fielddata/ordinals/GlobalOrdinalsBuilder.java b/server/src/main/java/org/opensearch/index/fielddata/ordinals/GlobalOrdinalsBuilder.java index 0ed496b5a459f..e136e649d088a 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/ordinals/GlobalOrdinalsBuilder.java +++ b/server/src/main/java/org/opensearch/index/fielddata/ordinals/GlobalOrdinalsBuilder.java @@ -55,6 +55,8 @@ /** * Utility class to build global ordinals. + * + * @opensearch.internal */ public enum GlobalOrdinalsBuilder { ; diff --git a/server/src/main/java/org/opensearch/index/fielddata/ordinals/GlobalOrdinalsIndexFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/ordinals/GlobalOrdinalsIndexFieldData.java index ec554ae78996d..90541b3a9f1c0 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/ordinals/GlobalOrdinalsIndexFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/ordinals/GlobalOrdinalsIndexFieldData.java @@ -65,6 +65,8 @@ * Each instance of {@link Consumer} uses a new set of {@link TermsEnum} that can be reused during the collection, * this is done to avoid creating all segment's {@link TermsEnum} each time we want to access the values of a single * segment. + * + * @opensearch.internal */ public final class GlobalOrdinalsIndexFieldData implements IndexOrdinalsFieldData, Accountable { diff --git a/server/src/main/java/org/opensearch/index/fielddata/ordinals/MultiOrdinals.java b/server/src/main/java/org/opensearch/index/fielddata/ordinals/MultiOrdinals.java index 2af4cab7cbdee..e6e51ed83a6ab 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/ordinals/MultiOrdinals.java +++ b/server/src/main/java/org/opensearch/index/fielddata/ordinals/MultiOrdinals.java @@ -51,6 +51,8 @@ /** * {@link Ordinals} implementation which is efficient at storing field data ordinals for multi-valued or sparse fields. + * + * @opensearch.internal */ public class MultiOrdinals extends Ordinals { diff --git a/server/src/main/java/org/opensearch/index/fielddata/ordinals/Ordinals.java b/server/src/main/java/org/opensearch/index/fielddata/ordinals/Ordinals.java index 52752a828df86..6ce0c06be02ea 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/ordinals/Ordinals.java +++ b/server/src/main/java/org/opensearch/index/fielddata/ordinals/Ordinals.java @@ -38,6 +38,8 @@ /** * A thread safe ordinals abstraction. Ordinals can only be positive integers. + * + * @opensearch.internal */ public abstract class Ordinals implements Accountable { diff --git a/server/src/main/java/org/opensearch/index/fielddata/ordinals/OrdinalsBuilder.java b/server/src/main/java/org/opensearch/index/fielddata/ordinals/OrdinalsBuilder.java index 5439c884b322f..85a9ba5358c3f 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/ordinals/OrdinalsBuilder.java +++ b/server/src/main/java/org/opensearch/index/fielddata/ordinals/OrdinalsBuilder.java @@ -46,6 +46,8 @@ * Simple class to build document ID <-> ordinal mapping. Note: Ordinals are * {@code 1} based monotonically increasing positive integers. {@code 0} * donates the missing value in this context. + * + * @opensearch.internal */ public final class OrdinalsBuilder implements Closeable { diff --git a/server/src/main/java/org/opensearch/index/fielddata/ordinals/SinglePackedOrdinals.java b/server/src/main/java/org/opensearch/index/fielddata/ordinals/SinglePackedOrdinals.java index a93da9495fbfb..90582079d3f76 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/ordinals/SinglePackedOrdinals.java +++ b/server/src/main/java/org/opensearch/index/fielddata/ordinals/SinglePackedOrdinals.java @@ -45,7 +45,12 @@ import java.util.Collection; import java.util.Collections; -public class SinglePackedOrdinals extends Ordinals { +/** + * Packed ordinals for a single field + * + * @opensearch.internal + */ +class SinglePackedOrdinals extends Ordinals { // ordinals with value 0 indicates no value private final PackedInts.Reader reader; diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/AbstractBinaryDVLeafFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/AbstractBinaryDVLeafFieldData.java index 787401386c120..4d2cb7e84df6c 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/AbstractBinaryDVLeafFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/AbstractBinaryDVLeafFieldData.java @@ -43,6 +43,11 @@ import java.util.Collection; import java.util.Collections; +/** + * Base class for binary docvalue "field data" + * + * @opensearch.internal + */ abstract class AbstractBinaryDVLeafFieldData implements LeafFieldData { private final BinaryDocValues values; diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/AbstractIndexOrdinalsFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/AbstractIndexOrdinalsFieldData.java index 2102234fdbcc5..7dab513372235 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/AbstractIndexOrdinalsFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/AbstractIndexOrdinalsFieldData.java @@ -54,6 +54,11 @@ import java.io.IOException; import java.util.function.Function; +/** + * Base class for sorting ordinals field data + * + * @opensearch.internal + */ public abstract class AbstractIndexOrdinalsFieldData implements IndexOrdinalsFieldData { private static final Logger logger = LogManager.getLogger(AbstractBinaryDVLeafFieldData.class); diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/AbstractLatLonPointIndexFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/AbstractLatLonPointIndexFieldData.java index 5fefc2fdcef3f..d094acf4ca79d 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/AbstractLatLonPointIndexFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/AbstractLatLonPointIndexFieldData.java @@ -51,6 +51,11 @@ import org.opensearch.search.sort.BucketedSort; import org.opensearch.search.sort.SortOrder; +/** + * Base class for sorting LatLonPoint docvalues + * + * @opensearch.internal + */ public abstract class AbstractLatLonPointIndexFieldData implements IndexGeoPointFieldData { protected final String fieldName; diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/AbstractLeafGeoPointFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/AbstractLeafGeoPointFieldData.java index f614d8aaef51a..89c462267a4d2 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/AbstractLeafGeoPointFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/AbstractLeafGeoPointFieldData.java @@ -41,6 +41,11 @@ import java.util.Collection; import java.util.Collections; +/** + * Base class for retrieving LatLonPoint docvalues + * + * @opensearch.internal + */ public abstract class AbstractLeafGeoPointFieldData implements LeafGeoPointFieldData { @Override diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/AbstractLeafOrdinalsFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/AbstractLeafOrdinalsFieldData.java index 736b1f5e61ce7..0e16dbbd06271 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/AbstractLeafOrdinalsFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/AbstractLeafOrdinalsFieldData.java @@ -44,6 +44,11 @@ import java.util.Collections; import java.util.function.Function; +/** + * Baseclass for ordinals docvalues + * + * @opensearch.internal + */ public abstract class AbstractLeafOrdinalsFieldData implements LeafOrdinalsFieldData { public static final Function> DEFAULT_SCRIPT_FUNCTION = ((Function< diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/BinaryDVLeafFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/BinaryDVLeafFieldData.java index 24936c8f3d665..dd8235977af8f 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/BinaryDVLeafFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/BinaryDVLeafFieldData.java @@ -46,7 +46,11 @@ import java.util.Collection; import java.util.Collections; -/** {@link LeafFieldData} impl on top of Lucene's binary doc values. */ +/** + * {@link LeafFieldData} impl on top of Lucene's binary doc values. + * + * @opensearch.internal + */ public class BinaryDVLeafFieldData implements LeafFieldData { private final LeafReader reader; diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/BinaryIndexFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/BinaryIndexFieldData.java index 3038b9b10ef83..6d3c1b8c14430 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/BinaryIndexFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/BinaryIndexFieldData.java @@ -47,6 +47,11 @@ import org.opensearch.search.sort.BucketedSort; import org.opensearch.search.sort.SortOrder; +/** + * Binary doc values ValuesSource + * + * @opensearch.internal + */ public class BinaryIndexFieldData implements IndexFieldData { public static class Builder implements IndexFieldData.Builder { diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/BytesBinaryDVLeafFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/BytesBinaryDVLeafFieldData.java index 7df4a415917e2..247658cabb8da 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/BytesBinaryDVLeafFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/BytesBinaryDVLeafFieldData.java @@ -36,6 +36,11 @@ import org.apache.lucene.util.BytesRef; import org.opensearch.index.fielddata.ScriptDocValues; +/** + * Binary valuessource for scripting + * + * @opensearch.internal + */ final class BytesBinaryDVLeafFieldData extends AbstractBinaryDVLeafFieldData { BytesBinaryDVLeafFieldData(BinaryDocValues values) { super(values); diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/BytesBinaryIndexFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/BytesBinaryIndexFieldData.java index 029beaf587a27..dbcbb26c5287e 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/BytesBinaryIndexFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/BytesBinaryIndexFieldData.java @@ -49,6 +49,11 @@ import java.io.IOException; +/** + * Binary docvalue values source + * + * @opensearch.internal + */ public class BytesBinaryIndexFieldData implements IndexFieldData { protected final String fieldName; diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/ConstantIndexFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/ConstantIndexFieldData.java index 763d6b27f74ee..1092b5ecb847f 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/ConstantIndexFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/ConstantIndexFieldData.java @@ -59,6 +59,11 @@ import java.util.Collection; import java.util.Collections; +/** + * Constant value field data + * + * @opensearch.internal + */ public class ConstantIndexFieldData extends AbstractIndexOrdinalsFieldData { public static class Builder implements IndexFieldData.Builder { diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/LatLonPointDVLeafFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/LatLonPointDVLeafFieldData.java index 6b7e182a98af9..814dc1cdd237b 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/LatLonPointDVLeafFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/LatLonPointDVLeafFieldData.java @@ -43,6 +43,11 @@ import java.util.Collection; import java.util.Collections; +/** + * LatLonPoint field data + * + * @opensearch.internal + */ final class LatLonPointDVLeafFieldData extends AbstractLeafGeoPointFieldData { private final LeafReader reader; private final String fieldName; diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/LeafDoubleFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/LeafDoubleFieldData.java index e74f6f44752a5..47dc02ef093de 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/LeafDoubleFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/LeafDoubleFieldData.java @@ -48,6 +48,8 @@ /** * Specialization of {@link LeafNumericFieldData} for floating-point numerics. + * + * @opensearch.internal */ public abstract class LeafDoubleFieldData implements LeafNumericFieldData { diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/LeafLongFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/LeafLongFieldData.java index 94e44853f74ae..408021dd5f096 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/LeafLongFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/LeafLongFieldData.java @@ -46,6 +46,8 @@ /** * Specialization of {@link LeafNumericFieldData} for integers. + * + * @opensearch.internal */ public abstract class LeafLongFieldData implements LeafNumericFieldData { diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/PagedBytesIndexFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/PagedBytesIndexFieldData.java index e661b61548cd0..4b6cb287a078f 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/PagedBytesIndexFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/PagedBytesIndexFieldData.java @@ -64,6 +64,11 @@ import java.io.IOException; +/** + * Doc Values for paged bytes + * + * @opensearch.internal + */ public class PagedBytesIndexFieldData extends AbstractIndexOrdinalsFieldData { private final double minFrequency, maxFrequency; diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/PagedBytesLeafFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/PagedBytesLeafFieldData.java index bbd8ef4645718..b54dccfb82f8f 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/PagedBytesLeafFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/PagedBytesLeafFieldData.java @@ -44,6 +44,11 @@ import java.util.Collections; import java.util.List; +/** + * Field Data for Paged Bytes + * + * @opensearch.internal + */ public class PagedBytesLeafFieldData extends AbstractLeafOrdinalsFieldData { private final PagedBytes.Reader bytes; diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/SortedNumericIndexFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/SortedNumericIndexFieldData.java index 714b762f81fb7..65a3b8563a4ce 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/SortedNumericIndexFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/SortedNumericIndexFieldData.java @@ -65,6 +65,8 @@ /** * FieldData backed by {@link LeafReader#getSortedNumericDocValues(String)} * @see DocValuesType#SORTED_NUMERIC + * + * @opensearch.internal */ public class SortedNumericIndexFieldData extends IndexNumericFieldData { public static class Builder implements IndexFieldData.Builder { diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/SortedSetBytesLeafFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/SortedSetBytesLeafFieldData.java index bb7d44938c03d..89502a6358881 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/SortedSetBytesLeafFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/SortedSetBytesLeafFieldData.java @@ -46,6 +46,8 @@ /** * An {@link LeafFieldData} implementation that uses Lucene {@link SortedSetDocValues}. + * + * @opensearch.internal */ public final class SortedSetBytesLeafFieldData extends AbstractLeafOrdinalsFieldData { diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/SortedSetOrdinalsIndexFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/SortedSetOrdinalsIndexFieldData.java index ef69cb69e84c9..682b3de27a04a 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/SortedSetOrdinalsIndexFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/SortedSetOrdinalsIndexFieldData.java @@ -55,6 +55,11 @@ import java.util.function.Function; +/** + * Sorted Set Ordinals doc values + * + * @opensearch.internal + */ public class SortedSetOrdinalsIndexFieldData extends AbstractIndexOrdinalsFieldData { public static class Builder implements IndexFieldData.Builder { diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/StringBinaryDVLeafFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/StringBinaryDVLeafFieldData.java index 137f1ad22ea9f..1c0f13ff13f23 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/StringBinaryDVLeafFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/StringBinaryDVLeafFieldData.java @@ -35,6 +35,11 @@ import org.apache.lucene.index.BinaryDocValues; import org.opensearch.index.fielddata.ScriptDocValues; +/** + * Field data for binary strings + * + * @opensearch.internal + */ final class StringBinaryDVLeafFieldData extends AbstractBinaryDVLeafFieldData { StringBinaryDVLeafFieldData(BinaryDocValues values) { super(values); diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/StringBinaryIndexFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/StringBinaryIndexFieldData.java index 72c39acec4e90..9e0c494d9432d 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/StringBinaryIndexFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/StringBinaryIndexFieldData.java @@ -47,6 +47,11 @@ import java.io.IOException; +/** + * Field Data for binary strings + * + * @opensearch.internal + */ public class StringBinaryIndexFieldData implements IndexFieldData { protected final String fieldName; diff --git a/server/src/main/java/org/opensearch/index/fieldvisitor/CustomFieldsVisitor.java b/server/src/main/java/org/opensearch/index/fieldvisitor/CustomFieldsVisitor.java index 5be2fa5209ca5..df4d398b2b181 100644 --- a/server/src/main/java/org/opensearch/index/fieldvisitor/CustomFieldsVisitor.java +++ b/server/src/main/java/org/opensearch/index/fieldvisitor/CustomFieldsVisitor.java @@ -40,6 +40,8 @@ * Supported pattern styles: "xxx*", "*xxx", "*xxx*" and "xxx*yyy". * The Uid field is always loaded. * The class is optimized for source loading as it is a common use case. + * + * @opensearch.internal */ public class CustomFieldsVisitor extends FieldsVisitor { diff --git a/server/src/main/java/org/opensearch/index/fieldvisitor/FieldsVisitor.java b/server/src/main/java/org/opensearch/index/fieldvisitor/FieldsVisitor.java index eb094ce1df9a4..d1c0e48570576 100644 --- a/server/src/main/java/org/opensearch/index/fieldvisitor/FieldsVisitor.java +++ b/server/src/main/java/org/opensearch/index/fieldvisitor/FieldsVisitor.java @@ -57,6 +57,8 @@ /** * Base {@link StoredFieldVisitor} that retrieves all non-redundant metadata. + * + * @opensearch.internal */ public class FieldsVisitor extends StoredFieldVisitor { private static final Set BASE_REQUIRED_FIELDS = unmodifiableSet(newHashSet(IdFieldMapper.NAME, RoutingFieldMapper.NAME)); diff --git a/server/src/main/java/org/opensearch/index/fieldvisitor/IdOnlyFieldVisitor.java b/server/src/main/java/org/opensearch/index/fieldvisitor/IdOnlyFieldVisitor.java index 67ec285f50cbf..b56026e0ffe49 100644 --- a/server/src/main/java/org/opensearch/index/fieldvisitor/IdOnlyFieldVisitor.java +++ b/server/src/main/java/org/opensearch/index/fieldvisitor/IdOnlyFieldVisitor.java @@ -37,6 +37,11 @@ import org.opensearch.index.mapper.IdFieldMapper; import org.opensearch.index.mapper.Uid; +/** + * Visitor pattern for doc ids only + * + * @opensearch.internal + */ public final class IdOnlyFieldVisitor extends StoredFieldVisitor { private String id = null; private boolean visited = false; diff --git a/server/src/main/java/org/opensearch/index/fieldvisitor/SingleFieldsVisitor.java b/server/src/main/java/org/opensearch/index/fieldvisitor/SingleFieldsVisitor.java index 3214ec2780701..69cef51c24421 100644 --- a/server/src/main/java/org/opensearch/index/fieldvisitor/SingleFieldsVisitor.java +++ b/server/src/main/java/org/opensearch/index/fieldvisitor/SingleFieldsVisitor.java @@ -42,6 +42,8 @@ /** * {@linkplain StoredFieldVisitor} that loads a single field value. + * + * @opensearch.internal */ public final class SingleFieldsVisitor extends StoredFieldVisitor { private final MappedFieldType field; diff --git a/server/src/main/java/org/opensearch/index/flush/FlushStats.java b/server/src/main/java/org/opensearch/index/flush/FlushStats.java index cfe28edf4c988..2490f22416c83 100644 --- a/server/src/main/java/org/opensearch/index/flush/FlushStats.java +++ b/server/src/main/java/org/opensearch/index/flush/FlushStats.java @@ -41,6 +41,11 @@ import java.io.IOException; +/** + * Encapsulates statistics for flush + * + * @opensearch.internal + */ public class FlushStats implements Writeable, ToXContentFragment { private long total; diff --git a/server/src/main/java/org/opensearch/index/get/GetResult.java b/server/src/main/java/org/opensearch/index/get/GetResult.java index aa2bf43c5b290..e2f23353f250e 100644 --- a/server/src/main/java/org/opensearch/index/get/GetResult.java +++ b/server/src/main/java/org/opensearch/index/get/GetResult.java @@ -63,6 +63,11 @@ import static org.opensearch.index.seqno.SequenceNumbers.UNASSIGNED_PRIMARY_TERM; import static org.opensearch.index.seqno.SequenceNumbers.UNASSIGNED_SEQ_NO; +/** + * Result provided for a search get + * + * @opensearch.api + */ public class GetResult implements Writeable, Iterable, ToXContentObject { public static final String _INDEX = "_index"; diff --git a/server/src/main/java/org/opensearch/index/get/GetStats.java b/server/src/main/java/org/opensearch/index/get/GetStats.java index fb37b5dfc6b42..06dc19e6349c1 100644 --- a/server/src/main/java/org/opensearch/index/get/GetStats.java +++ b/server/src/main/java/org/opensearch/index/get/GetStats.java @@ -41,6 +41,11 @@ import java.io.IOException; +/** + * Stats for a search get + * + * @opensearch.api + */ public class GetStats implements Writeable, ToXContentFragment { private long existsCount; diff --git a/server/src/main/java/org/opensearch/index/get/ShardGetService.java b/server/src/main/java/org/opensearch/index/get/ShardGetService.java index 6aa10bc450b51..7b34ab5f0d5da 100644 --- a/server/src/main/java/org/opensearch/index/get/ShardGetService.java +++ b/server/src/main/java/org/opensearch/index/get/ShardGetService.java @@ -84,6 +84,11 @@ import static org.opensearch.index.seqno.SequenceNumbers.UNASSIGNED_PRIMARY_TERM; import static org.opensearch.index.seqno.SequenceNumbers.UNASSIGNED_SEQ_NO; +/** + * Gets an index shard + * + * @opensearch.internal + */ public final class ShardGetService extends AbstractIndexShardComponent { private final MapperService mapperService; private final MeanMetric existsMetric = new MeanMetric(); diff --git a/server/src/main/java/org/opensearch/index/mapper/AbstractGeometryFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/AbstractGeometryFieldMapper.java index 0d90e694ef481..dd7a1fd3e027a 100644 --- a/server/src/main/java/org/opensearch/index/mapper/AbstractGeometryFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/AbstractGeometryFieldMapper.java @@ -62,6 +62,8 @@ /** * Base field mapper class for all spatial field types + * + * @opensearch.internal */ public abstract class AbstractGeometryFieldMapper extends FieldMapper { diff --git a/server/src/main/java/org/opensearch/index/mapper/AbstractPointGeometryFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/AbstractPointGeometryFieldMapper.java index 19e3a5073fd8c..a5e8f4d1d10e4 100644 --- a/server/src/main/java/org/opensearch/index/mapper/AbstractPointGeometryFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/AbstractPointGeometryFieldMapper.java @@ -56,7 +56,11 @@ import static org.opensearch.index.mapper.TypeParsers.parseField; -/** Base class for for spatial fields that only support indexing points */ +/** + * Base class for for spatial fields that only support indexing points + * + * @opensearch.internal + */ public abstract class AbstractPointGeometryFieldMapper extends AbstractGeometryFieldMapper { public static class Names extends AbstractGeometryFieldMapper.Names { diff --git a/server/src/main/java/org/opensearch/index/mapper/AbstractShapeGeometryFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/AbstractShapeGeometryFieldMapper.java index 56ef58f1b92e9..4586360f8ce82 100644 --- a/server/src/main/java/org/opensearch/index/mapper/AbstractShapeGeometryFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/AbstractShapeGeometryFieldMapper.java @@ -48,6 +48,8 @@ /** * Base class for {@link GeoShapeFieldMapper} and {@link LegacyGeoShapeFieldMapper} + * + * @opensearch.internal */ public abstract class AbstractShapeGeometryFieldMapper extends AbstractGeometryFieldMapper { diff --git a/server/src/main/java/org/opensearch/index/mapper/ArraySourceValueFetcher.java b/server/src/main/java/org/opensearch/index/mapper/ArraySourceValueFetcher.java index f28e4a64eec6e..936d6b4fb7f8b 100644 --- a/server/src/main/java/org/opensearch/index/mapper/ArraySourceValueFetcher.java +++ b/server/src/main/java/org/opensearch/index/mapper/ArraySourceValueFetcher.java @@ -47,6 +47,8 @@ * This class differs from {@link SourceValueFetcher} in that it directly handles * array values in parsing. Field types should use this class if their corresponding * mapper returns true for {@link FieldMapper#parsesArrayValue()}. + * + * @opensearch.internal */ public abstract class ArraySourceValueFetcher implements ValueFetcher { private final Set sourcePaths; diff --git a/server/src/main/java/org/opensearch/index/mapper/BinaryFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/BinaryFieldMapper.java index 68b0df63f2bef..ccc532d0539be 100644 --- a/server/src/main/java/org/opensearch/index/mapper/BinaryFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/BinaryFieldMapper.java @@ -59,6 +59,11 @@ import java.util.Map; import java.util.function.Supplier; +/** + * A mapper for binary fields + * + * @opensearch.internal + */ public class BinaryFieldMapper extends ParametrizedFieldMapper { public static final String CONTENT_TYPE = "binary"; diff --git a/server/src/main/java/org/opensearch/index/mapper/BinaryRangeUtil.java b/server/src/main/java/org/opensearch/index/mapper/BinaryRangeUtil.java index 96744ba2d01d8..f24d3a5853a88 100644 --- a/server/src/main/java/org/opensearch/index/mapper/BinaryRangeUtil.java +++ b/server/src/main/java/org/opensearch/index/mapper/BinaryRangeUtil.java @@ -47,6 +47,11 @@ import java.util.List; import java.util.Set; +/** + * Utility class for binary ranges + * + * @opensearch.internal + */ final class BinaryRangeUtil { private BinaryRangeUtil() {}; diff --git a/server/src/main/java/org/opensearch/index/mapper/BooleanFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/BooleanFieldMapper.java index a14364640d6ee..5d22a0f097298 100644 --- a/server/src/main/java/org/opensearch/index/mapper/BooleanFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/BooleanFieldMapper.java @@ -61,6 +61,8 @@ /** * A field mapper for boolean fields. + * + * @opensearch.internal */ public class BooleanFieldMapper extends ParametrizedFieldMapper { diff --git a/server/src/main/java/org/opensearch/index/mapper/CompletionFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/CompletionFieldMapper.java index 2d0f59fc76ea4..73b2603f16221 100644 --- a/server/src/main/java/org/opensearch/index/mapper/CompletionFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/CompletionFieldMapper.java @@ -90,6 +90,8 @@ * against the weighted FST index by the {@link CompletionSuggester}. * This field can also be extended to add search criteria to suggestions * for query-time filtering and boosting (see {@link ContextMappings} + * + * @opensearch.internal */ public class CompletionFieldMapper extends ParametrizedFieldMapper { public static final String CONTENT_TYPE = "completion"; diff --git a/server/src/main/java/org/opensearch/index/mapper/ConstantFieldType.java b/server/src/main/java/org/opensearch/index/mapper/ConstantFieldType.java index 4dec612ceff75..a28a6369b1aa4 100644 --- a/server/src/main/java/org/opensearch/index/mapper/ConstantFieldType.java +++ b/server/src/main/java/org/opensearch/index/mapper/ConstantFieldType.java @@ -51,6 +51,8 @@ * cheap. In particular they should not read data from disk or perform a * network call. Furthermore they may only return a {@link MatchAllDocsQuery} * or a {@link MatchNoDocsQuery}. + * + * @opensearch.internal */ public abstract class ConstantFieldType extends MappedFieldType { diff --git a/server/src/main/java/org/opensearch/index/mapper/ContentPath.java b/server/src/main/java/org/opensearch/index/mapper/ContentPath.java index 951a0bc0f9890..468551aeed287 100644 --- a/server/src/main/java/org/opensearch/index/mapper/ContentPath.java +++ b/server/src/main/java/org/opensearch/index/mapper/ContentPath.java @@ -32,6 +32,11 @@ package org.opensearch.index.mapper; +/** + * JSON Path for a document / field + * + * @opensearch.internal + */ public final class ContentPath { private static final char DELIMITER = '.'; diff --git a/server/src/main/java/org/opensearch/index/mapper/CustomDocValuesField.java b/server/src/main/java/org/opensearch/index/mapper/CustomDocValuesField.java index 664ee45c091bb..2776e7515bbf6 100644 --- a/server/src/main/java/org/opensearch/index/mapper/CustomDocValuesField.java +++ b/server/src/main/java/org/opensearch/index/mapper/CustomDocValuesField.java @@ -41,7 +41,13 @@ import java.io.Reader; -// used for binary, geo and range fields +/** + * Base class for constructing a custom docvalues type + * + * used for binary, geo, and range fields + * + * @opensearch.api + */ public abstract class CustomDocValuesField implements IndexableField { public static final FieldType TYPE = new FieldType(); diff --git a/server/src/main/java/org/opensearch/index/mapper/DataStreamFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/DataStreamFieldMapper.java index 03e792c4893d4..a94d85916338a 100644 --- a/server/src/main/java/org/opensearch/index/mapper/DataStreamFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/DataStreamFieldMapper.java @@ -22,6 +22,11 @@ import java.util.List; import java.util.Map; +/** + * Field mapper for a datastream field + * + * @opensearch.internal + */ public class DataStreamFieldMapper extends MetadataFieldMapper { public static final String NAME = "_data_stream_timestamp"; diff --git a/server/src/main/java/org/opensearch/index/mapper/DateFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/DateFieldMapper.java index e2239069603e6..0aef814f3dedb 100644 --- a/server/src/main/java/org/opensearch/index/mapper/DateFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/DateFieldMapper.java @@ -81,7 +81,11 @@ import static org.opensearch.common.time.DateUtils.toLong; -/** A {@link FieldMapper} for dates. */ +/** + * A {@link FieldMapper} for dates. + * + * @opensearch.internal + */ public final class DateFieldMapper extends ParametrizedFieldMapper { private static final DeprecationLogger DEPRECATION_LOGGER = DeprecationLogger.getLogger(DateFieldMapper.class); diff --git a/server/src/main/java/org/opensearch/index/mapper/DocValueFetcher.java b/server/src/main/java/org/opensearch/index/mapper/DocValueFetcher.java index e97a4cd636197..dd15f72bbd45e 100644 --- a/server/src/main/java/org/opensearch/index/mapper/DocValueFetcher.java +++ b/server/src/main/java/org/opensearch/index/mapper/DocValueFetcher.java @@ -45,6 +45,8 @@ /** * Value fetcher that loads from doc values. + * + * @opensearch.internal */ public final class DocValueFetcher implements ValueFetcher { private final DocValueFormat format; diff --git a/server/src/main/java/org/opensearch/index/mapper/DocumentMapper.java b/server/src/main/java/org/opensearch/index/mapper/DocumentMapper.java index 0bebfa024e185..6c3851315fc60 100644 --- a/server/src/main/java/org/opensearch/index/mapper/DocumentMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/DocumentMapper.java @@ -63,6 +63,11 @@ import java.util.Objects; import java.util.stream.Stream; +/** + * The OpenSearch DocumentMapper + * + * @opensearch.internal + */ public class DocumentMapper implements ToXContentFragment { public static class Builder { diff --git a/server/src/main/java/org/opensearch/index/mapper/DocumentMapperForType.java b/server/src/main/java/org/opensearch/index/mapper/DocumentMapperForType.java index dd92cdfacef64..b26c3f3645433 100644 --- a/server/src/main/java/org/opensearch/index/mapper/DocumentMapperForType.java +++ b/server/src/main/java/org/opensearch/index/mapper/DocumentMapperForType.java @@ -32,6 +32,14 @@ package org.opensearch.index.mapper; +/** + * Document mapper used for types + * + * @opensearch.internal + * + * @deprecated types are being removed + */ +@Deprecated public class DocumentMapperForType { private final DocumentMapper documentMapper; private final Mapping mapping; diff --git a/server/src/main/java/org/opensearch/index/mapper/DocumentMapperParser.java b/server/src/main/java/org/opensearch/index/mapper/DocumentMapperParser.java index 2d6880c6b4186..9fa088396a38b 100644 --- a/server/src/main/java/org/opensearch/index/mapper/DocumentMapperParser.java +++ b/server/src/main/java/org/opensearch/index/mapper/DocumentMapperParser.java @@ -55,6 +55,11 @@ import static java.util.Collections.unmodifiableMap; +/** + * Parser for a document mapper + * + * @opensearch.internal + */ public class DocumentMapperParser { final MapperService mapperService; diff --git a/server/src/main/java/org/opensearch/index/mapper/DocumentParser.java b/server/src/main/java/org/opensearch/index/mapper/DocumentParser.java index df8eb8f38cfcb..a346d57924199 100644 --- a/server/src/main/java/org/opensearch/index/mapper/DocumentParser.java +++ b/server/src/main/java/org/opensearch/index/mapper/DocumentParser.java @@ -56,7 +56,11 @@ import static org.opensearch.index.mapper.FieldMapper.IGNORE_MALFORMED_SETTING; -/** A parser for documents, given mappings from a DocumentMapper */ +/** + * A parser for documents, given mappings from a DocumentMapper + * + * @opensearch.internal + */ final class DocumentParser { private final IndexSettings indexSettings; diff --git a/server/src/main/java/org/opensearch/index/mapper/DynamicKeyFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/DynamicKeyFieldMapper.java index c1ff7fac39111..71f4c312a8c58 100644 --- a/server/src/main/java/org/opensearch/index/mapper/DynamicKeyFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/DynamicKeyFieldMapper.java @@ -51,6 +51,8 @@ * * Note: we anticipate that 'flattened' fields will be the only implementation of this * interface. Flattened object fields live in the 'mapper-flattened' module. + * + * @opensearch.internal */ public abstract class DynamicKeyFieldMapper extends FieldMapper { diff --git a/server/src/main/java/org/opensearch/index/mapper/DynamicKeyFieldTypeLookup.java b/server/src/main/java/org/opensearch/index/mapper/DynamicKeyFieldTypeLookup.java index fed914d420eb9..13150ddc50a51 100644 --- a/server/src/main/java/org/opensearch/index/mapper/DynamicKeyFieldTypeLookup.java +++ b/server/src/main/java/org/opensearch/index/mapper/DynamicKeyFieldTypeLookup.java @@ -44,6 +44,8 @@ * * Note: we anticipate that 'flattened' fields will be the only implementation {@link DynamicKeyFieldMapper}. * Flattened object fields live in the 'mapper-flattened' module. + * + * @opensearch.internal */ class DynamicKeyFieldTypeLookup { private final Map mappers; diff --git a/server/src/main/java/org/opensearch/index/mapper/DynamicTemplate.java b/server/src/main/java/org/opensearch/index/mapper/DynamicTemplate.java index e3afb80344686..8a418a7272b0a 100644 --- a/server/src/main/java/org/opensearch/index/mapper/DynamicTemplate.java +++ b/server/src/main/java/org/opensearch/index/mapper/DynamicTemplate.java @@ -44,6 +44,11 @@ import java.util.Map; import java.util.TreeMap; +/** + * A template that is dynamic based on field types + * + * @opensearch.internal + */ public class DynamicTemplate implements ToXContentObject { public enum MatchType { diff --git a/server/src/main/java/org/opensearch/index/mapper/FieldAliasMapper.java b/server/src/main/java/org/opensearch/index/mapper/FieldAliasMapper.java index d716ec1e828f9..30f7de09e6304 100644 --- a/server/src/main/java/org/opensearch/index/mapper/FieldAliasMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/FieldAliasMapper.java @@ -46,6 +46,8 @@ * * A field alias has no concrete field mappings of its own, but instead points to another field by * its path. Once defined, an alias can be used in place of the concrete field name in search requests. + * + * @opensearch.internal */ public final class FieldAliasMapper extends Mapper { public static final String CONTENT_TYPE = "alias"; diff --git a/server/src/main/java/org/opensearch/index/mapper/FieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/FieldMapper.java index 9c383d4b5a653..bd5a671887ef2 100644 --- a/server/src/main/java/org/opensearch/index/mapper/FieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/FieldMapper.java @@ -60,6 +60,11 @@ import java.util.TreeMap; import java.util.stream.StreamSupport; +/** + * The base OpenSearch Field Mapper + * + * @opensearch.internal + */ public abstract class FieldMapper extends Mapper implements Cloneable { public static final Setting IGNORE_MALFORMED_SETTING = Setting.boolSetting( "index.mapping.ignore_malformed", diff --git a/server/src/main/java/org/opensearch/index/mapper/FieldNamesFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/FieldNamesFieldMapper.java index 500df197f4f04..24793e916047b 100644 --- a/server/src/main/java/org/opensearch/index/mapper/FieldNamesFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/FieldNamesFieldMapper.java @@ -48,6 +48,8 @@ /** * A mapper that indexes the field names of a document under _field_names. This mapper is typically useful in order * to have fast exists and missing queries/filters. + * + * @opensearch.internal */ public class FieldNamesFieldMapper extends MetadataFieldMapper { diff --git a/server/src/main/java/org/opensearch/index/mapper/FieldTypeLookup.java b/server/src/main/java/org/opensearch/index/mapper/FieldTypeLookup.java index fd1f2df1131ab..bede143ed5e92 100644 --- a/server/src/main/java/org/opensearch/index/mapper/FieldTypeLookup.java +++ b/server/src/main/java/org/opensearch/index/mapper/FieldTypeLookup.java @@ -45,6 +45,8 @@ /** * An immutable container for looking up {@link MappedFieldType}s by their name. + * + * @opensearch.internal */ class FieldTypeLookup implements Iterable { diff --git a/server/src/main/java/org/opensearch/index/mapper/GeoPointFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/GeoPointFieldMapper.java index 123af3a1fe761..3dfdfdb87f8b9 100644 --- a/server/src/main/java/org/opensearch/index/mapper/GeoPointFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/GeoPointFieldMapper.java @@ -65,6 +65,8 @@ * Field Mapper for geo_point types. * * Uses lucene 6 LatLonPoint encoding + * + * @opensearch.internal */ public class GeoPointFieldMapper extends AbstractPointGeometryFieldMapper, List> { public static final String CONTENT_TYPE = "geo_point"; diff --git a/server/src/main/java/org/opensearch/index/mapper/GeoShapeFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/GeoShapeFieldMapper.java index e14f26404eb11..aeda2a2d93f12 100644 --- a/server/src/main/java/org/opensearch/index/mapper/GeoShapeFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/GeoShapeFieldMapper.java @@ -65,6 +65,8 @@ * or: *

    * "field" : "POLYGON ((100.0 0.0, 101.0 0.0, 101.0 1.0, 100.0 1.0, 100.0 0.0)) + * + * @opensearch.internal */ public class GeoShapeFieldMapper extends AbstractShapeGeometryFieldMapper { public static final String CONTENT_TYPE = "geo_shape"; diff --git a/server/src/main/java/org/opensearch/index/mapper/GeoShapeIndexer.java b/server/src/main/java/org/opensearch/index/mapper/GeoShapeIndexer.java index 24e458df3a626..8a1712c0f9645 100644 --- a/server/src/main/java/org/opensearch/index/mapper/GeoShapeIndexer.java +++ b/server/src/main/java/org/opensearch/index/mapper/GeoShapeIndexer.java @@ -60,6 +60,8 @@ /** * Utility class that converts geometries into Lucene-compatible form for indexing in a geo_shape field. + * + * @opensearch.internal */ public class GeoShapeIndexer implements AbstractGeometryFieldMapper.Indexer { diff --git a/server/src/main/java/org/opensearch/index/mapper/GeoShapeParser.java b/server/src/main/java/org/opensearch/index/mapper/GeoShapeParser.java index 1ba1d9ee3be59..d8740b7866773 100644 --- a/server/src/main/java/org/opensearch/index/mapper/GeoShapeParser.java +++ b/server/src/main/java/org/opensearch/index/mapper/GeoShapeParser.java @@ -46,6 +46,11 @@ import java.text.ParseException; import java.util.Collections; +/** + * Utility class that parses geo shapes + * + * @opensearch.internal + */ public class GeoShapeParser extends AbstractGeometryFieldMapper.Parser { private final GeometryParser geometryParser; diff --git a/server/src/main/java/org/opensearch/index/mapper/GeoShapeQueryable.java b/server/src/main/java/org/opensearch/index/mapper/GeoShapeQueryable.java index 7fc6f3cd7c6c6..fbcba13b3676d 100644 --- a/server/src/main/java/org/opensearch/index/mapper/GeoShapeQueryable.java +++ b/server/src/main/java/org/opensearch/index/mapper/GeoShapeQueryable.java @@ -41,6 +41,8 @@ /** * Implemented by {@link org.opensearch.index.mapper.MappedFieldType} that support * GeoShape queries. + * + * @opensearch.internal */ public interface GeoShapeQueryable { diff --git a/server/src/main/java/org/opensearch/index/mapper/IdFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/IdFieldMapper.java index 7ca7b9e81be96..a3c4153ec5373 100644 --- a/server/src/main/java/org/opensearch/index/mapper/IdFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/IdFieldMapper.java @@ -73,6 +73,8 @@ * A mapper for the _id field. It does nothing since _id is neither indexed nor * stored, but we need to keep it so that its FieldType can be used to generate * queries. + * + * @opensearch.internal */ public class IdFieldMapper extends MetadataFieldMapper { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(IdFieldMapper.class); diff --git a/server/src/main/java/org/opensearch/index/mapper/IgnoredFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/IgnoredFieldMapper.java index 0d82b20cfaea6..69e0c414bbcde 100644 --- a/server/src/main/java/org/opensearch/index/mapper/IgnoredFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/IgnoredFieldMapper.java @@ -44,6 +44,8 @@ /** * A field mapper that records fields that have been ignored because they were malformed. + * + * @opensearch.internal */ public final class IgnoredFieldMapper extends MetadataFieldMapper { diff --git a/server/src/main/java/org/opensearch/index/mapper/IndexFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/IndexFieldMapper.java index ae32aa52162fe..22feeed3fe675 100644 --- a/server/src/main/java/org/opensearch/index/mapper/IndexFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/IndexFieldMapper.java @@ -44,6 +44,11 @@ import java.util.Collections; import java.util.function.Supplier; +/** + * Index specific field mapper + * + * @opensearch.internal + */ public class IndexFieldMapper extends MetadataFieldMapper { public static final String NAME = "_index"; diff --git a/server/src/main/java/org/opensearch/index/mapper/IpFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/IpFieldMapper.java index 3ba5e1e0dfe35..aa5a5638776cf 100644 --- a/server/src/main/java/org/opensearch/index/mapper/IpFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/IpFieldMapper.java @@ -63,7 +63,11 @@ import java.util.function.BiFunction; import java.util.function.Supplier; -/** A {@link FieldMapper} for ip addresses. */ +/** + * A {@link FieldMapper} for ip addresses. + * + * @opensearch.internal + */ public class IpFieldMapper extends ParametrizedFieldMapper { private static final DeprecationLogger DEPRECATION_LOGGER = DeprecationLogger.getLogger(IpFieldMapper.class); diff --git a/server/src/main/java/org/opensearch/index/mapper/KeywordFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/KeywordFieldMapper.java index 4206b29e23456..cde2fb1b93668 100644 --- a/server/src/main/java/org/opensearch/index/mapper/KeywordFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/KeywordFieldMapper.java @@ -61,6 +61,8 @@ /** * A field mapper for keywords. This mapper accepts strings and indexes them as-is. + * + * @opensearch.internal */ public final class KeywordFieldMapper extends ParametrizedFieldMapper { diff --git a/server/src/main/java/org/opensearch/index/mapper/LegacyGeoShapeFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/LegacyGeoShapeFieldMapper.java index b8595647c328c..fc64d173d75f2 100644 --- a/server/src/main/java/org/opensearch/index/mapper/LegacyGeoShapeFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/LegacyGeoShapeFieldMapper.java @@ -93,6 +93,8 @@ * "field" : "POLYGON ((100.0 0.0, 101.0 0.0, 101.0 1.0, 100.0 1.0, 100.0 0.0)) * * @deprecated use {@link GeoShapeFieldMapper} + * + * @opensearch.internal */ @Deprecated public class LegacyGeoShapeFieldMapper extends AbstractShapeGeometryFieldMapper, Shape> { diff --git a/server/src/main/java/org/opensearch/index/mapper/LegacyGeoShapeIndexer.java b/server/src/main/java/org/opensearch/index/mapper/LegacyGeoShapeIndexer.java index d5342c2510100..8565599404bb0 100644 --- a/server/src/main/java/org/opensearch/index/mapper/LegacyGeoShapeIndexer.java +++ b/server/src/main/java/org/opensearch/index/mapper/LegacyGeoShapeIndexer.java @@ -43,6 +43,14 @@ import java.util.Arrays; import java.util.List; +/** + * Indexer for legacy prefix trees + * + * @opensearch.internal + * + * @deprecated will be removed in the next version + */ +@Deprecated public class LegacyGeoShapeIndexer implements AbstractGeometryFieldMapper.Indexer, Shape> { private LegacyGeoShapeFieldMapper.GeoShapeFieldType fieldType; diff --git a/server/src/main/java/org/opensearch/index/mapper/MappedFieldType.java b/server/src/main/java/org/opensearch/index/mapper/MappedFieldType.java index 645115bfe26e2..e37325b246727 100644 --- a/server/src/main/java/org/opensearch/index/mapper/MappedFieldType.java +++ b/server/src/main/java/org/opensearch/index/mapper/MappedFieldType.java @@ -77,6 +77,8 @@ /** * This defines the core properties and functions to operate on a field. + * + * @opensearch.internal */ public abstract class MappedFieldType { diff --git a/server/src/main/java/org/opensearch/index/mapper/Mapper.java b/server/src/main/java/org/opensearch/index/mapper/Mapper.java index f9f16a33a0c52..2f763ec0e35c1 100644 --- a/server/src/main/java/org/opensearch/index/mapper/Mapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/Mapper.java @@ -48,6 +48,11 @@ import java.util.function.Function; import java.util.function.Supplier; +/** + * The foundation OpenSearch mapper + * + * @opensearch.internal + */ public abstract class Mapper implements ToXContentFragment, Iterable { public static class BuilderContext { diff --git a/server/src/main/java/org/opensearch/index/mapper/MapperException.java b/server/src/main/java/org/opensearch/index/mapper/MapperException.java index 0276aa6431c6d..51f4614b883a3 100644 --- a/server/src/main/java/org/opensearch/index/mapper/MapperException.java +++ b/server/src/main/java/org/opensearch/index/mapper/MapperException.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Exception thrown for any mapping errors + * + * @opensearch.internal + */ public class MapperException extends OpenSearchException { public MapperException(StreamInput in) throws IOException { super(in); diff --git a/server/src/main/java/org/opensearch/index/mapper/MapperParsingException.java b/server/src/main/java/org/opensearch/index/mapper/MapperParsingException.java index dafe1e165038b..d293b69838b6b 100644 --- a/server/src/main/java/org/opensearch/index/mapper/MapperParsingException.java +++ b/server/src/main/java/org/opensearch/index/mapper/MapperParsingException.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Exception thrown if there are any errors parsing mappings + * + * @opensearch.internal + */ public class MapperParsingException extends MapperException { public MapperParsingException(StreamInput in) throws IOException { diff --git a/server/src/main/java/org/opensearch/index/mapper/MapperService.java b/server/src/main/java/org/opensearch/index/mapper/MapperService.java index 33c6ff2bc4391..980259fec7e44 100644 --- a/server/src/main/java/org/opensearch/index/mapper/MapperService.java +++ b/server/src/main/java/org/opensearch/index/mapper/MapperService.java @@ -87,6 +87,11 @@ import static java.util.Collections.emptyMap; import static java.util.Collections.unmodifiableMap; +/** + * The core field mapping service + * + * @opensearch.internal + */ public class MapperService extends AbstractIndexComponent implements Closeable { /** diff --git a/server/src/main/java/org/opensearch/index/mapper/Mapping.java b/server/src/main/java/org/opensearch/index/mapper/Mapping.java index 90d6c6a2ddcc0..292ee499ede7c 100644 --- a/server/src/main/java/org/opensearch/index/mapper/Mapping.java +++ b/server/src/main/java/org/opensearch/index/mapper/Mapping.java @@ -54,6 +54,8 @@ /** * Wrapper around everything that defines a mapping, without references to * utility classes like MapperService, ... + * + * @opensearch.internal */ public final class Mapping implements ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/index/mapper/MappingLookup.java b/server/src/main/java/org/opensearch/index/mapper/MappingLookup.java index 38f825e18904d..5bccb4f6e827e 100644 --- a/server/src/main/java/org/opensearch/index/mapper/MappingLookup.java +++ b/server/src/main/java/org/opensearch/index/mapper/MappingLookup.java @@ -45,6 +45,11 @@ import java.util.Map; import java.util.stream.Stream; +/** + * Looks up a mapping for a field + * + * @opensearch.internal + */ public final class MappingLookup implements Iterable { /** Full field name to mapper */ diff --git a/server/src/main/java/org/opensearch/index/mapper/MetadataFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/MetadataFieldMapper.java index 7fca0610c046d..b4142de9b097c 100644 --- a/server/src/main/java/org/opensearch/index/mapper/MetadataFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/MetadataFieldMapper.java @@ -42,6 +42,8 @@ /** * A mapper for a builtin field containing metadata about a document. + * + * @opensearch.internal */ public abstract class MetadataFieldMapper extends ParametrizedFieldMapper { diff --git a/server/src/main/java/org/opensearch/index/mapper/NestedPathFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/NestedPathFieldMapper.java index f420897ca187f..6b441df47b9fd 100644 --- a/server/src/main/java/org/opensearch/index/mapper/NestedPathFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/NestedPathFieldMapper.java @@ -21,6 +21,11 @@ import java.util.Collections; +/** + * Replacement for TypesFieldMapper used in nested fields + * + * @opensearch.internal + */ public class NestedPathFieldMapper extends MetadataFieldMapper { // OpenSearch version 2.0 removed types; this name is used for bwc public static final String LEGACY_NAME = "_type"; diff --git a/server/src/main/java/org/opensearch/index/mapper/NumberFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/NumberFieldMapper.java index bf7b1ae70c711..343a1235ba8e6 100644 --- a/server/src/main/java/org/opensearch/index/mapper/NumberFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/NumberFieldMapper.java @@ -77,7 +77,11 @@ import java.util.function.Function; import java.util.function.Supplier; -/** A {@link FieldMapper} for numeric types: byte, short, int, long, float and double. */ +/** + * A {@link FieldMapper} for numeric types: byte, short, int, long, float and double. + * + * @opensearch.internal + */ public class NumberFieldMapper extends ParametrizedFieldMapper { public static final Setting COERCE_SETTING = Setting.boolSetting("index.mapping.coerce", true, Property.IndexScope); diff --git a/server/src/main/java/org/opensearch/index/mapper/ObjectMapper.java b/server/src/main/java/org/opensearch/index/mapper/ObjectMapper.java index d3c2e7f1e5372..5fbebc0206270 100644 --- a/server/src/main/java/org/opensearch/index/mapper/ObjectMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/ObjectMapper.java @@ -56,6 +56,11 @@ import java.util.Locale; import java.util.Map; +/** + * Field mapper for object field types + * + * @opensearch.internal + */ public class ObjectMapper extends Mapper implements Cloneable { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(ObjectMapper.class); diff --git a/server/src/main/java/org/opensearch/index/mapper/ParametrizedFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/ParametrizedFieldMapper.java index 6e0b2613cf4ff..5697d2fffcf3b 100644 --- a/server/src/main/java/org/opensearch/index/mapper/ParametrizedFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/ParametrizedFieldMapper.java @@ -70,6 +70,8 @@ * * Subclasses should implement a {@link Builder} that is returned from the * {@link #getMergeBuilder()} method, initialised with the existing builder. + * + * @opensearch.internal */ public abstract class ParametrizedFieldMapper extends FieldMapper { diff --git a/server/src/main/java/org/opensearch/index/mapper/ParseContext.java b/server/src/main/java/org/opensearch/index/mapper/ParseContext.java index 50295626393ad..3dd68bb6d7c58 100644 --- a/server/src/main/java/org/opensearch/index/mapper/ParseContext.java +++ b/server/src/main/java/org/opensearch/index/mapper/ParseContext.java @@ -49,6 +49,11 @@ import java.util.List; import java.util.Set; +/** + * Holds the context at parse time + * + * @opensearch.internal + */ public abstract class ParseContext implements Iterable { /** Fork of {@link org.apache.lucene.document.Document} with additional functionality. */ diff --git a/server/src/main/java/org/opensearch/index/mapper/ParsedDocument.java b/server/src/main/java/org/opensearch/index/mapper/ParsedDocument.java index 6991db3306ea7..c17444740ca30 100644 --- a/server/src/main/java/org/opensearch/index/mapper/ParsedDocument.java +++ b/server/src/main/java/org/opensearch/index/mapper/ParsedDocument.java @@ -42,6 +42,8 @@ /** * The result of parsing a document. + * + * @opensearch.internal */ public class ParsedDocument { diff --git a/server/src/main/java/org/opensearch/index/mapper/RangeFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/RangeFieldMapper.java index 2568009cfc0d5..adc0cbaae7d1c 100644 --- a/server/src/main/java/org/opensearch/index/mapper/RangeFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/RangeFieldMapper.java @@ -77,7 +77,11 @@ import static org.opensearch.index.query.RangeQueryBuilder.LTE_FIELD; import static org.opensearch.index.query.RangeQueryBuilder.LT_FIELD; -/** A {@link FieldMapper} for indexing numeric and date ranges, and creating queries */ +/** + * A {@link FieldMapper} for indexing numeric and date ranges, and creating queries + * + * @opensearch.internal + */ public class RangeFieldMapper extends ParametrizedFieldMapper { public static final boolean DEFAULT_INCLUDE_UPPER = true; public static final boolean DEFAULT_INCLUDE_LOWER = true; diff --git a/server/src/main/java/org/opensearch/index/mapper/RangeType.java b/server/src/main/java/org/opensearch/index/mapper/RangeType.java index 5f666dece7ed2..ce31b5e6ac5df 100644 --- a/server/src/main/java/org/opensearch/index/mapper/RangeType.java +++ b/server/src/main/java/org/opensearch/index/mapper/RangeType.java @@ -66,7 +66,11 @@ import java.util.Set; import java.util.function.BiFunction; -/** Enum defining the type of range */ +/** + * Enum defining the type of range + * + * @opensearch.internal + */ public enum RangeType { IP("ip_range", LengthType.FIXED_16) { @Override diff --git a/server/src/main/java/org/opensearch/index/mapper/RootObjectMapper.java b/server/src/main/java/org/opensearch/index/mapper/RootObjectMapper.java index b83ce6022b012..cee9ba9f7507c 100644 --- a/server/src/main/java/org/opensearch/index/mapper/RootObjectMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/RootObjectMapper.java @@ -57,6 +57,11 @@ import static org.opensearch.common.xcontent.support.XContentMapValues.nodeBooleanValue; import static org.opensearch.index.mapper.TypeParsers.parseDateTimeFormatter; +/** + * The root object mapper for a document + * + * @opensearch.internal + */ public class RootObjectMapper extends ObjectMapper { private static final DeprecationLogger DEPRECATION_LOGGER = DeprecationLogger.getLogger(RootObjectMapper.class); diff --git a/server/src/main/java/org/opensearch/index/mapper/RoutingFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/RoutingFieldMapper.java index e487673b5c9da..f8bc833983391 100644 --- a/server/src/main/java/org/opensearch/index/mapper/RoutingFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/RoutingFieldMapper.java @@ -42,6 +42,11 @@ import java.util.Collections; import java.util.List; +/** + * Internal field mapper for _routing fields + * + * @opensearch.internal + */ public class RoutingFieldMapper extends MetadataFieldMapper { public static final String NAME = "_routing"; diff --git a/server/src/main/java/org/opensearch/index/mapper/SeqNoFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/SeqNoFieldMapper.java index 490e1a31ae72b..9b2e561acc841 100644 --- a/server/src/main/java/org/opensearch/index/mapper/SeqNoFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/SeqNoFieldMapper.java @@ -65,7 +65,8 @@ * identical seq# values for two document copies. The primary term is stored as * a doc value field without being indexed, since it is only intended for use * as a key-value lookup. - + * + * @opensearch.internal */ public class SeqNoFieldMapper extends MetadataFieldMapper { diff --git a/server/src/main/java/org/opensearch/index/mapper/SimpleMappedFieldType.java b/server/src/main/java/org/opensearch/index/mapper/SimpleMappedFieldType.java index 44c89211f5ef0..7ea5d49e234a5 100644 --- a/server/src/main/java/org/opensearch/index/mapper/SimpleMappedFieldType.java +++ b/server/src/main/java/org/opensearch/index/mapper/SimpleMappedFieldType.java @@ -42,6 +42,8 @@ /** * {@link MappedFieldType} base impl for field types that are neither dates nor ranges. + * + * @opensearch.internal */ public abstract class SimpleMappedFieldType extends MappedFieldType { diff --git a/server/src/main/java/org/opensearch/index/mapper/SourceFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/SourceFieldMapper.java index 8791c23e49051..4a5778db590dc 100644 --- a/server/src/main/java/org/opensearch/index/mapper/SourceFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/SourceFieldMapper.java @@ -60,6 +60,11 @@ import java.util.Map; import java.util.function.Function; +/** + * Internal field mapper for storing source (and recovery source) + * + * @opensearch.internal + */ public class SourceFieldMapper extends MetadataFieldMapper { public static final String NAME = "_source"; diff --git a/server/src/main/java/org/opensearch/index/mapper/SourceToParse.java b/server/src/main/java/org/opensearch/index/mapper/SourceToParse.java index 4aa8d3117bc9c..7993c3f0a3b36 100644 --- a/server/src/main/java/org/opensearch/index/mapper/SourceToParse.java +++ b/server/src/main/java/org/opensearch/index/mapper/SourceToParse.java @@ -39,6 +39,11 @@ import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.xcontent.XContentType; +/** + * Stores the document source + * + * @opensearch.internal + */ public class SourceToParse { private final BytesReference source; diff --git a/server/src/main/java/org/opensearch/index/mapper/SourceValueFetcher.java b/server/src/main/java/org/opensearch/index/mapper/SourceValueFetcher.java index 9467f22afa8e8..d602fceeed041 100644 --- a/server/src/main/java/org/opensearch/index/mapper/SourceValueFetcher.java +++ b/server/src/main/java/org/opensearch/index/mapper/SourceValueFetcher.java @@ -48,6 +48,8 @@ * to implement value fetching. * * Field types that handle arrays directly should instead use {@link ArraySourceValueFetcher}. + * + * @opensearch.internal */ public abstract class SourceValueFetcher implements ValueFetcher { private final Set sourcePaths; diff --git a/server/src/main/java/org/opensearch/index/mapper/StrictDynamicMappingException.java b/server/src/main/java/org/opensearch/index/mapper/StrictDynamicMappingException.java index 6e26ad46eecdc..6c2f10626541f 100644 --- a/server/src/main/java/org/opensearch/index/mapper/StrictDynamicMappingException.java +++ b/server/src/main/java/org/opensearch/index/mapper/StrictDynamicMappingException.java @@ -36,6 +36,11 @@ import java.io.IOException; +/** + * Exception thrown when mapping is set to `STRICT` + * + * @opensearch.internal + */ public class StrictDynamicMappingException extends MapperParsingException { public StrictDynamicMappingException(String path, String fieldName) { diff --git a/server/src/main/java/org/opensearch/index/mapper/StringFieldType.java b/server/src/main/java/org/opensearch/index/mapper/StringFieldType.java index 9aa6bf09a1176..fa9c02c3cf14e 100644 --- a/server/src/main/java/org/opensearch/index/mapper/StringFieldType.java +++ b/server/src/main/java/org/opensearch/index/mapper/StringFieldType.java @@ -59,7 +59,10 @@ /** Base class for {@link MappedFieldType} implementations that use the same * representation for internal index terms as the external representation so * that partial matching queries such as prefix, wildcard and fuzzy queries - * can be implemented. */ + * can be implemented. + * + * @opensearch.internal + */ public abstract class StringFieldType extends TermBasedFieldType { private static final Pattern WILDCARD_PATTERN = Pattern.compile("(\\\\.)|([?*]+)"); diff --git a/server/src/main/java/org/opensearch/index/mapper/TermBasedFieldType.java b/server/src/main/java/org/opensearch/index/mapper/TermBasedFieldType.java index 77efea3c20b6c..78dae2d2c27fc 100644 --- a/server/src/main/java/org/opensearch/index/mapper/TermBasedFieldType.java +++ b/server/src/main/java/org/opensearch/index/mapper/TermBasedFieldType.java @@ -46,7 +46,10 @@ import java.util.Map; /** Base {@link MappedFieldType} implementation for a field that is indexed - * with the inverted index. */ + * with the inverted index. + * + * @opensearch.internal + */ public abstract class TermBasedFieldType extends SimpleMappedFieldType { public TermBasedFieldType( diff --git a/server/src/main/java/org/opensearch/index/mapper/TextFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/TextFieldMapper.java index 360240eb9d59c..bad09e76ecab6 100644 --- a/server/src/main/java/org/opensearch/index/mapper/TextFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/TextFieldMapper.java @@ -102,7 +102,11 @@ import java.util.function.IntPredicate; import java.util.function.Supplier; -/** A {@link FieldMapper} for full-text fields. */ +/** + * A {@link FieldMapper} for full-text fields. + * + * @opensearch.internal + */ public class TextFieldMapper extends ParametrizedFieldMapper { public static final String CONTENT_TYPE = "text"; diff --git a/server/src/main/java/org/opensearch/index/mapper/TextParams.java b/server/src/main/java/org/opensearch/index/mapper/TextParams.java index 0f764c298d912..f8fd02edafb11 100644 --- a/server/src/main/java/org/opensearch/index/mapper/TextParams.java +++ b/server/src/main/java/org/opensearch/index/mapper/TextParams.java @@ -47,6 +47,8 @@ /** * Utility functions for text mapper parameters + * + * @opensearch.internal */ public final class TextParams { diff --git a/server/src/main/java/org/opensearch/index/mapper/TextSearchInfo.java b/server/src/main/java/org/opensearch/index/mapper/TextSearchInfo.java index e341711621d41..79cb5f1ab2a54 100644 --- a/server/src/main/java/org/opensearch/index/mapper/TextSearchInfo.java +++ b/server/src/main/java/org/opensearch/index/mapper/TextSearchInfo.java @@ -40,6 +40,8 @@ /** * Encapsulates information about how to perform text searches over a field + * + * @opensearch.internal */ public class TextSearchInfo { diff --git a/server/src/main/java/org/opensearch/index/mapper/TypeParsers.java b/server/src/main/java/org/opensearch/index/mapper/TypeParsers.java index 7f0451cc2fa84..5c1b1428f6137 100644 --- a/server/src/main/java/org/opensearch/index/mapper/TypeParsers.java +++ b/server/src/main/java/org/opensearch/index/mapper/TypeParsers.java @@ -51,6 +51,11 @@ import static org.opensearch.common.xcontent.support.XContentMapValues.nodeFloatValue; import static org.opensearch.common.xcontent.support.XContentMapValues.nodeStringValue; +/** + * Foundation type parsers + * + * @opensearch.internal + */ public class TypeParsers { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(TypeParsers.class); diff --git a/server/src/main/java/org/opensearch/index/mapper/Uid.java b/server/src/main/java/org/opensearch/index/mapper/Uid.java index fa149b9dcac46..fa6094ab4ed59 100644 --- a/server/src/main/java/org/opensearch/index/mapper/Uid.java +++ b/server/src/main/java/org/opensearch/index/mapper/Uid.java @@ -38,6 +38,11 @@ import java.util.Arrays; import java.util.Base64; +/** + * A documents OpenSearch id + * + * @opensearch.internal + */ public final class Uid { public static final char DELIMITER = '#'; diff --git a/server/src/main/java/org/opensearch/index/mapper/ValueFetcher.java b/server/src/main/java/org/opensearch/index/mapper/ValueFetcher.java index 99d2f33701229..d1cea3fe7f1b0 100644 --- a/server/src/main/java/org/opensearch/index/mapper/ValueFetcher.java +++ b/server/src/main/java/org/opensearch/index/mapper/ValueFetcher.java @@ -42,6 +42,8 @@ /** * A helper class for fetching field values during the {@link FetchFieldsPhase}. Each {@link MappedFieldType} * is in charge of defining a value fetcher through {@link MappedFieldType#valueFetcher}. + * + * @opensearch.internal */ public interface ValueFetcher { /** diff --git a/server/src/main/java/org/opensearch/index/mapper/VersionFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/VersionFieldMapper.java index e601894105b59..f5c36a3d30495 100644 --- a/server/src/main/java/org/opensearch/index/mapper/VersionFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/VersionFieldMapper.java @@ -42,7 +42,11 @@ import java.util.Collections; -/** Mapper for the _version field. */ +/** + * Mapper for the _version field. + * + * @opensearch.internal + */ public class VersionFieldMapper extends MetadataFieldMapper { public static final String NAME = "_version"; diff --git a/server/src/main/java/org/opensearch/index/merge/MergeStats.java b/server/src/main/java/org/opensearch/index/merge/MergeStats.java index 6ef4ed77a8269..2bd6bc88b8659 100644 --- a/server/src/main/java/org/opensearch/index/merge/MergeStats.java +++ b/server/src/main/java/org/opensearch/index/merge/MergeStats.java @@ -42,6 +42,11 @@ import java.io.IOException; +/** + * Stores stats about a merge process + * + * @opensearch.internal + */ public class MergeStats implements Writeable, ToXContentFragment { private long total; diff --git a/server/src/main/java/org/opensearch/index/merge/OnGoingMerge.java b/server/src/main/java/org/opensearch/index/merge/OnGoingMerge.java index c42d883d612e7..59edc54d2f1ca 100644 --- a/server/src/main/java/org/opensearch/index/merge/OnGoingMerge.java +++ b/server/src/main/java/org/opensearch/index/merge/OnGoingMerge.java @@ -39,6 +39,8 @@ /** * Represents a single on going merge within an index. + * + * @opensearch.internal */ public class OnGoingMerge { diff --git a/server/src/main/java/org/opensearch/index/query/AbstractGeometryQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/AbstractGeometryQueryBuilder.java index 9281f1767d72d..a72447402d3c5 100644 --- a/server/src/main/java/org/opensearch/index/query/AbstractGeometryQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/AbstractGeometryQueryBuilder.java @@ -64,6 +64,8 @@ /** * Base {@link QueryBuilder} that builds a Geometry Query + * + * @opensearch.internal */ public abstract class AbstractGeometryQueryBuilder> extends AbstractQueryBuilder { diff --git a/server/src/main/java/org/opensearch/index/query/AbstractQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/AbstractQueryBuilder.java index 3ab3d099f0778..0265084462f6d 100644 --- a/server/src/main/java/org/opensearch/index/query/AbstractQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/AbstractQueryBuilder.java @@ -62,6 +62,8 @@ /** * Base class for all classes producing lucene queries. * Supports conversion to BytesReference and creation of lucene Query objects. + * + * @opensearch.internal */ public abstract class AbstractQueryBuilder> implements QueryBuilder { diff --git a/server/src/main/java/org/opensearch/index/query/BaseTermQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/BaseTermQueryBuilder.java index 6790d6682a799..af377834c6d76 100644 --- a/server/src/main/java/org/opensearch/index/query/BaseTermQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/BaseTermQueryBuilder.java @@ -42,6 +42,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Base class for a TermQueryBuilder + * + * @opensearch.internal + */ public abstract class BaseTermQueryBuilder> extends AbstractQueryBuilder { public static final ParseField VALUE_FIELD = new ParseField("value"); diff --git a/server/src/main/java/org/opensearch/index/query/BoolQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/BoolQueryBuilder.java index b23231806ea1a..d335a47bf2289 100644 --- a/server/src/main/java/org/opensearch/index/query/BoolQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/BoolQueryBuilder.java @@ -59,6 +59,8 @@ /** * A Query that matches documents matching boolean combinations of other queries. + * + * @opensearch.internal */ public class BoolQueryBuilder extends AbstractQueryBuilder { public static final String NAME = "bool"; diff --git a/server/src/main/java/org/opensearch/index/query/BoostingQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/BoostingQueryBuilder.java index cb50bcd6a3aa7..531858aa0b54b 100644 --- a/server/src/main/java/org/opensearch/index/query/BoostingQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/BoostingQueryBuilder.java @@ -56,6 +56,8 @@ * are simply used to lessen the scores. Documents that match the negativeQuery have their score * multiplied by the supplied "boost" parameter, so this should be less than 1 to achieve a * demoting effect + * + * @opensearch.internal */ public class BoostingQueryBuilder extends AbstractQueryBuilder { public static final String NAME = "boosting"; diff --git a/server/src/main/java/org/opensearch/index/query/CommonTermsQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/CommonTermsQueryBuilder.java index b77b512518186..9096492c66481 100644 --- a/server/src/main/java/org/opensearch/index/query/CommonTermsQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/CommonTermsQueryBuilder.java @@ -63,6 +63,8 @@ * * @deprecated Since max_optimization optimization landed in 7.0, normal MatchQuery * will achieve the same result without any configuration. + * + * @opensearch.internal */ @Deprecated public class CommonTermsQueryBuilder extends AbstractQueryBuilder { diff --git a/server/src/main/java/org/opensearch/index/query/ConstantScoreQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/ConstantScoreQueryBuilder.java index 5901e32249158..d3356592b7981 100644 --- a/server/src/main/java/org/opensearch/index/query/ConstantScoreQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/ConstantScoreQueryBuilder.java @@ -48,6 +48,8 @@ /** * A query that wraps a filter and simply returns a constant score equal to the * query boost for every document in the filter. + * + * @opensearch.internal */ public class ConstantScoreQueryBuilder extends AbstractQueryBuilder { public static final String NAME = "constant_score"; diff --git a/server/src/main/java/org/opensearch/index/query/DateRangeIncludingNowQuery.java b/server/src/main/java/org/opensearch/index/query/DateRangeIncludingNowQuery.java index cd4cccc966014..2a7dbf314103d 100644 --- a/server/src/main/java/org/opensearch/index/query/DateRangeIncludingNowQuery.java +++ b/server/src/main/java/org/opensearch/index/query/DateRangeIncludingNowQuery.java @@ -44,6 +44,8 @@ * A simple wrapper class that indicates that the wrapped query has made use of NOW * when parsing its datemath. Useful for preprocessors such as the percolator that * need to know when not to extract dates from the query. + * + * @opensearch.internal */ public class DateRangeIncludingNowQuery extends Query { diff --git a/server/src/main/java/org/opensearch/index/query/DisMaxQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/DisMaxQueryBuilder.java index f5c97fde14baa..87a707fd0a43d 100644 --- a/server/src/main/java/org/opensearch/index/query/DisMaxQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/DisMaxQueryBuilder.java @@ -53,6 +53,8 @@ * A query that generates the union of documents produced by its sub-queries, and that scores each document * with the maximum score for that document as produced by any sub-query, plus a tie breaking increment for any * additional matching sub-queries. + * + * @opensearch.internal */ public class DisMaxQueryBuilder extends AbstractQueryBuilder { public static final String NAME = "dis_max"; diff --git a/server/src/main/java/org/opensearch/index/query/DistanceFeatureQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/DistanceFeatureQueryBuilder.java index 9f6322234f32d..dee6e3f8a762f 100644 --- a/server/src/main/java/org/opensearch/index/query/DistanceFeatureQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/DistanceFeatureQueryBuilder.java @@ -54,6 +54,8 @@ /** * A query to boost scores based on their proximity to the given origin * for date, date_nanos and geo_point field types + * + * @opensearch.internal */ public class DistanceFeatureQueryBuilder extends AbstractQueryBuilder { public static final String NAME = "distance_feature"; diff --git a/server/src/main/java/org/opensearch/index/query/ExistsQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/ExistsQueryBuilder.java index 75c54093a8bd3..135a9788ab039 100644 --- a/server/src/main/java/org/opensearch/index/query/ExistsQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/ExistsQueryBuilder.java @@ -58,6 +58,8 @@ /** * Constructs a query that only match on documents that the field has a value in them. + * + * @opensearch.internal */ public class ExistsQueryBuilder extends AbstractQueryBuilder { public static final String NAME = "exists"; diff --git a/server/src/main/java/org/opensearch/index/query/FieldMaskingSpanQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/FieldMaskingSpanQueryBuilder.java index 1b095c6130a7c..41cce48cd3d7f 100644 --- a/server/src/main/java/org/opensearch/index/query/FieldMaskingSpanQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/FieldMaskingSpanQueryBuilder.java @@ -47,6 +47,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Query builder for field masking span query + * + * @opensearch.internal + */ public class FieldMaskingSpanQueryBuilder extends AbstractQueryBuilder implements SpanQueryBuilder { public static final ParseField SPAN_FIELD_MASKING_FIELD = new ParseField("span_field_masking", "field_masking_span"); diff --git a/server/src/main/java/org/opensearch/index/query/FuzzyQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/FuzzyQueryBuilder.java index e11cb5fabfed0..2def2dab53450 100644 --- a/server/src/main/java/org/opensearch/index/query/FuzzyQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/FuzzyQueryBuilder.java @@ -52,6 +52,8 @@ /** * A Query that does fuzzy matching for a specific value. + * + * @opensearch.internal */ public class FuzzyQueryBuilder extends AbstractQueryBuilder implements MultiTermQueryBuilder { public static final String NAME = "fuzzy"; diff --git a/server/src/main/java/org/opensearch/index/query/GeoBoundingBoxQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/GeoBoundingBoxQueryBuilder.java index 879ad07ca81fd..cafdec91aef15 100644 --- a/server/src/main/java/org/opensearch/index/query/GeoBoundingBoxQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/GeoBoundingBoxQueryBuilder.java @@ -63,6 +63,8 @@ * * This query can only operate on fields of type geo_point that have latitude and longitude * enabled. + * + * @opensearch.internal * */ public class GeoBoundingBoxQueryBuilder extends AbstractQueryBuilder { public static final String NAME = "geo_bounding_box"; diff --git a/server/src/main/java/org/opensearch/index/query/GeoDistanceQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/GeoDistanceQueryBuilder.java index 9fb3ef262ab63..6859bd0bffa7e 100644 --- a/server/src/main/java/org/opensearch/index/query/GeoDistanceQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/GeoDistanceQueryBuilder.java @@ -60,6 +60,8 @@ /** * Filter results of a query to include only those within a specific distance to some * geo point. + * + * @opensearch.internal */ public class GeoDistanceQueryBuilder extends AbstractQueryBuilder { public static final String NAME = "geo_distance"; diff --git a/server/src/main/java/org/opensearch/index/query/GeoExecType.java b/server/src/main/java/org/opensearch/index/query/GeoExecType.java index da1c26e0abbd9..8b58b50352384 100644 --- a/server/src/main/java/org/opensearch/index/query/GeoExecType.java +++ b/server/src/main/java/org/opensearch/index/query/GeoExecType.java @@ -39,7 +39,11 @@ import java.io.IOException; -/** Specifies how a geo query should be run. */ +/** + * Specifies how a geo query should be run. + * + * @opensearch.internal + */ public enum GeoExecType implements Writeable { MEMORY(0), diff --git a/server/src/main/java/org/opensearch/index/query/GeoPolygonQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/GeoPolygonQueryBuilder.java index c6a3fbded13c0..2841cd7670aa5 100644 --- a/server/src/main/java/org/opensearch/index/query/GeoPolygonQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/GeoPolygonQueryBuilder.java @@ -56,6 +56,11 @@ import java.util.List; import java.util.Objects; +/** + * Query builder for polygon queries + * + * @opensearch.internal + */ public class GeoPolygonQueryBuilder extends AbstractQueryBuilder { public static final String NAME = "geo_polygon"; diff --git a/server/src/main/java/org/opensearch/index/query/GeoShapeQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/GeoShapeQueryBuilder.java index 161c6e64c7bf3..589c733eafe00 100644 --- a/server/src/main/java/org/opensearch/index/query/GeoShapeQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/GeoShapeQueryBuilder.java @@ -57,6 +57,8 @@ * can be applied to any {@link MappedFieldType} that implements {@link GeoShapeQueryable}. * * GeoJson and WKT shape definitions are supported + * + * @opensearch.internal */ public class GeoShapeQueryBuilder extends AbstractGeometryQueryBuilder { public static final String NAME = "geo_shape"; diff --git a/server/src/main/java/org/opensearch/index/query/GeoValidationMethod.java b/server/src/main/java/org/opensearch/index/query/GeoValidationMethod.java index 45c90727fbb8b..eee6782a1f85e 100644 --- a/server/src/main/java/org/opensearch/index/query/GeoValidationMethod.java +++ b/server/src/main/java/org/opensearch/index/query/GeoValidationMethod.java @@ -46,7 +46,9 @@ * On STRICT validation invalid coordinates cause an exception to be thrown. * On IGNORE_MALFORMED invalid coordinates are being accepted. * On COERCE invalid coordinates are being corrected to the most likely valid coordinate. - * */ + * + * @opensearch.internal + */ public enum GeoValidationMethod implements Writeable { COERCE, IGNORE_MALFORMED, diff --git a/server/src/main/java/org/opensearch/index/query/IdsQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/IdsQueryBuilder.java index 724425957f75a..d76a2b98b951a 100644 --- a/server/src/main/java/org/opensearch/index/query/IdsQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/IdsQueryBuilder.java @@ -58,6 +58,8 @@ /** * A query that will return only documents matching specific ids (and a type). + * + * @opensearch.internal */ public class IdsQueryBuilder extends AbstractQueryBuilder { public static final String NAME = "ids"; diff --git a/server/src/main/java/org/opensearch/index/query/InnerHitBuilder.java b/server/src/main/java/org/opensearch/index/query/InnerHitBuilder.java index a1e041ba24080..a185894bbd94a 100644 --- a/server/src/main/java/org/opensearch/index/query/InnerHitBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/InnerHitBuilder.java @@ -64,6 +64,9 @@ import static org.opensearch.common.xcontent.XContentParser.Token.END_OBJECT; +/** + * Query builder for inner hits + */ public final class InnerHitBuilder implements Writeable, ToXContentObject { public static final ParseField NAME_FIELD = new ParseField("name"); diff --git a/server/src/main/java/org/opensearch/index/query/InnerHitContextBuilder.java b/server/src/main/java/org/opensearch/index/query/InnerHitContextBuilder.java index 10efb18dc0cfa..8c4c001ffb135 100644 --- a/server/src/main/java/org/opensearch/index/query/InnerHitContextBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/InnerHitContextBuilder.java @@ -49,6 +49,8 @@ /** * A builder for {@link InnerHitsContext.InnerHitSubContext} + * + * @opensearch.internal */ public abstract class InnerHitContextBuilder { protected final QueryBuilder query; diff --git a/server/src/main/java/org/opensearch/index/query/IntervalBuilder.java b/server/src/main/java/org/opensearch/index/query/IntervalBuilder.java index e91adc5abe27a..0a13900d110ab 100644 --- a/server/src/main/java/org/opensearch/index/query/IntervalBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/IntervalBuilder.java @@ -57,6 +57,8 @@ /** * Constructs an IntervalsSource based on analyzed text + * + * @opensearch.internal */ public class IntervalBuilder { diff --git a/server/src/main/java/org/opensearch/index/query/IntervalFilterScript.java b/server/src/main/java/org/opensearch/index/query/IntervalFilterScript.java index 0e9ed2cc557f6..a5513e560d15f 100644 --- a/server/src/main/java/org/opensearch/index/query/IntervalFilterScript.java +++ b/server/src/main/java/org/opensearch/index/query/IntervalFilterScript.java @@ -38,6 +38,8 @@ /** * Base class for scripts used as interval filters, see {@link IntervalsSourceProvider.IntervalFilter} + * + * @opensearch.internal */ public abstract class IntervalFilterScript { diff --git a/server/src/main/java/org/opensearch/index/query/IntervalMode.java b/server/src/main/java/org/opensearch/index/query/IntervalMode.java index f0489bf452678..9e4d07aa9c943 100644 --- a/server/src/main/java/org/opensearch/index/query/IntervalMode.java +++ b/server/src/main/java/org/opensearch/index/query/IntervalMode.java @@ -15,6 +15,11 @@ import java.io.IOException; +/** + * Mode for Text and Mapped Field Types + * + * @opensearch.internal + */ public enum IntervalMode implements Writeable { ORDERED(0), UNORDERED(1), diff --git a/server/src/main/java/org/opensearch/index/query/IntervalQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/IntervalQueryBuilder.java index 13dd60d3c2a0f..fe0dc34f994a0 100644 --- a/server/src/main/java/org/opensearch/index/query/IntervalQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/IntervalQueryBuilder.java @@ -49,6 +49,8 @@ /** * Builder for {@link IntervalQuery} + * + * @opensearch.internal */ public class IntervalQueryBuilder extends AbstractQueryBuilder { diff --git a/server/src/main/java/org/opensearch/index/query/IntervalsSourceProvider.java b/server/src/main/java/org/opensearch/index/query/IntervalsSourceProvider.java index b53dfc32d7006..9409a264fa8a0 100644 --- a/server/src/main/java/org/opensearch/index/query/IntervalsSourceProvider.java +++ b/server/src/main/java/org/opensearch/index/query/IntervalsSourceProvider.java @@ -77,6 +77,8 @@ * to a proximity source (phrase, ordered, unordered, unordered without overlaps depending on how * strict the matching should be); {@link Combine}, which allows proximity queries * between different sub-sources; and {@link Disjunction}. + * + * @opensearch.internal */ public abstract class IntervalsSourceProvider implements NamedWriteable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/index/query/LegacyGeoShapeQueryProcessor.java b/server/src/main/java/org/opensearch/index/query/LegacyGeoShapeQueryProcessor.java index d16bdb8ac6327..189f42ae59020 100644 --- a/server/src/main/java/org/opensearch/index/query/LegacyGeoShapeQueryProcessor.java +++ b/server/src/main/java/org/opensearch/index/query/LegacyGeoShapeQueryProcessor.java @@ -75,6 +75,14 @@ import static org.opensearch.search.SearchService.ALLOW_EXPENSIVE_QUERIES; +/** + * Query Processor for Legacy Geo Shape types (prefix trees) + * + * @opensearch.internal + * + * @deprecated this will be removed in a future release + */ +@Deprecated public class LegacyGeoShapeQueryProcessor { private AbstractShapeGeometryFieldMapper.AbstractShapeGeometryFieldType ft; diff --git a/server/src/main/java/org/opensearch/index/query/MatchAllQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/MatchAllQueryBuilder.java index ba51ec82e4667..7192b190ffed9 100644 --- a/server/src/main/java/org/opensearch/index/query/MatchAllQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/MatchAllQueryBuilder.java @@ -45,6 +45,8 @@ /** * A query that matches on all documents. + * + * @opensearch.internal */ public class MatchAllQueryBuilder extends AbstractQueryBuilder { public static final String NAME = "match_all"; diff --git a/server/src/main/java/org/opensearch/index/query/MatchBoolPrefixQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/MatchBoolPrefixQueryBuilder.java index b6a85e2936b20..f8f84c52309d5 100644 --- a/server/src/main/java/org/opensearch/index/query/MatchBoolPrefixQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/MatchBoolPrefixQueryBuilder.java @@ -58,6 +58,8 @@ /** * The boolean prefix query analyzes the input text and creates a boolean query containing a Term query for each term, except * for the last term, which is used to create a prefix query + * + * @opensearch.internal */ public class MatchBoolPrefixQueryBuilder extends AbstractQueryBuilder { diff --git a/server/src/main/java/org/opensearch/index/query/MatchNoneQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/MatchNoneQueryBuilder.java index f71f1fac9094d..95b8569182cff 100644 --- a/server/src/main/java/org/opensearch/index/query/MatchNoneQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/MatchNoneQueryBuilder.java @@ -44,6 +44,8 @@ /** * A query that matches no document. + * + * @opensearch.internal */ public class MatchNoneQueryBuilder extends AbstractQueryBuilder { public static final String NAME = "match_none"; diff --git a/server/src/main/java/org/opensearch/index/query/MatchPhrasePrefixQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/MatchPhrasePrefixQueryBuilder.java index 3ee3c25837f37..dd727d6ffdc2b 100644 --- a/server/src/main/java/org/opensearch/index/query/MatchPhrasePrefixQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/MatchPhrasePrefixQueryBuilder.java @@ -50,6 +50,8 @@ /** * Match query is a query that analyzes the text and constructs a phrase prefix * query as the result of the analysis. + * + * @opensearch.internal */ public class MatchPhrasePrefixQueryBuilder extends AbstractQueryBuilder { public static final String NAME = "match_phrase_prefix"; diff --git a/server/src/main/java/org/opensearch/index/query/MatchPhraseQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/MatchPhraseQueryBuilder.java index 03d00841db79a..815ad5e349183 100644 --- a/server/src/main/java/org/opensearch/index/query/MatchPhraseQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/MatchPhraseQueryBuilder.java @@ -49,6 +49,8 @@ /** * Match query is a query that analyzes the text and constructs a phrase query * as the result of the analysis. + * + * @opensearch.internal */ public class MatchPhraseQueryBuilder extends AbstractQueryBuilder { public static final String NAME = "match_phrase"; diff --git a/server/src/main/java/org/opensearch/index/query/MatchQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/MatchQueryBuilder.java index 54c0f79dbac92..380e8722daca9 100644 --- a/server/src/main/java/org/opensearch/index/query/MatchQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/MatchQueryBuilder.java @@ -53,6 +53,8 @@ /** * Match query is a query that analyzes the text and constructs a query as the * result of the analysis. + * + * @opensearch.internal */ public class MatchQueryBuilder extends AbstractQueryBuilder { diff --git a/server/src/main/java/org/opensearch/index/query/MoreLikeThisQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/MoreLikeThisQueryBuilder.java index 1ecc88387e549..fe13aef627f7b 100644 --- a/server/src/main/java/org/opensearch/index/query/MoreLikeThisQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/MoreLikeThisQueryBuilder.java @@ -87,6 +87,8 @@ * A more like this query that finds documents that are "like" the provided set of document(s). * * The documents are provided as a set of strings and/or a list of {@link Item}. + * + * @opensearch.internal */ public class MoreLikeThisQueryBuilder extends AbstractQueryBuilder { public static final String NAME = "more_like_this"; diff --git a/server/src/main/java/org/opensearch/index/query/MultiMatchQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/MultiMatchQueryBuilder.java index 3a130f395539f..c3718f5520b23 100644 --- a/server/src/main/java/org/opensearch/index/query/MultiMatchQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/MultiMatchQueryBuilder.java @@ -62,6 +62,8 @@ /** * Same as {@link MatchQueryBuilder} but supports multiple fields. + * + * @opensearch.internal */ public class MultiMatchQueryBuilder extends AbstractQueryBuilder { diff --git a/server/src/main/java/org/opensearch/index/query/MultiTermQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/MultiTermQueryBuilder.java index c88e8ce5fbfb0..b8e88da4741bb 100644 --- a/server/src/main/java/org/opensearch/index/query/MultiTermQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/MultiTermQueryBuilder.java @@ -31,6 +31,11 @@ package org.opensearch.index.query; +/** + * Base interface for multi term queries + * + * @opensearch.internal + */ public interface MultiTermQueryBuilder extends QueryBuilder { /** * Get the field name for this query. diff --git a/server/src/main/java/org/opensearch/index/query/NestedQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/NestedQueryBuilder.java index 52a7635d708f5..4e491b34e7b93 100644 --- a/server/src/main/java/org/opensearch/index/query/NestedQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/NestedQueryBuilder.java @@ -74,6 +74,11 @@ import static org.opensearch.search.SearchService.ALLOW_EXPENSIVE_QUERIES; import static org.opensearch.search.fetch.subphase.InnerHitsContext.intersect; +/** + * Query builder for nested queries + * + * @opensearch.internal + */ public class NestedQueryBuilder extends AbstractQueryBuilder { public static final String NAME = "nested"; /** diff --git a/server/src/main/java/org/opensearch/index/query/Operator.java b/server/src/main/java/org/opensearch/index/query/Operator.java index 3963ca97a42d4..01fef29413484 100644 --- a/server/src/main/java/org/opensearch/index/query/Operator.java +++ b/server/src/main/java/org/opensearch/index/query/Operator.java @@ -41,6 +41,11 @@ import java.io.IOException; import java.util.Locale; +/** + * Boolean operators + * + * @opensearch.internal + */ public enum Operator implements Writeable { OR, AND; diff --git a/server/src/main/java/org/opensearch/index/query/ParsedQuery.java b/server/src/main/java/org/opensearch/index/query/ParsedQuery.java index 57ed444660686..5d9f67ac365b9 100644 --- a/server/src/main/java/org/opensearch/index/query/ParsedQuery.java +++ b/server/src/main/java/org/opensearch/index/query/ParsedQuery.java @@ -41,6 +41,8 @@ /** * The result of parsing a query. + * + * @opensearch.internal */ public class ParsedQuery { private final Query query; diff --git a/server/src/main/java/org/opensearch/index/query/PrefixQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/PrefixQueryBuilder.java index 1d2a07c99374b..46d785756b855 100644 --- a/server/src/main/java/org/opensearch/index/query/PrefixQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/PrefixQueryBuilder.java @@ -54,6 +54,8 @@ /** * A Query that matches documents containing terms with a specified prefix. + * + * @opensearch.internal */ public class PrefixQueryBuilder extends AbstractQueryBuilder implements MultiTermQueryBuilder { public static final String NAME = "prefix"; diff --git a/server/src/main/java/org/opensearch/index/query/QueryBuilder.java b/server/src/main/java/org/opensearch/index/query/QueryBuilder.java index 0ae9668192242..44720881afaa3 100644 --- a/server/src/main/java/org/opensearch/index/query/QueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/QueryBuilder.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Foundation class for all OpenSearch query builders + * + * @opensearch.internal + */ public interface QueryBuilder extends NamedWriteable, ToXContentObject, Rewriteable { /** diff --git a/server/src/main/java/org/opensearch/index/query/QueryBuilders.java b/server/src/main/java/org/opensearch/index/query/QueryBuilders.java index 7ea12fdc6406b..0a5e846bd4e94 100644 --- a/server/src/main/java/org/opensearch/index/query/QueryBuilders.java +++ b/server/src/main/java/org/opensearch/index/query/QueryBuilders.java @@ -53,6 +53,8 @@ /** * Utility class to create search queries. + * + * @opensearch.internal */ public final class QueryBuilders { diff --git a/server/src/main/java/org/opensearch/index/query/QueryParser.java b/server/src/main/java/org/opensearch/index/query/QueryParser.java index e01b2bd844282..d28858b110e8f 100644 --- a/server/src/main/java/org/opensearch/index/query/QueryParser.java +++ b/server/src/main/java/org/opensearch/index/query/QueryParser.java @@ -38,6 +38,8 @@ /** * Defines a query parser that is able to parse {@link QueryBuilder}s from {@link org.opensearch.common.xcontent.XContent}. + * + * @opensearch.internal */ @FunctionalInterface public interface QueryParser { diff --git a/server/src/main/java/org/opensearch/index/query/QueryRewriteContext.java b/server/src/main/java/org/opensearch/index/query/QueryRewriteContext.java index 720ee077119d6..8e14d2372e9c5 100644 --- a/server/src/main/java/org/opensearch/index/query/QueryRewriteContext.java +++ b/server/src/main/java/org/opensearch/index/query/QueryRewriteContext.java @@ -45,6 +45,8 @@ /** * Context object used to rewrite {@link QueryBuilder} instances into simplified version. + * + * @opensearch.internal */ public class QueryRewriteContext { private final NamedXContentRegistry xContentRegistry; diff --git a/server/src/main/java/org/opensearch/index/query/QueryShardContext.java b/server/src/main/java/org/opensearch/index/query/QueryShardContext.java index bfc0490e507db..fe2ed23b2b279 100644 --- a/server/src/main/java/org/opensearch/index/query/QueryShardContext.java +++ b/server/src/main/java/org/opensearch/index/query/QueryShardContext.java @@ -89,6 +89,8 @@ /** * Context object used to create lucene queries on the shard level. + * + * @opensearch.internal */ public class QueryShardContext extends QueryRewriteContext { diff --git a/server/src/main/java/org/opensearch/index/query/QueryShardException.java b/server/src/main/java/org/opensearch/index/query/QueryShardException.java index 4b6c6d9aa8dd5..26865db0ab042 100644 --- a/server/src/main/java/org/opensearch/index/query/QueryShardException.java +++ b/server/src/main/java/org/opensearch/index/query/QueryShardException.java @@ -42,6 +42,8 @@ /** * Exception that is thrown when creating lucene queries on the shard + * + * @opensearch.internal */ public class QueryShardException extends OpenSearchException { diff --git a/server/src/main/java/org/opensearch/index/query/QueryStringQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/QueryStringQueryBuilder.java index 7d893f54ea64c..32337f5df34c5 100644 --- a/server/src/main/java/org/opensearch/index/query/QueryStringQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/QueryStringQueryBuilder.java @@ -66,6 +66,8 @@ * will use the {@link #defaultField(String)} set. The second, when one or more fields are added * (using {@link #field(String)}), will run the parsed query against the provided fields, and combine * them using Dismax. + * + * @opensearch.internal */ public class QueryStringQueryBuilder extends AbstractQueryBuilder { diff --git a/server/src/main/java/org/opensearch/index/query/QueryValidationException.java b/server/src/main/java/org/opensearch/index/query/QueryValidationException.java index 8582ccbde4709..06680cabee0cd 100644 --- a/server/src/main/java/org/opensearch/index/query/QueryValidationException.java +++ b/server/src/main/java/org/opensearch/index/query/QueryValidationException.java @@ -38,6 +38,8 @@ /** * This exception can be used to indicate various reasons why validation of a query has failed. + * + * @opensearch.internal */ public class QueryValidationException extends ValidationException { diff --git a/server/src/main/java/org/opensearch/index/query/RangeQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/RangeQueryBuilder.java index 80b792d750546..5a3f0e80b24c9 100644 --- a/server/src/main/java/org/opensearch/index/query/RangeQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/RangeQueryBuilder.java @@ -55,6 +55,8 @@ /** * A Query that matches documents within an range of terms. + * + * @opensearch.internal */ public class RangeQueryBuilder extends AbstractQueryBuilder implements MultiTermQueryBuilder { public static final String NAME = "range"; diff --git a/server/src/main/java/org/opensearch/index/query/RegexpFlag.java b/server/src/main/java/org/opensearch/index/query/RegexpFlag.java index b1ee70a22bb17..926e00450a0c2 100644 --- a/server/src/main/java/org/opensearch/index/query/RegexpFlag.java +++ b/server/src/main/java/org/opensearch/index/query/RegexpFlag.java @@ -50,6 +50,8 @@ * * @see RegexpQueryBuilder#flags(RegexpFlag...) * @see RegexpQueryBuilder#flags(RegexpFlag...) + * + * @opensearch.internal */ public enum RegexpFlag { diff --git a/server/src/main/java/org/opensearch/index/query/RegexpQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/RegexpQueryBuilder.java index c8192557ef266..2c45cb179b227 100644 --- a/server/src/main/java/org/opensearch/index/query/RegexpQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/RegexpQueryBuilder.java @@ -57,6 +57,8 @@ /** * A Query that does fuzzy matching for a specific value. + * + * @opensearch.internal */ public class RegexpQueryBuilder extends AbstractQueryBuilder implements MultiTermQueryBuilder { public static final String NAME = "regexp"; diff --git a/server/src/main/java/org/opensearch/index/query/Rewriteable.java b/server/src/main/java/org/opensearch/index/query/Rewriteable.java index 826c6e71796c6..dd148bf98ea48 100644 --- a/server/src/main/java/org/opensearch/index/query/Rewriteable.java +++ b/server/src/main/java/org/opensearch/index/query/Rewriteable.java @@ -40,6 +40,8 @@ /** * A basic interface for rewriteable classes. + * + * @opensearch.internal */ public interface Rewriteable { diff --git a/server/src/main/java/org/opensearch/index/query/ScriptQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/ScriptQueryBuilder.java index 1d781060dc6bc..b4e6a6d9a9cdd 100644 --- a/server/src/main/java/org/opensearch/index/query/ScriptQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/ScriptQueryBuilder.java @@ -59,6 +59,11 @@ import static org.opensearch.search.SearchService.ALLOW_EXPENSIVE_QUERIES; +/** + * Query builder for script queries + * + * @opensearch.internal + */ public class ScriptQueryBuilder extends AbstractQueryBuilder { public static final String NAME = "script"; diff --git a/server/src/main/java/org/opensearch/index/query/SearchIndexNameMatcher.java b/server/src/main/java/org/opensearch/index/query/SearchIndexNameMatcher.java index 8d4d06d65c412..00758309fc0f0 100644 --- a/server/src/main/java/org/opensearch/index/query/SearchIndexNameMatcher.java +++ b/server/src/main/java/org/opensearch/index/query/SearchIndexNameMatcher.java @@ -42,6 +42,8 @@ /** * A predicate that checks whether an index pattern matches the current search shard target. + * + * @opensearch.internal */ public class SearchIndexNameMatcher implements Predicate { private final String indexName; diff --git a/server/src/main/java/org/opensearch/index/query/SimpleQueryStringBuilder.java b/server/src/main/java/org/opensearch/index/query/SimpleQueryStringBuilder.java index 0de30e42eb4d0..30b9fb35d72ed 100644 --- a/server/src/main/java/org/opensearch/index/query/SimpleQueryStringBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/SimpleQueryStringBuilder.java @@ -86,6 +86,7 @@ * {@code fields} - fields to search, defaults to _all if not set, allows * boosting a field with ^n * + * @opensearch.internal */ public class SimpleQueryStringBuilder extends AbstractQueryBuilder { diff --git a/server/src/main/java/org/opensearch/index/query/SimpleQueryStringFlag.java b/server/src/main/java/org/opensearch/index/query/SimpleQueryStringFlag.java index d6dc6cc1e4462..500e41dc6f73f 100644 --- a/server/src/main/java/org/opensearch/index/query/SimpleQueryStringFlag.java +++ b/server/src/main/java/org/opensearch/index/query/SimpleQueryStringFlag.java @@ -38,6 +38,8 @@ /** * Flags for the XSimpleQueryString parser + * + * @opensearch.internal */ public enum SimpleQueryStringFlag { ALL(-1), diff --git a/server/src/main/java/org/opensearch/index/query/SpanContainingQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/SpanContainingQueryBuilder.java index 9168f7a29f2dc..12a6cfb237f2f 100644 --- a/server/src/main/java/org/opensearch/index/query/SpanContainingQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/SpanContainingQueryBuilder.java @@ -49,6 +49,8 @@ /** * Builder for {@link org.apache.lucene.queries.spans.SpanContainingQuery}. + * + * @opensearch.internal */ public class SpanContainingQueryBuilder extends AbstractQueryBuilder implements SpanQueryBuilder { public static final String NAME = "span_containing"; diff --git a/server/src/main/java/org/opensearch/index/query/SpanFirstQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/SpanFirstQueryBuilder.java index e3d6315b5d18c..4754b05d9a74f 100644 --- a/server/src/main/java/org/opensearch/index/query/SpanFirstQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/SpanFirstQueryBuilder.java @@ -47,6 +47,11 @@ import static org.opensearch.index.query.SpanQueryBuilder.SpanQueryBuilderUtil.checkNoBoost; +/** + * Query builder for span_first queries + * + * @opensearch.internal + */ public class SpanFirstQueryBuilder extends AbstractQueryBuilder implements SpanQueryBuilder { public static final String NAME = "span_first"; diff --git a/server/src/main/java/org/opensearch/index/query/SpanMultiTermQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/SpanMultiTermQueryBuilder.java index 9411ba9c59087..b067d974393ef 100644 --- a/server/src/main/java/org/opensearch/index/query/SpanMultiTermQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/SpanMultiTermQueryBuilder.java @@ -56,6 +56,8 @@ /** * Query that allows wrapping a {@link MultiTermQueryBuilder} (one of wildcard, fuzzy, prefix, term, range or regexp query) * as a {@link SpanQueryBuilder} so it can be nested. + * + * @opensearch.internal */ public class SpanMultiTermQueryBuilder extends AbstractQueryBuilder implements SpanQueryBuilder { diff --git a/server/src/main/java/org/opensearch/index/query/SpanNearQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/SpanNearQueryBuilder.java index a648eedc9f3b5..ccc0b8f9dbde7 100644 --- a/server/src/main/java/org/opensearch/index/query/SpanNearQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/SpanNearQueryBuilder.java @@ -57,6 +57,8 @@ * Matches spans which are near one another. One can specify slop, the maximum number * of intervening unmatched positions, as well as whether matches are required to be in-order. * The span near query maps to Lucene {@link SpanNearQuery}. + * + * @opensearch.internal */ public class SpanNearQueryBuilder extends AbstractQueryBuilder implements SpanQueryBuilder { public static final String NAME = "span_near"; diff --git a/server/src/main/java/org/opensearch/index/query/SpanNotQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/SpanNotQueryBuilder.java index c43430e00de98..f55a85f7ccda7 100644 --- a/server/src/main/java/org/opensearch/index/query/SpanNotQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/SpanNotQueryBuilder.java @@ -47,6 +47,11 @@ import static org.opensearch.index.query.SpanQueryBuilder.SpanQueryBuilderUtil.checkNoBoost; +/** + * Query builder for span_not queries + * + * @opensearch.internal + */ public class SpanNotQueryBuilder extends AbstractQueryBuilder implements SpanQueryBuilder { public static final String NAME = "span_not"; diff --git a/server/src/main/java/org/opensearch/index/query/SpanOrQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/SpanOrQueryBuilder.java index 0a08f778cf889..c85631bff2061 100644 --- a/server/src/main/java/org/opensearch/index/query/SpanOrQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/SpanOrQueryBuilder.java @@ -52,6 +52,8 @@ /** * Span query that matches the union of its clauses. Maps to {@link SpanOrQuery}. + * + * @opensearch.internal */ public class SpanOrQueryBuilder extends AbstractQueryBuilder implements SpanQueryBuilder { public static final String NAME = "span_or"; diff --git a/server/src/main/java/org/opensearch/index/query/SpanQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/SpanQueryBuilder.java index ba2adadc7a77c..29aa4cfbcc6ce 100644 --- a/server/src/main/java/org/opensearch/index/query/SpanQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/SpanQueryBuilder.java @@ -37,6 +37,8 @@ /** * Marker interface for a specific type of {@link QueryBuilder} that allows to build span queries. + * + * @opensearch.internal */ public interface SpanQueryBuilder extends QueryBuilder { diff --git a/server/src/main/java/org/opensearch/index/query/SpanTermQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/SpanTermQueryBuilder.java index 02a0f55685ca4..e1fafc358c248 100644 --- a/server/src/main/java/org/opensearch/index/query/SpanTermQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/SpanTermQueryBuilder.java @@ -48,6 +48,8 @@ /** * A Span Query that matches documents containing a term. * @see SpanTermQuery + * + * @opensearch.internal */ public class SpanTermQueryBuilder extends BaseTermQueryBuilder implements SpanQueryBuilder { public static final String NAME = "span_term"; diff --git a/server/src/main/java/org/opensearch/index/query/SpanWithinQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/SpanWithinQueryBuilder.java index a8ab2a8831f55..c7eab888e5c2a 100644 --- a/server/src/main/java/org/opensearch/index/query/SpanWithinQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/SpanWithinQueryBuilder.java @@ -49,6 +49,8 @@ /** * Builder for {@link org.apache.lucene.queries.spans.SpanWithinQuery}. + * + * @opensearch.internal */ public class SpanWithinQueryBuilder extends AbstractQueryBuilder implements SpanQueryBuilder { public static final String NAME = "span_within"; diff --git a/server/src/main/java/org/opensearch/index/query/TermQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/TermQueryBuilder.java index a600e8284e395..a611b3c77f595 100644 --- a/server/src/main/java/org/opensearch/index/query/TermQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/TermQueryBuilder.java @@ -50,6 +50,8 @@ /** * A Query that matches documents containing a term. + * + * @opensearch.internal */ public class TermQueryBuilder extends BaseTermQueryBuilder { public static final String NAME = "term"; diff --git a/server/src/main/java/org/opensearch/index/query/TermsQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/TermsQueryBuilder.java index ac29cb2cf5201..28f98f7060395 100644 --- a/server/src/main/java/org/opensearch/index/query/TermsQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/TermsQueryBuilder.java @@ -71,6 +71,8 @@ /** * A filter for a field based on several terms matching on any of them. + * + * @opensearch.internal */ public class TermsQueryBuilder extends AbstractQueryBuilder { public static final String NAME = "terms"; diff --git a/server/src/main/java/org/opensearch/index/query/TermsSetQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/TermsSetQueryBuilder.java index f7dd146f9f019..6bb42f8ff5d39 100644 --- a/server/src/main/java/org/opensearch/index/query/TermsSetQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/TermsSetQueryBuilder.java @@ -62,6 +62,11 @@ import java.util.Map; import java.util.Objects; +/** + * Query builder for terms_set queries + * + * @opensearch.internal + */ public final class TermsSetQueryBuilder extends AbstractQueryBuilder { public static final String NAME = "terms_set"; diff --git a/server/src/main/java/org/opensearch/index/query/VectorGeoPointShapeQueryProcessor.java b/server/src/main/java/org/opensearch/index/query/VectorGeoPointShapeQueryProcessor.java index 08ba3dc1fe8fa..eb7923a5b5212 100644 --- a/server/src/main/java/org/opensearch/index/query/VectorGeoPointShapeQueryProcessor.java +++ b/server/src/main/java/org/opensearch/index/query/VectorGeoPointShapeQueryProcessor.java @@ -59,6 +59,11 @@ import java.util.ArrayList; +/** + * Query processor for lucene 6 LatLonPoint queries + * + * @opensearch.internal + */ public class VectorGeoPointShapeQueryProcessor { public Query geoShapeQuery(Geometry shape, String fieldName, ShapeRelation relation, QueryShardContext context) { diff --git a/server/src/main/java/org/opensearch/index/query/VectorGeoShapeQueryProcessor.java b/server/src/main/java/org/opensearch/index/query/VectorGeoShapeQueryProcessor.java index 16a2968a2e7b2..47766c6c8521e 100644 --- a/server/src/main/java/org/opensearch/index/query/VectorGeoShapeQueryProcessor.java +++ b/server/src/main/java/org/opensearch/index/query/VectorGeoShapeQueryProcessor.java @@ -58,6 +58,11 @@ import java.util.ArrayList; import java.util.List; +/** + * Query processor for Lucene 6 LatLonShape queries + * + * @opensearch.internal + */ public class VectorGeoShapeQueryProcessor { public Query geoShapeQuery(Geometry shape, String fieldName, ShapeRelation relation, QueryShardContext context) { diff --git a/server/src/main/java/org/opensearch/index/query/WildcardQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/WildcardQueryBuilder.java index 9dab290b8bd3e..e8c226303e44d 100644 --- a/server/src/main/java/org/opensearch/index/query/WildcardQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/WildcardQueryBuilder.java @@ -59,6 +59,8 @@ * needs to iterate over many terms. In order to prevent extremely slow WildcardQueries, * a Wildcard term should not start with one of the wildcards {@code *} or * {@code ?}. + * + * @opensearch.internal */ public class WildcardQueryBuilder extends AbstractQueryBuilder implements MultiTermQueryBuilder { public static final String NAME = "wildcard"; diff --git a/server/src/main/java/org/opensearch/index/query/WrapperQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/WrapperQueryBuilder.java index 81c8e14f50912..6933c961fdbcb 100644 --- a/server/src/main/java/org/opensearch/index/query/WrapperQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/WrapperQueryBuilder.java @@ -62,6 +62,8 @@ * bool.must(new TermQueryBuilder("field2","value2")); * * + * + * @opensearch.internal */ public class WrapperQueryBuilder extends AbstractQueryBuilder { public static final String NAME = "wrapper"; diff --git a/server/src/main/java/org/opensearch/index/query/functionscore/DecayFunction.java b/server/src/main/java/org/opensearch/index/query/functionscore/DecayFunction.java index 02d01ef470b61..5d0e05c1cdf30 100644 --- a/server/src/main/java/org/opensearch/index/query/functionscore/DecayFunction.java +++ b/server/src/main/java/org/opensearch/index/query/functionscore/DecayFunction.java @@ -41,6 +41,7 @@ * function or something of the kind. This is used, for example, by * {@link GaussDecayFunctionBuilder}. * + * @opensearch.internal */ public interface DecayFunction { diff --git a/server/src/main/java/org/opensearch/index/query/functionscore/DecayFunctionBuilder.java b/server/src/main/java/org/opensearch/index/query/functionscore/DecayFunctionBuilder.java index 0ee61b34cd279..b90462baed612 100644 --- a/server/src/main/java/org/opensearch/index/query/functionscore/DecayFunctionBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/functionscore/DecayFunctionBuilder.java @@ -72,6 +72,11 @@ import java.io.InputStream; import java.util.Objects; +/** + * Foundation builder for a decay function + * + * @opensearch.internal + */ public abstract class DecayFunctionBuilder> extends ScoreFunctionBuilder { protected static final String ORIGIN = "origin"; diff --git a/server/src/main/java/org/opensearch/index/query/functionscore/DecayFunctionParser.java b/server/src/main/java/org/opensearch/index/query/functionscore/DecayFunctionParser.java index c4ae707ba9212..bc1dc79694681 100644 --- a/server/src/main/java/org/opensearch/index/query/functionscore/DecayFunctionParser.java +++ b/server/src/main/java/org/opensearch/index/query/functionscore/DecayFunctionParser.java @@ -79,6 +79,8 @@ * {@link DecayFunctionBuilder}, setup a PARSER field with this class, and * register them in {@link SearchModule#registerScoreFunctions} or {@link SearchPlugin#getScoreFunctions} * See {@link GaussDecayFunctionBuilder#PARSER} for an example. + * + * @opensearch.internal */ public final class DecayFunctionParser> implements ScoreFunctionParser { diff --git a/server/src/main/java/org/opensearch/index/query/functionscore/ExponentialDecayFunctionBuilder.java b/server/src/main/java/org/opensearch/index/query/functionscore/ExponentialDecayFunctionBuilder.java index b78e75762fe11..96754466bb0e1 100644 --- a/server/src/main/java/org/opensearch/index/query/functionscore/ExponentialDecayFunctionBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/functionscore/ExponentialDecayFunctionBuilder.java @@ -40,6 +40,11 @@ import java.io.IOException; +/** + * Foundation builder for an exponential decay + * + * @opensearch.internal + */ public class ExponentialDecayFunctionBuilder extends DecayFunctionBuilder { public static final String NAME = "exp"; public static final ScoreFunctionParser PARSER = new DecayFunctionParser<>( diff --git a/server/src/main/java/org/opensearch/index/query/functionscore/FieldValueFactorFunctionBuilder.java b/server/src/main/java/org/opensearch/index/query/functionscore/FieldValueFactorFunctionBuilder.java index 39f12409267ab..f89032f87afec 100644 --- a/server/src/main/java/org/opensearch/index/query/functionscore/FieldValueFactorFunctionBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/functionscore/FieldValueFactorFunctionBuilder.java @@ -52,6 +52,8 @@ /** * Builder to construct {@code field_value_factor} functions for a function * score query. + * + * @opensearch.internal */ public class FieldValueFactorFunctionBuilder extends ScoreFunctionBuilder { public static final String NAME = "field_value_factor"; diff --git a/server/src/main/java/org/opensearch/index/query/functionscore/FunctionScoreQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/functionscore/FunctionScoreQueryBuilder.java index f9484e6c94ea7..9f39b8f74d819 100644 --- a/server/src/main/java/org/opensearch/index/query/functionscore/FunctionScoreQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/functionscore/FunctionScoreQueryBuilder.java @@ -66,6 +66,8 @@ /** * A query that uses a filters with a script associated with them to compute the * score. + * + * @opensearch.internal */ public class FunctionScoreQueryBuilder extends AbstractQueryBuilder { public static final String NAME = "function_score"; diff --git a/server/src/main/java/org/opensearch/index/query/functionscore/GaussDecayFunctionBuilder.java b/server/src/main/java/org/opensearch/index/query/functionscore/GaussDecayFunctionBuilder.java index ac6ae33cb4ed0..b3e42292addeb 100644 --- a/server/src/main/java/org/opensearch/index/query/functionscore/GaussDecayFunctionBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/functionscore/GaussDecayFunctionBuilder.java @@ -41,6 +41,11 @@ import java.io.IOException; +/** + * Foundation builder for a gaussian decay + * + * @opensearch.internal + */ public class GaussDecayFunctionBuilder extends DecayFunctionBuilder { public static final String NAME = "gauss"; public static final ParseField FUNCTION_NAME_FIELD = new ParseField(NAME); diff --git a/server/src/main/java/org/opensearch/index/query/functionscore/LinearDecayFunctionBuilder.java b/server/src/main/java/org/opensearch/index/query/functionscore/LinearDecayFunctionBuilder.java index 03102e45a41ba..b3b948677756a 100644 --- a/server/src/main/java/org/opensearch/index/query/functionscore/LinearDecayFunctionBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/functionscore/LinearDecayFunctionBuilder.java @@ -40,6 +40,11 @@ import java.io.IOException; +/** + * Foundation builder for a linear decay + * + * @opensearch.internal + */ public class LinearDecayFunctionBuilder extends DecayFunctionBuilder { public static final String NAME = "linear"; public static final ScoreFunctionParser PARSER = new DecayFunctionParser<>(LinearDecayFunctionBuilder::new); diff --git a/server/src/main/java/org/opensearch/index/query/functionscore/RandomScoreFunctionBuilder.java b/server/src/main/java/org/opensearch/index/query/functionscore/RandomScoreFunctionBuilder.java index 26495c93082ae..9e65b1703ba8a 100644 --- a/server/src/main/java/org/opensearch/index/query/functionscore/RandomScoreFunctionBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/functionscore/RandomScoreFunctionBuilder.java @@ -49,6 +49,8 @@ /** * A function that computes a random score for the matched documents + * + * @opensearch.internal */ public class RandomScoreFunctionBuilder extends ScoreFunctionBuilder { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RandomScoreFunctionBuilder.class); diff --git a/server/src/main/java/org/opensearch/index/query/functionscore/ScoreFunctionBuilder.java b/server/src/main/java/org/opensearch/index/query/functionscore/ScoreFunctionBuilder.java index 4987f260bc9b4..564a4a9de0f19 100644 --- a/server/src/main/java/org/opensearch/index/query/functionscore/ScoreFunctionBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/functionscore/ScoreFunctionBuilder.java @@ -45,6 +45,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Foundation builder for a score function + * + * @opensearch.internal + */ public abstract class ScoreFunctionBuilder> implements ToXContentFragment, NamedWriteable { private Float weight; diff --git a/server/src/main/java/org/opensearch/index/query/functionscore/ScoreFunctionBuilders.java b/server/src/main/java/org/opensearch/index/query/functionscore/ScoreFunctionBuilders.java index 59d02e9381d7e..db35752cd5ee7 100644 --- a/server/src/main/java/org/opensearch/index/query/functionscore/ScoreFunctionBuilders.java +++ b/server/src/main/java/org/opensearch/index/query/functionscore/ScoreFunctionBuilders.java @@ -40,6 +40,8 @@ /** * Static method aliases for constructors of known {@link ScoreFunctionBuilder}s. + * + * @opensearch.internal */ public class ScoreFunctionBuilders { diff --git a/server/src/main/java/org/opensearch/index/query/functionscore/ScoreFunctionParser.java b/server/src/main/java/org/opensearch/index/query/functionscore/ScoreFunctionParser.java index e5720b94e71fa..e4674dea7bdf2 100644 --- a/server/src/main/java/org/opensearch/index/query/functionscore/ScoreFunctionParser.java +++ b/server/src/main/java/org/opensearch/index/query/functionscore/ScoreFunctionParser.java @@ -38,6 +38,8 @@ /** * Parses XContent into a {@link ScoreFunctionBuilder}. + * + * @opensearch.internal */ @FunctionalInterface public interface ScoreFunctionParser> { diff --git a/server/src/main/java/org/opensearch/index/query/functionscore/ScriptScoreFunctionBuilder.java b/server/src/main/java/org/opensearch/index/query/functionscore/ScriptScoreFunctionBuilder.java index 2701e5867edde..15ce6a3423157 100644 --- a/server/src/main/java/org/opensearch/index/query/functionscore/ScriptScoreFunctionBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/functionscore/ScriptScoreFunctionBuilder.java @@ -51,6 +51,8 @@ /** * A function that uses a script to compute or influence the score of documents * that match with the inner query or filter. + * + * @opensearch.internal */ public class ScriptScoreFunctionBuilder extends ScoreFunctionBuilder { public static final String NAME = "script_score"; diff --git a/server/src/main/java/org/opensearch/index/query/functionscore/ScriptScoreQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/functionscore/ScriptScoreQueryBuilder.java index e2a1f2fb1f5aa..9605ba424bfb0 100644 --- a/server/src/main/java/org/opensearch/index/query/functionscore/ScriptScoreQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/functionscore/ScriptScoreQueryBuilder.java @@ -61,6 +61,8 @@ /** * A query that computes a document score based on the provided script + * + * @opensearch.internal */ public class ScriptScoreQueryBuilder extends AbstractQueryBuilder { diff --git a/server/src/main/java/org/opensearch/index/query/functionscore/WeightBuilder.java b/server/src/main/java/org/opensearch/index/query/functionscore/WeightBuilder.java index 333a6a3c6ee1c..71f66b0909b44 100644 --- a/server/src/main/java/org/opensearch/index/query/functionscore/WeightBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/functionscore/WeightBuilder.java @@ -43,6 +43,8 @@ /** * A query that multiplies the weight to the score. + * + * @opensearch.internal */ public class WeightBuilder extends ScoreFunctionBuilder { public static final String NAME = "weight"; diff --git a/server/src/main/java/org/opensearch/index/query/support/NestedScope.java b/server/src/main/java/org/opensearch/index/query/support/NestedScope.java index 150498191dfbe..4a09b11666c18 100644 --- a/server/src/main/java/org/opensearch/index/query/support/NestedScope.java +++ b/server/src/main/java/org/opensearch/index/query/support/NestedScope.java @@ -39,6 +39,8 @@ /** * During query parsing this keeps track of the current nested level. + * + * @opensearch.internal */ public final class NestedScope { diff --git a/server/src/main/java/org/opensearch/index/query/support/QueryParsers.java b/server/src/main/java/org/opensearch/index/query/support/QueryParsers.java index 851b334fc10b4..fd5a846060eaa 100644 --- a/server/src/main/java/org/opensearch/index/query/support/QueryParsers.java +++ b/server/src/main/java/org/opensearch/index/query/support/QueryParsers.java @@ -37,6 +37,11 @@ import org.opensearch.common.ParseField; import org.opensearch.common.xcontent.DeprecationHandler; +/** + * Utility class for Query Parsers + * + * @opensearch.internal + */ public final class QueryParsers { public static final ParseField CONSTANT_SCORE = new ParseField("constant_score"); diff --git a/server/src/main/java/org/opensearch/index/recovery/RecoveryStats.java b/server/src/main/java/org/opensearch/index/recovery/RecoveryStats.java index 4be13f3eacc5e..14d8fa6f70939 100644 --- a/server/src/main/java/org/opensearch/index/recovery/RecoveryStats.java +++ b/server/src/main/java/org/opensearch/index/recovery/RecoveryStats.java @@ -45,6 +45,8 @@ /** * Recovery related statistics, starting at the shard level and allowing aggregation to * indices and node level + * + * @opensearch.internal */ public class RecoveryStats implements ToXContentFragment, Writeable { diff --git a/server/src/main/java/org/opensearch/index/refresh/RefreshStats.java b/server/src/main/java/org/opensearch/index/refresh/RefreshStats.java index f673ab8ae03d4..8a54e5105c61e 100644 --- a/server/src/main/java/org/opensearch/index/refresh/RefreshStats.java +++ b/server/src/main/java/org/opensearch/index/refresh/RefreshStats.java @@ -43,6 +43,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Encapsulates stats for index refresh + * + * @opensearch.internal + */ public class RefreshStats implements Writeable, ToXContentFragment { private long total; diff --git a/server/src/main/java/org/opensearch/index/reindex/AbstractBulkByScrollRequest.java b/server/src/main/java/org/opensearch/index/reindex/AbstractBulkByScrollRequest.java index 0de9a50dd1e8d..46883f8b274f2 100644 --- a/server/src/main/java/org/opensearch/index/reindex/AbstractBulkByScrollRequest.java +++ b/server/src/main/java/org/opensearch/index/reindex/AbstractBulkByScrollRequest.java @@ -53,6 +53,11 @@ import static org.opensearch.common.unit.TimeValue.timeValueMillis; import static org.opensearch.common.unit.TimeValue.timeValueMinutes; +/** + * Base class for requesting bulk by scrolls + * + * @opensearch.internal + */ public abstract class AbstractBulkByScrollRequest> extends ActionRequest { public static final int MAX_DOCS_ALL_MATCHES = -1; diff --git a/server/src/main/java/org/opensearch/index/reindex/AbstractBulkByScrollRequestBuilder.java b/server/src/main/java/org/opensearch/index/reindex/AbstractBulkByScrollRequestBuilder.java index bb729a4e8e2cb..c32e31802ac35 100644 --- a/server/src/main/java/org/opensearch/index/reindex/AbstractBulkByScrollRequestBuilder.java +++ b/server/src/main/java/org/opensearch/index/reindex/AbstractBulkByScrollRequestBuilder.java @@ -41,6 +41,11 @@ import org.opensearch.common.unit.TimeValue; import org.opensearch.index.query.QueryBuilder; +/** + * Base builder for bulk by scroll requests + * + * @opensearch.internal + */ public abstract class AbstractBulkByScrollRequestBuilder< Request extends AbstractBulkByScrollRequest, Self extends AbstractBulkByScrollRequestBuilder> extends ActionRequestBuilder { diff --git a/server/src/main/java/org/opensearch/index/reindex/AbstractBulkIndexByScrollRequest.java b/server/src/main/java/org/opensearch/index/reindex/AbstractBulkIndexByScrollRequest.java index 27c655ee11087..f98ca036bd263 100644 --- a/server/src/main/java/org/opensearch/index/reindex/AbstractBulkIndexByScrollRequest.java +++ b/server/src/main/java/org/opensearch/index/reindex/AbstractBulkIndexByScrollRequest.java @@ -41,6 +41,11 @@ import java.io.IOException; +/** + * Base request class for bulk indexing by scroll + * + * @opensearch.internal + */ public abstract class AbstractBulkIndexByScrollRequest> extends AbstractBulkByScrollRequest { /** diff --git a/server/src/main/java/org/opensearch/index/reindex/AbstractBulkIndexByScrollRequestBuilder.java b/server/src/main/java/org/opensearch/index/reindex/AbstractBulkIndexByScrollRequestBuilder.java index f26d54d3e2265..2dda25b52f6be 100644 --- a/server/src/main/java/org/opensearch/index/reindex/AbstractBulkIndexByScrollRequestBuilder.java +++ b/server/src/main/java/org/opensearch/index/reindex/AbstractBulkIndexByScrollRequestBuilder.java @@ -37,6 +37,11 @@ import org.opensearch.client.OpenSearchClient; import org.opensearch.script.Script; +/** + * Base builder class for bulk index by scrolls + * + * @opensearch.internal + */ public abstract class AbstractBulkIndexByScrollRequestBuilder< Request extends AbstractBulkIndexByScrollRequest, Self extends AbstractBulkIndexByScrollRequestBuilder> extends AbstractBulkByScrollRequestBuilder { diff --git a/server/src/main/java/org/opensearch/index/reindex/BulkByScrollResponse.java b/server/src/main/java/org/opensearch/index/reindex/BulkByScrollResponse.java index 6a4b55f5877e7..b2b123136baf3 100644 --- a/server/src/main/java/org/opensearch/index/reindex/BulkByScrollResponse.java +++ b/server/src/main/java/org/opensearch/index/reindex/BulkByScrollResponse.java @@ -62,6 +62,8 @@ /** * Response used for actions that index many documents using a scroll request. + * + * @opensearch.internal */ public class BulkByScrollResponse extends ActionResponse implements ToXContentFragment { private TimeValue took; diff --git a/server/src/main/java/org/opensearch/index/reindex/BulkByScrollResponseBuilder.java b/server/src/main/java/org/opensearch/index/reindex/BulkByScrollResponseBuilder.java index db8d85ac5c8d9..8d51c27c02dd9 100644 --- a/server/src/main/java/org/opensearch/index/reindex/BulkByScrollResponseBuilder.java +++ b/server/src/main/java/org/opensearch/index/reindex/BulkByScrollResponseBuilder.java @@ -44,6 +44,8 @@ /** * Helps build a {@link BulkByScrollResponse}. Used by an instance of {@link ObjectParser} when parsing from XContent. + * + * @opensearch.internal */ class BulkByScrollResponseBuilder extends StatusBuilder { private TimeValue took; diff --git a/server/src/main/java/org/opensearch/index/reindex/BulkByScrollTask.java b/server/src/main/java/org/opensearch/index/reindex/BulkByScrollTask.java index e792adb9a32f9..7751b2d848535 100644 --- a/server/src/main/java/org/opensearch/index/reindex/BulkByScrollTask.java +++ b/server/src/main/java/org/opensearch/index/reindex/BulkByScrollTask.java @@ -82,6 +82,8 @@ * We don't always know if this task will be a leader or worker task when it's created, because if slices is set to "auto" it may * be either depending on the number of shards in the source indices. We figure that out when the request is handled and set it on this * class with {@link #setWorkerCount(int)} or {@link #setWorker(float, Integer)}. + * + * @opensearch.internal */ public class BulkByScrollTask extends CancellableTask { diff --git a/server/src/main/java/org/opensearch/index/reindex/ClientScrollableHitSource.java b/server/src/main/java/org/opensearch/index/reindex/ClientScrollableHitSource.java index 6a78d16d3b385..82008746f06f8 100644 --- a/server/src/main/java/org/opensearch/index/reindex/ClientScrollableHitSource.java +++ b/server/src/main/java/org/opensearch/index/reindex/ClientScrollableHitSource.java @@ -66,6 +66,8 @@ /** * A scrollable source of hits from a {@linkplain Client} instance. + * + * @opensearch.internal */ public class ClientScrollableHitSource extends ScrollableHitSource { private final ParentTaskAssigningClient client; diff --git a/server/src/main/java/org/opensearch/index/reindex/DeleteByQueryAction.java b/server/src/main/java/org/opensearch/index/reindex/DeleteByQueryAction.java index eda40576b7190..5292c793e9c3c 100644 --- a/server/src/main/java/org/opensearch/index/reindex/DeleteByQueryAction.java +++ b/server/src/main/java/org/opensearch/index/reindex/DeleteByQueryAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Action type for delete by query + * + * @opensearch.internal + */ public class DeleteByQueryAction extends ActionType { public static final DeleteByQueryAction INSTANCE = new DeleteByQueryAction(); diff --git a/server/src/main/java/org/opensearch/index/reindex/DeleteByQueryRequest.java b/server/src/main/java/org/opensearch/index/reindex/DeleteByQueryRequest.java index 4f297b89c0651..bfc9ea00cea38 100644 --- a/server/src/main/java/org/opensearch/index/reindex/DeleteByQueryRequest.java +++ b/server/src/main/java/org/opensearch/index/reindex/DeleteByQueryRequest.java @@ -62,6 +62,8 @@ * stored in the transaction logs that might not be supported in the future. *

  • it's results won't be visible until the index is refreshed.
  • * + * + * @opensearch.internal */ public class DeleteByQueryRequest extends AbstractBulkByScrollRequest implements diff --git a/server/src/main/java/org/opensearch/index/reindex/DeleteByQueryRequestBuilder.java b/server/src/main/java/org/opensearch/index/reindex/DeleteByQueryRequestBuilder.java index a508536245e9b..bfc0a1b77c580 100644 --- a/server/src/main/java/org/opensearch/index/reindex/DeleteByQueryRequestBuilder.java +++ b/server/src/main/java/org/opensearch/index/reindex/DeleteByQueryRequestBuilder.java @@ -37,6 +37,11 @@ import org.opensearch.action.search.SearchRequestBuilder; import org.opensearch.client.OpenSearchClient; +/** + * Builder for delete by query + * + * @opensearch.internal + */ public class DeleteByQueryRequestBuilder extends AbstractBulkByScrollRequestBuilder { public DeleteByQueryRequestBuilder(OpenSearchClient client, ActionType action) { diff --git a/server/src/main/java/org/opensearch/index/reindex/LeaderBulkByScrollTaskState.java b/server/src/main/java/org/opensearch/index/reindex/LeaderBulkByScrollTaskState.java index 1edc48c3b0d90..bef696fe18ed4 100644 --- a/server/src/main/java/org/opensearch/index/reindex/LeaderBulkByScrollTaskState.java +++ b/server/src/main/java/org/opensearch/index/reindex/LeaderBulkByScrollTaskState.java @@ -44,6 +44,8 @@ /** * Tracks the state of sliced subtasks and provides unified status information for a sliced BulkByScrollRequest. + * + * @opensearch.internal */ public class LeaderBulkByScrollTaskState { diff --git a/server/src/main/java/org/opensearch/index/reindex/ReindexAction.java b/server/src/main/java/org/opensearch/index/reindex/ReindexAction.java index 6888cd1262579..e4695b34af497 100644 --- a/server/src/main/java/org/opensearch/index/reindex/ReindexAction.java +++ b/server/src/main/java/org/opensearch/index/reindex/ReindexAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Action type for reindex requests + * + * @opensearch.internal + */ public class ReindexAction extends ActionType { public static final ReindexAction INSTANCE = new ReindexAction(); public static final String NAME = "indices:data/write/reindex"; diff --git a/server/src/main/java/org/opensearch/index/reindex/ReindexRequest.java b/server/src/main/java/org/opensearch/index/reindex/ReindexRequest.java index 5858b4b8108d2..b444757b85951 100644 --- a/server/src/main/java/org/opensearch/index/reindex/ReindexRequest.java +++ b/server/src/main/java/org/opensearch/index/reindex/ReindexRequest.java @@ -73,6 +73,8 @@ * returning all the subrequests that it will make it tries to return a representative set of subrequests. This is best-effort for a bunch * of reasons, not least of which that scripts are allowed to change the destination request in drastic ways, including changing the index * to which documents are written. + * + * @opensearch.internal */ public class ReindexRequest extends AbstractBulkIndexByScrollRequest implements CompositeIndicesRequest, ToXContentObject { /** diff --git a/server/src/main/java/org/opensearch/index/reindex/ReindexRequestBuilder.java b/server/src/main/java/org/opensearch/index/reindex/ReindexRequestBuilder.java index 291acd1e8ad8d..c59b5885c25be 100644 --- a/server/src/main/java/org/opensearch/index/reindex/ReindexRequestBuilder.java +++ b/server/src/main/java/org/opensearch/index/reindex/ReindexRequestBuilder.java @@ -39,6 +39,11 @@ import org.opensearch.action.search.SearchRequestBuilder; import org.opensearch.client.OpenSearchClient; +/** + * Builder for reindex requests + * + * @opensearch.internal + */ public class ReindexRequestBuilder extends AbstractBulkIndexByScrollRequestBuilder { private final IndexRequestBuilder destination; diff --git a/server/src/main/java/org/opensearch/index/reindex/RejectAwareActionListener.java b/server/src/main/java/org/opensearch/index/reindex/RejectAwareActionListener.java index 1e5f10ce30915..da3afb178300e 100644 --- a/server/src/main/java/org/opensearch/index/reindex/RejectAwareActionListener.java +++ b/server/src/main/java/org/opensearch/index/reindex/RejectAwareActionListener.java @@ -37,6 +37,11 @@ import java.util.function.Consumer; +/** + * Action listener for rejections + * + * @opensearch.internal + */ // public for testing public interface RejectAwareActionListener extends ActionListener { void onRejection(Exception e); diff --git a/server/src/main/java/org/opensearch/index/reindex/RemoteInfo.java b/server/src/main/java/org/opensearch/index/reindex/RemoteInfo.java index 03d0ab072a5a1..6464ce266b1fc 100644 --- a/server/src/main/java/org/opensearch/index/reindex/RemoteInfo.java +++ b/server/src/main/java/org/opensearch/index/reindex/RemoteInfo.java @@ -57,6 +57,11 @@ import static org.opensearch.common.unit.TimeValue.timeValueSeconds; import static org.opensearch.index.query.QueryBuilders.matchAllQuery; +/** + * Encapsulates informatoin for remote resources + * + * @opensearch.internal + */ public class RemoteInfo implements Writeable, ToXContentObject { /** * Default {@link #socketTimeout} for requests that don't have one set. diff --git a/server/src/main/java/org/opensearch/index/reindex/RetryListener.java b/server/src/main/java/org/opensearch/index/reindex/RetryListener.java index a3d469ba66ebc..ad09080cfea2b 100644 --- a/server/src/main/java/org/opensearch/index/reindex/RetryListener.java +++ b/server/src/main/java/org/opensearch/index/reindex/RetryListener.java @@ -42,6 +42,11 @@ import java.util.Iterator; import java.util.function.Consumer; +/** + * Base listener for retries + * + * @opensearch.internal + */ class RetryListener implements RejectAwareActionListener { private final Logger logger; private final Iterator retries; diff --git a/server/src/main/java/org/opensearch/index/reindex/ScrollableHitSource.java b/server/src/main/java/org/opensearch/index/reindex/ScrollableHitSource.java index f0c720e21a73e..a61d53714a9b8 100644 --- a/server/src/main/java/org/opensearch/index/reindex/ScrollableHitSource.java +++ b/server/src/main/java/org/opensearch/index/reindex/ScrollableHitSource.java @@ -66,6 +66,8 @@ * A scrollable source of results. Pumps data out into the passed onResponse consumer. Same data may come out several times in case * of failures during searching (though not yet). Once the onResponse consumer is done, it should call AsyncResponse.isDone(time) to receive * more data (only receives one response at a time). + * + * @opensearch.internal */ public abstract class ScrollableHitSource { private final AtomicReference scrollId = new AtomicReference<>(); diff --git a/server/src/main/java/org/opensearch/index/reindex/SuccessfullyProcessed.java b/server/src/main/java/org/opensearch/index/reindex/SuccessfullyProcessed.java index 94aa5b77f541a..343f5e2a1c52b 100644 --- a/server/src/main/java/org/opensearch/index/reindex/SuccessfullyProcessed.java +++ b/server/src/main/java/org/opensearch/index/reindex/SuccessfullyProcessed.java @@ -35,6 +35,8 @@ /** * Implemented by {@link WorkerBulkByScrollTaskState} and {@link BulkByScrollTask.Status} to consistently implement * {@link #getSuccessfullyProcessed()}. + * + * @opensearch.internal */ public interface SuccessfullyProcessed { /** diff --git a/server/src/main/java/org/opensearch/index/reindex/UpdateByQueryAction.java b/server/src/main/java/org/opensearch/index/reindex/UpdateByQueryAction.java index 8facce990be6f..322a552b310fb 100644 --- a/server/src/main/java/org/opensearch/index/reindex/UpdateByQueryAction.java +++ b/server/src/main/java/org/opensearch/index/reindex/UpdateByQueryAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Action type for updating by query + * + * @opensearch.internal + */ public class UpdateByQueryAction extends ActionType { public static final UpdateByQueryAction INSTANCE = new UpdateByQueryAction(); public static final String NAME = "indices:data/write/update/byquery"; diff --git a/server/src/main/java/org/opensearch/index/reindex/UpdateByQueryRequest.java b/server/src/main/java/org/opensearch/index/reindex/UpdateByQueryRequest.java index 92bcef8455e63..446065925ef5f 100644 --- a/server/src/main/java/org/opensearch/index/reindex/UpdateByQueryRequest.java +++ b/server/src/main/java/org/opensearch/index/reindex/UpdateByQueryRequest.java @@ -49,6 +49,8 @@ * CompositeIndicesRequest but in a misleading way. Rather than returning all the subrequests that it will make it tries to return a * representative set of subrequests. This is best-effort but better than {@linkplain ReindexRequest} because scripts can't change the * destination index and things. + * + * @opensearch.internal */ public class UpdateByQueryRequest extends AbstractBulkIndexByScrollRequest implements diff --git a/server/src/main/java/org/opensearch/index/reindex/UpdateByQueryRequestBuilder.java b/server/src/main/java/org/opensearch/index/reindex/UpdateByQueryRequestBuilder.java index f2184167a1eb7..1e4847157b0bb 100644 --- a/server/src/main/java/org/opensearch/index/reindex/UpdateByQueryRequestBuilder.java +++ b/server/src/main/java/org/opensearch/index/reindex/UpdateByQueryRequestBuilder.java @@ -37,6 +37,11 @@ import org.opensearch.action.search.SearchRequestBuilder; import org.opensearch.client.OpenSearchClient; +/** + * Request builder for updating a document by query + * + * @opensearch.internal + */ public class UpdateByQueryRequestBuilder extends AbstractBulkIndexByScrollRequestBuilder< UpdateByQueryRequest, UpdateByQueryRequestBuilder> { diff --git a/server/src/main/java/org/opensearch/index/reindex/WorkerBulkByScrollTaskState.java b/server/src/main/java/org/opensearch/index/reindex/WorkerBulkByScrollTaskState.java index 2846298e005e7..eefdc4f90dc7b 100644 --- a/server/src/main/java/org/opensearch/index/reindex/WorkerBulkByScrollTaskState.java +++ b/server/src/main/java/org/opensearch/index/reindex/WorkerBulkByScrollTaskState.java @@ -53,6 +53,8 @@ /** * Task behavior for {@link BulkByScrollTask} that does the actual work of querying and indexing + * + * @opensearch.internal */ public class WorkerBulkByScrollTaskState implements SuccessfullyProcessed { diff --git a/server/src/main/java/org/opensearch/index/search/MatchQuery.java b/server/src/main/java/org/opensearch/index/search/MatchQuery.java index 485715c430b3f..950d63d657075 100644 --- a/server/src/main/java/org/opensearch/index/search/MatchQuery.java +++ b/server/src/main/java/org/opensearch/index/search/MatchQuery.java @@ -82,6 +82,11 @@ import static org.opensearch.common.lucene.search.Queries.newLenientFieldQuery; import static org.opensearch.common.lucene.search.Queries.newUnmappedFieldQuery; +/** + * Foundation match query + * + * @opensearch.internal + */ public class MatchQuery { public enum Type implements Writeable { diff --git a/server/src/main/java/org/opensearch/index/search/MultiMatchQuery.java b/server/src/main/java/org/opensearch/index/search/MultiMatchQuery.java index f924c698c0f22..6dd2a33f96bb4 100644 --- a/server/src/main/java/org/opensearch/index/search/MultiMatchQuery.java +++ b/server/src/main/java/org/opensearch/index/search/MultiMatchQuery.java @@ -58,6 +58,11 @@ import static org.opensearch.common.lucene.search.Queries.newLenientFieldQuery; +/** + * Foundation multi match query + * + * @opensearch.internal + */ public class MultiMatchQuery extends MatchQuery { private Float groupTieBreaker = null; diff --git a/server/src/main/java/org/opensearch/index/search/NestedHelper.java b/server/src/main/java/org/opensearch/index/search/NestedHelper.java index 487dc2bddde6b..ae91f66c5aebd 100644 --- a/server/src/main/java/org/opensearch/index/search/NestedHelper.java +++ b/server/src/main/java/org/opensearch/index/search/NestedHelper.java @@ -49,7 +49,10 @@ import org.opensearch.index.mapper.ObjectMapper; /** Utility class to filter parent and children clauses when building nested - * queries. */ + * queries. + * + * @opensearch.internal + */ public final class NestedHelper { private final MapperService mapperService; diff --git a/server/src/main/java/org/opensearch/index/search/OpenSearchToParentBlockJoinQuery.java b/server/src/main/java/org/opensearch/index/search/OpenSearchToParentBlockJoinQuery.java index 66f66be43b0ca..770301629d964 100644 --- a/server/src/main/java/org/opensearch/index/search/OpenSearchToParentBlockJoinQuery.java +++ b/server/src/main/java/org/opensearch/index/search/OpenSearchToParentBlockJoinQuery.java @@ -45,7 +45,11 @@ import java.io.IOException; import java.util.Objects; -/** A {@link ToParentBlockJoinQuery} that allows to retrieve its nested path. */ +/** + * A {@link ToParentBlockJoinQuery} that allows to retrieve its nested path. + * + * @opensearch.internal + */ public final class OpenSearchToParentBlockJoinQuery extends Query { private final ToParentBlockJoinQuery query; diff --git a/server/src/main/java/org/opensearch/index/search/QueryParserHelper.java b/server/src/main/java/org/opensearch/index/search/QueryParserHelper.java index 68c61bd9acc54..5e9839385ce20 100644 --- a/server/src/main/java/org/opensearch/index/search/QueryParserHelper.java +++ b/server/src/main/java/org/opensearch/index/search/QueryParserHelper.java @@ -48,6 +48,8 @@ /** * Helpers to extract and expand field names and boosts + * + * @opensearch.internal */ public final class QueryParserHelper { private QueryParserHelper() {} diff --git a/server/src/main/java/org/opensearch/index/search/QueryStringQueryParser.java b/server/src/main/java/org/opensearch/index/search/QueryStringQueryParser.java index 980a42163c9c9..cdb7464ff250a 100644 --- a/server/src/main/java/org/opensearch/index/search/QueryStringQueryParser.java +++ b/server/src/main/java/org/opensearch/index/search/QueryStringQueryParser.java @@ -90,6 +90,8 @@ * queries based on the mapping information. * This class uses {@link MultiMatchQuery} to build the text query around operators and {@link XQueryParser} * to assemble the result logically. + * + * @opensearch.internal */ public class QueryStringQueryParser extends XQueryParser { private static final String EXISTS_FIELD = "_exists_"; diff --git a/server/src/main/java/org/opensearch/index/search/SimpleQueryStringQueryParser.java b/server/src/main/java/org/opensearch/index/search/SimpleQueryStringQueryParser.java index f4f68634d0df5..f57af7b3370bf 100644 --- a/server/src/main/java/org/opensearch/index/search/SimpleQueryStringQueryParser.java +++ b/server/src/main/java/org/opensearch/index/search/SimpleQueryStringQueryParser.java @@ -66,6 +66,8 @@ /** * Wrapper class for Lucene's SimpleQueryStringQueryParser that allows us to redefine * different types of queries. + * + * @opensearch.internal */ public class SimpleQueryStringQueryParser extends SimpleQueryParser { diff --git a/server/src/main/java/org/opensearch/index/search/stats/SearchStats.java b/server/src/main/java/org/opensearch/index/search/stats/SearchStats.java index d55c2924eccf6..34584d5cb6f89 100644 --- a/server/src/main/java/org/opensearch/index/search/stats/SearchStats.java +++ b/server/src/main/java/org/opensearch/index/search/stats/SearchStats.java @@ -47,6 +47,11 @@ import java.util.HashMap; import java.util.Map; +/** + * Encapsulates stats for search time + * + * @opensearch.internal + */ public class SearchStats implements Writeable, ToXContentFragment { public static class Stats implements Writeable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/index/search/stats/ShardSearchStats.java b/server/src/main/java/org/opensearch/index/search/stats/ShardSearchStats.java index 917ea99432da7..93373e57a1081 100644 --- a/server/src/main/java/org/opensearch/index/search/stats/ShardSearchStats.java +++ b/server/src/main/java/org/opensearch/index/search/stats/ShardSearchStats.java @@ -48,6 +48,11 @@ import static java.util.Collections.emptyMap; +/** + * Shard level search stats + * + * @opensearch.internal + */ public final class ShardSearchStats implements SearchOperationListener { private final StatsHolder totalStats = new StatsHolder(); diff --git a/server/src/main/java/org/opensearch/index/seqno/CountedBitSet.java b/server/src/main/java/org/opensearch/index/seqno/CountedBitSet.java index 1bccfc4047fad..2f40b0bc8b0c6 100644 --- a/server/src/main/java/org/opensearch/index/seqno/CountedBitSet.java +++ b/server/src/main/java/org/opensearch/index/seqno/CountedBitSet.java @@ -39,6 +39,8 @@ * A {@link CountedBitSet} wraps a {@link FixedBitSet} but automatically releases the internal bitset * when all bits are set to reduce memory usage. This structure can work well for sequence numbers as * these numbers are likely to form contiguous ranges (eg. filling all bits). + * + * @opensearch.internal */ public final class CountedBitSet { static final long BASE_RAM_BYTES_USED = RamUsageEstimator.shallowSizeOfInstance(CountedBitSet.class); diff --git a/server/src/main/java/org/opensearch/index/seqno/GlobalCheckpointSyncAction.java b/server/src/main/java/org/opensearch/index/seqno/GlobalCheckpointSyncAction.java index a46a0c0d70a4d..83ee51b0d2654 100644 --- a/server/src/main/java/org/opensearch/index/seqno/GlobalCheckpointSyncAction.java +++ b/server/src/main/java/org/opensearch/index/seqno/GlobalCheckpointSyncAction.java @@ -60,6 +60,8 @@ * Background global checkpoint sync action initiated when a shard goes inactive. This is needed because while we send the global checkpoint * on every replication operation, after the last operation completes the global checkpoint could advance but without a follow-up operation * the global checkpoint will never be synced to the replicas. + * + * @opensearch.internal */ public class GlobalCheckpointSyncAction extends TransportReplicationAction< GlobalCheckpointSyncAction.Request, diff --git a/server/src/main/java/org/opensearch/index/seqno/LocalCheckpointTracker.java b/server/src/main/java/org/opensearch/index/seqno/LocalCheckpointTracker.java index 7aab597f8816c..058d3043d21e0 100644 --- a/server/src/main/java/org/opensearch/index/seqno/LocalCheckpointTracker.java +++ b/server/src/main/java/org/opensearch/index/seqno/LocalCheckpointTracker.java @@ -40,6 +40,8 @@ /** * This class generates sequences numbers and keeps track of the so-called "local checkpoint" which is the highest number for which all * previous sequence numbers have been processed (inclusive). + * + * @opensearch.internal */ public class LocalCheckpointTracker { diff --git a/server/src/main/java/org/opensearch/index/seqno/ReplicationTracker.java b/server/src/main/java/org/opensearch/index/seqno/ReplicationTracker.java index 99509ad5d1da9..ac611a4af4318 100644 --- a/server/src/main/java/org/opensearch/index/seqno/ReplicationTracker.java +++ b/server/src/main/java/org/opensearch/index/seqno/ReplicationTracker.java @@ -90,6 +90,8 @@ * shards that are taken into account for the global checkpoint calculation are called the "in-sync shards". *

    * The global checkpoint is maintained by the primary shard and is replicated to all the replicas (via {@link GlobalCheckpointSyncAction}). + * + * @opensearch.internal */ public class ReplicationTracker extends AbstractIndexShardComponent implements LongSupplier { diff --git a/server/src/main/java/org/opensearch/index/seqno/RetentionLease.java b/server/src/main/java/org/opensearch/index/seqno/RetentionLease.java index f9ab4c4e3ff1f..63151ceb647de 100644 --- a/server/src/main/java/org/opensearch/index/seqno/RetentionLease.java +++ b/server/src/main/java/org/opensearch/index/seqno/RetentionLease.java @@ -49,6 +49,8 @@ * that all operations with sequence number at least that retaining sequence number will be retained during merge operations (which could * otherwise merge away operations that have been soft deleted). Each retention lease contains a unique identifier, the retaining sequence * number, the timestamp of when the lease was created or renewed, and the source of the retention lease (e.g., "ccr"). + * + * @opensearch.internal */ public final class RetentionLease implements ToXContentObject, Writeable { diff --git a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseActions.java b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseActions.java index 37c32e1c4409c..3827666a5678c 100644 --- a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseActions.java +++ b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseActions.java @@ -64,6 +64,8 @@ * responded with success. Additionally, note the use of * {@link TransportSingleShardAction#asyncShardOperation(SingleShardRequest, ShardId, ActionListener)} to handle the case when acquiring * permits goes asynchronous because acquiring permits is blocked + * + * @opensearch.internal */ public class RetentionLeaseActions { diff --git a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseAlreadyExistsException.java b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseAlreadyExistsException.java index 20761621d6c16..f394b4b69affe 100644 --- a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseAlreadyExistsException.java +++ b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseAlreadyExistsException.java @@ -38,6 +38,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Exception thrown if a retention lease already exists + * + * @opensearch.internal + */ public class RetentionLeaseAlreadyExistsException extends ResourceAlreadyExistsException { public RetentionLeaseAlreadyExistsException(final String id) { diff --git a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseBackgroundSyncAction.java b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseBackgroundSyncAction.java index 014ffedb81e3f..891b55f0e8391 100644 --- a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseBackgroundSyncAction.java +++ b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseBackgroundSyncAction.java @@ -73,6 +73,8 @@ * that if a replica misses a background retention lease sync then that shard will not be marked as stale. We have some tolerance for a * shard copy missing renewals of retention leases since the background sync interval is much smaller than the expected lifetime of * retention leases. + * + * @opensearch.internal */ public class RetentionLeaseBackgroundSyncAction extends TransportReplicationAction< RetentionLeaseBackgroundSyncAction.Request, diff --git a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseInvalidRetainingSeqNoException.java b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseInvalidRetainingSeqNoException.java index 5231c7260a292..b532846f57ac4 100644 --- a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseInvalidRetainingSeqNoException.java +++ b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseInvalidRetainingSeqNoException.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Exception thrown when an invalid sequence number is retained + * + * @opensearch.internal + */ public class RetentionLeaseInvalidRetainingSeqNoException extends OpenSearchException { RetentionLeaseInvalidRetainingSeqNoException( diff --git a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseNotFoundException.java b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseNotFoundException.java index 1f77206bf998c..524778d0f9414 100644 --- a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseNotFoundException.java +++ b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseNotFoundException.java @@ -38,6 +38,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Exception thrown when a retention lease is not found + * + * @opensearch.internal + */ public class RetentionLeaseNotFoundException extends ResourceNotFoundException { public RetentionLeaseNotFoundException(final String id) { diff --git a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseStats.java b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseStats.java index 77749915958be..a9dbf2288aea4 100644 --- a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseStats.java +++ b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseStats.java @@ -43,6 +43,8 @@ /** * Represents retention lease stats. + * + * @opensearch.internal */ public final class RetentionLeaseStats implements ToXContentFragment, Writeable { diff --git a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseSyncAction.java b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseSyncAction.java index 55bd01df0979a..a6aebeb21a76a 100644 --- a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseSyncAction.java +++ b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseSyncAction.java @@ -74,6 +74,8 @@ /** * Write action responsible for syncing retention leases to replicas. This action is deliberately a write action so that if a replica misses * a retention lease sync then that shard will be marked as stale. + * + * @opensearch.internal */ public class RetentionLeaseSyncAction extends TransportWriteAction< RetentionLeaseSyncAction.Request, diff --git a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseSyncer.java b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseSyncer.java index a8f48b0d431a5..25a768868f5d5 100644 --- a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseSyncer.java +++ b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseSyncer.java @@ -39,6 +39,11 @@ import java.util.Objects; +/** + * Syncs retention leases + * + * @opensearch.internal + */ public class RetentionLeaseSyncer { private final SyncAction syncAction; private final BackgroundSyncAction backgroundSyncAction; diff --git a/server/src/main/java/org/opensearch/index/seqno/RetentionLeases.java b/server/src/main/java/org/opensearch/index/seqno/RetentionLeases.java index e5fef4dcffc5a..c879e38510dde 100644 --- a/server/src/main/java/org/opensearch/index/seqno/RetentionLeases.java +++ b/server/src/main/java/org/opensearch/index/seqno/RetentionLeases.java @@ -55,6 +55,8 @@ /** * Represents a versioned collection of retention leases. We version the collection of retention leases to ensure that sync requests that * arrive out of order on the replica, using the version to ensure that older sync requests are rejected. + * + * @opensearch.internal */ public class RetentionLeases implements ToXContentFragment, Writeable { diff --git a/server/src/main/java/org/opensearch/index/seqno/SeqNoStats.java b/server/src/main/java/org/opensearch/index/seqno/SeqNoStats.java index 0f26377568e17..58c69501c3608 100644 --- a/server/src/main/java/org/opensearch/index/seqno/SeqNoStats.java +++ b/server/src/main/java/org/opensearch/index/seqno/SeqNoStats.java @@ -41,6 +41,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Sequence number statistics + * + * @opensearch.internal + */ public class SeqNoStats implements ToXContentFragment, Writeable { private static final String SEQ_NO = "seq_no"; diff --git a/server/src/main/java/org/opensearch/index/seqno/SequenceNumbers.java b/server/src/main/java/org/opensearch/index/seqno/SequenceNumbers.java index 3da32efe4d027..f8639595d9195 100644 --- a/server/src/main/java/org/opensearch/index/seqno/SequenceNumbers.java +++ b/server/src/main/java/org/opensearch/index/seqno/SequenceNumbers.java @@ -36,6 +36,8 @@ /** * A utility class for handling sequence numbers. + * + * @opensearch.internal */ public class SequenceNumbers { diff --git a/server/src/main/java/org/opensearch/index/shard/AbstractIndexShardComponent.java b/server/src/main/java/org/opensearch/index/shard/AbstractIndexShardComponent.java index 24f0f7aa7b730..2832c17ddc11a 100644 --- a/server/src/main/java/org/opensearch/index/shard/AbstractIndexShardComponent.java +++ b/server/src/main/java/org/opensearch/index/shard/AbstractIndexShardComponent.java @@ -36,6 +36,11 @@ import org.opensearch.common.logging.Loggers; import org.opensearch.index.IndexSettings; +/** + * Base index shard class + * + * @opensearch.internal + */ public abstract class AbstractIndexShardComponent implements IndexShardComponent { protected final Logger logger; diff --git a/server/src/main/java/org/opensearch/index/shard/DocsStats.java b/server/src/main/java/org/opensearch/index/shard/DocsStats.java index e9d41ceff09e8..952f94d26e1ef 100644 --- a/server/src/main/java/org/opensearch/index/shard/DocsStats.java +++ b/server/src/main/java/org/opensearch/index/shard/DocsStats.java @@ -41,6 +41,11 @@ import java.io.IOException; +/** + * Document statistics + * + * @opensearch.internal + */ public class DocsStats implements Writeable, ToXContentFragment { private long count = 0; diff --git a/server/src/main/java/org/opensearch/index/shard/GlobalCheckpointListeners.java b/server/src/main/java/org/opensearch/index/shard/GlobalCheckpointListeners.java index 3c8ed8ea7492a..e26f2ccca4fd1 100644 --- a/server/src/main/java/org/opensearch/index/shard/GlobalCheckpointListeners.java +++ b/server/src/main/java/org/opensearch/index/shard/GlobalCheckpointListeners.java @@ -58,6 +58,8 @@ /** * Represents a collection of global checkpoint listeners. This collection can be added to, and all listeners present at the time of an * update will be notified together. All listeners will be notified when the shard is closed. + * + * @opensearch.internal */ public class GlobalCheckpointListeners implements Closeable { diff --git a/server/src/main/java/org/opensearch/index/shard/IllegalIndexShardStateException.java b/server/src/main/java/org/opensearch/index/shard/IllegalIndexShardStateException.java index a6cd831291e37..bc9bc4a5a61fd 100644 --- a/server/src/main/java/org/opensearch/index/shard/IllegalIndexShardStateException.java +++ b/server/src/main/java/org/opensearch/index/shard/IllegalIndexShardStateException.java @@ -39,6 +39,11 @@ import java.io.IOException; +/** + * Exception thrown when an index shard is in an illegal state + * + * @opensearch.internal + */ public class IllegalIndexShardStateException extends OpenSearchException { private final IndexShardState currentState; diff --git a/server/src/main/java/org/opensearch/index/shard/IndexEventListener.java b/server/src/main/java/org/opensearch/index/shard/IndexEventListener.java index c07798202144b..600bbc0af4cbc 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexEventListener.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexEventListener.java @@ -49,6 +49,8 @@ * local state via their arguments. Yet, if an instance is shared across indices they might be called concurrently and should not * modify local state without sufficient synchronization. *

    + * + * @opensearch.internal */ public interface IndexEventListener { diff --git a/server/src/main/java/org/opensearch/index/shard/IndexSettingProvider.java b/server/src/main/java/org/opensearch/index/shard/IndexSettingProvider.java index 7d1e77214640b..441a9a6413ffc 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexSettingProvider.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexSettingProvider.java @@ -37,6 +37,8 @@ /** * An {@link IndexSettingProvider} is a provider for index level settings that can be set * explicitly as a default value (so they show up as "set" for newly created indices) + * + * @opensearch.internal */ public interface IndexSettingProvider { /** diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShard.java b/server/src/main/java/org/opensearch/index/shard/IndexShard.java index f02b7047899ce..b11148a9a2ef1 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShard.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShard.java @@ -199,6 +199,11 @@ import static org.opensearch.index.seqno.RetentionLeaseActions.RETAIN_ALL; import static org.opensearch.index.seqno.SequenceNumbers.UNASSIGNED_SEQ_NO; +/** + * An OpenSearch index shard + * + * @opensearch.internal + */ public class IndexShard extends AbstractIndexShardComponent implements IndicesClusterStateService.Shard { private final ThreadPool threadPool; diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShardClosedException.java b/server/src/main/java/org/opensearch/index/shard/IndexShardClosedException.java index a7f58ddfb84d0..e4452a377c167 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShardClosedException.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShardClosedException.java @@ -36,6 +36,11 @@ import java.io.IOException; +/** + * Exception thrown if trying to operate on a closed Index Shard + * + * @opensearch.internal + */ public class IndexShardClosedException extends IllegalIndexShardStateException { public IndexShardClosedException(ShardId shardId) { super(shardId, IndexShardState.CLOSED, "Closed"); diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShardComponent.java b/server/src/main/java/org/opensearch/index/shard/IndexShardComponent.java index 9f8ae26ca3110..66e0d74c47a72 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShardComponent.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShardComponent.java @@ -34,6 +34,11 @@ import org.opensearch.index.IndexSettings; +/** + * Base interface for an IndexShard + * + * @opensearch.internal + */ public interface IndexShardComponent { ShardId shardId(); diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShardNotRecoveringException.java b/server/src/main/java/org/opensearch/index/shard/IndexShardNotRecoveringException.java index 9245119f9bf23..f75e1f2ac7bc5 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShardNotRecoveringException.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShardNotRecoveringException.java @@ -36,6 +36,11 @@ import java.io.IOException; +/** + * Exception thrown if an index shard is not recovering + * + * @opensearch.internal + */ public class IndexShardNotRecoveringException extends IllegalIndexShardStateException { public IndexShardNotRecoveringException(ShardId shardId, IndexShardState currentState) { diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShardNotStartedException.java b/server/src/main/java/org/opensearch/index/shard/IndexShardNotStartedException.java index b4be8cc08a6b6..cf33d30a339d5 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShardNotStartedException.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShardNotStartedException.java @@ -36,6 +36,11 @@ import java.io.IOException; +/** + * Exception thrown when trying to operate on an Index Shard that hasn't been started + * + * @opensearch.internal + */ public class IndexShardNotStartedException extends IllegalIndexShardStateException { public IndexShardNotStartedException(ShardId shardId, IndexShardState currentState) { diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShardOperationPermits.java b/server/src/main/java/org/opensearch/index/shard/IndexShardOperationPermits.java index 9474a7dc99bb9..3e788b55c6f32 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShardOperationPermits.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShardOperationPermits.java @@ -64,6 +64,8 @@ * between terms) we immediately delay all operations to a queue, obtain all available permits, and wait for outstanding operations to drain * and return their permits. Delayed operations will acquire permits and be completed after the operation that blocked all operations has * completed. + * + * @opensearch.internal */ final class IndexShardOperationPermits implements Closeable { diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShardRecoveringException.java b/server/src/main/java/org/opensearch/index/shard/IndexShardRecoveringException.java index 7a71dcdf207ca..11e93c978c7d1 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShardRecoveringException.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShardRecoveringException.java @@ -36,6 +36,11 @@ import java.io.IOException; +/** + * Exception thrown when there is an error recovering an Index Shard + * + * @opensearch.internal + */ public class IndexShardRecoveringException extends IllegalIndexShardStateException { public IndexShardRecoveringException(ShardId shardId) { diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShardRecoveryException.java b/server/src/main/java/org/opensearch/index/shard/IndexShardRecoveryException.java index 1c0d51828c6dd..a4cf6164bae5d 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShardRecoveryException.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShardRecoveryException.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Exception thrown when there is an error on recovery of Index Shard + * + * @opensearch.internal + */ public class IndexShardRecoveryException extends OpenSearchException { public IndexShardRecoveryException(ShardId shardId, String msg, Throwable cause) { super(msg, cause); diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShardRelocatedException.java b/server/src/main/java/org/opensearch/index/shard/IndexShardRelocatedException.java index fbe0306bbc006..3d63dba938d5c 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShardRelocatedException.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShardRelocatedException.java @@ -36,6 +36,11 @@ import java.io.IOException; +/** + * Exception thrown if there is an error relocating an index shard + * + * @opensearch.internal + */ public class IndexShardRelocatedException extends IllegalIndexShardStateException { public IndexShardRelocatedException(ShardId shardId) { diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShardStartedException.java b/server/src/main/java/org/opensearch/index/shard/IndexShardStartedException.java index 3582341b92a55..fd7985a32bd58 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShardStartedException.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShardStartedException.java @@ -36,6 +36,11 @@ import java.io.IOException; +/** + * Exception thrown if there is an error starting an index shard + * + * @opensearch.internal + */ public class IndexShardStartedException extends IllegalIndexShardStateException { public IndexShardStartedException(ShardId shardId) { diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShardState.java b/server/src/main/java/org/opensearch/index/shard/IndexShardState.java index 526dcdad87063..5a0808ece96d5 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShardState.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShardState.java @@ -32,6 +32,9 @@ package org.opensearch.index.shard; +/** + * Index Shard States + */ public enum IndexShardState { CREATED((byte) 0), RECOVERING((byte) 1), diff --git a/server/src/main/java/org/opensearch/index/shard/IndexingOperationListener.java b/server/src/main/java/org/opensearch/index/shard/IndexingOperationListener.java index aff44203cca22..ed6e9f82ad064 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexingOperationListener.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexingOperationListener.java @@ -39,6 +39,8 @@ /** * An indexing listener for indexing, delete, events. + * + * @opensearch.internal */ public interface IndexingOperationListener { diff --git a/server/src/main/java/org/opensearch/index/shard/IndexingStats.java b/server/src/main/java/org/opensearch/index/shard/IndexingStats.java index bdc5373e0b9b3..c57be2b2b689c 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexingStats.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexingStats.java @@ -45,6 +45,11 @@ import java.io.IOException; import java.util.Map; +/** + * Tracks indexing statistics + * + * @opensearch.internal + */ public class IndexingStats implements Writeable, ToXContentFragment { public static class Stats implements Writeable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/index/shard/InternalIndexingStats.java b/server/src/main/java/org/opensearch/index/shard/InternalIndexingStats.java index 76d64ab918163..25500ceafb2ef 100644 --- a/server/src/main/java/org/opensearch/index/shard/InternalIndexingStats.java +++ b/server/src/main/java/org/opensearch/index/shard/InternalIndexingStats.java @@ -41,6 +41,8 @@ /** * Internal class that maintains relevant indexing statistics / metrics. * @see IndexShard + * + * @opensearch.internal */ final class InternalIndexingStats implements IndexingOperationListener { private final StatsHolder totalStats = new StatsHolder(); diff --git a/server/src/main/java/org/opensearch/index/shard/LocalShardSnapshot.java b/server/src/main/java/org/opensearch/index/shard/LocalShardSnapshot.java index 98556db3ae138..dc02cc054118c 100644 --- a/server/src/main/java/org/opensearch/index/shard/LocalShardSnapshot.java +++ b/server/src/main/java/org/opensearch/index/shard/LocalShardSnapshot.java @@ -51,6 +51,11 @@ import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; +/** + * A shard snapshot stored locally + * + * @opensearch.internal + */ final class LocalShardSnapshot implements Closeable { private final IndexShard shard; private final Store store; diff --git a/server/src/main/java/org/opensearch/index/shard/OpenSearchMergePolicy.java b/server/src/main/java/org/opensearch/index/shard/OpenSearchMergePolicy.java index 28ae3f0b30679..258a283c63476 100644 --- a/server/src/main/java/org/opensearch/index/shard/OpenSearchMergePolicy.java +++ b/server/src/main/java/org/opensearch/index/shard/OpenSearchMergePolicy.java @@ -56,6 +56,8 @@ *

    * For now, this {@link MergePolicy} takes care of moving versions that used to * be stored as payloads to numeric doc values. + * + * @opensearch.internal */ public final class OpenSearchMergePolicy extends FilterMergePolicy { diff --git a/server/src/main/java/org/opensearch/index/shard/PrimaryReplicaSyncer.java b/server/src/main/java/org/opensearch/index/shard/PrimaryReplicaSyncer.java index 726d2925177fa..463c9b7ca4af2 100644 --- a/server/src/main/java/org/opensearch/index/shard/PrimaryReplicaSyncer.java +++ b/server/src/main/java/org/opensearch/index/shard/PrimaryReplicaSyncer.java @@ -65,6 +65,11 @@ import static java.util.Objects.requireNonNull; +/** + * Syncer for Primary replica + * + * @opensearch.internal + */ public class PrimaryReplicaSyncer { private static final Logger logger = LogManager.getLogger(PrimaryReplicaSyncer.class); diff --git a/server/src/main/java/org/opensearch/index/shard/RefreshListeners.java b/server/src/main/java/org/opensearch/index/shard/RefreshListeners.java index 570b882e1fcab..7dbbcbb2d7d20 100644 --- a/server/src/main/java/org/opensearch/index/shard/RefreshListeners.java +++ b/server/src/main/java/org/opensearch/index/shard/RefreshListeners.java @@ -56,6 +56,8 @@ * {@link IndexShard} but kept here so it can be tested without standing up the entire thing. * * When {@link Closeable#close()}d it will no longer accept listeners and flush any existing listeners. + * + * @opensearch.internal */ public final class RefreshListeners implements ReferenceManager.RefreshListener, Closeable { private final IntSupplier getMaxRefreshListeners; diff --git a/server/src/main/java/org/opensearch/index/shard/RemoveCorruptedLuceneSegmentsAction.java b/server/src/main/java/org/opensearch/index/shard/RemoveCorruptedLuceneSegmentsAction.java index 621f1fcec28f2..93ef2c4abf09d 100644 --- a/server/src/main/java/org/opensearch/index/shard/RemoveCorruptedLuceneSegmentsAction.java +++ b/server/src/main/java/org/opensearch/index/shard/RemoveCorruptedLuceneSegmentsAction.java @@ -43,6 +43,8 @@ /** * Removes corrupted Lucene index segments + * + * @opensearch.internal */ public class RemoveCorruptedLuceneSegmentsAction { diff --git a/server/src/main/java/org/opensearch/index/shard/RemoveCorruptedShardDataCommand.java b/server/src/main/java/org/opensearch/index/shard/RemoveCorruptedShardDataCommand.java index a6ecc803affbb..feceb017a3663 100644 --- a/server/src/main/java/org/opensearch/index/shard/RemoveCorruptedShardDataCommand.java +++ b/server/src/main/java/org/opensearch/index/shard/RemoveCorruptedShardDataCommand.java @@ -84,6 +84,11 @@ import java.util.Objects; import java.util.stream.StreamSupport; +/** + * Command for removing a corruped shard + * + * @opensearch.internal + */ public class RemoveCorruptedShardDataCommand extends OpenSearchNodeCommand { private static final Logger logger = LogManager.getLogger(RemoveCorruptedShardDataCommand.class); diff --git a/server/src/main/java/org/opensearch/index/shard/ReplicationGroup.java b/server/src/main/java/org/opensearch/index/shard/ReplicationGroup.java index fc52d09361281..6d19e9f500411 100644 --- a/server/src/main/java/org/opensearch/index/shard/ReplicationGroup.java +++ b/server/src/main/java/org/opensearch/index/shard/ReplicationGroup.java @@ -42,6 +42,8 @@ /** * Replication group for a shard. Used by a primary shard to coordinate replication and recoveries. + * + * @opensearch.internal */ public class ReplicationGroup { private final IndexShardRoutingTable routingTable; diff --git a/server/src/main/java/org/opensearch/index/shard/SearchOperationListener.java b/server/src/main/java/org/opensearch/index/shard/SearchOperationListener.java index da4b3a141dfc5..d3177055a5bd8 100644 --- a/server/src/main/java/org/opensearch/index/shard/SearchOperationListener.java +++ b/server/src/main/java/org/opensearch/index/shard/SearchOperationListener.java @@ -43,6 +43,8 @@ /** * An listener for search, fetch and context events. + * + * @opensearch.internal */ public interface SearchOperationListener { diff --git a/server/src/main/java/org/opensearch/index/shard/ShardId.java b/server/src/main/java/org/opensearch/index/shard/ShardId.java index a4ff927c5a5dc..d44e4140fd095 100644 --- a/server/src/main/java/org/opensearch/index/shard/ShardId.java +++ b/server/src/main/java/org/opensearch/index/shard/ShardId.java @@ -44,6 +44,8 @@ /** * Allows for shard level components to be injected with the shard id. + * + * @opensearch.internal */ public class ShardId implements Comparable, ToXContentFragment, Writeable { diff --git a/server/src/main/java/org/opensearch/index/shard/ShardNotFoundException.java b/server/src/main/java/org/opensearch/index/shard/ShardNotFoundException.java index 8346b841007d9..c97f392f54a5a 100644 --- a/server/src/main/java/org/opensearch/index/shard/ShardNotFoundException.java +++ b/server/src/main/java/org/opensearch/index/shard/ShardNotFoundException.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Exception thrown if a shard is not found + * + * @opensearch.internal + */ public class ShardNotFoundException extends ResourceNotFoundException { public ShardNotFoundException(ShardId shardId) { this(shardId, null); diff --git a/server/src/main/java/org/opensearch/index/shard/ShardNotInPrimaryModeException.java b/server/src/main/java/org/opensearch/index/shard/ShardNotInPrimaryModeException.java index a82f1ba5c77d0..cb03424e027e4 100644 --- a/server/src/main/java/org/opensearch/index/shard/ShardNotInPrimaryModeException.java +++ b/server/src/main/java/org/opensearch/index/shard/ShardNotInPrimaryModeException.java @@ -36,6 +36,11 @@ import java.io.IOException; +/** + * Exception thrown if a shard is not in primary mode + * + * @opensearch.internal + */ public class ShardNotInPrimaryModeException extends IllegalIndexShardStateException { public ShardNotInPrimaryModeException(final ShardId shardId, final IndexShardState currentState) { diff --git a/server/src/main/java/org/opensearch/index/shard/ShardPath.java b/server/src/main/java/org/opensearch/index/shard/ShardPath.java index 39f86ea362bb1..9960326e914e4 100644 --- a/server/src/main/java/org/opensearch/index/shard/ShardPath.java +++ b/server/src/main/java/org/opensearch/index/shard/ShardPath.java @@ -50,6 +50,11 @@ import java.util.Map; import java.util.Objects; +/** + * Path for a shard + * + * @opensearch.internal + */ public final class ShardPath { public static final String INDEX_FOLDER_NAME = "index"; public static final String TRANSLOG_FOLDER_NAME = "translog"; diff --git a/server/src/main/java/org/opensearch/index/shard/ShardSplittingQuery.java b/server/src/main/java/org/opensearch/index/shard/ShardSplittingQuery.java index 16d76ece840a2..5f3297fa08b08 100644 --- a/server/src/main/java/org/opensearch/index/shard/ShardSplittingQuery.java +++ b/server/src/main/java/org/opensearch/index/shard/ShardSplittingQuery.java @@ -72,6 +72,8 @@ * A query that selects all docs that do NOT belong in the current shards this query is executed on. * It can be used to split a shard into N shards marking every document that doesn't belong into the shard * as deleted. See {@link org.apache.lucene.index.IndexWriter#deleteDocuments(Query...)} + * + * @opensearch.internal */ final class ShardSplittingQuery extends Query { private final IndexMetadata indexMetadata; diff --git a/server/src/main/java/org/opensearch/index/shard/ShardStateMetadata.java b/server/src/main/java/org/opensearch/index/shard/ShardStateMetadata.java index 194c1e58277a8..9cd9149cda913 100644 --- a/server/src/main/java/org/opensearch/index/shard/ShardStateMetadata.java +++ b/server/src/main/java/org/opensearch/index/shard/ShardStateMetadata.java @@ -45,6 +45,11 @@ import java.io.OutputStream; import java.util.Objects; +/** + * Metadata string a shard state + * + * @opensearch.internal + */ public final class ShardStateMetadata { private static final String SHARD_STATE_FILE_PREFIX = "state-"; diff --git a/server/src/main/java/org/opensearch/index/shard/ShardToolCli.java b/server/src/main/java/org/opensearch/index/shard/ShardToolCli.java index 0234e85fbf0db..1b4eb5a3f8c39 100644 --- a/server/src/main/java/org/opensearch/index/shard/ShardToolCli.java +++ b/server/src/main/java/org/opensearch/index/shard/ShardToolCli.java @@ -36,6 +36,8 @@ /** * Class encapsulating and dispatching commands from the {@code opensearch-shard} command line tool + * + * @opensearch.internal */ public class ShardToolCli extends LoggingAwareMultiCommand { diff --git a/server/src/main/java/org/opensearch/index/shard/ShardUtils.java b/server/src/main/java/org/opensearch/index/shard/ShardUtils.java index a9cbd2c3f23f9..3d51fa6a05357 100644 --- a/server/src/main/java/org/opensearch/index/shard/ShardUtils.java +++ b/server/src/main/java/org/opensearch/index/shard/ShardUtils.java @@ -38,6 +38,11 @@ import org.opensearch.common.lucene.index.OpenSearchDirectoryReader; import org.opensearch.common.lucene.index.OpenSearchLeafReader; +/** + * Utility class for shard operations + * + * @opensearch.internal + */ public final class ShardUtils { private ShardUtils() {} diff --git a/server/src/main/java/org/opensearch/index/shard/StoreRecovery.java b/server/src/main/java/org/opensearch/index/shard/StoreRecovery.java index 6eb7a29984e1c..7ed424e9623eb 100644 --- a/server/src/main/java/org/opensearch/index/shard/StoreRecovery.java +++ b/server/src/main/java/org/opensearch/index/shard/StoreRecovery.java @@ -79,6 +79,8 @@ /** * This package private utility class encapsulates the logic to recover an index shard from either an existing index on * disk or from a snapshot in a repository. + * + * @opensearch.internal */ final class StoreRecovery { diff --git a/server/src/main/java/org/opensearch/index/similarity/NonNegativeScoresSimilarity.java b/server/src/main/java/org/opensearch/index/similarity/NonNegativeScoresSimilarity.java index 420f81b755987..9d8be5703a6b7 100644 --- a/server/src/main/java/org/opensearch/index/similarity/NonNegativeScoresSimilarity.java +++ b/server/src/main/java/org/opensearch/index/similarity/NonNegativeScoresSimilarity.java @@ -42,6 +42,8 @@ * A {@link Similarity} that rejects negative scores. This class exists so that users get * an error instead of silently corrupt top hits. It should be applied to any custom or * scripted similarity. + * + * @opensearch.internal */ // public for testing public final class NonNegativeScoresSimilarity extends Similarity { diff --git a/server/src/main/java/org/opensearch/index/similarity/ScriptedSimilarity.java b/server/src/main/java/org/opensearch/index/similarity/ScriptedSimilarity.java index 27be5658448d1..53604606887eb 100644 --- a/server/src/main/java/org/opensearch/index/similarity/ScriptedSimilarity.java +++ b/server/src/main/java/org/opensearch/index/similarity/ScriptedSimilarity.java @@ -43,6 +43,8 @@ /** * A {@link Similarity} implementation that allows scores to be scripted. + * + * @opensearch.internal */ public final class ScriptedSimilarity extends Similarity { diff --git a/server/src/main/java/org/opensearch/index/similarity/ScriptedSimilarityProvider.java b/server/src/main/java/org/opensearch/index/similarity/ScriptedSimilarityProvider.java index c84293d06b0f7..ab1c0341ef3dc 100644 --- a/server/src/main/java/org/opensearch/index/similarity/ScriptedSimilarityProvider.java +++ b/server/src/main/java/org/opensearch/index/similarity/ScriptedSimilarityProvider.java @@ -41,7 +41,11 @@ import org.opensearch.script.SimilarityScript; import org.opensearch.script.SimilarityWeightScript; -/** Provider of scripted similarities. */ +/** + * Provider of scripted similarities. + * + * @opensearch.internal + */ final class ScriptedSimilarityProvider implements TriFunction { @Override diff --git a/server/src/main/java/org/opensearch/index/similarity/SimilarityProvider.java b/server/src/main/java/org/opensearch/index/similarity/SimilarityProvider.java index 9a4444e9ac0f6..ad64f3a55228f 100644 --- a/server/src/main/java/org/opensearch/index/similarity/SimilarityProvider.java +++ b/server/src/main/java/org/opensearch/index/similarity/SimilarityProvider.java @@ -38,6 +38,8 @@ /** * Wrapper around a {@link Similarity} and its name. + * + * @opensearch.internal */ public final class SimilarityProvider { diff --git a/server/src/main/java/org/opensearch/index/similarity/SimilarityProviders.java b/server/src/main/java/org/opensearch/index/similarity/SimilarityProviders.java index 3617c9607a3ab..1e3ec368df411 100644 --- a/server/src/main/java/org/opensearch/index/similarity/SimilarityProviders.java +++ b/server/src/main/java/org/opensearch/index/similarity/SimilarityProviders.java @@ -76,6 +76,11 @@ import static java.util.Collections.unmodifiableMap; +/** + * A provider for similarity computations + * + * @opensearch.internal + */ final class SimilarityProviders { private SimilarityProviders() {} // no instantiation diff --git a/server/src/main/java/org/opensearch/index/similarity/SimilarityService.java b/server/src/main/java/org/opensearch/index/similarity/SimilarityService.java index bb82d53de815a..1bfcc302c3bfc 100644 --- a/server/src/main/java/org/opensearch/index/similarity/SimilarityService.java +++ b/server/src/main/java/org/opensearch/index/similarity/SimilarityService.java @@ -62,6 +62,11 @@ import java.util.function.Function; import java.util.function.Supplier; +/** + * Service for similarity computations + * + * @opensearch.internal + */ public final class SimilarityService extends AbstractIndexComponent { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(SimilarityService.class); public static final String DEFAULT_SIMILARITY = "BM25"; diff --git a/server/src/main/java/org/opensearch/index/snapshots/IndexShardRestoreException.java b/server/src/main/java/org/opensearch/index/snapshots/IndexShardRestoreException.java index 7dbc3ff60dd74..af2fedc36c60d 100644 --- a/server/src/main/java/org/opensearch/index/snapshots/IndexShardRestoreException.java +++ b/server/src/main/java/org/opensearch/index/snapshots/IndexShardRestoreException.java @@ -40,6 +40,8 @@ /** * Generic shard restore exception + * + * @opensearch.internal */ public class IndexShardRestoreException extends OpenSearchException { public IndexShardRestoreException(ShardId shardId, String msg) { diff --git a/server/src/main/java/org/opensearch/index/snapshots/IndexShardRestoreFailedException.java b/server/src/main/java/org/opensearch/index/snapshots/IndexShardRestoreFailedException.java index 3850f853cc914..07cc1367e72b5 100644 --- a/server/src/main/java/org/opensearch/index/snapshots/IndexShardRestoreFailedException.java +++ b/server/src/main/java/org/opensearch/index/snapshots/IndexShardRestoreFailedException.java @@ -39,6 +39,8 @@ /** * Thrown when restore of a shard fails + * + * @opensearch.internal */ public class IndexShardRestoreFailedException extends IndexShardRestoreException { public IndexShardRestoreFailedException(ShardId shardId, String msg) { diff --git a/server/src/main/java/org/opensearch/index/snapshots/IndexShardSnapshotException.java b/server/src/main/java/org/opensearch/index/snapshots/IndexShardSnapshotException.java index db7550c964299..0d8001ec3d730 100644 --- a/server/src/main/java/org/opensearch/index/snapshots/IndexShardSnapshotException.java +++ b/server/src/main/java/org/opensearch/index/snapshots/IndexShardSnapshotException.java @@ -40,6 +40,8 @@ /** * Generic shard snapshot exception + * + * @opensearch.internal */ public class IndexShardSnapshotException extends OpenSearchException { public IndexShardSnapshotException(ShardId shardId, String msg) { diff --git a/server/src/main/java/org/opensearch/index/snapshots/IndexShardSnapshotFailedException.java b/server/src/main/java/org/opensearch/index/snapshots/IndexShardSnapshotFailedException.java index 236cd668f443d..db03dfc7f421c 100644 --- a/server/src/main/java/org/opensearch/index/snapshots/IndexShardSnapshotFailedException.java +++ b/server/src/main/java/org/opensearch/index/snapshots/IndexShardSnapshotFailedException.java @@ -39,6 +39,8 @@ /** * Thrown when snapshot process is failed on a shard level + * + * @opensearch.internal */ public class IndexShardSnapshotFailedException extends IndexShardSnapshotException { public IndexShardSnapshotFailedException(ShardId shardId, String msg) { diff --git a/server/src/main/java/org/opensearch/index/snapshots/IndexShardSnapshotStatus.java b/server/src/main/java/org/opensearch/index/snapshots/IndexShardSnapshotStatus.java index fa7da12c18adf..f0ce45e290c16 100644 --- a/server/src/main/java/org/opensearch/index/snapshots/IndexShardSnapshotStatus.java +++ b/server/src/main/java/org/opensearch/index/snapshots/IndexShardSnapshotStatus.java @@ -37,6 +37,8 @@ /** * Represent shard snapshot status + * + * @opensearch.internal */ public class IndexShardSnapshotStatus { diff --git a/server/src/main/java/org/opensearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshot.java b/server/src/main/java/org/opensearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshot.java index 516fc19da1c8f..f3b6e91a79535 100644 --- a/server/src/main/java/org/opensearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshot.java +++ b/server/src/main/java/org/opensearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshot.java @@ -54,6 +54,8 @@ /** * Shard snapshot metadata + * + * @opensearch.internal */ public class BlobStoreIndexShardSnapshot implements ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshots.java b/server/src/main/java/org/opensearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshots.java index 87d04e2e01bd2..4f59f65e25553 100644 --- a/server/src/main/java/org/opensearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshots.java +++ b/server/src/main/java/org/opensearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshots.java @@ -55,6 +55,8 @@ *

    * This class is used to find files that were already snapshotted and clear out files that no longer referenced by any * snapshots. + * + * @opensearch.internal */ public class BlobStoreIndexShardSnapshots implements Iterable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/index/snapshots/blobstore/RateLimitingInputStream.java b/server/src/main/java/org/opensearch/index/snapshots/blobstore/RateLimitingInputStream.java index 6b5ce49289ac7..b95814f92624c 100644 --- a/server/src/main/java/org/opensearch/index/snapshots/blobstore/RateLimitingInputStream.java +++ b/server/src/main/java/org/opensearch/index/snapshots/blobstore/RateLimitingInputStream.java @@ -41,6 +41,8 @@ /** * Rate limiting wrapper for InputStream + * + * @opensearch.internal */ public class RateLimitingInputStream extends FilterInputStream { diff --git a/server/src/main/java/org/opensearch/index/snapshots/blobstore/SlicedInputStream.java b/server/src/main/java/org/opensearch/index/snapshots/blobstore/SlicedInputStream.java index c5b227341fbe5..b9b27547fe50c 100644 --- a/server/src/main/java/org/opensearch/index/snapshots/blobstore/SlicedInputStream.java +++ b/server/src/main/java/org/opensearch/index/snapshots/blobstore/SlicedInputStream.java @@ -43,6 +43,8 @@ * of all logical sub-streams ahead of time. Instead, {@link #openSlice(int)} is called * if a new slice is required. Each slice is closed once it's been fully consumed or if * close is called before. + * + * @opensearch.internal */ public abstract class SlicedInputStream extends InputStream { private int slice = 0; diff --git a/server/src/main/java/org/opensearch/index/snapshots/blobstore/SnapshotFiles.java b/server/src/main/java/org/opensearch/index/snapshots/blobstore/SnapshotFiles.java index 81075472c00da..9ac002f2bc60c 100644 --- a/server/src/main/java/org/opensearch/index/snapshots/blobstore/SnapshotFiles.java +++ b/server/src/main/java/org/opensearch/index/snapshots/blobstore/SnapshotFiles.java @@ -41,6 +41,8 @@ /** * Contains a list of files participating in a snapshot + * + * @opensearch.internal */ public class SnapshotFiles { diff --git a/server/src/main/java/org/opensearch/index/stats/IndexingPressurePerShardStats.java b/server/src/main/java/org/opensearch/index/stats/IndexingPressurePerShardStats.java index 1786b02c38643..b93de9f3039e5 100644 --- a/server/src/main/java/org/opensearch/index/stats/IndexingPressurePerShardStats.java +++ b/server/src/main/java/org/opensearch/index/stats/IndexingPressurePerShardStats.java @@ -19,6 +19,11 @@ import java.io.IOException; +/** + * Per shard indexing pressure statistics + * + * @opensearch.internal + */ public class IndexingPressurePerShardStats implements Writeable, ToXContentFragment { private final String shardId; diff --git a/server/src/main/java/org/opensearch/index/stats/IndexingPressureStats.java b/server/src/main/java/org/opensearch/index/stats/IndexingPressureStats.java index fd13b170e3fc2..5a94dc104fcf8 100644 --- a/server/src/main/java/org/opensearch/index/stats/IndexingPressureStats.java +++ b/server/src/main/java/org/opensearch/index/stats/IndexingPressureStats.java @@ -42,6 +42,11 @@ import java.io.IOException; +/** + * Base indexing pressure statistics + * + * @opensearch.internal + */ public class IndexingPressureStats implements Writeable, ToXContentFragment { private final long totalCombinedCoordinatingAndPrimaryBytes; diff --git a/server/src/main/java/org/opensearch/index/stats/ShardIndexingPressureStats.java b/server/src/main/java/org/opensearch/index/stats/ShardIndexingPressureStats.java index 7e928e0e4c094..16f3cc418c820 100644 --- a/server/src/main/java/org/opensearch/index/stats/ShardIndexingPressureStats.java +++ b/server/src/main/java/org/opensearch/index/stats/ShardIndexingPressureStats.java @@ -20,6 +20,11 @@ import java.util.HashMap; import java.util.Map; +/** + * Cumulative shard indexing pressure stats + * + * @opensearch.internal + */ public class ShardIndexingPressureStats implements Writeable, ToXContentFragment { private final Map shardIndexingPressureStore; diff --git a/server/src/main/java/org/opensearch/index/store/ByteSizeCachingDirectory.java b/server/src/main/java/org/opensearch/index/store/ByteSizeCachingDirectory.java index f9af1847dfff6..76836391cb9d6 100644 --- a/server/src/main/java/org/opensearch/index/store/ByteSizeCachingDirectory.java +++ b/server/src/main/java/org/opensearch/index/store/ByteSizeCachingDirectory.java @@ -47,6 +47,11 @@ import java.nio.file.NoSuchFileException; import java.util.Set; +/** + * Caching directory sized in bytes + * + * @opensearch.internal + */ final class ByteSizeCachingDirectory extends FilterDirectory { private static class SizeAndModCount { diff --git a/server/src/main/java/org/opensearch/index/store/FsDirectoryFactory.java b/server/src/main/java/org/opensearch/index/store/FsDirectoryFactory.java index 2539968b20b0e..02e9eb50e7309 100644 --- a/server/src/main/java/org/opensearch/index/store/FsDirectoryFactory.java +++ b/server/src/main/java/org/opensearch/index/store/FsDirectoryFactory.java @@ -57,6 +57,11 @@ import java.util.HashSet; import java.util.Set; +/** + * Factory for a filesystem directory + * + * @opensearch.internal + */ public class FsDirectoryFactory implements IndexStorePlugin.DirectoryFactory { public static final Setting INDEX_LOCK_FACTOR_SETTING = new Setting<>("index.store.fs.fs_lock", "native", (s) -> { diff --git a/server/src/main/java/org/opensearch/index/store/Store.java b/server/src/main/java/org/opensearch/index/store/Store.java index f4a94023a8ac8..e21cf8e3e5b58 100644 --- a/server/src/main/java/org/opensearch/index/store/Store.java +++ b/server/src/main/java/org/opensearch/index/store/Store.java @@ -140,6 +140,8 @@ * store.decRef(); * } * + * + * @opensearch.internal */ public class Store extends AbstractIndexShardComponent implements Closeable, RefCounted { /** diff --git a/server/src/main/java/org/opensearch/index/store/StoreFileMetadata.java b/server/src/main/java/org/opensearch/index/store/StoreFileMetadata.java index ea8704fe0f06f..30bab979b46c5 100644 --- a/server/src/main/java/org/opensearch/index/store/StoreFileMetadata.java +++ b/server/src/main/java/org/opensearch/index/store/StoreFileMetadata.java @@ -44,6 +44,11 @@ import java.text.ParseException; import java.util.Objects; +/** + * Metadata for the store file + * + * @opensearch.internal + */ public class StoreFileMetadata implements Writeable { private final String name; diff --git a/server/src/main/java/org/opensearch/index/store/StoreStats.java b/server/src/main/java/org/opensearch/index/store/StoreStats.java index 7122fa853676b..fdda71aaaeebb 100644 --- a/server/src/main/java/org/opensearch/index/store/StoreStats.java +++ b/server/src/main/java/org/opensearch/index/store/StoreStats.java @@ -43,6 +43,11 @@ import java.io.IOException; +/** + * Statistics about an OpenSearch Store + * + * @opensearch.internal + */ public class StoreStats implements Writeable, ToXContentFragment { /** diff --git a/server/src/main/java/org/opensearch/index/store/VerifyingIndexOutput.java b/server/src/main/java/org/opensearch/index/store/VerifyingIndexOutput.java index 7c005d5abd175..507f7149319fe 100644 --- a/server/src/main/java/org/opensearch/index/store/VerifyingIndexOutput.java +++ b/server/src/main/java/org/opensearch/index/store/VerifyingIndexOutput.java @@ -40,6 +40,8 @@ /** * abstract class for verifying what was written. * subclasses override {@link #writeByte(byte)} and {@link #writeBytes(byte[], int, int)} + * + * @opensearch.internal */ // do NOT optimize this class for performance public abstract class VerifyingIndexOutput extends FilterIndexOutput { diff --git a/server/src/main/java/org/opensearch/index/termvectors/TermVectorsService.java b/server/src/main/java/org/opensearch/index/termvectors/TermVectorsService.java index 3467a86c86c86..7648f151851c0 100644 --- a/server/src/main/java/org/opensearch/index/termvectors/TermVectorsService.java +++ b/server/src/main/java/org/opensearch/index/termvectors/TermVectorsService.java @@ -83,6 +83,11 @@ import java.util.concurrent.TimeUnit; import java.util.function.LongSupplier; +/** + * Service for Term Vectors + * + * @opensearch.internal + */ public class TermVectorsService { private TermVectorsService() {} diff --git a/server/src/main/java/org/opensearch/index/translog/BaseTranslogReader.java b/server/src/main/java/org/opensearch/index/translog/BaseTranslogReader.java index 138ad9a221096..aaa54bfdf7c2d 100644 --- a/server/src/main/java/org/opensearch/index/translog/BaseTranslogReader.java +++ b/server/src/main/java/org/opensearch/index/translog/BaseTranslogReader.java @@ -43,6 +43,8 @@ /** * A base class for all classes that allows reading ops from translog files + * + * @opensearch.internal */ public abstract class BaseTranslogReader implements Comparable { diff --git a/server/src/main/java/org/opensearch/index/translog/BufferedChecksumStreamInput.java b/server/src/main/java/org/opensearch/index/translog/BufferedChecksumStreamInput.java index e93ba670ffd45..5feb994171b65 100644 --- a/server/src/main/java/org/opensearch/index/translog/BufferedChecksumStreamInput.java +++ b/server/src/main/java/org/opensearch/index/translog/BufferedChecksumStreamInput.java @@ -43,6 +43,8 @@ /** * Similar to Lucene's BufferedChecksumIndexInput, however this wraps a * {@link StreamInput} so anything read will update the checksum + * + * @opensearch.internal */ public final class BufferedChecksumStreamInput extends FilterStreamInput { private static final int SKIP_BUFFER_SIZE = 1024; diff --git a/server/src/main/java/org/opensearch/index/translog/BufferedChecksumStreamOutput.java b/server/src/main/java/org/opensearch/index/translog/BufferedChecksumStreamOutput.java index 9d2375df7a9d7..0efffccfb8a7f 100644 --- a/server/src/main/java/org/opensearch/index/translog/BufferedChecksumStreamOutput.java +++ b/server/src/main/java/org/opensearch/index/translog/BufferedChecksumStreamOutput.java @@ -42,6 +42,8 @@ /** * Similar to Lucene's BufferedChecksumIndexOutput, however this wraps a * {@link StreamOutput} so anything written will update the checksum + * + * @opensearch.internal */ public final class BufferedChecksumStreamOutput extends StreamOutput { private final StreamOutput out; diff --git a/server/src/main/java/org/opensearch/index/translog/ChannelFactory.java b/server/src/main/java/org/opensearch/index/translog/ChannelFactory.java index 46eef80c95ff9..f86b9dea0a5f7 100644 --- a/server/src/main/java/org/opensearch/index/translog/ChannelFactory.java +++ b/server/src/main/java/org/opensearch/index/translog/ChannelFactory.java @@ -39,6 +39,8 @@ /** * only for testing until we have a disk-full FileSystem + * + * @opensearch.internal */ @FunctionalInterface public interface ChannelFactory { diff --git a/server/src/main/java/org/opensearch/index/translog/Checkpoint.java b/server/src/main/java/org/opensearch/index/translog/Checkpoint.java index 0cff884cabfaa..ade28791b2e27 100644 --- a/server/src/main/java/org/opensearch/index/translog/Checkpoint.java +++ b/server/src/main/java/org/opensearch/index/translog/Checkpoint.java @@ -54,6 +54,11 @@ import java.nio.file.OpenOption; import java.nio.file.Path; +/** + * A checkpoint for OpenSearch operations + * + * @opensearch.internal + */ final class Checkpoint { final long offset; diff --git a/server/src/main/java/org/opensearch/index/translog/DefaultTranslogDeletionPolicy.java b/server/src/main/java/org/opensearch/index/translog/DefaultTranslogDeletionPolicy.java index 1346a16910d58..efc762ef00d52 100644 --- a/server/src/main/java/org/opensearch/index/translog/DefaultTranslogDeletionPolicy.java +++ b/server/src/main/java/org/opensearch/index/translog/DefaultTranslogDeletionPolicy.java @@ -16,6 +16,8 @@ * via the {@link org.opensearch.plugins.EnginePlugin#getCustomTranslogDeletionPolicyFactory()}. * * The default policy uses total number, size in bytes and maximum age for files. + * + * @opensearch.internal */ public class DefaultTranslogDeletionPolicy extends TranslogDeletionPolicy { diff --git a/server/src/main/java/org/opensearch/index/translog/MultiSnapshot.java b/server/src/main/java/org/opensearch/index/translog/MultiSnapshot.java index 9a2fd009f4216..f1de0ddab97c4 100644 --- a/server/src/main/java/org/opensearch/index/translog/MultiSnapshot.java +++ b/server/src/main/java/org/opensearch/index/translog/MultiSnapshot.java @@ -42,6 +42,8 @@ /** * A snapshot composed out of multiple snapshots + * + * @opensearch.internal */ final class MultiSnapshot implements Translog.Snapshot { diff --git a/server/src/main/java/org/opensearch/index/translog/TragicExceptionHolder.java b/server/src/main/java/org/opensearch/index/translog/TragicExceptionHolder.java index 6a8fdc4a3d7a3..818d840cb11fd 100644 --- a/server/src/main/java/org/opensearch/index/translog/TragicExceptionHolder.java +++ b/server/src/main/java/org/opensearch/index/translog/TragicExceptionHolder.java @@ -37,6 +37,11 @@ import java.util.concurrent.atomic.AtomicReference; +/** + * Exception thrown if there are any massive OpenSearch failures + * + * @opensearch.internal + */ public class TragicExceptionHolder { private final AtomicReference tragedy = new AtomicReference<>(); diff --git a/server/src/main/java/org/opensearch/index/translog/Translog.java b/server/src/main/java/org/opensearch/index/translog/Translog.java index 25d84efbee38f..4a11db2bc6a1d 100644 --- a/server/src/main/java/org/opensearch/index/translog/Translog.java +++ b/server/src/main/java/org/opensearch/index/translog/Translog.java @@ -109,6 +109,8 @@ * which is an fsynced copy of its last {@code translog.ckp} such that in disaster recovery last fsynced offsets, number of * operation etc. are still preserved. *

    + * + * @opensearch.internal */ public class Translog extends AbstractIndexShardComponent implements IndexShardComponent, Closeable { diff --git a/server/src/main/java/org/opensearch/index/translog/TranslogConfig.java b/server/src/main/java/org/opensearch/index/translog/TranslogConfig.java index b2928c8340870..1d01dc854be37 100644 --- a/server/src/main/java/org/opensearch/index/translog/TranslogConfig.java +++ b/server/src/main/java/org/opensearch/index/translog/TranslogConfig.java @@ -40,10 +40,12 @@ import java.nio.file.Path; -/* +/** * Holds all the configuration that is used to create a {@link Translog}. * Once {@link Translog} has been created with this object, changes to this * object will affect the {@link Translog} instance. + * + * @opensearch.internal */ public final class TranslogConfig { diff --git a/server/src/main/java/org/opensearch/index/translog/TranslogCorruptedException.java b/server/src/main/java/org/opensearch/index/translog/TranslogCorruptedException.java index 62159179eea13..cf3d07c0ef910 100644 --- a/server/src/main/java/org/opensearch/index/translog/TranslogCorruptedException.java +++ b/server/src/main/java/org/opensearch/index/translog/TranslogCorruptedException.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Exception thrown if the translog is corrupted + * + * @opensearch.internal + */ public class TranslogCorruptedException extends OpenSearchException { public TranslogCorruptedException(String source, String details) { super(corruptedMessage(source, details)); diff --git a/server/src/main/java/org/opensearch/index/translog/TranslogDeletionPolicy.java b/server/src/main/java/org/opensearch/index/translog/TranslogDeletionPolicy.java index 62f2703becca7..95f39c1188b2b 100644 --- a/server/src/main/java/org/opensearch/index/translog/TranslogDeletionPolicy.java +++ b/server/src/main/java/org/opensearch/index/translog/TranslogDeletionPolicy.java @@ -44,6 +44,11 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicBoolean; +/** + * Defines a translog deletion policy + * + * @opensearch.internal + */ public abstract class TranslogDeletionPolicy { private final Map openTranslogRef; diff --git a/server/src/main/java/org/opensearch/index/translog/TranslogDeletionPolicyFactory.java b/server/src/main/java/org/opensearch/index/translog/TranslogDeletionPolicyFactory.java index e964308a537ab..8f40fdc90368f 100644 --- a/server/src/main/java/org/opensearch/index/translog/TranslogDeletionPolicyFactory.java +++ b/server/src/main/java/org/opensearch/index/translog/TranslogDeletionPolicyFactory.java @@ -13,6 +13,11 @@ import java.util.function.Supplier; +/** + * Factory to instantiate a translog deletion policy + * + * @opensearch.api + */ @FunctionalInterface public interface TranslogDeletionPolicyFactory { TranslogDeletionPolicy create(IndexSettings settings, Supplier supplier); diff --git a/server/src/main/java/org/opensearch/index/translog/TranslogException.java b/server/src/main/java/org/opensearch/index/translog/TranslogException.java index a162ab0fa019b..ffa964c13976e 100644 --- a/server/src/main/java/org/opensearch/index/translog/TranslogException.java +++ b/server/src/main/java/org/opensearch/index/translog/TranslogException.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Exception thrown if there are any failures in the translog + * + * @opensearch.internal + */ public class TranslogException extends OpenSearchException { public TranslogException(ShardId shardId, String msg) { diff --git a/server/src/main/java/org/opensearch/index/translog/TranslogHeader.java b/server/src/main/java/org/opensearch/index/translog/TranslogHeader.java index c6158ecc942b6..0819d009c9992 100644 --- a/server/src/main/java/org/opensearch/index/translog/TranslogHeader.java +++ b/server/src/main/java/org/opensearch/index/translog/TranslogHeader.java @@ -53,6 +53,8 @@ /** * Each translog file is started with a translog header then followed by translog operations. + * + * @opensearch.internal */ final class TranslogHeader { public static final String TRANSLOG_CODEC = "translog"; diff --git a/server/src/main/java/org/opensearch/index/translog/TranslogReader.java b/server/src/main/java/org/opensearch/index/translog/TranslogReader.java index 3c47ce2207e4b..9d22fe0a498eb 100644 --- a/server/src/main/java/org/opensearch/index/translog/TranslogReader.java +++ b/server/src/main/java/org/opensearch/index/translog/TranslogReader.java @@ -50,6 +50,8 @@ /** * an immutable translog filereader + * + * @opensearch.internal */ public class TranslogReader extends BaseTranslogReader implements Closeable { protected final long length; diff --git a/server/src/main/java/org/opensearch/index/translog/TranslogSnapshot.java b/server/src/main/java/org/opensearch/index/translog/TranslogSnapshot.java index c9b1383bb0206..89718156cbbe8 100644 --- a/server/src/main/java/org/opensearch/index/translog/TranslogSnapshot.java +++ b/server/src/main/java/org/opensearch/index/translog/TranslogSnapshot.java @@ -38,6 +38,11 @@ import java.io.IOException; import java.nio.ByteBuffer; +/** + * A snapshot of translog operations + * + * @opensearch.internal + */ final class TranslogSnapshot extends BaseTranslogReader { private final int totalOperations; diff --git a/server/src/main/java/org/opensearch/index/translog/TranslogStats.java b/server/src/main/java/org/opensearch/index/translog/TranslogStats.java index 427802140d927..6265ba60db555 100644 --- a/server/src/main/java/org/opensearch/index/translog/TranslogStats.java +++ b/server/src/main/java/org/opensearch/index/translog/TranslogStats.java @@ -41,6 +41,11 @@ import java.io.IOException; +/** + * Translog statistics + * + * @opensearch.internal + */ public class TranslogStats implements Writeable, ToXContentFragment { private long translogSizeInBytes; diff --git a/server/src/main/java/org/opensearch/index/translog/TranslogWriter.java b/server/src/main/java/org/opensearch/index/translog/TranslogWriter.java index 66241f7b6847f..413975f82678b 100644 --- a/server/src/main/java/org/opensearch/index/translog/TranslogWriter.java +++ b/server/src/main/java/org/opensearch/index/translog/TranslogWriter.java @@ -68,6 +68,11 @@ import java.util.function.LongConsumer; import java.util.function.LongSupplier; +/** + * Writer that writes operations to the translog + * + * @opensearch.internal + */ public class TranslogWriter extends BaseTranslogReader implements Closeable { private final ShardId shardId; diff --git a/server/src/main/java/org/opensearch/index/translog/TruncateTranslogAction.java b/server/src/main/java/org/opensearch/index/translog/TruncateTranslogAction.java index 7d30fe2e2ffe3..33294eb9e7d24 100644 --- a/server/src/main/java/org/opensearch/index/translog/TruncateTranslogAction.java +++ b/server/src/main/java/org/opensearch/index/translog/TruncateTranslogAction.java @@ -67,6 +67,11 @@ import java.util.Set; import java.util.TreeSet; +/** + * Action event when translog is truncated + * + * @opensearch.internal + */ public class TruncateTranslogAction { protected static final Logger logger = LogManager.getLogger(TruncateTranslogAction.class); diff --git a/server/src/main/java/org/opensearch/index/translog/TruncatedTranslogException.java b/server/src/main/java/org/opensearch/index/translog/TruncatedTranslogException.java index 8ae7a65727537..3660e2c835e11 100644 --- a/server/src/main/java/org/opensearch/index/translog/TruncatedTranslogException.java +++ b/server/src/main/java/org/opensearch/index/translog/TruncatedTranslogException.java @@ -36,6 +36,11 @@ import java.io.IOException; +/** + * Exception thrown if there is an error truncating the translog + * + * @opensearch.internal + */ public class TruncatedTranslogException extends TranslogCorruptedException { public TruncatedTranslogException(StreamInput in) throws IOException { diff --git a/server/src/main/java/org/opensearch/index/warmer/ShardIndexWarmerService.java b/server/src/main/java/org/opensearch/index/warmer/ShardIndexWarmerService.java index 225400818f200..c690ed8c1c385 100644 --- a/server/src/main/java/org/opensearch/index/warmer/ShardIndexWarmerService.java +++ b/server/src/main/java/org/opensearch/index/warmer/ShardIndexWarmerService.java @@ -41,6 +41,11 @@ import java.util.concurrent.TimeUnit; +/** + * Warms the index into the cache + * + * @opensearch.internal + */ public class ShardIndexWarmerService extends AbstractIndexShardComponent { private final CounterMetric current = new CounterMetric(); diff --git a/server/src/main/java/org/opensearch/index/warmer/WarmerStats.java b/server/src/main/java/org/opensearch/index/warmer/WarmerStats.java index 0d4241aa534ec..79fba31d015d3 100644 --- a/server/src/main/java/org/opensearch/index/warmer/WarmerStats.java +++ b/server/src/main/java/org/opensearch/index/warmer/WarmerStats.java @@ -41,6 +41,11 @@ import java.io.IOException; +/** + * Stats collected about the warmer + * + * @opensearch.internal + */ public class WarmerStats implements Writeable, ToXContentFragment { private long current; diff --git a/server/src/main/java/org/opensearch/indices/AbstractIndexShardCacheEntity.java b/server/src/main/java/org/opensearch/indices/AbstractIndexShardCacheEntity.java index 4717867a5245d..c0202f099f4e0 100644 --- a/server/src/main/java/org/opensearch/indices/AbstractIndexShardCacheEntity.java +++ b/server/src/main/java/org/opensearch/indices/AbstractIndexShardCacheEntity.java @@ -39,6 +39,8 @@ /** * Abstract base class for the an {@link IndexShard} level {@linkplain IndicesRequestCache.CacheEntity}. + * + * @opensearch.internal */ abstract class AbstractIndexShardCacheEntity implements IndicesRequestCache.CacheEntity { diff --git a/server/src/main/java/org/opensearch/indices/AliasFilterParsingException.java b/server/src/main/java/org/opensearch/indices/AliasFilterParsingException.java index 0a2c292ab7765..494824b11bafe 100644 --- a/server/src/main/java/org/opensearch/indices/AliasFilterParsingException.java +++ b/server/src/main/java/org/opensearch/indices/AliasFilterParsingException.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Exception thrown for parsing alias filters + * + * @opensearch.internal + */ public class AliasFilterParsingException extends OpenSearchException { public AliasFilterParsingException(Index index, String name, String desc, Throwable ex) { diff --git a/server/src/main/java/org/opensearch/indices/IndexClosedException.java b/server/src/main/java/org/opensearch/indices/IndexClosedException.java index aa2971e598e06..64ffcf173f46f 100644 --- a/server/src/main/java/org/opensearch/indices/IndexClosedException.java +++ b/server/src/main/java/org/opensearch/indices/IndexClosedException.java @@ -41,6 +41,8 @@ /** * Exception indicating that one or more requested indices are closed. + * + * @opensearch.internal */ public class IndexClosedException extends OpenSearchException { diff --git a/server/src/main/java/org/opensearch/indices/IndexCreationException.java b/server/src/main/java/org/opensearch/indices/IndexCreationException.java index fde1ad623fa12..2eca5c8f0a5d9 100644 --- a/server/src/main/java/org/opensearch/indices/IndexCreationException.java +++ b/server/src/main/java/org/opensearch/indices/IndexCreationException.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Exception thrown if there is an error creating an index + * + * @opensearch.internal + */ public class IndexCreationException extends OpenSearchException implements OpenSearchWrapperException { public IndexCreationException(String index, Throwable cause) { diff --git a/server/src/main/java/org/opensearch/indices/IndexPrimaryShardNotAllocatedException.java b/server/src/main/java/org/opensearch/indices/IndexPrimaryShardNotAllocatedException.java index 2e680e6d0aa77..a646ae53ecc5a 100644 --- a/server/src/main/java/org/opensearch/indices/IndexPrimaryShardNotAllocatedException.java +++ b/server/src/main/java/org/opensearch/indices/IndexPrimaryShardNotAllocatedException.java @@ -42,6 +42,8 @@ /** * Thrown when some action cannot be performed because the primary shard of * some shard group in an index has not been allocated post api action. + * + * @opensearch.internal */ public class IndexPrimaryShardNotAllocatedException extends OpenSearchException { public IndexPrimaryShardNotAllocatedException(StreamInput in) throws IOException { diff --git a/server/src/main/java/org/opensearch/indices/IndexTemplateMissingException.java b/server/src/main/java/org/opensearch/indices/IndexTemplateMissingException.java index fde9ef3712cf0..78060c1b3a072 100644 --- a/server/src/main/java/org/opensearch/indices/IndexTemplateMissingException.java +++ b/server/src/main/java/org/opensearch/indices/IndexTemplateMissingException.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Exception thrown if an index template is missing + * + * @opensearch.internal + */ public class IndexTemplateMissingException extends OpenSearchException { private final String name; diff --git a/server/src/main/java/org/opensearch/indices/IndexingMemoryController.java b/server/src/main/java/org/opensearch/indices/IndexingMemoryController.java index 1917a224e5410..ae51a525765ba 100644 --- a/server/src/main/java/org/opensearch/indices/IndexingMemoryController.java +++ b/server/src/main/java/org/opensearch/indices/IndexingMemoryController.java @@ -62,6 +62,11 @@ import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.locks.ReentrantLock; +/** + * Memory controller for indexing operations + * + * @opensearch.internal + */ public class IndexingMemoryController implements IndexingOperationListener, Closeable { private static final Logger logger = LogManager.getLogger(IndexingMemoryController.class); diff --git a/server/src/main/java/org/opensearch/indices/IndicesModule.java b/server/src/main/java/org/opensearch/indices/IndicesModule.java index 5e59908e741ba..f188c47e7a9de 100644 --- a/server/src/main/java/org/opensearch/indices/IndicesModule.java +++ b/server/src/main/java/org/opensearch/indices/IndicesModule.java @@ -89,6 +89,8 @@ /** * Configures classes and services that are shared by indices on each node. + * + * @opensearch.internal */ public class IndicesModule extends AbstractModule { private final List namedWritables = new ArrayList<>(); diff --git a/server/src/main/java/org/opensearch/indices/IndicesQueryCache.java b/server/src/main/java/org/opensearch/indices/IndicesQueryCache.java index 2cbb83fde278d..ce94d769f9c31 100644 --- a/server/src/main/java/org/opensearch/indices/IndicesQueryCache.java +++ b/server/src/main/java/org/opensearch/indices/IndicesQueryCache.java @@ -62,6 +62,11 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.function.Predicate; +/** + * The query cache for indices + * + * @opensearch.internal + */ public class IndicesQueryCache implements QueryCache, Closeable { private static final Logger logger = LogManager.getLogger(IndicesQueryCache.class); diff --git a/server/src/main/java/org/opensearch/indices/IndicesRequestCache.java b/server/src/main/java/org/opensearch/indices/IndicesRequestCache.java index d82ec0afc2c98..920d3492e0b62 100644 --- a/server/src/main/java/org/opensearch/indices/IndicesRequestCache.java +++ b/server/src/main/java/org/opensearch/indices/IndicesRequestCache.java @@ -76,6 +76,8 @@ *

    * There are still several TODOs left in this class, some easily addressable, some more complex, but the support * is functional. + * + * @opensearch.internal */ public final class IndicesRequestCache implements RemovalListener, Closeable { diff --git a/server/src/main/java/org/opensearch/indices/IndicesService.java b/server/src/main/java/org/opensearch/indices/IndicesService.java index 5caafb0ce60d4..87cd63119f1d4 100644 --- a/server/src/main/java/org/opensearch/indices/IndicesService.java +++ b/server/src/main/java/org/opensearch/indices/IndicesService.java @@ -189,6 +189,11 @@ import static org.opensearch.index.query.AbstractQueryBuilder.parseInnerQueryBuilder; import static org.opensearch.search.SearchService.ALLOW_EXPENSIVE_QUERIES; +/** + * Main OpenSearch indices service + * + * @opensearch.internal + */ public class IndicesService extends AbstractLifecycleComponent implements IndicesClusterStateService.AllocatedIndices, diff --git a/server/src/main/java/org/opensearch/indices/InvalidAliasNameException.java b/server/src/main/java/org/opensearch/indices/InvalidAliasNameException.java index 3658ffe8e588b..47184fc608bea 100644 --- a/server/src/main/java/org/opensearch/indices/InvalidAliasNameException.java +++ b/server/src/main/java/org/opensearch/indices/InvalidAliasNameException.java @@ -39,6 +39,11 @@ import java.io.IOException; +/** + * Exception thrown if an alias name is invalid + * + * @opensearch.internal + */ public class InvalidAliasNameException extends OpenSearchException { public InvalidAliasNameException(Index index, String name, String desc) { diff --git a/server/src/main/java/org/opensearch/indices/InvalidIndexNameException.java b/server/src/main/java/org/opensearch/indices/InvalidIndexNameException.java index b9df6569ebbf3..631aaa937cf63 100644 --- a/server/src/main/java/org/opensearch/indices/InvalidIndexNameException.java +++ b/server/src/main/java/org/opensearch/indices/InvalidIndexNameException.java @@ -39,6 +39,11 @@ import java.io.IOException; +/** + * Exception thrown if an index name is invalid + * + * @opensearch.internal + */ public class InvalidIndexNameException extends OpenSearchException { public InvalidIndexNameException(String name, String desc) { diff --git a/server/src/main/java/org/opensearch/indices/InvalidIndexTemplateException.java b/server/src/main/java/org/opensearch/indices/InvalidIndexTemplateException.java index 3ecbfe1e70edd..17a7334e6867a 100644 --- a/server/src/main/java/org/opensearch/indices/InvalidIndexTemplateException.java +++ b/server/src/main/java/org/opensearch/indices/InvalidIndexTemplateException.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Exception thrown if an index template is invalid + * + * @opensearch.internal + */ public class InvalidIndexTemplateException extends OpenSearchException { private final String name; diff --git a/server/src/main/java/org/opensearch/indices/InvalidTypeNameException.java b/server/src/main/java/org/opensearch/indices/InvalidTypeNameException.java index d240cf6f83ff7..1e33488b6fb8a 100644 --- a/server/src/main/java/org/opensearch/indices/InvalidTypeNameException.java +++ b/server/src/main/java/org/opensearch/indices/InvalidTypeNameException.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Exception thrown if a type is invalid + * + * @opensearch.internal + */ public class InvalidTypeNameException extends MapperException { public InvalidTypeNameException(StreamInput in) throws IOException { diff --git a/server/src/main/java/org/opensearch/indices/NodeIndicesStats.java b/server/src/main/java/org/opensearch/indices/NodeIndicesStats.java index 8e89894cbc78e..b6eedb338b006 100644 --- a/server/src/main/java/org/opensearch/indices/NodeIndicesStats.java +++ b/server/src/main/java/org/opensearch/indices/NodeIndicesStats.java @@ -67,6 +67,8 @@ /** * Global information on indices stats running on a specific node. + * + * @opensearch.internal */ public class NodeIndicesStats implements Writeable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/indices/ShardLimitValidator.java b/server/src/main/java/org/opensearch/indices/ShardLimitValidator.java index 7e4376e8ea8de..a5ec6cbecaf55 100644 --- a/server/src/main/java/org/opensearch/indices/ShardLimitValidator.java +++ b/server/src/main/java/org/opensearch/indices/ShardLimitValidator.java @@ -53,6 +53,8 @@ * NOTE: This is the limit applied at *shard creation time*. If you are looking for the limit applied at *allocation* time, which is * controlled by a different setting, * see {@link org.opensearch.cluster.routing.allocation.decider.ShardsLimitAllocationDecider}. + * + * @opensearch.internal */ public class ShardLimitValidator { public static final Setting SETTING_CLUSTER_MAX_SHARDS_PER_NODE = Setting.intSetting( diff --git a/server/src/main/java/org/opensearch/indices/SystemIndexDescriptor.java b/server/src/main/java/org/opensearch/indices/SystemIndexDescriptor.java index 9e41fe8943474..f3592a3561d3a 100644 --- a/server/src/main/java/org/opensearch/indices/SystemIndexDescriptor.java +++ b/server/src/main/java/org/opensearch/indices/SystemIndexDescriptor.java @@ -39,6 +39,8 @@ /** * Describes a system index. Provides the information required to create and maintain the system index. + * + * @opensearch.internal */ public class SystemIndexDescriptor { private final String indexPattern; diff --git a/server/src/main/java/org/opensearch/indices/SystemIndices.java b/server/src/main/java/org/opensearch/indices/SystemIndices.java index 042291554670c..3d5df507348fb 100644 --- a/server/src/main/java/org/opensearch/indices/SystemIndices.java +++ b/server/src/main/java/org/opensearch/indices/SystemIndices.java @@ -63,6 +63,8 @@ * This class holds the {@link SystemIndexDescriptor} objects that represent system indices the * node knows about. Methods for determining if an index should be a system index are also provided * to reduce the locations within the code that need to deal with {@link SystemIndexDescriptor}s. + * + * @opensearch.internal */ public class SystemIndices { private static final Logger logger = LogManager.getLogger(SystemIndices.class); diff --git a/server/src/main/java/org/opensearch/indices/TermsLookup.java b/server/src/main/java/org/opensearch/indices/TermsLookup.java index bf6c024fa130e..0aed352bc3664 100644 --- a/server/src/main/java/org/opensearch/indices/TermsLookup.java +++ b/server/src/main/java/org/opensearch/indices/TermsLookup.java @@ -51,6 +51,8 @@ /** * Encapsulates the parameters needed to fetch terms. + * + * @opensearch.internal */ public class TermsLookup implements Writeable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/indices/TypeMissingException.java b/server/src/main/java/org/opensearch/indices/TypeMissingException.java index 3392979fdbc0d..a57e62bf2a76e 100644 --- a/server/src/main/java/org/opensearch/indices/TypeMissingException.java +++ b/server/src/main/java/org/opensearch/indices/TypeMissingException.java @@ -40,6 +40,14 @@ import java.io.IOException; import java.util.Arrays; +/** + * Exception thrown if a document type is missing + * + * @opensearch.internal + * + * @deprecated Types are removed + */ +@Deprecated public class TypeMissingException extends OpenSearchException { public TypeMissingException(Index index, String... types) { diff --git a/server/src/main/java/org/opensearch/indices/analysis/AnalysisModule.java b/server/src/main/java/org/opensearch/indices/analysis/AnalysisModule.java index 5d43bfa8876c8..cc87c982a684d 100644 --- a/server/src/main/java/org/opensearch/indices/analysis/AnalysisModule.java +++ b/server/src/main/java/org/opensearch/indices/analysis/AnalysisModule.java @@ -74,6 +74,8 @@ /** * Sets up {@link AnalysisRegistry}. + * + * @opensearch.internal */ public final class AnalysisModule { static { diff --git a/server/src/main/java/org/opensearch/indices/analysis/HunspellService.java b/server/src/main/java/org/opensearch/indices/analysis/HunspellService.java index 08f8b18920eb9..61191a1e49f63 100644 --- a/server/src/main/java/org/opensearch/indices/analysis/HunspellService.java +++ b/server/src/main/java/org/opensearch/indices/analysis/HunspellService.java @@ -87,6 +87,8 @@ * * * @see org.opensearch.index.analysis.HunspellTokenFilterFactory + * + * @opensearch.internal */ public class HunspellService { diff --git a/server/src/main/java/org/opensearch/indices/analysis/PreBuiltAnalyzers.java b/server/src/main/java/org/opensearch/indices/analysis/PreBuiltAnalyzers.java index 640100bbcc082..fad9c7d6c61cc 100644 --- a/server/src/main/java/org/opensearch/indices/analysis/PreBuiltAnalyzers.java +++ b/server/src/main/java/org/opensearch/indices/analysis/PreBuiltAnalyzers.java @@ -45,6 +45,11 @@ import java.util.Locale; +/** + * Pre built analyzers + * + * @opensearch.internal + */ public enum PreBuiltAnalyzers { STANDARD(CachingStrategy.OPENSEARCH) { diff --git a/server/src/main/java/org/opensearch/indices/analysis/PreBuiltCacheFactory.java b/server/src/main/java/org/opensearch/indices/analysis/PreBuiltCacheFactory.java index f53c1b5568584..192301c7bd9cf 100644 --- a/server/src/main/java/org/opensearch/indices/analysis/PreBuiltCacheFactory.java +++ b/server/src/main/java/org/opensearch/indices/analysis/PreBuiltCacheFactory.java @@ -39,6 +39,11 @@ import java.util.HashMap; import java.util.Map; +/** + * A factory for the pre-built cache + * + * @opensearch.internal + */ public class PreBuiltCacheFactory { /** diff --git a/server/src/main/java/org/opensearch/indices/analysis/PreBuiltTokenizers.java b/server/src/main/java/org/opensearch/indices/analysis/PreBuiltTokenizers.java index 3499e63501efd..c68f8fe6c3ba5 100644 --- a/server/src/main/java/org/opensearch/indices/analysis/PreBuiltTokenizers.java +++ b/server/src/main/java/org/opensearch/indices/analysis/PreBuiltTokenizers.java @@ -37,6 +37,11 @@ import org.opensearch.index.analysis.TokenFilterFactory; import org.opensearch.indices.analysis.PreBuiltCacheFactory.CachingStrategy; +/** + * Pre-built tokenizers for analysis + * + * @opensearch.internal + */ public enum PreBuiltTokenizers { STANDARD(CachingStrategy.ONE) { diff --git a/server/src/main/java/org/opensearch/indices/breaker/AllCircuitBreakerStats.java b/server/src/main/java/org/opensearch/indices/breaker/AllCircuitBreakerStats.java index 4c737774fc42e..01284d42a3cf9 100644 --- a/server/src/main/java/org/opensearch/indices/breaker/AllCircuitBreakerStats.java +++ b/server/src/main/java/org/opensearch/indices/breaker/AllCircuitBreakerStats.java @@ -42,6 +42,8 @@ /** * Stats class encapsulating all of the different circuit breaker stats + * + * @opensearch.internal */ public class AllCircuitBreakerStats implements Writeable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/indices/breaker/BreakerSettings.java b/server/src/main/java/org/opensearch/indices/breaker/BreakerSettings.java index 97c851e036778..a421253227dbf 100644 --- a/server/src/main/java/org/opensearch/indices/breaker/BreakerSettings.java +++ b/server/src/main/java/org/opensearch/indices/breaker/BreakerSettings.java @@ -39,6 +39,8 @@ /** * Settings for a {@link CircuitBreaker} + * + * @opensearch.internal */ public final class BreakerSettings { diff --git a/server/src/main/java/org/opensearch/indices/breaker/CircuitBreakerService.java b/server/src/main/java/org/opensearch/indices/breaker/CircuitBreakerService.java index fd7ce00fde798..b5cc1a6b1c6c5 100644 --- a/server/src/main/java/org/opensearch/indices/breaker/CircuitBreakerService.java +++ b/server/src/main/java/org/opensearch/indices/breaker/CircuitBreakerService.java @@ -40,6 +40,8 @@ /** * Interface for Circuit Breaker services, which provide breakers to classes * that load field data. + * + * @opensearch.internal */ public abstract class CircuitBreakerService extends AbstractLifecycleComponent { private static final Logger logger = LogManager.getLogger(CircuitBreakerService.class); diff --git a/server/src/main/java/org/opensearch/indices/breaker/CircuitBreakerStats.java b/server/src/main/java/org/opensearch/indices/breaker/CircuitBreakerStats.java index 4c67e4ce21a33..64bf4c16a6059 100644 --- a/server/src/main/java/org/opensearch/indices/breaker/CircuitBreakerStats.java +++ b/server/src/main/java/org/opensearch/indices/breaker/CircuitBreakerStats.java @@ -44,6 +44,8 @@ /** * Class encapsulating stats about the circuit breaker + * + * @opensearch.internal */ public class CircuitBreakerStats implements Writeable, ToXContentObject { diff --git a/server/src/main/java/org/opensearch/indices/breaker/HierarchyCircuitBreakerService.java b/server/src/main/java/org/opensearch/indices/breaker/HierarchyCircuitBreakerService.java index ec5d1edf3c448..02d1e1a76f3f1 100644 --- a/server/src/main/java/org/opensearch/indices/breaker/HierarchyCircuitBreakerService.java +++ b/server/src/main/java/org/opensearch/indices/breaker/HierarchyCircuitBreakerService.java @@ -71,6 +71,8 @@ /** * CircuitBreakerService that attempts to redistribute space between breakers * if tripped + * + * @opensearch.internal */ public class HierarchyCircuitBreakerService extends CircuitBreakerService { private static final Logger logger = LogManager.getLogger(HierarchyCircuitBreakerService.class); diff --git a/server/src/main/java/org/opensearch/indices/breaker/NoneCircuitBreakerService.java b/server/src/main/java/org/opensearch/indices/breaker/NoneCircuitBreakerService.java index ef77598b20009..bcb47b48a5f14 100644 --- a/server/src/main/java/org/opensearch/indices/breaker/NoneCircuitBreakerService.java +++ b/server/src/main/java/org/opensearch/indices/breaker/NoneCircuitBreakerService.java @@ -37,6 +37,8 @@ /** * Class that returns a breaker that never breaks + * + * @opensearch.internal */ public class NoneCircuitBreakerService extends CircuitBreakerService { diff --git a/server/src/main/java/org/opensearch/indices/cluster/IndicesClusterStateService.java b/server/src/main/java/org/opensearch/indices/cluster/IndicesClusterStateService.java index b7f8bc5a4e502..d06b33b121667 100644 --- a/server/src/main/java/org/opensearch/indices/cluster/IndicesClusterStateService.java +++ b/server/src/main/java/org/opensearch/indices/cluster/IndicesClusterStateService.java @@ -106,6 +106,11 @@ import static org.opensearch.indices.cluster.IndicesClusterStateService.AllocatedIndices.IndexRemovalReason.NO_LONGER_ASSIGNED; import static org.opensearch.indices.cluster.IndicesClusterStateService.AllocatedIndices.IndexRemovalReason.REOPENED; +/** + * Service to update the cluster state for multiple indices + * + * @opensearch.internal + */ public class IndicesClusterStateService extends AbstractLifecycleComponent implements ClusterStateApplier { private static final Logger logger = LogManager.getLogger(IndicesClusterStateService.class); diff --git a/server/src/main/java/org/opensearch/indices/fielddata/cache/IndicesFieldDataCache.java b/server/src/main/java/org/opensearch/indices/fielddata/cache/IndicesFieldDataCache.java index a632175e0a609..01e00fdc19899 100644 --- a/server/src/main/java/org/opensearch/indices/fielddata/cache/IndicesFieldDataCache.java +++ b/server/src/main/java/org/opensearch/indices/fielddata/cache/IndicesFieldDataCache.java @@ -64,6 +64,11 @@ import java.util.List; import java.util.function.ToLongBiFunction; +/** + * The field data cache for multiple indices + * + * @opensearch.internal + */ public class IndicesFieldDataCache implements RemovalListener, Releasable { private static final Logger logger = LogManager.getLogger(IndicesFieldDataCache.class); diff --git a/server/src/main/java/org/opensearch/indices/mapper/MapperRegistry.java b/server/src/main/java/org/opensearch/indices/mapper/MapperRegistry.java index 23ce1b277aeeb..3a1d7b1ebb1e3 100644 --- a/server/src/main/java/org/opensearch/indices/mapper/MapperRegistry.java +++ b/server/src/main/java/org/opensearch/indices/mapper/MapperRegistry.java @@ -46,6 +46,8 @@ /** * A registry for all field mappers. + * + * @opensearch.internal */ public final class MapperRegistry { diff --git a/server/src/main/java/org/opensearch/indices/recovery/DelayRecoveryException.java b/server/src/main/java/org/opensearch/indices/recovery/DelayRecoveryException.java index 994634cb43413..bd88dcc236fb4 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/DelayRecoveryException.java +++ b/server/src/main/java/org/opensearch/indices/recovery/DelayRecoveryException.java @@ -40,7 +40,7 @@ /** * An exception marking that this recovery attempt should be ignored (since probably, we already recovered). * - * + * @opensearch.internal */ public class DelayRecoveryException extends OpenSearchException { diff --git a/server/src/main/java/org/opensearch/indices/recovery/MultiChunkTransfer.java b/server/src/main/java/org/opensearch/indices/recovery/MultiChunkTransfer.java index 78983c9ab5cf8..8a6aa0db26610 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/MultiChunkTransfer.java +++ b/server/src/main/java/org/opensearch/indices/recovery/MultiChunkTransfer.java @@ -68,6 +68,8 @@ * greater than {@code maxConcurrentFileChunks}), the sending/requesting thread will abort its execution. That process will be resumed by * one of the networking threads which receive/handle the responses of the current pending file chunk requests. This process will continue * until all chunk requests are sent/responded. + * + * @opensearch.internal */ public abstract class MultiChunkTransfer implements Closeable { private Status status = Status.PROCESSING; diff --git a/server/src/main/java/org/opensearch/indices/recovery/MultiFileWriter.java b/server/src/main/java/org/opensearch/indices/recovery/MultiFileWriter.java index f0295fdd2fbef..285be4346071d 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/MultiFileWriter.java +++ b/server/src/main/java/org/opensearch/indices/recovery/MultiFileWriter.java @@ -56,6 +56,11 @@ import java.util.concurrent.ConcurrentMap; import java.util.concurrent.atomic.AtomicBoolean; +/** + * A multi file writer utility for recovery + * + * @opensearch.internal + */ public class MultiFileWriter extends AbstractRefCounted implements Releasable { public MultiFileWriter(Store store, RecoveryState.Index indexState, String tempFilePrefix, Logger logger, Runnable ensureOpen) { diff --git a/server/src/main/java/org/opensearch/indices/recovery/PeerRecoveryNotFound.java b/server/src/main/java/org/opensearch/indices/recovery/PeerRecoveryNotFound.java index 30a0f8053b109..478dabba7aef0 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/PeerRecoveryNotFound.java +++ b/server/src/main/java/org/opensearch/indices/recovery/PeerRecoveryNotFound.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Exception thrown if peer recovery is not found + * + * @opensearch.internal + */ public class PeerRecoveryNotFound extends ResourceNotFoundException { public PeerRecoveryNotFound(final long recoveryId, final ShardId shardId, final String targetAllocationId) { diff --git a/server/src/main/java/org/opensearch/indices/recovery/PeerRecoverySourceService.java b/server/src/main/java/org/opensearch/indices/recovery/PeerRecoverySourceService.java index 5e9db2e1d67f3..1eb0fe2c1929d 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/PeerRecoverySourceService.java +++ b/server/src/main/java/org/opensearch/indices/recovery/PeerRecoverySourceService.java @@ -72,6 +72,8 @@ /** * The source recovery accepts recovery requests from other peer shards and start the recovery process from this * source shard to the target shard. + * + * @opensearch.internal */ public class PeerRecoverySourceService extends AbstractLifecycleComponent implements IndexEventListener, ClusterStateListener { diff --git a/server/src/main/java/org/opensearch/indices/recovery/PeerRecoveryTargetService.java b/server/src/main/java/org/opensearch/indices/recovery/PeerRecoveryTargetService.java index 9348988f8edcc..6f1c199527596 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/PeerRecoveryTargetService.java +++ b/server/src/main/java/org/opensearch/indices/recovery/PeerRecoveryTargetService.java @@ -94,6 +94,8 @@ *

    * Note, it can be safely assumed that there will only be a single recovery per shard (index+id) and * not several of them (since we don't allocate several shard replicas to the same node). + * + * @opensearch.internal */ public class PeerRecoveryTargetService implements IndexEventListener { diff --git a/server/src/main/java/org/opensearch/indices/recovery/RecoverFilesRecoveryException.java b/server/src/main/java/org/opensearch/indices/recovery/RecoverFilesRecoveryException.java index d3ac3319bf2f0..fe7bba1769463 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RecoverFilesRecoveryException.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RecoverFilesRecoveryException.java @@ -42,6 +42,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Exception thrown if there is an error recovering files + * + * @opensearch.internal + */ public class RecoverFilesRecoveryException extends OpenSearchException implements OpenSearchWrapperException { private final int numberOfFiles; diff --git a/server/src/main/java/org/opensearch/indices/recovery/RecoveriesCollection.java b/server/src/main/java/org/opensearch/indices/recovery/RecoveriesCollection.java index 0b2dd9804067e..0312dfeec4eeb 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RecoveriesCollection.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RecoveriesCollection.java @@ -55,6 +55,8 @@ * of those recoveries). The class is used to guarantee concurrent semantics such that once a recoveries was done/cancelled/failed * no other thread will be able to find it. Last, the {@link RecoveryRef} inner class verifies that recovery temporary files * and store will only be cleared once on going usage is finished. + * + * @opensearch.internal */ public class RecoveriesCollection { diff --git a/server/src/main/java/org/opensearch/indices/recovery/RecoveryCleanFilesRequest.java b/server/src/main/java/org/opensearch/indices/recovery/RecoveryCleanFilesRequest.java index 974bba9673d43..6c597fcd086c4 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RecoveryCleanFilesRequest.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RecoveryCleanFilesRequest.java @@ -41,6 +41,11 @@ import java.io.IOException; +/** + * Request to clean up recovery files + * + * @opensearch.internal + */ public class RecoveryCleanFilesRequest extends RecoveryTransportRequest { private final long recoveryId; diff --git a/server/src/main/java/org/opensearch/indices/recovery/RecoveryFailedException.java b/server/src/main/java/org/opensearch/indices/recovery/RecoveryFailedException.java index 5293286269659..f2665e8bbb1a7 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RecoveryFailedException.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RecoveryFailedException.java @@ -40,6 +40,11 @@ import java.io.IOException; +/** + * Exception thrown if recovery fails + * + * @opensearch.internal + */ public class RecoveryFailedException extends OpenSearchException { public RecoveryFailedException(StartRecoveryRequest request, Throwable cause) { diff --git a/server/src/main/java/org/opensearch/indices/recovery/RecoveryFileChunkRequest.java b/server/src/main/java/org/opensearch/indices/recovery/RecoveryFileChunkRequest.java index 2a0357547048a..886de8d56645c 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RecoveryFileChunkRequest.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RecoveryFileChunkRequest.java @@ -42,6 +42,11 @@ import java.io.IOException; +/** + * Request for a recovery file chunk + * + * @opensearch.internal + */ public final class RecoveryFileChunkRequest extends RecoveryTransportRequest { private final boolean lastChunk; private final long recoveryId; diff --git a/server/src/main/java/org/opensearch/indices/recovery/RecoveryFilesInfoRequest.java b/server/src/main/java/org/opensearch/indices/recovery/RecoveryFilesInfoRequest.java index 6c1b29e155dd0..dccadfcf49cf1 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RecoveryFilesInfoRequest.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RecoveryFilesInfoRequest.java @@ -40,6 +40,11 @@ import java.util.ArrayList; import java.util.List; +/** + * Request for recovery file information + * + * @opensearch.internal + */ public class RecoveryFilesInfoRequest extends RecoveryTransportRequest { private long recoveryId; diff --git a/server/src/main/java/org/opensearch/indices/recovery/RecoveryFinalizeRecoveryRequest.java b/server/src/main/java/org/opensearch/indices/recovery/RecoveryFinalizeRecoveryRequest.java index f3ef74e1fdf59..a7334fba15664 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RecoveryFinalizeRecoveryRequest.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RecoveryFinalizeRecoveryRequest.java @@ -40,6 +40,11 @@ import java.io.IOException; +/** + * Request to finalize recovery + * + * @opensearch.internal + */ final class RecoveryFinalizeRecoveryRequest extends RecoveryTransportRequest { private final long recoveryId; diff --git a/server/src/main/java/org/opensearch/indices/recovery/RecoveryHandoffPrimaryContextRequest.java b/server/src/main/java/org/opensearch/indices/recovery/RecoveryHandoffPrimaryContextRequest.java index 048de6edade73..4e47668d82656 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RecoveryHandoffPrimaryContextRequest.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RecoveryHandoffPrimaryContextRequest.java @@ -42,6 +42,8 @@ /** * The request object to handoff the primary context to the relocation target. + * + * @opensearch.internal */ class RecoveryHandoffPrimaryContextRequest extends TransportRequest { diff --git a/server/src/main/java/org/opensearch/indices/recovery/RecoveryPrepareForTranslogOperationsRequest.java b/server/src/main/java/org/opensearch/indices/recovery/RecoveryPrepareForTranslogOperationsRequest.java index 579643bd62763..bdacb0b724884 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RecoveryPrepareForTranslogOperationsRequest.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RecoveryPrepareForTranslogOperationsRequest.java @@ -39,6 +39,11 @@ import java.io.IOException; +/** + * Request to prepare cluster for translog operations + * + * @opensearch.internal + */ class RecoveryPrepareForTranslogOperationsRequest extends RecoveryTransportRequest { private final long recoveryId; diff --git a/server/src/main/java/org/opensearch/indices/recovery/RecoveryRequestTracker.java b/server/src/main/java/org/opensearch/indices/recovery/RecoveryRequestTracker.java index 048a8019d2cda..71a7f2776f324 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RecoveryRequestTracker.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RecoveryRequestTracker.java @@ -44,6 +44,11 @@ import static org.opensearch.index.seqno.SequenceNumbers.NO_OPS_PERFORMED; +/** + * Tracks recovery requests + * + * @opensearch.internal + */ public class RecoveryRequestTracker { private final Map> ongoingRequests = Collections.synchronizedMap(new HashMap<>()); diff --git a/server/src/main/java/org/opensearch/indices/recovery/RecoveryResponse.java b/server/src/main/java/org/opensearch/indices/recovery/RecoveryResponse.java index f316606dcb9a9..3a9bbf9da8928 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RecoveryResponse.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RecoveryResponse.java @@ -39,6 +39,11 @@ import java.io.IOException; import java.util.List; +/** + * Response for recovery operations + * + * @opensearch.internal + */ public final class RecoveryResponse extends TransportResponse { final List phase1FileNames; diff --git a/server/src/main/java/org/opensearch/indices/recovery/RecoverySettings.java b/server/src/main/java/org/opensearch/indices/recovery/RecoverySettings.java index 8d9eab24f6027..60076f1668af8 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RecoverySettings.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RecoverySettings.java @@ -44,6 +44,11 @@ import org.opensearch.common.unit.ByteSizeValue; import org.opensearch.common.unit.TimeValue; +/** + * Settings for the recovery mechanism + * + * @opensearch.internal + */ public class RecoverySettings { private static final Logger logger = LogManager.getLogger(RecoverySettings.class); diff --git a/server/src/main/java/org/opensearch/indices/recovery/RecoverySourceHandler.java b/server/src/main/java/org/opensearch/indices/recovery/RecoverySourceHandler.java index 77596f50a8a5e..fdbdbf4c688e2 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RecoverySourceHandler.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RecoverySourceHandler.java @@ -115,6 +115,8 @@ * while the {@link RateLimiter} passed via {@link RecoverySettings} is shared across recoveries * originating from this nodes to throttle the number bytes send during file transfer. The transaction log * phase bypasses the rate limiter entirely. + * + * @opensearch.internal */ public class RecoverySourceHandler { diff --git a/server/src/main/java/org/opensearch/indices/recovery/RecoveryState.java b/server/src/main/java/org/opensearch/indices/recovery/RecoveryState.java index 9f57a0ebd4d0f..1d809c2d55415 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RecoveryState.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RecoveryState.java @@ -63,6 +63,8 @@ /** * Keeps track of state related to shard recovery. + * + * @opensearch.internal */ public class RecoveryState implements ToXContentFragment, Writeable { diff --git a/server/src/main/java/org/opensearch/indices/recovery/RecoveryTarget.java b/server/src/main/java/org/opensearch/indices/recovery/RecoveryTarget.java index 6dbbf21eb9360..83c2b03fa19e0 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RecoveryTarget.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RecoveryTarget.java @@ -71,6 +71,8 @@ /** * Represents a recovery where the current node is the target node of the recovery. To track recoveries in a central place, instances of * this class are created through {@link RecoveriesCollection}. + * + * @opensearch.internal */ public class RecoveryTarget extends AbstractRefCounted implements RecoveryTargetHandler { diff --git a/server/src/main/java/org/opensearch/indices/recovery/RecoveryTargetHandler.java b/server/src/main/java/org/opensearch/indices/recovery/RecoveryTargetHandler.java index 1acef9a8592e4..84b6ec170d3f7 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RecoveryTargetHandler.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RecoveryTargetHandler.java @@ -41,6 +41,11 @@ import java.util.List; +/** + * Handler for the recovery target + * + * @opensearch.internal + */ public interface RecoveryTargetHandler { /** diff --git a/server/src/main/java/org/opensearch/indices/recovery/RecoveryTranslogOperationsRequest.java b/server/src/main/java/org/opensearch/indices/recovery/RecoveryTranslogOperationsRequest.java index 94ac53f77a1d1..eacfb87ecc732 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RecoveryTranslogOperationsRequest.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RecoveryTranslogOperationsRequest.java @@ -42,6 +42,11 @@ import java.io.IOException; import java.util.List; +/** + * Request for recovery translog operations + * + * @opensearch.internal + */ public class RecoveryTranslogOperationsRequest extends RecoveryTransportRequest { private final long recoveryId; diff --git a/server/src/main/java/org/opensearch/indices/recovery/RecoveryTranslogOperationsResponse.java b/server/src/main/java/org/opensearch/indices/recovery/RecoveryTranslogOperationsResponse.java index da2f224501816..b4ea8bd3e89b6 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RecoveryTranslogOperationsResponse.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RecoveryTranslogOperationsResponse.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Response for recovery translog operations + * + * @opensearch.internal + */ final class RecoveryTranslogOperationsResponse extends TransportResponse { final long localCheckpoint; diff --git a/server/src/main/java/org/opensearch/indices/recovery/RecoveryTransportRequest.java b/server/src/main/java/org/opensearch/indices/recovery/RecoveryTransportRequest.java index 0ebc8c3d8550d..b48fe4003e18a 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RecoveryTransportRequest.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RecoveryTransportRequest.java @@ -40,6 +40,11 @@ import java.io.IOException; +/** + * Transport request for recovery + * + * @opensearch.internal + */ public abstract class RecoveryTransportRequest extends TransportRequest { private final long requestSeqNo; diff --git a/server/src/main/java/org/opensearch/indices/recovery/ReestablishRecoveryRequest.java b/server/src/main/java/org/opensearch/indices/recovery/ReestablishRecoveryRequest.java index bbf3f19ceb563..179e16f5f0cf6 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/ReestablishRecoveryRequest.java +++ b/server/src/main/java/org/opensearch/indices/recovery/ReestablishRecoveryRequest.java @@ -41,6 +41,8 @@ /** * Represents a request for starting a peer recovery. + * + * @opensearch.internal */ public class ReestablishRecoveryRequest extends TransportRequest { diff --git a/server/src/main/java/org/opensearch/indices/recovery/RemoteRecoveryTargetHandler.java b/server/src/main/java/org/opensearch/indices/recovery/RemoteRecoveryTargetHandler.java index 35727baa83939..fd6de6322bb0a 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/RemoteRecoveryTargetHandler.java +++ b/server/src/main/java/org/opensearch/indices/recovery/RemoteRecoveryTargetHandler.java @@ -70,6 +70,11 @@ import java.util.concurrent.atomic.AtomicLong; import java.util.function.Consumer; +/** + * Target handler for remote recovery + * + * @opensearch.internal + */ public class RemoteRecoveryTargetHandler implements RecoveryTargetHandler { private static final Logger logger = LogManager.getLogger(RemoteRecoveryTargetHandler.class); diff --git a/server/src/main/java/org/opensearch/indices/recovery/StartRecoveryRequest.java b/server/src/main/java/org/opensearch/indices/recovery/StartRecoveryRequest.java index f2efae2fbe798..24e6504cde59d 100644 --- a/server/src/main/java/org/opensearch/indices/recovery/StartRecoveryRequest.java +++ b/server/src/main/java/org/opensearch/indices/recovery/StartRecoveryRequest.java @@ -44,6 +44,8 @@ /** * Represents a request for starting a peer recovery. + * + * @opensearch.internal */ public class StartRecoveryRequest extends TransportRequest { diff --git a/server/src/main/java/org/opensearch/indices/replication/common/ReplicationTimer.java b/server/src/main/java/org/opensearch/indices/replication/common/ReplicationTimer.java index 976df28265d9a..eeb0ba8bb2c00 100644 --- a/server/src/main/java/org/opensearch/indices/replication/common/ReplicationTimer.java +++ b/server/src/main/java/org/opensearch/indices/replication/common/ReplicationTimer.java @@ -18,6 +18,8 @@ /** * A serializable timer that is used to measure the time taken for * file replication operations like recovery. + * + * @opensearch.internal */ public class ReplicationTimer implements Writeable { private long startTime = 0; diff --git a/server/src/main/java/org/opensearch/indices/replication/common/ReplicationType.java b/server/src/main/java/org/opensearch/indices/replication/common/ReplicationType.java index 98d68d67ba5e3..ac4840e390c0b 100644 --- a/server/src/main/java/org/opensearch/indices/replication/common/ReplicationType.java +++ b/server/src/main/java/org/opensearch/indices/replication/common/ReplicationType.java @@ -11,6 +11,8 @@ /** * Enumerates the types of replication strategies supported by OpenSearch. * For more information, see https://github.com/opensearch-project/OpenSearch/issues/1694 + * + * @opensearch.internal */ public enum ReplicationType { diff --git a/server/src/main/java/org/opensearch/indices/store/IndicesStore.java b/server/src/main/java/org/opensearch/indices/store/IndicesStore.java index ef10bae987bb1..11442632246b6 100644 --- a/server/src/main/java/org/opensearch/indices/store/IndicesStore.java +++ b/server/src/main/java/org/opensearch/indices/store/IndicesStore.java @@ -83,6 +83,11 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; +/** + * Store for multiple indexes + * + * @opensearch.internal + */ public class IndicesStore implements ClusterStateListener, Closeable { private static final Logger logger = LogManager.getLogger(IndicesStore.class); From 91564705bfa7e3b6aba559d35ead4cbe20fa3657 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 9 May 2022 11:55:15 -0700 Subject: [PATCH 138/514] Fixing PublishTests tests (running against unclean build folders) (#3253) (#3256) Signed-off-by: Andriy Redko (cherry picked from commit e615ac1e0702082dd9507a1f592d7d6daf4081c1) Co-authored-by: Andriy Redko --- .../gradle/pluginzip/PublishTests.java | 40 ++++++++++++++----- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/buildSrc/src/test/java/org/opensearch/gradle/pluginzip/PublishTests.java b/buildSrc/src/test/java/org/opensearch/gradle/pluginzip/PublishTests.java index f5a00d795c0cd..4ca1c856b3247 100644 --- a/buildSrc/src/test/java/org/opensearch/gradle/pluginzip/PublishTests.java +++ b/buildSrc/src/test/java/org/opensearch/gradle/pluginzip/PublishTests.java @@ -13,25 +13,42 @@ import org.gradle.testfixtures.ProjectBuilder; import org.gradle.api.Project; import org.opensearch.gradle.test.GradleUnitTestCase; +import org.junit.Before; import org.junit.Test; +import org.junit.rules.TemporaryFolder; + import java.io.IOException; import org.gradle.api.publish.maven.tasks.PublishToMavenRepository; import java.io.File; -import org.gradle.testkit.runner.BuildResult; import java.io.FileWriter; import java.io.Writer; -import static org.gradle.testkit.runner.TaskOutcome.SUCCESS; -import static org.junit.Assert.assertEquals; import java.nio.file.Files; + +import static org.gradle.testkit.runner.TaskOutcome.SUCCESS; + import org.apache.maven.model.Model; import org.apache.maven.model.io.xpp3.MavenXpp3Reader; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import java.io.FileReader; import org.gradle.api.tasks.bundling.Zip; +import org.gradle.internal.impldep.org.junit.After; + import java.util.List; import java.util.ArrayList; public class PublishTests extends GradleUnitTestCase { + private TemporaryFolder projectDir; + + @Before + public void setUp() throws IOException { + projectDir = new TemporaryFolder(); + projectDir.create(); + } + + @After + public void tearDown() { + projectDir.delete(); + } @Test public void testZipPublish() throws IOException, XmlPullParserException { @@ -50,12 +67,11 @@ public void testZipPublish() throws IOException, XmlPullParserException { assertTrue(project.getTasks().getNames().contains(zipPublishTask)); assertNotNull("Task to generate: ", project.getTasks().getByName(zipPublishTask)); // Run Gradle functional tests, but calling a build.gradle file, that resembles the plugin publish behavior - File projectDir = new File("build/functionalTest"); + // Create a sample plugin zip file - File sampleZip = new File("build/functionalTest/sample-plugin.zip"); - Files.createDirectories(projectDir.toPath()); + File sampleZip = new File(projectDir.getRoot(), "sample-plugin.zip"); Files.createFile(sampleZip.toPath()); - writeString(new File(projectDir, "settings.gradle"), ""); + writeString(projectDir.newFile("settings.gradle"), ""); // Generate the build.gradle file String buildFileContent = "apply plugin: 'maven-publish' \n" + "apply plugin: 'java' \n" @@ -75,7 +91,7 @@ public void testZipPublish() throws IOException, XmlPullParserException { + " }\n" + " }\n" + "}"; - writeString(new File(projectDir, "build.gradle"), buildFileContent); + writeString(projectDir.newFile("build.gradle"), buildFileContent); // Execute the task publishPluginZipPublicationToZipStagingRepository List allArguments = new ArrayList(); allArguments.add("build"); @@ -84,20 +100,22 @@ public void testZipPublish() throws IOException, XmlPullParserException { runner.forwardOutput(); runner.withPluginClasspath(); runner.withArguments(allArguments); - runner.withProjectDir(projectDir); + runner.withProjectDir(projectDir.getRoot()); BuildResult result = runner.build(); // Check if task publishMavenzipPublicationToZipstagingRepository has ran well assertEquals(SUCCESS, result.task(":" + zipPublishTask).getOutcome()); // check if the zip has been published to local staging repo assertTrue( - new File("build/functionalTest/local-staging-repo/org/opensearch/plugin/sample-plugin/2.0.0.0/sample-plugin-2.0.0.0.zip") + new File(projectDir.getRoot(), "local-staging-repo/org/opensearch/plugin/sample-plugin/2.0.0.0/sample-plugin-2.0.0.0.zip") .exists() ); assertEquals(SUCCESS, result.task(":" + "build").getOutcome()); // Parse the maven file and validate the groupID to org.opensearch.plugin MavenXpp3Reader reader = new MavenXpp3Reader(); Model model = reader.read( - new FileReader("build/functionalTest/local-staging-repo/org/opensearch/plugin/sample-plugin/2.0.0.0/sample-plugin-2.0.0.0.pom") + new FileReader( + new File(projectDir.getRoot(), "local-staging-repo/org/opensearch/plugin/sample-plugin/2.0.0.0/sample-plugin-2.0.0.0.pom") + ) ); assertEquals(model.getGroupId(), "org.opensearch.plugin"); } From 982b2221df165774ee20a2f886d955abe1045384 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 10 May 2022 09:40:07 -0700 Subject: [PATCH 139/514] [Javadocs] add to o.o.search.rescore,searchafter,slice, sort, and suggest (#3264) (#3266) Adds class level javadocs to org.opensearch.search, and org.opensearch.search.rescore, searchAfter, slice, sort, and suggest subpackages. Signed-off-by: Nicholas Walter Knize (cherry picked from commit 3b71ea6c1ec8e73cada531c617c2327ab252aa14) Co-authored-by: Nick Knize --- .../java/org/opensearch/search/DefaultSearchContext.java | 5 +++++ .../main/java/org/opensearch/search/DocValueFormat.java | 6 +++++- .../main/java/org/opensearch/search/MultiValueMode.java | 2 ++ .../src/main/java/org/opensearch/search/RescoreDocIds.java | 2 ++ server/src/main/java/org/opensearch/search/Scroll.java | 2 +- .../opensearch/search/SearchContextMissingException.java | 5 +++++ .../org/opensearch/search/SearchContextSourcePrinter.java | 5 +++++ .../main/java/org/opensearch/search/SearchException.java | 5 +++++ .../main/java/org/opensearch/search/SearchExtBuilder.java | 2 ++ server/src/main/java/org/opensearch/search/SearchHit.java | 2 ++ server/src/main/java/org/opensearch/search/SearchHits.java | 5 +++++ .../src/main/java/org/opensearch/search/SearchModule.java | 2 ++ .../java/org/opensearch/search/SearchParseException.java | 5 +++++ .../main/java/org/opensearch/search/SearchPhaseResult.java | 2 ++ .../src/main/java/org/opensearch/search/SearchService.java | 5 +++++ .../main/java/org/opensearch/search/SearchShardTarget.java | 2 ++ .../main/java/org/opensearch/search/SearchSortValues.java | 5 +++++ .../org/opensearch/search/SearchSortValuesAndFormats.java | 5 +++++ .../org/opensearch/search/rescore/QueryRescoreMode.java | 5 +++++ .../java/org/opensearch/search/rescore/QueryRescorer.java | 6 ++++++ .../opensearch/search/rescore/QueryRescorerBuilder.java | 5 +++++ .../java/org/opensearch/search/rescore/RescoreContext.java | 2 ++ .../java/org/opensearch/search/rescore/RescorePhase.java | 2 ++ .../main/java/org/opensearch/search/rescore/Rescorer.java | 2 ++ .../org/opensearch/search/rescore/RescorerBuilder.java | 2 ++ .../opensearch/search/searchafter/SearchAfterBuilder.java | 5 +++++ .../org/opensearch/search/slice/DocValuesSliceQuery.java | 2 ++ .../java/org/opensearch/search/slice/SliceBuilder.java | 2 ++ .../main/java/org/opensearch/search/slice/SliceQuery.java | 2 ++ .../java/org/opensearch/search/slice/TermsSliceQuery.java | 2 ++ .../main/java/org/opensearch/search/sort/BucketedSort.java | 2 ++ .../java/org/opensearch/search/sort/FieldSortBuilder.java | 2 ++ .../org/opensearch/search/sort/GeoDistanceSortBuilder.java | 2 ++ .../main/java/org/opensearch/search/sort/MinAndMax.java | 2 ++ .../java/org/opensearch/search/sort/NestedSortBuilder.java | 5 +++++ .../java/org/opensearch/search/sort/ScoreSortBuilder.java | 2 ++ .../java/org/opensearch/search/sort/ScriptSortBuilder.java | 2 ++ .../java/org/opensearch/search/sort/SortAndFormats.java | 5 +++++ .../main/java/org/opensearch/search/sort/SortBuilder.java | 5 +++++ .../main/java/org/opensearch/search/sort/SortBuilders.java | 2 +- .../org/opensearch/search/sort/SortFieldAndFormat.java | 5 +++++ .../src/main/java/org/opensearch/search/sort/SortMode.java | 2 ++ .../main/java/org/opensearch/search/sort/SortOrder.java | 2 +- .../main/java/org/opensearch/search/sort/SortParser.java | 5 +++++ .../main/java/org/opensearch/search/sort/SortValue.java | 2 ++ .../search/suggest/DirectSpellcheckerSettings.java | 5 +++++ .../main/java/org/opensearch/search/suggest/SortBy.java | 2 ++ .../main/java/org/opensearch/search/suggest/Suggest.java | 2 ++ .../java/org/opensearch/search/suggest/SuggestBuilder.java | 2 ++ .../org/opensearch/search/suggest/SuggestBuilders.java | 2 ++ .../java/org/opensearch/search/suggest/SuggestPhase.java | 2 ++ .../main/java/org/opensearch/search/suggest/Suggester.java | 5 +++++ .../org/opensearch/search/suggest/SuggestionBuilder.java | 2 ++ .../opensearch/search/suggest/SuggestionSearchContext.java | 5 +++++ .../search/suggest/completion/CompletionStats.java | 5 +++++ .../search/suggest/completion/CompletionSuggester.java | 5 +++++ .../search/suggest/completion/CompletionSuggestion.java | 1 + .../suggest/completion/CompletionSuggestionBuilder.java | 2 ++ .../suggest/completion/CompletionSuggestionContext.java | 5 +++++ .../opensearch/search/suggest/completion/FuzzyOptions.java | 2 ++ .../opensearch/search/suggest/completion/RegexOptions.java | 2 ++ .../suggest/completion/TopSuggestGroupDocsCollector.java | 2 ++ .../suggest/completion/context/CategoryContextMapping.java | 2 ++ .../suggest/completion/context/CategoryQueryContext.java | 2 ++ .../search/suggest/completion/context/ContextBuilder.java | 2 ++ .../search/suggest/completion/context/ContextMapping.java | 2 ++ .../search/suggest/completion/context/ContextMappings.java | 2 ++ .../suggest/completion/context/GeoContextMapping.java | 2 ++ .../search/suggest/completion/context/GeoQueryContext.java | 2 ++ .../search/suggest/phrase/CandidateGenerator.java | 6 ++++++ .../opensearch/search/suggest/phrase/CandidateScorer.java | 5 +++++ .../org/opensearch/search/suggest/phrase/Correction.java | 6 ++++++ .../search/suggest/phrase/DirectCandidateGenerator.java | 5 +++++ .../suggest/phrase/DirectCandidateGeneratorBuilder.java | 5 +++++ .../java/org/opensearch/search/suggest/phrase/Laplace.java | 2 ++ .../opensearch/search/suggest/phrase/LaplaceScorer.java | 5 +++++ .../search/suggest/phrase/LinearInterpolatingScorer.java | 7 ++++++- .../search/suggest/phrase/LinearInterpolation.java | 2 ++ .../suggest/phrase/MultiCandidateGeneratorWrapper.java | 7 ++++++- .../search/suggest/phrase/NoisyChannelSpellChecker.java | 5 +++++ .../opensearch/search/suggest/phrase/PhraseSuggester.java | 5 +++++ .../opensearch/search/suggest/phrase/PhraseSuggestion.java | 2 ++ .../search/suggest/phrase/PhraseSuggestionBuilder.java | 2 ++ .../search/suggest/phrase/PhraseSuggestionContext.java | 5 +++++ .../opensearch/search/suggest/phrase/SmoothingModel.java | 5 +++++ .../opensearch/search/suggest/phrase/StupidBackoff.java | 2 ++ .../search/suggest/phrase/StupidBackoffScorer.java | 5 +++++ .../org/opensearch/search/suggest/phrase/WordScorer.java | 7 ++++++- .../org/opensearch/search/suggest/term/TermSuggester.java | 5 +++++ .../org/opensearch/search/suggest/term/TermSuggestion.java | 2 ++ .../search/suggest/term/TermSuggestionBuilder.java | 2 ++ .../search/suggest/term/TermSuggestionContext.java | 5 +++++ 92 files changed, 309 insertions(+), 7 deletions(-) diff --git a/server/src/main/java/org/opensearch/search/DefaultSearchContext.java b/server/src/main/java/org/opensearch/search/DefaultSearchContext.java index 6fd78b834344d..d09143e3373b4 100644 --- a/server/src/main/java/org/opensearch/search/DefaultSearchContext.java +++ b/server/src/main/java/org/opensearch/search/DefaultSearchContext.java @@ -99,6 +99,11 @@ import java.util.concurrent.Executor; import java.util.function.LongSupplier; +/** + * The main search context used during search phase + * + * @opensearch.internal + */ final class DefaultSearchContext extends SearchContext { private final ReaderContext readerContext; diff --git a/server/src/main/java/org/opensearch/search/DocValueFormat.java b/server/src/main/java/org/opensearch/search/DocValueFormat.java index 9536e72c04b7b..5c8bcfb4dcf7c 100644 --- a/server/src/main/java/org/opensearch/search/DocValueFormat.java +++ b/server/src/main/java/org/opensearch/search/DocValueFormat.java @@ -63,7 +63,11 @@ import java.util.Objects; import java.util.function.LongSupplier; -/** A formatter for values as returned by the fielddata/doc-values APIs. */ +/** + * A formatter for values as returned by the fielddata/doc-values APIs. + * + * @opensearch.internal + */ public interface DocValueFormat extends NamedWriteable { long MASK_2_63 = 0x8000000000000000L; BigInteger BIGINTEGER_2_64_MINUS_ONE = BigInteger.ONE.shiftLeft(64).subtract(BigInteger.ONE); // 2^64 -1 diff --git a/server/src/main/java/org/opensearch/search/MultiValueMode.java b/server/src/main/java/org/opensearch/search/MultiValueMode.java index bc09d972054a5..687eddf7f4667 100644 --- a/server/src/main/java/org/opensearch/search/MultiValueMode.java +++ b/server/src/main/java/org/opensearch/search/MultiValueMode.java @@ -58,6 +58,8 @@ /** * Defines what values to pick in the case a document contains multiple values for a particular field. + * + * @opensearch.internal */ public enum MultiValueMode implements Writeable { /** diff --git a/server/src/main/java/org/opensearch/search/RescoreDocIds.java b/server/src/main/java/org/opensearch/search/RescoreDocIds.java index bf19d25975393..d93d590fcb817 100644 --- a/server/src/main/java/org/opensearch/search/RescoreDocIds.java +++ b/server/src/main/java/org/opensearch/search/RescoreDocIds.java @@ -45,6 +45,8 @@ * Since {@link org.opensearch.search.internal.SearchContext} no longer hold the states of search, the top K results * (i.e., documents that will be rescored by query rescorers) need to be serialized/ deserialized between search phases. * A {@link RescoreDocIds} encapsulates the top K results for each rescorer by its ordinal index. + * + * @opensearch.internal */ public final class RescoreDocIds implements Writeable { public static final RescoreDocIds EMPTY = new RescoreDocIds(Collections.emptyMap()); diff --git a/server/src/main/java/org/opensearch/search/Scroll.java b/server/src/main/java/org/opensearch/search/Scroll.java index f46078ae82d26..747d7b73aee8f 100644 --- a/server/src/main/java/org/opensearch/search/Scroll.java +++ b/server/src/main/java/org/opensearch/search/Scroll.java @@ -44,7 +44,7 @@ * A scroll enables scrolling of search request. It holds a {@link #keepAlive()} time that * will control how long to keep the scrolling resources open. * - * + * @opensearch.internal */ public final class Scroll implements Writeable { diff --git a/server/src/main/java/org/opensearch/search/SearchContextMissingException.java b/server/src/main/java/org/opensearch/search/SearchContextMissingException.java index 1e96077a6730e..a74dc412f280c 100644 --- a/server/src/main/java/org/opensearch/search/SearchContextMissingException.java +++ b/server/src/main/java/org/opensearch/search/SearchContextMissingException.java @@ -40,6 +40,11 @@ import java.io.IOException; +/** + * Error thrown if no search context is available + * + * @opensearch.internal + */ public class SearchContextMissingException extends OpenSearchException { private final ShardSearchContextId contextId; diff --git a/server/src/main/java/org/opensearch/search/SearchContextSourcePrinter.java b/server/src/main/java/org/opensearch/search/SearchContextSourcePrinter.java index 8f226ab86378f..c673eb512347c 100644 --- a/server/src/main/java/org/opensearch/search/SearchContextSourcePrinter.java +++ b/server/src/main/java/org/opensearch/search/SearchContextSourcePrinter.java @@ -35,6 +35,11 @@ import org.opensearch.search.internal.SearchContext; import org.opensearch.tasks.Task; +/** + * Prints the search context source + * + * @opensearch.internal + */ public class SearchContextSourcePrinter { private final SearchContext searchContext; diff --git a/server/src/main/java/org/opensearch/search/SearchException.java b/server/src/main/java/org/opensearch/search/SearchException.java index afe99cb62a67b..93cccd0d73070 100644 --- a/server/src/main/java/org/opensearch/search/SearchException.java +++ b/server/src/main/java/org/opensearch/search/SearchException.java @@ -39,6 +39,11 @@ import java.io.IOException; +/** + * Error thrown if there is a problem during search + * + * @opensearch.internal + */ public class SearchException extends OpenSearchException implements OpenSearchWrapperException { private final SearchShardTarget shardTarget; diff --git a/server/src/main/java/org/opensearch/search/SearchExtBuilder.java b/server/src/main/java/org/opensearch/search/SearchExtBuilder.java index ad1c4b47f1ac1..ab8e6d927786e 100644 --- a/server/src/main/java/org/opensearch/search/SearchExtBuilder.java +++ b/server/src/main/java/org/opensearch/search/SearchExtBuilder.java @@ -55,6 +55,8 @@ * of the {@link SearchExtSpec}. * * @see SearchExtSpec + * + * @opensearch.internal */ public abstract class SearchExtBuilder implements NamedWriteable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/search/SearchHit.java b/server/src/main/java/org/opensearch/search/SearchHit.java index daae83e408530..8297ae0798e7d 100644 --- a/server/src/main/java/org/opensearch/search/SearchHit.java +++ b/server/src/main/java/org/opensearch/search/SearchHit.java @@ -90,6 +90,8 @@ * A single search hit. * * @see SearchHits + * + * @opensearch.internal */ public final class SearchHit implements Writeable, ToXContentObject, Iterable { diff --git a/server/src/main/java/org/opensearch/search/SearchHits.java b/server/src/main/java/org/opensearch/search/SearchHits.java index 8abbaa6c9e6c2..67198608e7d9e 100644 --- a/server/src/main/java/org/opensearch/search/SearchHits.java +++ b/server/src/main/java/org/opensearch/search/SearchHits.java @@ -54,6 +54,11 @@ import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +/** + * Encapsulates the results of a search operation + * + * @opensearch.internal + */ public final class SearchHits implements Writeable, ToXContentFragment, Iterable { public static SearchHits empty() { return empty(true); diff --git a/server/src/main/java/org/opensearch/search/SearchModule.java b/server/src/main/java/org/opensearch/search/SearchModule.java index bf0cc646d271e..0995497eba50e 100644 --- a/server/src/main/java/org/opensearch/search/SearchModule.java +++ b/server/src/main/java/org/opensearch/search/SearchModule.java @@ -317,6 +317,8 @@ /** * Sets up things that can be done at search time like queries, aggregations, and suggesters. + * + * @opensearch.internal */ public class SearchModule { public static final Setting INDICES_MAX_CLAUSE_COUNT_SETTING = Setting.intSetting( diff --git a/server/src/main/java/org/opensearch/search/SearchParseException.java b/server/src/main/java/org/opensearch/search/SearchParseException.java index 65d16f2b4aa41..8c017ba216870 100644 --- a/server/src/main/java/org/opensearch/search/SearchParseException.java +++ b/server/src/main/java/org/opensearch/search/SearchParseException.java @@ -41,6 +41,11 @@ import java.io.IOException; +/** + * Main error thrown if there is a problem during parsing a query + * + * @opensearch.internal + */ public class SearchParseException extends SearchException { public static final int UNKNOWN_POSITION = -1; diff --git a/server/src/main/java/org/opensearch/search/SearchPhaseResult.java b/server/src/main/java/org/opensearch/search/SearchPhaseResult.java index 86472e74d6658..fd07e4b10939b 100644 --- a/server/src/main/java/org/opensearch/search/SearchPhaseResult.java +++ b/server/src/main/java/org/opensearch/search/SearchPhaseResult.java @@ -50,6 +50,8 @@ * request ID is particularly important since it is used to reference and maintain a context * across search phases to ensure the same point in time snapshot is used for querying and * fetching etc. + * + * @opensearch.internal */ public abstract class SearchPhaseResult extends TransportResponse { diff --git a/server/src/main/java/org/opensearch/search/SearchService.java b/server/src/main/java/org/opensearch/search/SearchService.java index 5a5f223d33e60..9b2e1e3168344 100644 --- a/server/src/main/java/org/opensearch/search/SearchService.java +++ b/server/src/main/java/org/opensearch/search/SearchService.java @@ -151,6 +151,11 @@ import static org.opensearch.common.unit.TimeValue.timeValueMillis; import static org.opensearch.common.unit.TimeValue.timeValueMinutes; +/** + * The main search service + * + * @opensearch.internal + */ public class SearchService extends AbstractLifecycleComponent implements IndexEventListener { private static final Logger logger = LogManager.getLogger(SearchService.class); diff --git a/server/src/main/java/org/opensearch/search/SearchShardTarget.java b/server/src/main/java/org/opensearch/search/SearchShardTarget.java index 32e5400576ad9..3d72ba6804efc 100644 --- a/server/src/main/java/org/opensearch/search/SearchShardTarget.java +++ b/server/src/main/java/org/opensearch/search/SearchShardTarget.java @@ -46,6 +46,8 @@ /** * The target that the search request was executed on. + * + * @opensearch.internal */ public final class SearchShardTarget implements Writeable, Comparable { diff --git a/server/src/main/java/org/opensearch/search/SearchSortValues.java b/server/src/main/java/org/opensearch/search/SearchSortValues.java index aa234685b9407..4abd191e8e5f5 100644 --- a/server/src/main/java/org/opensearch/search/SearchSortValues.java +++ b/server/src/main/java/org/opensearch/search/SearchSortValues.java @@ -47,6 +47,11 @@ import java.util.Arrays; import java.util.Objects; +/** + * Values to sort during search + * + * @opensearch.internal + */ public class SearchSortValues implements ToXContentFragment, Writeable { private static final Object[] EMPTY_ARRAY = new Object[0]; diff --git a/server/src/main/java/org/opensearch/search/SearchSortValuesAndFormats.java b/server/src/main/java/org/opensearch/search/SearchSortValuesAndFormats.java index 74bc2bd50f62a..c6e95e7f58d61 100644 --- a/server/src/main/java/org/opensearch/search/SearchSortValuesAndFormats.java +++ b/server/src/main/java/org/opensearch/search/SearchSortValuesAndFormats.java @@ -41,6 +41,11 @@ import java.io.IOException; import java.util.Arrays; +/** + * Doc value and formats to sort during search + * + * @opensearch.internal + */ public class SearchSortValuesAndFormats implements Writeable { private final Object[] rawSortValues; private final Object[] formattedSortValues; diff --git a/server/src/main/java/org/opensearch/search/rescore/QueryRescoreMode.java b/server/src/main/java/org/opensearch/search/rescore/QueryRescoreMode.java index 748738b688c7f..818ce18cba6d2 100644 --- a/server/src/main/java/org/opensearch/search/rescore/QueryRescoreMode.java +++ b/server/src/main/java/org/opensearch/search/rescore/QueryRescoreMode.java @@ -39,6 +39,11 @@ import java.io.IOException; import java.util.Locale; +/** + * What mode the rescorer should operate in + * + * @opensearch.internal + */ public enum QueryRescoreMode implements Writeable { Avg { @Override diff --git a/server/src/main/java/org/opensearch/search/rescore/QueryRescorer.java b/server/src/main/java/org/opensearch/search/rescore/QueryRescorer.java index a610881e39ca9..afd897ef49aa7 100644 --- a/server/src/main/java/org/opensearch/search/rescore/QueryRescorer.java +++ b/server/src/main/java/org/opensearch/search/rescore/QueryRescorer.java @@ -47,6 +47,12 @@ import static java.util.stream.Collectors.toSet; +/** + * A concrete query rescorer used to re-rank the Top-K results of a previously + * executed search. + * + * @opensearch.internal + */ public final class QueryRescorer implements Rescorer { public static final Rescorer INSTANCE = new QueryRescorer(); diff --git a/server/src/main/java/org/opensearch/search/rescore/QueryRescorerBuilder.java b/server/src/main/java/org/opensearch/search/rescore/QueryRescorerBuilder.java index 39ca06caaab7d..8382d4c7535cd 100644 --- a/server/src/main/java/org/opensearch/search/rescore/QueryRescorerBuilder.java +++ b/server/src/main/java/org/opensearch/search/rescore/QueryRescorerBuilder.java @@ -50,6 +50,11 @@ import static org.opensearch.index.query.AbstractQueryBuilder.parseInnerQueryBuilder; +/** + * Builds a query rescorer object + * + * @opensearch.internal + */ public class QueryRescorerBuilder extends RescorerBuilder { public static final String NAME = "query"; diff --git a/server/src/main/java/org/opensearch/search/rescore/RescoreContext.java b/server/src/main/java/org/opensearch/search/rescore/RescoreContext.java index 8c9b63d17e5d1..c0e4bbb874531 100644 --- a/server/src/main/java/org/opensearch/search/rescore/RescoreContext.java +++ b/server/src/main/java/org/opensearch/search/rescore/RescoreContext.java @@ -42,6 +42,8 @@ * Context available to the rescore while it is running. Rescore * implementations should extend this with any additional resources that * they will need while rescoring. + * + * @opensearch.internal */ public class RescoreContext { private final int windowSize; diff --git a/server/src/main/java/org/opensearch/search/rescore/RescorePhase.java b/server/src/main/java/org/opensearch/search/rescore/RescorePhase.java index 2f01ac265447b..e8e3c1e07dab9 100644 --- a/server/src/main/java/org/opensearch/search/rescore/RescorePhase.java +++ b/server/src/main/java/org/opensearch/search/rescore/RescorePhase.java @@ -42,6 +42,8 @@ /** * Rescore phase of a search request, used to run potentially expensive scoring models against the top matching documents. + * + * @opensearch.internal */ public class RescorePhase { diff --git a/server/src/main/java/org/opensearch/search/rescore/Rescorer.java b/server/src/main/java/org/opensearch/search/rescore/Rescorer.java index 128f0d3ae4eec..33f8e5e7b535d 100644 --- a/server/src/main/java/org/opensearch/search/rescore/Rescorer.java +++ b/server/src/main/java/org/opensearch/search/rescore/Rescorer.java @@ -45,6 +45,8 @@ * Subclasses should borrow heavily from {@link QueryRescorer} because it is * fairly well behaved and documents that tradeoffs that it is making. There * is also an {@code ExampleRescorer} that is worth looking at. + * + * @opensearch.internal */ public interface Rescorer { /** diff --git a/server/src/main/java/org/opensearch/search/rescore/RescorerBuilder.java b/server/src/main/java/org/opensearch/search/rescore/RescorerBuilder.java index 4eae1386aa25e..1c29e9ee60477 100644 --- a/server/src/main/java/org/opensearch/search/rescore/RescorerBuilder.java +++ b/server/src/main/java/org/opensearch/search/rescore/RescorerBuilder.java @@ -49,6 +49,8 @@ /** * The abstract base builder for instances of {@link RescorerBuilder}. + * + * @opensearch.internal */ public abstract class RescorerBuilder> implements diff --git a/server/src/main/java/org/opensearch/search/searchafter/SearchAfterBuilder.java b/server/src/main/java/org/opensearch/search/searchafter/SearchAfterBuilder.java index 45413ad45b1a3..6d18bd7a37ea5 100644 --- a/server/src/main/java/org/opensearch/search/searchafter/SearchAfterBuilder.java +++ b/server/src/main/java/org/opensearch/search/searchafter/SearchAfterBuilder.java @@ -59,6 +59,11 @@ import java.util.List; import java.util.Objects; +/** + * Builds a search after object + * + * @opensearch.internal + */ public class SearchAfterBuilder implements ToXContentObject, Writeable { public static final ParseField SEARCH_AFTER = new ParseField("search_after"); private static final Object[] EMPTY_SORT_VALUES = new Object[0]; diff --git a/server/src/main/java/org/opensearch/search/slice/DocValuesSliceQuery.java b/server/src/main/java/org/opensearch/search/slice/DocValuesSliceQuery.java index 7ffe89250d313..8c009b9f5f672 100644 --- a/server/src/main/java/org/opensearch/search/slice/DocValuesSliceQuery.java +++ b/server/src/main/java/org/opensearch/search/slice/DocValuesSliceQuery.java @@ -52,6 +52,8 @@ * * NOTE: With deterministic field values this query can be used across different readers safely. * If updates are accepted on the field you must ensure that the same reader is used for all `slice` queries. + * + * @opensearch.internal */ public final class DocValuesSliceQuery extends SliceQuery { public DocValuesSliceQuery(String field, int id, int max) { diff --git a/server/src/main/java/org/opensearch/search/slice/SliceBuilder.java b/server/src/main/java/org/opensearch/search/slice/SliceBuilder.java index 9a9444927ae5f..21e8a5646b9a5 100644 --- a/server/src/main/java/org/opensearch/search/slice/SliceBuilder.java +++ b/server/src/main/java/org/opensearch/search/slice/SliceBuilder.java @@ -75,6 +75,8 @@ * (instead of {@code numShards*numSlices}). * Otherwise the provided field must be a numeric and doc_values must be enabled. In that case a * {@link org.opensearch.search.slice.DocValuesSliceQuery} is used to filter the results. + * + * @opensearch.internal */ public class SliceBuilder implements Writeable, ToXContentObject { diff --git a/server/src/main/java/org/opensearch/search/slice/SliceQuery.java b/server/src/main/java/org/opensearch/search/slice/SliceQuery.java index 5b2c97e44a521..9b30b4e854de7 100644 --- a/server/src/main/java/org/opensearch/search/slice/SliceQuery.java +++ b/server/src/main/java/org/opensearch/search/slice/SliceQuery.java @@ -39,6 +39,8 @@ /** * An abstract {@link Query} that defines an hash function to partition the documents in multiple slices. + * + * @opensearch.internal */ public abstract class SliceQuery extends Query { private final String field; diff --git a/server/src/main/java/org/opensearch/search/slice/TermsSliceQuery.java b/server/src/main/java/org/opensearch/search/slice/TermsSliceQuery.java index 4a7b19701fecd..630d17dfaed19 100644 --- a/server/src/main/java/org/opensearch/search/slice/TermsSliceQuery.java +++ b/server/src/main/java/org/opensearch/search/slice/TermsSliceQuery.java @@ -59,6 +59,8 @@ * For each segment this filter enumerates the terms dictionary, computes the hash code for each term and fills * a bit set with the documents of all terms whose hash code matches the predicate. * NOTE: Documents with no value for that field are ignored. + * + * @opensearch.internal */ public final class TermsSliceQuery extends SliceQuery { // Fixed seed for computing term hashCode diff --git a/server/src/main/java/org/opensearch/search/sort/BucketedSort.java b/server/src/main/java/org/opensearch/search/sort/BucketedSort.java index 848b8c2d21252..b6b5c58502063 100644 --- a/server/src/main/java/org/opensearch/search/sort/BucketedSort.java +++ b/server/src/main/java/org/opensearch/search/sort/BucketedSort.java @@ -92,6 +92,8 @@ * (like {@link BigArrays#overSize(long)}) to get amortized linear number * of allocations and to play well with our paged arrays. *

    + * + * @opensearch.internal */ public abstract class BucketedSort implements Releasable { /** diff --git a/server/src/main/java/org/opensearch/search/sort/FieldSortBuilder.java b/server/src/main/java/org/opensearch/search/sort/FieldSortBuilder.java index d4a3b8651e7a1..b4a93ec9869e6 100644 --- a/server/src/main/java/org/opensearch/search/sort/FieldSortBuilder.java +++ b/server/src/main/java/org/opensearch/search/sort/FieldSortBuilder.java @@ -81,6 +81,8 @@ /** * A sort builder to sort based on a document field. + * + * @opensearch.internal */ public class FieldSortBuilder extends SortBuilder { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(FieldSortBuilder.class); diff --git a/server/src/main/java/org/opensearch/search/sort/GeoDistanceSortBuilder.java b/server/src/main/java/org/opensearch/search/sort/GeoDistanceSortBuilder.java index 2ab9703b45980..a1fe3a02fb113 100644 --- a/server/src/main/java/org/opensearch/search/sort/GeoDistanceSortBuilder.java +++ b/server/src/main/java/org/opensearch/search/sort/GeoDistanceSortBuilder.java @@ -84,6 +84,8 @@ /** * A geo distance based sorting on a geo point like field. + * + * @opensearch.internal */ public class GeoDistanceSortBuilder extends SortBuilder { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(GeoDistanceSortBuilder.class); diff --git a/server/src/main/java/org/opensearch/search/sort/MinAndMax.java b/server/src/main/java/org/opensearch/search/sort/MinAndMax.java index bae4ad1bda353..c5aae37f49052 100644 --- a/server/src/main/java/org/opensearch/search/sort/MinAndMax.java +++ b/server/src/main/java/org/opensearch/search/sort/MinAndMax.java @@ -43,6 +43,8 @@ /** * A class that encapsulates a minimum and a maximum, that are of the same type and {@link Comparable}. + * + * @opensearch.internal */ public class MinAndMax> implements Writeable { private final T minValue; diff --git a/server/src/main/java/org/opensearch/search/sort/NestedSortBuilder.java b/server/src/main/java/org/opensearch/search/sort/NestedSortBuilder.java index 2463cb9294911..18bf0dcd4b60e 100644 --- a/server/src/main/java/org/opensearch/search/sort/NestedSortBuilder.java +++ b/server/src/main/java/org/opensearch/search/sort/NestedSortBuilder.java @@ -47,6 +47,11 @@ import static org.opensearch.search.sort.SortBuilder.parseNestedFilter; +/** + * Builds a sort on nested objects + * + * @opensearch.internal + */ public class NestedSortBuilder implements Writeable, ToXContentObject { public static final ParseField NESTED_FIELD = new ParseField("nested"); public static final ParseField PATH_FIELD = new ParseField("path"); diff --git a/server/src/main/java/org/opensearch/search/sort/ScoreSortBuilder.java b/server/src/main/java/org/opensearch/search/sort/ScoreSortBuilder.java index d0dab54bf8f68..a78180fa21267 100644 --- a/server/src/main/java/org/opensearch/search/sort/ScoreSortBuilder.java +++ b/server/src/main/java/org/opensearch/search/sort/ScoreSortBuilder.java @@ -49,6 +49,8 @@ /** * A sort builder allowing to sort by score. + * + * @opensearch.internal */ public class ScoreSortBuilder extends SortBuilder { diff --git a/server/src/main/java/org/opensearch/search/sort/ScriptSortBuilder.java b/server/src/main/java/org/opensearch/search/sort/ScriptSortBuilder.java index 55a3f380b0e16..6a412eb3b5e2b 100644 --- a/server/src/main/java/org/opensearch/search/sort/ScriptSortBuilder.java +++ b/server/src/main/java/org/opensearch/search/sort/ScriptSortBuilder.java @@ -77,6 +77,8 @@ /** * Script sort builder allows to sort based on a custom script expression. + * + * @opensearch.internal */ public class ScriptSortBuilder extends SortBuilder { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(ScriptSortBuilder.class); diff --git a/server/src/main/java/org/opensearch/search/sort/SortAndFormats.java b/server/src/main/java/org/opensearch/search/sort/SortAndFormats.java index e0abe94ff6e23..272b1e9c1dc8d 100644 --- a/server/src/main/java/org/opensearch/search/sort/SortAndFormats.java +++ b/server/src/main/java/org/opensearch/search/sort/SortAndFormats.java @@ -34,6 +34,11 @@ import org.apache.lucene.search.Sort; import org.opensearch.search.DocValueFormat; +/** + * Utility class to hold sort and doc value format instances + * + * @opensearch.internal + */ public final class SortAndFormats { public final Sort sort; diff --git a/server/src/main/java/org/opensearch/search/sort/SortBuilder.java b/server/src/main/java/org/opensearch/search/sort/SortBuilder.java index 74a4d974c9555..a8ade60b5b64f 100644 --- a/server/src/main/java/org/opensearch/search/sort/SortBuilder.java +++ b/server/src/main/java/org/opensearch/search/sort/SortBuilder.java @@ -60,6 +60,11 @@ import static org.opensearch.index.query.AbstractQueryBuilder.parseInnerQueryBuilder; +/** + * Base class for sort object builders + * + * @opensearch.internal + */ public abstract class SortBuilder> implements NamedWriteable, ToXContentObject, Rewriteable> { protected SortOrder order = SortOrder.ASC; diff --git a/server/src/main/java/org/opensearch/search/sort/SortBuilders.java b/server/src/main/java/org/opensearch/search/sort/SortBuilders.java index dc535847257d7..209b5b160f30b 100644 --- a/server/src/main/java/org/opensearch/search/sort/SortBuilders.java +++ b/server/src/main/java/org/opensearch/search/sort/SortBuilders.java @@ -39,7 +39,7 @@ /** * A set of static factory methods for {@link SortBuilder}s. * - * + * @opensearch.internal */ public class SortBuilders { diff --git a/server/src/main/java/org/opensearch/search/sort/SortFieldAndFormat.java b/server/src/main/java/org/opensearch/search/sort/SortFieldAndFormat.java index 8b0d0c1cd6775..c1441288bf732 100644 --- a/server/src/main/java/org/opensearch/search/sort/SortFieldAndFormat.java +++ b/server/src/main/java/org/opensearch/search/sort/SortFieldAndFormat.java @@ -36,6 +36,11 @@ import org.apache.lucene.search.SortField; import org.opensearch.search.DocValueFormat; +/** + * A holder for SortField and doc value format objects + * + * @opensearch.internal + */ public final class SortFieldAndFormat { public final SortField field; diff --git a/server/src/main/java/org/opensearch/search/sort/SortMode.java b/server/src/main/java/org/opensearch/search/sort/SortMode.java index 6c63bfa702417..eda46b9bb0f0e 100644 --- a/server/src/main/java/org/opensearch/search/sort/SortMode.java +++ b/server/src/main/java/org/opensearch/search/sort/SortMode.java @@ -50,6 +50,8 @@ *
  • avg - Use the average of all values as sort value. Only applicable for number based array fields.
  • *
  • median - Use the median of all values as sort value. Only applicable for number based array fields.
  • * + * + * @opensearch.internal */ public enum SortMode implements Writeable { /** pick the lowest value **/ diff --git a/server/src/main/java/org/opensearch/search/sort/SortOrder.java b/server/src/main/java/org/opensearch/search/sort/SortOrder.java index 290c2fdb413a5..cfb917329ceb3 100644 --- a/server/src/main/java/org/opensearch/search/sort/SortOrder.java +++ b/server/src/main/java/org/opensearch/search/sort/SortOrder.java @@ -43,7 +43,7 @@ /** * A sorting order. * - * + * @opensearch.internal */ public enum SortOrder implements Writeable { /** diff --git a/server/src/main/java/org/opensearch/search/sort/SortParser.java b/server/src/main/java/org/opensearch/search/sort/SortParser.java index 870981c47382c..425dd77308e36 100644 --- a/server/src/main/java/org/opensearch/search/sort/SortParser.java +++ b/server/src/main/java/org/opensearch/search/sort/SortParser.java @@ -12,6 +12,11 @@ import java.io.IOException; +/** + * A base parser interface for creating sort objects based on API requests + * + * @opensearch.internal + */ @FunctionalInterface public interface SortParser> { /** diff --git a/server/src/main/java/org/opensearch/search/sort/SortValue.java b/server/src/main/java/org/opensearch/search/sort/SortValue.java index 4d403afaf264e..d876ade3132b4 100644 --- a/server/src/main/java/org/opensearch/search/sort/SortValue.java +++ b/server/src/main/java/org/opensearch/search/sort/SortValue.java @@ -45,6 +45,8 @@ /** * A {@link Comparable}, {@link DocValueFormat} aware wrapper around a sort value. + * + * @opensearch.internal */ public abstract class SortValue implements NamedWriteable, Comparable { /** diff --git a/server/src/main/java/org/opensearch/search/suggest/DirectSpellcheckerSettings.java b/server/src/main/java/org/opensearch/search/suggest/DirectSpellcheckerSettings.java index 03821a90fbbec..d49953594847c 100644 --- a/server/src/main/java/org/opensearch/search/suggest/DirectSpellcheckerSettings.java +++ b/server/src/main/java/org/opensearch/search/suggest/DirectSpellcheckerSettings.java @@ -41,6 +41,11 @@ import java.util.Comparator; +/** + * Settings for the direct spell checker + * + * @opensearch.internal + */ public class DirectSpellcheckerSettings { // NB: If this changes, make sure to change the default in TermBuilderSuggester diff --git a/server/src/main/java/org/opensearch/search/suggest/SortBy.java b/server/src/main/java/org/opensearch/search/suggest/SortBy.java index 39f825a98a9b7..4d0b058d1ffe1 100644 --- a/server/src/main/java/org/opensearch/search/suggest/SortBy.java +++ b/server/src/main/java/org/opensearch/search/suggest/SortBy.java @@ -42,6 +42,8 @@ /** * An enum representing the valid sorting options + * + * @opensearch.internal */ public enum SortBy implements Writeable { /** Sort should first be based on score, then document frequency and then the term itself. */ diff --git a/server/src/main/java/org/opensearch/search/suggest/Suggest.java b/server/src/main/java/org/opensearch/search/suggest/Suggest.java index 14ee4acdd11a9..90cc382ee4126 100644 --- a/server/src/main/java/org/opensearch/search/suggest/Suggest.java +++ b/server/src/main/java/org/opensearch/search/suggest/Suggest.java @@ -71,6 +71,8 @@ /** * Top level suggest result, containing the result for each suggestion. + * + * @opensearch.internal */ public class Suggest implements Iterable>>, Writeable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/search/suggest/SuggestBuilder.java b/server/src/main/java/org/opensearch/search/suggest/SuggestBuilder.java index f0e9aabc1fcfd..3f77ce29dd2bd 100644 --- a/server/src/main/java/org/opensearch/search/suggest/SuggestBuilder.java +++ b/server/src/main/java/org/opensearch/search/suggest/SuggestBuilder.java @@ -57,6 +57,8 @@ *

    * Suggesting works by suggesting terms/phrases that appear in the suggest text that are similar compared * to the terms in provided text. These suggestions are based on several options described in this class. + * + * @opensearch.internal */ public class SuggestBuilder implements Writeable, ToXContentObject { protected static final ParseField GLOBAL_TEXT_FIELD = new ParseField("text"); diff --git a/server/src/main/java/org/opensearch/search/suggest/SuggestBuilders.java b/server/src/main/java/org/opensearch/search/suggest/SuggestBuilders.java index 7ce66862aefde..100b981b6194e 100644 --- a/server/src/main/java/org/opensearch/search/suggest/SuggestBuilders.java +++ b/server/src/main/java/org/opensearch/search/suggest/SuggestBuilders.java @@ -38,6 +38,8 @@ /** * A static factory for building suggester lookup queries + * + * @opensearch.internal */ public abstract class SuggestBuilders { diff --git a/server/src/main/java/org/opensearch/search/suggest/SuggestPhase.java b/server/src/main/java/org/opensearch/search/suggest/SuggestPhase.java index d2b2edf900b9d..6ecc8939cfe70 100644 --- a/server/src/main/java/org/opensearch/search/suggest/SuggestPhase.java +++ b/server/src/main/java/org/opensearch/search/suggest/SuggestPhase.java @@ -46,6 +46,8 @@ /** * Suggest phase of a search request, used to collect suggestions + * + * @opensearch.internal */ public class SuggestPhase { diff --git a/server/src/main/java/org/opensearch/search/suggest/Suggester.java b/server/src/main/java/org/opensearch/search/suggest/Suggester.java index b1a12e20e4d62..29efc6c4a3a6a 100644 --- a/server/src/main/java/org/opensearch/search/suggest/Suggester.java +++ b/server/src/main/java/org/opensearch/search/suggest/Suggester.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Base class used for all suggester implementations + * + * @opensearch.internal + */ public abstract class Suggester { protected abstract Suggest.Suggestion> innerExecute( diff --git a/server/src/main/java/org/opensearch/search/suggest/SuggestionBuilder.java b/server/src/main/java/org/opensearch/search/suggest/SuggestionBuilder.java index 60768cf3a0842..ccc6676ebf596 100644 --- a/server/src/main/java/org/opensearch/search/suggest/SuggestionBuilder.java +++ b/server/src/main/java/org/opensearch/search/suggest/SuggestionBuilder.java @@ -53,6 +53,8 @@ /** * Base class for the different suggestion implementations. + * + * @opensearch.internal */ public abstract class SuggestionBuilder> implements NamedWriteable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/search/suggest/SuggestionSearchContext.java b/server/src/main/java/org/opensearch/search/suggest/SuggestionSearchContext.java index 881bc1f091883..9b38c73692eda 100644 --- a/server/src/main/java/org/opensearch/search/suggest/SuggestionSearchContext.java +++ b/server/src/main/java/org/opensearch/search/suggest/SuggestionSearchContext.java @@ -38,6 +38,11 @@ import java.util.LinkedHashMap; import java.util.Map; +/** + * Context used for suggestion based search + * + * @opensearch.internal + */ public class SuggestionSearchContext { private final Map suggestions = new LinkedHashMap<>(4); diff --git a/server/src/main/java/org/opensearch/search/suggest/completion/CompletionStats.java b/server/src/main/java/org/opensearch/search/suggest/completion/CompletionStats.java index 098e00d5f382f..f9090f30fdc73 100644 --- a/server/src/main/java/org/opensearch/search/suggest/completion/CompletionStats.java +++ b/server/src/main/java/org/opensearch/search/suggest/completion/CompletionStats.java @@ -42,6 +42,11 @@ import java.io.IOException; +/** + * Stats for completion suggester + * + * @opensearch.internal + */ public class CompletionStats implements Writeable, ToXContentFragment { private static final String COMPLETION = "completion"; diff --git a/server/src/main/java/org/opensearch/search/suggest/completion/CompletionSuggester.java b/server/src/main/java/org/opensearch/search/suggest/completion/CompletionSuggester.java index ba6db16722125..c897b36f14ff9 100644 --- a/server/src/main/java/org/opensearch/search/suggest/completion/CompletionSuggester.java +++ b/server/src/main/java/org/opensearch/search/suggest/completion/CompletionSuggester.java @@ -51,6 +51,11 @@ import java.util.Map; import java.util.Set; +/** + * The completion suggester implementation + * + * @opensearch.internal + */ public class CompletionSuggester extends Suggester { public static final CompletionSuggester INSTANCE = new CompletionSuggester(); diff --git a/server/src/main/java/org/opensearch/search/suggest/completion/CompletionSuggestion.java b/server/src/main/java/org/opensearch/search/suggest/completion/CompletionSuggestion.java index 3f6a3138daa1f..e8245d46a6231 100644 --- a/server/src/main/java/org/opensearch/search/suggest/completion/CompletionSuggestion.java +++ b/server/src/main/java/org/opensearch/search/suggest/completion/CompletionSuggestion.java @@ -76,6 +76,7 @@ * .. * } * + * @opensearch.internal */ public final class CompletionSuggestion extends Suggest.Suggestion { diff --git a/server/src/main/java/org/opensearch/search/suggest/completion/CompletionSuggestionBuilder.java b/server/src/main/java/org/opensearch/search/suggest/completion/CompletionSuggestionBuilder.java index f9b65d49015ac..471dd1bbe05de 100644 --- a/server/src/main/java/org/opensearch/search/suggest/completion/CompletionSuggestionBuilder.java +++ b/server/src/main/java/org/opensearch/search/suggest/completion/CompletionSuggestionBuilder.java @@ -67,6 +67,8 @@ * for users as they type search terms. The implementation of the completion service uses FSTs that * are created at index-time and so must be defined in the mapping with the type "completion" before * indexing. + * + * @opensearch.internal */ public class CompletionSuggestionBuilder extends SuggestionBuilder { diff --git a/server/src/main/java/org/opensearch/search/suggest/completion/CompletionSuggestionContext.java b/server/src/main/java/org/opensearch/search/suggest/completion/CompletionSuggestionContext.java index 1fbea11ab0b4c..f92b7f7ed82ba 100644 --- a/server/src/main/java/org/opensearch/search/suggest/completion/CompletionSuggestionContext.java +++ b/server/src/main/java/org/opensearch/search/suggest/completion/CompletionSuggestionContext.java @@ -44,6 +44,11 @@ import java.util.List; import java.util.Map; +/** + * Context used for the completion suggester + * + * @opensearch.internal + */ public class CompletionSuggestionContext extends SuggestionSearchContext.SuggestionContext { protected CompletionSuggestionContext(QueryShardContext shardContext) { diff --git a/server/src/main/java/org/opensearch/search/suggest/completion/FuzzyOptions.java b/server/src/main/java/org/opensearch/search/suggest/completion/FuzzyOptions.java index 97c049af25eea..6c4a71a00e07a 100644 --- a/server/src/main/java/org/opensearch/search/suggest/completion/FuzzyOptions.java +++ b/server/src/main/java/org/opensearch/search/suggest/completion/FuzzyOptions.java @@ -49,6 +49,8 @@ /** * Fuzzy options for completion suggester + * + * @opensearch.internal */ public class FuzzyOptions implements ToXContentFragment, Writeable { static final ParseField FUZZY_OPTIONS = new ParseField("fuzzy"); diff --git a/server/src/main/java/org/opensearch/search/suggest/completion/RegexOptions.java b/server/src/main/java/org/opensearch/search/suggest/completion/RegexOptions.java index 2cb746bbd589c..fc33eda23a423 100644 --- a/server/src/main/java/org/opensearch/search/suggest/completion/RegexOptions.java +++ b/server/src/main/java/org/opensearch/search/suggest/completion/RegexOptions.java @@ -49,6 +49,8 @@ /** * Regular expression options for completion suggester + * + * @opensearch.internal */ public class RegexOptions implements ToXContentFragment, Writeable { static final ParseField REGEX_OPTIONS = new ParseField("regex"); diff --git a/server/src/main/java/org/opensearch/search/suggest/completion/TopSuggestGroupDocsCollector.java b/server/src/main/java/org/opensearch/search/suggest/completion/TopSuggestGroupDocsCollector.java index 9405bf82da186..4fbd661037aa9 100644 --- a/server/src/main/java/org/opensearch/search/suggest/completion/TopSuggestGroupDocsCollector.java +++ b/server/src/main/java/org/opensearch/search/suggest/completion/TopSuggestGroupDocsCollector.java @@ -47,6 +47,8 @@ * This collector groups suggestions coming from the same document but matching different contexts * or surface form together. When different contexts or surface forms match the same suggestion form only * the best one per document (sorted by weight) is kept. + * + * @opensearch.internal **/ class TopSuggestGroupDocsCollector extends TopSuggestDocsCollector { private Map> docContexts = new HashMap<>(); diff --git a/server/src/main/java/org/opensearch/search/suggest/completion/context/CategoryContextMapping.java b/server/src/main/java/org/opensearch/search/suggest/completion/context/CategoryContextMapping.java index 8da248ac35bc4..624e828d78b83 100644 --- a/server/src/main/java/org/opensearch/search/suggest/completion/context/CategoryContextMapping.java +++ b/server/src/main/java/org/opensearch/search/suggest/completion/context/CategoryContextMapping.java @@ -61,6 +61,8 @@ * category (string) value. * {@link CategoryQueryContext} defines options for constructing * a unit of query context for this context type + * + * @opensearch.internal */ public class CategoryContextMapping extends ContextMapping { diff --git a/server/src/main/java/org/opensearch/search/suggest/completion/context/CategoryQueryContext.java b/server/src/main/java/org/opensearch/search/suggest/completion/context/CategoryQueryContext.java index f85d263c01592..bc31e88587870 100644 --- a/server/src/main/java/org/opensearch/search/suggest/completion/context/CategoryQueryContext.java +++ b/server/src/main/java/org/opensearch/search/suggest/completion/context/CategoryQueryContext.java @@ -48,6 +48,8 @@ /** * Defines the query context for {@link CategoryContextMapping} + * + * @opensearch.internal */ public final class CategoryQueryContext implements ToXContentObject { public static final String NAME = "category"; diff --git a/server/src/main/java/org/opensearch/search/suggest/completion/context/ContextBuilder.java b/server/src/main/java/org/opensearch/search/suggest/completion/context/ContextBuilder.java index f2e4436c1fb0f..9fe2e885fc3fa 100644 --- a/server/src/main/java/org/opensearch/search/suggest/completion/context/ContextBuilder.java +++ b/server/src/main/java/org/opensearch/search/suggest/completion/context/ContextBuilder.java @@ -34,6 +34,8 @@ /** * Builder for {@link ContextMapping} + * + * @opensearch.internal */ public abstract class ContextBuilder> { diff --git a/server/src/main/java/org/opensearch/search/suggest/completion/context/ContextMapping.java b/server/src/main/java/org/opensearch/search/suggest/completion/context/ContextMapping.java index 497a7500f4968..3492da40edd77 100644 --- a/server/src/main/java/org/opensearch/search/suggest/completion/context/ContextMapping.java +++ b/server/src/main/java/org/opensearch/search/suggest/completion/context/ContextMapping.java @@ -57,6 +57,8 @@ * filter and/or boost suggestions at query time for {@link CompletionFieldMapper}. * * Implementations have to define how contexts are parsed at query/index time + * + * @opensearch.internal */ public abstract class ContextMapping implements ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/search/suggest/completion/context/ContextMappings.java b/server/src/main/java/org/opensearch/search/suggest/completion/context/ContextMappings.java index 76b5081607715..3d8d3c4c8e7c2 100644 --- a/server/src/main/java/org/opensearch/search/suggest/completion/context/ContextMappings.java +++ b/server/src/main/java/org/opensearch/search/suggest/completion/context/ContextMappings.java @@ -65,6 +65,8 @@ * ContextMappings indexes context-enabled suggestion fields * and creates context queries for defined {@link ContextMapping}s * for a {@link CompletionFieldMapper} + * + * @opensearch.internal */ public class ContextMappings implements ToXContent, Iterable> { diff --git a/server/src/main/java/org/opensearch/search/suggest/completion/context/GeoContextMapping.java b/server/src/main/java/org/opensearch/search/suggest/completion/context/GeoContextMapping.java index bb92e6aa0f130..f191e371d672f 100644 --- a/server/src/main/java/org/opensearch/search/suggest/completion/context/GeoContextMapping.java +++ b/server/src/main/java/org/opensearch/search/suggest/completion/context/GeoContextMapping.java @@ -75,6 +75,8 @@ * * {@link GeoQueryContext} defines the options for constructing * a unit of query context for this context type + * + * @opensearch.internal */ public class GeoContextMapping extends ContextMapping { diff --git a/server/src/main/java/org/opensearch/search/suggest/completion/context/GeoQueryContext.java b/server/src/main/java/org/opensearch/search/suggest/completion/context/GeoQueryContext.java index e891cbdf72853..d47c79747a841 100644 --- a/server/src/main/java/org/opensearch/search/suggest/completion/context/GeoQueryContext.java +++ b/server/src/main/java/org/opensearch/search/suggest/completion/context/GeoQueryContext.java @@ -54,6 +54,8 @@ /** * Defines the query context for {@link GeoContextMapping} + * + * @opensearch.internal */ public final class GeoQueryContext implements ToXContentObject { public static final String NAME = "geo"; diff --git a/server/src/main/java/org/opensearch/search/suggest/phrase/CandidateGenerator.java b/server/src/main/java/org/opensearch/search/suggest/phrase/CandidateGenerator.java index cea00352374a8..79c21a85681db 100644 --- a/server/src/main/java/org/opensearch/search/suggest/phrase/CandidateGenerator.java +++ b/server/src/main/java/org/opensearch/search/suggest/phrase/CandidateGenerator.java @@ -39,6 +39,12 @@ import java.io.IOException; //TODO public for tests + +/** + * Base class for phrase candidates + * + * @opensearch.internal + */ public abstract class CandidateGenerator { public abstract boolean isKnownWord(BytesRef term) throws IOException; diff --git a/server/src/main/java/org/opensearch/search/suggest/phrase/CandidateScorer.java b/server/src/main/java/org/opensearch/search/suggest/phrase/CandidateScorer.java index aaa50039714c8..3d094cab5802c 100644 --- a/server/src/main/java/org/opensearch/search/suggest/phrase/CandidateScorer.java +++ b/server/src/main/java/org/opensearch/search/suggest/phrase/CandidateScorer.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Scores phrase candidates + * + * @opensearch.internal + */ final class CandidateScorer { private final WordScorer scorer; private final int maxNumCorrections; diff --git a/server/src/main/java/org/opensearch/search/suggest/phrase/Correction.java b/server/src/main/java/org/opensearch/search/suggest/phrase/Correction.java index 30193da7c4ee8..057d43452ce66 100644 --- a/server/src/main/java/org/opensearch/search/suggest/phrase/Correction.java +++ b/server/src/main/java/org/opensearch/search/suggest/phrase/Correction.java @@ -38,6 +38,12 @@ import java.util.Arrays; //TODO public for tests + +/** + * Correction in phrase suggester + * + * @opensearch.internal + */ public final class Correction implements Comparable { public static final Correction[] EMPTY = new Correction[0]; diff --git a/server/src/main/java/org/opensearch/search/suggest/phrase/DirectCandidateGenerator.java b/server/src/main/java/org/opensearch/search/suggest/phrase/DirectCandidateGenerator.java index b49229dc6daf0..c8ca01d6991cb 100644 --- a/server/src/main/java/org/opensearch/search/suggest/phrase/DirectCandidateGenerator.java +++ b/server/src/main/java/org/opensearch/search/suggest/phrase/DirectCandidateGenerator.java @@ -65,6 +65,11 @@ import static java.lang.Math.min; import static java.lang.Math.round; +/** + * Generates the phrase directly from the IndexReader + * + * @opensearch.internal + */ public final class DirectCandidateGenerator extends CandidateGenerator { private final DirectSpellChecker spellchecker; diff --git a/server/src/main/java/org/opensearch/search/suggest/phrase/DirectCandidateGeneratorBuilder.java b/server/src/main/java/org/opensearch/search/suggest/phrase/DirectCandidateGeneratorBuilder.java index 411ec3f8ed791..80b7221686781 100644 --- a/server/src/main/java/org/opensearch/search/suggest/phrase/DirectCandidateGeneratorBuilder.java +++ b/server/src/main/java/org/opensearch/search/suggest/phrase/DirectCandidateGeneratorBuilder.java @@ -57,6 +57,11 @@ import java.util.Objects; import java.util.function.Consumer; +/** + * Builder for a phrase candidate directly retrieved from an IndexReader + * + * @opensearch.internal + */ public final class DirectCandidateGeneratorBuilder implements CandidateGenerator { private static final String TYPE = "direct_generator"; diff --git a/server/src/main/java/org/opensearch/search/suggest/phrase/Laplace.java b/server/src/main/java/org/opensearch/search/suggest/phrase/Laplace.java index 7c37c1cdf3929..e45f2cbebc114 100644 --- a/server/src/main/java/org/opensearch/search/suggest/phrase/Laplace.java +++ b/server/src/main/java/org/opensearch/search/suggest/phrase/Laplace.java @@ -54,6 +54,8 @@ * href="http://en.wikipedia.org/wiki/N-gram#Smoothing_techniques">N-Gram * Smoothing for details. *

    + * + * @opensearch.internal */ public final class Laplace extends SmoothingModel { public static final String NAME = "laplace"; diff --git a/server/src/main/java/org/opensearch/search/suggest/phrase/LaplaceScorer.java b/server/src/main/java/org/opensearch/search/suggest/phrase/LaplaceScorer.java index b61e70aee338c..7ac1d14576ea1 100644 --- a/server/src/main/java/org/opensearch/search/suggest/phrase/LaplaceScorer.java +++ b/server/src/main/java/org/opensearch/search/suggest/phrase/LaplaceScorer.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Scorer implementation based on a laplace computation + * + * @opensearch.internal + */ final class LaplaceScorer extends WordScorer { private double alpha; diff --git a/server/src/main/java/org/opensearch/search/suggest/phrase/LinearInterpolatingScorer.java b/server/src/main/java/org/opensearch/search/suggest/phrase/LinearInterpolatingScorer.java index e6982ea586c07..e012dde78c59e 100644 --- a/server/src/main/java/org/opensearch/search/suggest/phrase/LinearInterpolatingScorer.java +++ b/server/src/main/java/org/opensearch/search/suggest/phrase/LinearInterpolatingScorer.java @@ -38,7 +38,12 @@ import java.io.IOException; -//TODO public for tests +/** + * Linear interpolation based scoring + * + * @opensearch.internal + */ +// TODO public for tests public final class LinearInterpolatingScorer extends WordScorer { private final double unigramLambda; diff --git a/server/src/main/java/org/opensearch/search/suggest/phrase/LinearInterpolation.java b/server/src/main/java/org/opensearch/search/suggest/phrase/LinearInterpolation.java index bb3e022215a31..ba79cebb29882 100644 --- a/server/src/main/java/org/opensearch/search/suggest/phrase/LinearInterpolation.java +++ b/server/src/main/java/org/opensearch/search/suggest/phrase/LinearInterpolation.java @@ -54,6 +54,8 @@ * href="http://en.wikipedia.org/wiki/N-gram#Smoothing_techniques">N-Gram * Smoothing for details. *

    + * + * @opensearch.internal */ public final class LinearInterpolation extends SmoothingModel { public static final String NAME = "linear"; diff --git a/server/src/main/java/org/opensearch/search/suggest/phrase/MultiCandidateGeneratorWrapper.java b/server/src/main/java/org/opensearch/search/suggest/phrase/MultiCandidateGeneratorWrapper.java index d6af04eb31442..1fc26ba94264a 100644 --- a/server/src/main/java/org/opensearch/search/suggest/phrase/MultiCandidateGeneratorWrapper.java +++ b/server/src/main/java/org/opensearch/search/suggest/phrase/MultiCandidateGeneratorWrapper.java @@ -39,7 +39,12 @@ import java.io.IOException; import java.util.Arrays; -//TODO public for tests +/** + * Wrapper for a multi-candidate generator + * + * @opensearch.internal + */ +// TODO public for tests public final class MultiCandidateGeneratorWrapper extends CandidateGenerator { private final CandidateGenerator[] candidateGenerator; diff --git a/server/src/main/java/org/opensearch/search/suggest/phrase/NoisyChannelSpellChecker.java b/server/src/main/java/org/opensearch/search/suggest/phrase/NoisyChannelSpellChecker.java index 67f1897f8e9df..49790c996371a 100644 --- a/server/src/main/java/org/opensearch/search/suggest/phrase/NoisyChannelSpellChecker.java +++ b/server/src/main/java/org/opensearch/search/suggest/phrase/NoisyChannelSpellChecker.java @@ -45,6 +45,11 @@ import java.util.ArrayList; import java.util.List; +/** + * Spell checker based on a noisy channel + * + * @opensearch.internal + */ final class NoisyChannelSpellChecker { public static final double REAL_WORD_LIKELIHOOD = 0.95d; public static final int DEFAULT_TOKEN_LIMIT = 10; diff --git a/server/src/main/java/org/opensearch/search/suggest/phrase/PhraseSuggester.java b/server/src/main/java/org/opensearch/search/suggest/phrase/PhraseSuggester.java index 71c2326b730cd..ef0ab4917de2c 100644 --- a/server/src/main/java/org/opensearch/search/suggest/phrase/PhraseSuggester.java +++ b/server/src/main/java/org/opensearch/search/suggest/phrase/PhraseSuggester.java @@ -64,6 +64,11 @@ import java.util.List; import java.util.Map; +/** + * Phrase suggestion implementation + * + * @opensearch.internal + */ public final class PhraseSuggester extends Suggester { private final BytesRef SEPARATOR = new BytesRef(" "); private static final String SUGGESTION_TEMPLATE_VAR_NAME = "suggestion"; diff --git a/server/src/main/java/org/opensearch/search/suggest/phrase/PhraseSuggestion.java b/server/src/main/java/org/opensearch/search/suggest/phrase/PhraseSuggestion.java index f5c4de576fdc8..648d00e350976 100644 --- a/server/src/main/java/org/opensearch/search/suggest/phrase/PhraseSuggestion.java +++ b/server/src/main/java/org/opensearch/search/suggest/phrase/PhraseSuggestion.java @@ -50,6 +50,8 @@ /** * Suggestion entry returned from the {@link PhraseSuggester}. + * + * @opensearch.internal */ public class PhraseSuggestion extends Suggest.Suggestion { diff --git a/server/src/main/java/org/opensearch/search/suggest/phrase/PhraseSuggestionBuilder.java b/server/src/main/java/org/opensearch/search/suggest/phrase/PhraseSuggestionBuilder.java index 564ec1ee7431e..ca9effe722297 100644 --- a/server/src/main/java/org/opensearch/search/suggest/phrase/PhraseSuggestionBuilder.java +++ b/server/src/main/java/org/opensearch/search/suggest/phrase/PhraseSuggestionBuilder.java @@ -68,6 +68,8 @@ /** * Defines the actual suggest command for phrase suggestions ( {@code phrase}). + * + * @opensearch.internal */ public class PhraseSuggestionBuilder extends SuggestionBuilder { diff --git a/server/src/main/java/org/opensearch/search/suggest/phrase/PhraseSuggestionContext.java b/server/src/main/java/org/opensearch/search/suggest/phrase/PhraseSuggestionContext.java index f62a239e388f6..f5107ff9a5d58 100644 --- a/server/src/main/java/org/opensearch/search/suggest/phrase/PhraseSuggestionContext.java +++ b/server/src/main/java/org/opensearch/search/suggest/phrase/PhraseSuggestionContext.java @@ -45,6 +45,11 @@ import java.util.List; import java.util.Map; +/** + * Context used during phrase suggestion + * + * @opensearch.internal + */ class PhraseSuggestionContext extends SuggestionContext { static final boolean DEFAULT_COLLATE_PRUNE = false; static final boolean DEFAULT_REQUIRE_UNIGRAM = true; diff --git a/server/src/main/java/org/opensearch/search/suggest/phrase/SmoothingModel.java b/server/src/main/java/org/opensearch/search/suggest/phrase/SmoothingModel.java index 916eb451d8fd7..a795c6f8ac096 100644 --- a/server/src/main/java/org/opensearch/search/suggest/phrase/SmoothingModel.java +++ b/server/src/main/java/org/opensearch/search/suggest/phrase/SmoothingModel.java @@ -41,6 +41,11 @@ import java.io.IOException; +/** + * Smooths the scoring calculation + * + * @opensearch.internal + */ public abstract class SmoothingModel implements NamedWriteable, ToXContentFragment { @Override diff --git a/server/src/main/java/org/opensearch/search/suggest/phrase/StupidBackoff.java b/server/src/main/java/org/opensearch/search/suggest/phrase/StupidBackoff.java index 1013b17f62ec2..241eef5db3a54 100644 --- a/server/src/main/java/org/opensearch/search/suggest/phrase/StupidBackoff.java +++ b/server/src/main/java/org/opensearch/search/suggest/phrase/StupidBackoff.java @@ -55,6 +55,8 @@ * href="http://en.wikipedia.org/wiki/N-gram#Smoothing_techniques">N-Gram * Smoothing for details. *

    + * + * @opensearch.internal */ public final class StupidBackoff extends SmoothingModel { /** diff --git a/server/src/main/java/org/opensearch/search/suggest/phrase/StupidBackoffScorer.java b/server/src/main/java/org/opensearch/search/suggest/phrase/StupidBackoffScorer.java index 96005bdb10650..35de07015b853 100644 --- a/server/src/main/java/org/opensearch/search/suggest/phrase/StupidBackoffScorer.java +++ b/server/src/main/java/org/opensearch/search/suggest/phrase/StupidBackoffScorer.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * naive backoff scorer + * + * @opensearch.internal + */ class StupidBackoffScorer extends WordScorer { private final double discount; diff --git a/server/src/main/java/org/opensearch/search/suggest/phrase/WordScorer.java b/server/src/main/java/org/opensearch/search/suggest/phrase/WordScorer.java index 8b988ff4ff838..4a32aee83b36e 100644 --- a/server/src/main/java/org/opensearch/search/suggest/phrase/WordScorer.java +++ b/server/src/main/java/org/opensearch/search/suggest/phrase/WordScorer.java @@ -44,7 +44,12 @@ import java.io.IOException; -//TODO public for tests +/** + * Scores by words + * + * @opensearch.internal + */ +// TODO public for tests public abstract class WordScorer { protected final IndexReader reader; protected final String field; diff --git a/server/src/main/java/org/opensearch/search/suggest/term/TermSuggester.java b/server/src/main/java/org/opensearch/search/suggest/term/TermSuggester.java index 4b480165c9b2d..0c9a3bcc2e168 100644 --- a/server/src/main/java/org/opensearch/search/suggest/term/TermSuggester.java +++ b/server/src/main/java/org/opensearch/search/suggest/term/TermSuggester.java @@ -49,6 +49,11 @@ import java.util.ArrayList; import java.util.List; +/** + * The Term Suggester implementation + * + * @opensearch.internal + */ public final class TermSuggester extends Suggester { public static final TermSuggester INSTANCE = new TermSuggester(); diff --git a/server/src/main/java/org/opensearch/search/suggest/term/TermSuggestion.java b/server/src/main/java/org/opensearch/search/suggest/term/TermSuggestion.java index 86b1db3ed6ab7..78d0e8f58e6a5 100644 --- a/server/src/main/java/org/opensearch/search/suggest/term/TermSuggestion.java +++ b/server/src/main/java/org/opensearch/search/suggest/term/TermSuggestion.java @@ -54,6 +54,8 @@ /** * The suggestion responses corresponding with the suggestions in the request. + * + * @opensearch.internal */ public class TermSuggestion extends Suggestion { diff --git a/server/src/main/java/org/opensearch/search/suggest/term/TermSuggestionBuilder.java b/server/src/main/java/org/opensearch/search/suggest/term/TermSuggestionBuilder.java index f9cea912a101d..27916ef03e9b1 100644 --- a/server/src/main/java/org/opensearch/search/suggest/term/TermSuggestionBuilder.java +++ b/server/src/main/java/org/opensearch/search/suggest/term/TermSuggestionBuilder.java @@ -77,6 +77,8 @@ * Defines the actual suggest command. Each command uses the global options * unless defined in the suggestion itself. All options are the same as the * global options, but are only applicable for this suggestion. + * + * @opensearch.internal */ public class TermSuggestionBuilder extends SuggestionBuilder { diff --git a/server/src/main/java/org/opensearch/search/suggest/term/TermSuggestionContext.java b/server/src/main/java/org/opensearch/search/suggest/term/TermSuggestionContext.java index 0079d627cdbdc..fce317989f316 100644 --- a/server/src/main/java/org/opensearch/search/suggest/term/TermSuggestionContext.java +++ b/server/src/main/java/org/opensearch/search/suggest/term/TermSuggestionContext.java @@ -35,6 +35,11 @@ import org.opensearch.search.suggest.DirectSpellcheckerSettings; import org.opensearch.search.suggest.SuggestionSearchContext.SuggestionContext; +/** + * Context used during term suggestion + * + * @opensearch.internal + */ final class TermSuggestionContext extends SuggestionContext { private final DirectSpellcheckerSettings settings = new DirectSpellcheckerSettings(); From a6913e08c0e1734e2c7bf8c47ef848844cae81d8 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 10 May 2022 13:11:24 -0400 Subject: [PATCH 140/514] Allow to configure POM for ZIP publication (#3252) (#3270) Signed-off-by: Andriy Redko (cherry picked from commit f5c0b30a8ef1edb49ef457433d1e3908bbeb6953) Co-authored-by: Andriy Redko --- .../opensearch/gradle/pluginzip/Publish.java | 28 ++++++++++++------- .../gradle/pluginzip/PublishTests.java | 2 +- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/buildSrc/src/main/java/org/opensearch/gradle/pluginzip/Publish.java b/buildSrc/src/main/java/org/opensearch/gradle/pluginzip/Publish.java index 0a3b198b4d32f..d83384ec7d172 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/pluginzip/Publish.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/pluginzip/Publish.java @@ -7,18 +7,17 @@ */ package org.opensearch.gradle.pluginzip; -import java.util.*; import org.gradle.api.Plugin; import org.gradle.api.Project; +import org.gradle.api.publish.Publication; import org.gradle.api.publish.PublishingExtension; import org.gradle.api.publish.maven.MavenPublication; import org.gradle.api.publish.maven.plugins.MavenPublishPlugin; + import java.nio.file.Path; import org.gradle.api.Task; public class Publish implements Plugin { - private Project project; - public final static String EXTENSION_NAME = "zipmavensettings"; public final static String PUBLICATION_NAME = "pluginZip"; public final static String STAGING_REPO = "zipStaging"; @@ -38,7 +37,19 @@ public static void configMaven(Project project) { }); }); publishing.publications(publications -> { - publications.create(PUBLICATION_NAME, MavenPublication.class, mavenZip -> { + final Publication publication = publications.findByName(PUBLICATION_NAME); + if (publication == null) { + publications.create(PUBLICATION_NAME, MavenPublication.class, mavenZip -> { + String zipGroup = "org.opensearch.plugin"; + String zipArtifact = project.getName(); + String zipVersion = getProperty("version", project); + mavenZip.artifact(project.getTasks().named("bundlePlugin")); + mavenZip.setGroupId(zipGroup); + mavenZip.setArtifactId(zipArtifact); + mavenZip.setVersion(zipVersion); + }); + } else { + final MavenPublication mavenZip = (MavenPublication) publication; String zipGroup = "org.opensearch.plugin"; String zipArtifact = project.getName(); String zipVersion = getProperty("version", project); @@ -46,7 +57,7 @@ public static void configMaven(Project project) { mavenZip.setGroupId(zipGroup); mavenZip.setArtifactId(zipArtifact); mavenZip.setVersion(zipVersion); - }); + } }); }); } @@ -63,7 +74,6 @@ static String getProperty(String name, Project project) { @Override public void apply(Project project) { - this.project = project; project.afterEvaluate(evaluatedProject -> { configMaven(project); Task validatePluginZipPom = project.getTasks().findByName("validatePluginZipPom"); @@ -72,10 +82,8 @@ public void apply(Project project) { } Task publishPluginZipPublicationToZipStagingRepository = project.getTasks() .findByName("publishPluginZipPublicationToZipStagingRepository"); - if (validatePluginZipPom != null) { - project.getTasks() - .getByName("publishPluginZipPublicationToZipStagingRepository") - .dependsOn("generatePomFileForNebulaPublication"); + if (publishPluginZipPublicationToZipStagingRepository != null) { + publishPluginZipPublicationToZipStagingRepository.dependsOn("generatePomFileForNebulaPublication"); } }); } diff --git a/buildSrc/src/test/java/org/opensearch/gradle/pluginzip/PublishTests.java b/buildSrc/src/test/java/org/opensearch/gradle/pluginzip/PublishTests.java index 4ca1c856b3247..851c450699bd7 100644 --- a/buildSrc/src/test/java/org/opensearch/gradle/pluginzip/PublishTests.java +++ b/buildSrc/src/test/java/org/opensearch/gradle/pluginzip/PublishTests.java @@ -13,6 +13,7 @@ import org.gradle.testfixtures.ProjectBuilder; import org.gradle.api.Project; import org.opensearch.gradle.test.GradleUnitTestCase; +import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.rules.TemporaryFolder; @@ -31,7 +32,6 @@ import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import java.io.FileReader; import org.gradle.api.tasks.bundling.Zip; -import org.gradle.internal.impldep.org.junit.After; import java.util.List; import java.util.ArrayList; From bc3c606938c7188b5b96c4036a11126a7159d2b0 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 10 May 2022 13:59:52 -0400 Subject: [PATCH 141/514] [Javadocs] add to o.o.dfs,fetch,internal,lookup,profile, and query packages (#3261) (#3262) Adds class level javadocs to org.opensearch.dfs, fetch, internal, lookup, profile, and query packages. Signed-off-by: Nicholas Walter Knize (cherry picked from commit 1118dcf3727b6a2dee598159d65560adfc4d0dec) Co-authored-by: Nick Knize --- .../main/java/org/opensearch/search/dfs/AggregatedDfs.java | 5 +++++ .../src/main/java/org/opensearch/search/dfs/DfsPhase.java | 2 ++ .../opensearch/search/dfs/DfsPhaseExecutionException.java | 5 +++++ .../java/org/opensearch/search/dfs/DfsSearchResult.java | 5 +++++ .../main/java/org/opensearch/search/fetch/FetchContext.java | 2 ++ .../main/java/org/opensearch/search/fetch/FetchPhase.java | 2 ++ .../search/fetch/FetchPhaseExecutionException.java | 5 +++++ .../java/org/opensearch/search/fetch/FetchSearchResult.java | 5 +++++ .../java/org/opensearch/search/fetch/FetchSubPhase.java | 2 ++ .../org/opensearch/search/fetch/FetchSubPhaseProcessor.java | 2 ++ .../org/opensearch/search/fetch/QueryFetchSearchResult.java | 5 +++++ .../search/fetch/ScrollQueryFetchSearchResult.java | 5 +++++ .../java/org/opensearch/search/fetch/ShardFetchRequest.java | 2 ++ .../opensearch/search/fetch/ShardFetchSearchRequest.java | 2 ++ .../org/opensearch/search/fetch/StoredFieldsContext.java | 2 ++ .../org/opensearch/search/fetch/subphase/ExplainPhase.java | 2 ++ .../search/fetch/subphase/FetchDocValuesContext.java | 2 ++ .../search/fetch/subphase/FetchDocValuesPhase.java | 2 ++ .../search/fetch/subphase/FetchFieldsContext.java | 2 ++ .../opensearch/search/fetch/subphase/FetchFieldsPhase.java | 2 ++ .../opensearch/search/fetch/subphase/FetchScorePhase.java | 5 +++++ .../search/fetch/subphase/FetchSourceContext.java | 2 ++ .../opensearch/search/fetch/subphase/FetchSourcePhase.java | 5 +++++ .../opensearch/search/fetch/subphase/FetchVersionPhase.java | 5 +++++ .../opensearch/search/fetch/subphase/FieldAndFormat.java | 2 ++ .../org/opensearch/search/fetch/subphase/FieldFetcher.java | 2 ++ .../opensearch/search/fetch/subphase/InnerHitsContext.java | 2 ++ .../opensearch/search/fetch/subphase/InnerHitsPhase.java | 5 +++++ .../search/fetch/subphase/MatchedQueriesPhase.java | 5 +++++ .../search/fetch/subphase/ScriptFieldsContext.java | 5 +++++ .../opensearch/search/fetch/subphase/ScriptFieldsPhase.java | 5 +++++ .../search/fetch/subphase/SeqNoPrimaryTermPhase.java | 5 +++++ .../subphase/highlight/AbstractHighlighterBuilder.java | 2 ++ .../search/fetch/subphase/highlight/CustomQueryScorer.java | 5 +++++ .../fetch/subphase/highlight/FastVectorHighlighter.java | 5 +++++ .../fetch/subphase/highlight/FieldHighlightContext.java | 5 +++++ .../fetch/subphase/highlight/FragmentBuilderHelper.java | 2 ++ .../search/fetch/subphase/highlight/HighlightBuilder.java | 2 ++ .../search/fetch/subphase/highlight/HighlightField.java | 2 ++ .../search/fetch/subphase/highlight/HighlightPhase.java | 5 +++++ .../search/fetch/subphase/highlight/HighlightUtils.java | 5 +++++ .../search/fetch/subphase/highlight/Highlighter.java | 2 ++ .../search/fetch/subphase/highlight/PlainHighlighter.java | 5 +++++ .../fetch/subphase/highlight/SearchHighlightContext.java | 5 +++++ .../fetch/subphase/highlight/SimpleFragmentsBuilder.java | 2 ++ .../highlight/SourceScoreOrderFragmentsBuilder.java | 5 +++++ .../subphase/highlight/SourceSimpleFragmentsBuilder.java | 5 +++++ .../search/fetch/subphase/highlight/UnifiedHighlighter.java | 5 +++++ .../java/org/opensearch/search/internal/AliasFilter.java | 2 ++ .../opensearch/search/internal/CancellableBulkScorer.java | 2 ++ .../opensearch/search/internal/ContextIndexSearcher.java | 2 ++ .../opensearch/search/internal/ExitableDirectoryReader.java | 2 ++ .../opensearch/search/internal/FilteredSearchContext.java | 5 +++++ .../search/internal/InternalScrollSearchRequest.java | 5 +++++ .../opensearch/search/internal/InternalSearchResponse.java | 2 ++ .../org/opensearch/search/internal/LegacyReaderContext.java | 5 +++++ .../java/org/opensearch/search/internal/ReaderContext.java | 2 ++ .../java/org/opensearch/search/internal/ScrollContext.java | 6 +++++- .../java/org/opensearch/search/internal/SearchContext.java | 2 ++ .../opensearch/search/internal/ShardSearchContextId.java | 5 +++++ .../org/opensearch/search/internal/ShardSearchRequest.java | 2 ++ .../org/opensearch/search/internal/SubSearchContext.java | 5 +++++ .../main/java/org/opensearch/search/lookup/DocLookup.java | 5 +++++ .../main/java/org/opensearch/search/lookup/FieldLookup.java | 5 +++++ .../java/org/opensearch/search/lookup/FieldsLookup.java | 5 +++++ .../java/org/opensearch/search/lookup/LeafDocLookup.java | 5 +++++ .../java/org/opensearch/search/lookup/LeafFieldsLookup.java | 5 +++++ .../java/org/opensearch/search/lookup/LeafSearchLookup.java | 2 ++ .../java/org/opensearch/search/lookup/SearchLookup.java | 5 +++++ .../java/org/opensearch/search/lookup/SourceLookup.java | 5 +++++ .../search/profile/AbstractInternalProfileTree.java | 5 +++++ .../opensearch/search/profile/AbstractProfileBreakdown.java | 2 ++ .../org/opensearch/search/profile/AbstractProfiler.java | 5 +++++ .../search/profile/ContextualProfileBreakdown.java | 2 ++ .../java/org/opensearch/search/profile/NetworkTime.java | 5 +++++ .../java/org/opensearch/search/profile/ProfileResult.java | 2 ++ .../org/opensearch/search/profile/ProfileShardResult.java | 5 +++++ .../main/java/org/opensearch/search/profile/Profilers.java | 6 +++++- .../search/profile/SearchProfileShardResults.java | 2 ++ .../src/main/java/org/opensearch/search/profile/Timer.java | 2 ++ .../profile/aggregation/AggregationProfileBreakdown.java | 2 ++ .../profile/aggregation/AggregationProfileShardResult.java | 2 ++ .../search/profile/aggregation/AggregationProfiler.java | 5 +++++ .../search/profile/aggregation/AggregationTimingType.java | 5 +++++ .../profile/aggregation/InternalAggregationProfileTree.java | 5 +++++ .../search/profile/aggregation/ProfilingAggregator.java | 3 +++ .../profile/aggregation/ProfilingLeafBucketCollector.java | 5 +++++ .../opensearch/search/profile/query/CollectorResult.java | 2 ++ .../profile/query/ConcurrentQueryProfileBreakdown.java | 2 ++ .../search/profile/query/InternalProfileCollector.java | 2 ++ .../profile/query/InternalProfileCollectorManager.java | 5 +++++ .../search/profile/query/InternalProfileComponent.java | 5 +++++ .../search/profile/query/InternalQueryProfileTree.java | 2 ++ .../opensearch/search/profile/query/ProfileCollector.java | 6 +++++- .../search/profile/query/ProfileCollectorManager.java | 2 ++ .../org/opensearch/search/profile/query/ProfileScorer.java | 2 ++ .../org/opensearch/search/profile/query/ProfileWeight.java | 2 ++ .../search/profile/query/QueryProfileBreakdown.java | 2 ++ .../search/profile/query/QueryProfileShardResult.java | 2 ++ .../org/opensearch/search/profile/query/QueryProfiler.java | 2 ++ .../opensearch/search/profile/query/QueryTimingType.java | 5 +++++ .../opensearch/search/query/EarlyTerminatingCollector.java | 2 ++ .../search/query/EarlyTerminatingCollectorManager.java | 5 +++++ .../opensearch/search/query/EarlyTerminatingListener.java | 2 ++ .../opensearch/search/query/FilteredCollectorManager.java | 5 +++++ .../opensearch/search/query/MinimumCollectorManager.java | 3 +++ .../org/opensearch/search/query/MultiCollectorWrapper.java | 2 ++ .../org/opensearch/search/query/QueryCollectorContext.java | 5 +++++ .../search/query/QueryCollectorManagerContext.java | 5 +++++ .../main/java/org/opensearch/search/query/QueryPhase.java | 2 ++ .../search/query/QueryPhaseExecutionException.java | 5 +++++ .../org/opensearch/search/query/QueryPhaseSearcher.java | 2 ++ .../org/opensearch/search/query/QuerySearchRequest.java | 5 +++++ .../java/org/opensearch/search/query/QuerySearchResult.java | 5 +++++ .../org/opensearch/search/query/ReduceableSearchResult.java | 2 ++ .../opensearch/search/query/ScrollQuerySearchResult.java | 5 +++++ .../opensearch/search/query/TopDocsCollectorContext.java | 2 ++ .../search/query/TotalHitCountCollectorManager.java | 5 +++++ 118 files changed, 418 insertions(+), 3 deletions(-) diff --git a/server/src/main/java/org/opensearch/search/dfs/AggregatedDfs.java b/server/src/main/java/org/opensearch/search/dfs/AggregatedDfs.java index 0c1cba2c84cf0..c4d159187bb8e 100644 --- a/server/src/main/java/org/opensearch/search/dfs/AggregatedDfs.java +++ b/server/src/main/java/org/opensearch/search/dfs/AggregatedDfs.java @@ -44,6 +44,11 @@ import java.io.IOException; +/** + * Compute global distributed frequency across the index + * + * @opensearch.internal + */ public class AggregatedDfs implements Writeable { private ObjectObjectHashMap termStatistics; diff --git a/server/src/main/java/org/opensearch/search/dfs/DfsPhase.java b/server/src/main/java/org/opensearch/search/dfs/DfsPhase.java index 72ccc1fd5aca8..6814fbd6e32c5 100644 --- a/server/src/main/java/org/opensearch/search/dfs/DfsPhase.java +++ b/server/src/main/java/org/opensearch/search/dfs/DfsPhase.java @@ -51,6 +51,8 @@ /** * Dfs phase of a search request, used to make scoring 100% accurate by collecting additional info from each shard before the query phase. * The additional information is used to better compare the scores coming from all the shards, which depend on local factors (e.g. idf) + * + * @opensearch.internal */ public class DfsPhase { diff --git a/server/src/main/java/org/opensearch/search/dfs/DfsPhaseExecutionException.java b/server/src/main/java/org/opensearch/search/dfs/DfsPhaseExecutionException.java index 9344672c16807..2572bc1a73b6a 100644 --- a/server/src/main/java/org/opensearch/search/dfs/DfsPhaseExecutionException.java +++ b/server/src/main/java/org/opensearch/search/dfs/DfsPhaseExecutionException.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Thrown if there are any errors in the DFS phase + * + * @opensearch.internal + */ public class DfsPhaseExecutionException extends SearchException { public DfsPhaseExecutionException(SearchShardTarget shardTarget, String msg, Throwable t) { diff --git a/server/src/main/java/org/opensearch/search/dfs/DfsSearchResult.java b/server/src/main/java/org/opensearch/search/dfs/DfsSearchResult.java index 48ab8aa683133..90cc547f62a95 100644 --- a/server/src/main/java/org/opensearch/search/dfs/DfsSearchResult.java +++ b/server/src/main/java/org/opensearch/search/dfs/DfsSearchResult.java @@ -49,6 +49,11 @@ import java.io.IOException; +/** + * Result from a Distributed Frequency Search phase + * + * @opensearch.internal + */ public class DfsSearchResult extends SearchPhaseResult { private static final Term[] EMPTY_TERMS = new Term[0]; diff --git a/server/src/main/java/org/opensearch/search/fetch/FetchContext.java b/server/src/main/java/org/opensearch/search/fetch/FetchContext.java index d26dbac33afea..7e36ace9e2112 100644 --- a/server/src/main/java/org/opensearch/search/fetch/FetchContext.java +++ b/server/src/main/java/org/opensearch/search/fetch/FetchContext.java @@ -57,6 +57,8 @@ /** * Encapsulates state required to execute fetch phases + * + * @opensearch.internal */ public class FetchContext { diff --git a/server/src/main/java/org/opensearch/search/fetch/FetchPhase.java b/server/src/main/java/org/opensearch/search/fetch/FetchPhase.java index e50f903b22920..4803184fa3abe 100644 --- a/server/src/main/java/org/opensearch/search/fetch/FetchPhase.java +++ b/server/src/main/java/org/opensearch/search/fetch/FetchPhase.java @@ -90,6 +90,8 @@ /** * Fetch phase of a search request, used to fetch the actual top matching documents to be returned to the client, identified * after reducing all of the matches returned by the query phase + * + * @opensearch.internal */ public class FetchPhase { private static final Logger LOGGER = LogManager.getLogger(FetchPhase.class); diff --git a/server/src/main/java/org/opensearch/search/fetch/FetchPhaseExecutionException.java b/server/src/main/java/org/opensearch/search/fetch/FetchPhaseExecutionException.java index 4b9310edfef9a..b1a31525f704e 100644 --- a/server/src/main/java/org/opensearch/search/fetch/FetchPhaseExecutionException.java +++ b/server/src/main/java/org/opensearch/search/fetch/FetchPhaseExecutionException.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Thrown when there are errors during the fetch phase + * + * @opensearch.internal + */ public class FetchPhaseExecutionException extends SearchException { public FetchPhaseExecutionException(SearchShardTarget shardTarget, String msg, Throwable t) { diff --git a/server/src/main/java/org/opensearch/search/fetch/FetchSearchResult.java b/server/src/main/java/org/opensearch/search/fetch/FetchSearchResult.java index f4d4849a5a406..dcc7d60495a5e 100644 --- a/server/src/main/java/org/opensearch/search/fetch/FetchSearchResult.java +++ b/server/src/main/java/org/opensearch/search/fetch/FetchSearchResult.java @@ -43,6 +43,11 @@ import java.io.IOException; +/** + * Result from a fetch + * + * @opensearch.internal + */ public final class FetchSearchResult extends SearchPhaseResult { private SearchHits hits; diff --git a/server/src/main/java/org/opensearch/search/fetch/FetchSubPhase.java b/server/src/main/java/org/opensearch/search/fetch/FetchSubPhase.java index 3c38249d88648..744505ec98c68 100644 --- a/server/src/main/java/org/opensearch/search/fetch/FetchSubPhase.java +++ b/server/src/main/java/org/opensearch/search/fetch/FetchSubPhase.java @@ -42,6 +42,8 @@ /** * Sub phase within the fetch phase used to fetch things *about* the documents like highlighting or matched queries. + * + * @opensearch.internal */ public interface FetchSubPhase { diff --git a/server/src/main/java/org/opensearch/search/fetch/FetchSubPhaseProcessor.java b/server/src/main/java/org/opensearch/search/fetch/FetchSubPhaseProcessor.java index ce32cf62bec93..6288861fff695 100644 --- a/server/src/main/java/org/opensearch/search/fetch/FetchSubPhaseProcessor.java +++ b/server/src/main/java/org/opensearch/search/fetch/FetchSubPhaseProcessor.java @@ -39,6 +39,8 @@ /** * Executes the logic for a {@link FetchSubPhase} against a particular leaf reader and hit + * + * @opensearch.internal */ public interface FetchSubPhaseProcessor { diff --git a/server/src/main/java/org/opensearch/search/fetch/QueryFetchSearchResult.java b/server/src/main/java/org/opensearch/search/fetch/QueryFetchSearchResult.java index 5d655ce8a4f8f..047bf1b2074e0 100644 --- a/server/src/main/java/org/opensearch/search/fetch/QueryFetchSearchResult.java +++ b/server/src/main/java/org/opensearch/search/fetch/QueryFetchSearchResult.java @@ -41,6 +41,11 @@ import java.io.IOException; +/** + * Query fetch result + * + * @opensearch.internal + */ public final class QueryFetchSearchResult extends SearchPhaseResult { private final QuerySearchResult queryResult; diff --git a/server/src/main/java/org/opensearch/search/fetch/ScrollQueryFetchSearchResult.java b/server/src/main/java/org/opensearch/search/fetch/ScrollQueryFetchSearchResult.java index 3156ccc11bc12..cfba9ae461bb5 100644 --- a/server/src/main/java/org/opensearch/search/fetch/ScrollQueryFetchSearchResult.java +++ b/server/src/main/java/org/opensearch/search/fetch/ScrollQueryFetchSearchResult.java @@ -40,6 +40,11 @@ import java.io.IOException; +/** + * Scroll fetch result + * + * @opensearch.internal + */ public final class ScrollQueryFetchSearchResult extends SearchPhaseResult { private final QueryFetchSearchResult result; diff --git a/server/src/main/java/org/opensearch/search/fetch/ShardFetchRequest.java b/server/src/main/java/org/opensearch/search/fetch/ShardFetchRequest.java index 65f595938a563..8bccc4425b46b 100644 --- a/server/src/main/java/org/opensearch/search/fetch/ShardFetchRequest.java +++ b/server/src/main/java/org/opensearch/search/fetch/ShardFetchRequest.java @@ -54,6 +54,8 @@ /** * Shard level fetch base request. Holds all the info needed to execute a fetch. * Used with search scroll as the original request doesn't hold indices. + * + * @opensearch.internal */ public class ShardFetchRequest extends TransportRequest { diff --git a/server/src/main/java/org/opensearch/search/fetch/ShardFetchSearchRequest.java b/server/src/main/java/org/opensearch/search/fetch/ShardFetchSearchRequest.java index aadb13c1543e1..f3c52e3a6abc7 100644 --- a/server/src/main/java/org/opensearch/search/fetch/ShardFetchSearchRequest.java +++ b/server/src/main/java/org/opensearch/search/fetch/ShardFetchSearchRequest.java @@ -50,6 +50,8 @@ /** * Shard level fetch request used with search. Holds indices taken from the original search request * and implements {@link org.opensearch.action.IndicesRequest}. + * + * @opensearch.internal */ public class ShardFetchSearchRequest extends ShardFetchRequest implements IndicesRequest { diff --git a/server/src/main/java/org/opensearch/search/fetch/StoredFieldsContext.java b/server/src/main/java/org/opensearch/search/fetch/StoredFieldsContext.java index 225cfad2b611c..56904a501eb20 100644 --- a/server/src/main/java/org/opensearch/search/fetch/StoredFieldsContext.java +++ b/server/src/main/java/org/opensearch/search/fetch/StoredFieldsContext.java @@ -50,6 +50,8 @@ /** * Context used to fetch the {@code stored_fields}. + * + * @opensearch.internal */ public class StoredFieldsContext implements Writeable { public static final String _NONE_ = "_none_"; diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/ExplainPhase.java b/server/src/main/java/org/opensearch/search/fetch/subphase/ExplainPhase.java index 42b2d6e94de19..d34cc9bf49421 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/ExplainPhase.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/ExplainPhase.java @@ -42,6 +42,8 @@ /** * Explains the scoring calculations for the top hits. + * + * @opensearch.internal */ public final class ExplainPhase implements FetchSubPhase { diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchDocValuesContext.java b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchDocValuesContext.java index 3bfb3365fe46e..ce5bd152cca00 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchDocValuesContext.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchDocValuesContext.java @@ -41,6 +41,8 @@ /** * All the required context to pull a field from the doc values. + * + * @opensearch.internal */ public class FetchDocValuesContext { private final List fields; diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchDocValuesPhase.java b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchDocValuesPhase.java index b44d856008407..a8ab8c0dcb8a8 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchDocValuesPhase.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchDocValuesPhase.java @@ -49,6 +49,8 @@ * Fetch sub phase which pulls data from doc values. * * Specifying {@code "docvalue_fields": ["field1", "field2"]} + * + * @opensearch.internal */ public final class FetchDocValuesPhase implements FetchSubPhase { diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchFieldsContext.java b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchFieldsContext.java index 5c481ccfef2d6..3803dedae9b57 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchFieldsContext.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchFieldsContext.java @@ -35,6 +35,8 @@ /** * The context needed to retrieve fields. + * + * @opensearch.internal */ public class FetchFieldsContext { private final List fields; diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchFieldsPhase.java b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchFieldsPhase.java index 353ec3f8080d2..0b15124f08cee 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchFieldsPhase.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchFieldsPhase.java @@ -50,6 +50,8 @@ /** * A fetch sub-phase for high-level field retrieval. Given a list of fields, it * retrieves the field values from _source and returns them as document fields. + * + * @opensearch.internal */ public final class FetchFieldsPhase implements FetchSubPhase { diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchScorePhase.java b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchScorePhase.java index a83c994d91c2a..3516df482d321 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchScorePhase.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchScorePhase.java @@ -44,6 +44,11 @@ import java.io.IOException; +/** + * Fetches the score of a query match during search phase + * + * @opensearch.internal + */ public class FetchScorePhase implements FetchSubPhase { @Override diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchSourceContext.java b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchSourceContext.java index d8b803447c25f..fe972028508e8 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchSourceContext.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchSourceContext.java @@ -54,6 +54,8 @@ /** * Context used to fetch the {@code _source}. + * + * @opensearch.internal */ public class FetchSourceContext implements Writeable, ToXContentObject { diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchSourcePhase.java b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchSourcePhase.java index 30274ac697a4d..f5c1e082c80c9 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchSourcePhase.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchSourcePhase.java @@ -46,6 +46,11 @@ import java.io.IOException; import java.util.Map; +/** + * Fetches the document source during search phase + * + * @opensearch.internal + */ public final class FetchSourcePhase implements FetchSubPhase { @Override diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchVersionPhase.java b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchVersionPhase.java index d2d4740a32cd6..06d37531385a1 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/FetchVersionPhase.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/FetchVersionPhase.java @@ -41,6 +41,11 @@ import java.io.IOException; +/** + * Fetches the version of a term during search phase + * + * @opensearch.internal + */ public final class FetchVersionPhase implements FetchSubPhase { @Override diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/FieldAndFormat.java b/server/src/main/java/org/opensearch/search/fetch/subphase/FieldAndFormat.java index c87151170e17e..225b697bad88e 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/FieldAndFormat.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/FieldAndFormat.java @@ -49,6 +49,8 @@ /** * Wrapper around a field name and the format that should be used to * display values of this field. + * + * @opensearch.internal */ public final class FieldAndFormat implements Writeable, ToXContentObject { private static final ParseField FIELD_FIELD = new ParseField("field"); diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/FieldFetcher.java b/server/src/main/java/org/opensearch/search/fetch/subphase/FieldFetcher.java index 6790a1a79d634..e2402c03c0bd6 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/FieldFetcher.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/FieldFetcher.java @@ -51,6 +51,8 @@ /** * A helper class to {@link FetchFieldsPhase} that's initialized with a list of field patterns to fetch. * Then given a specific document, it can retrieve the corresponding fields from the document's source. + * + * @opensearch.internal */ public class FieldFetcher { public static FieldFetcher create(QueryShardContext context, SearchLookup searchLookup, Collection fieldAndFormats) { diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/InnerHitsContext.java b/server/src/main/java/org/opensearch/search/fetch/subphase/InnerHitsContext.java index 22acd599d18c6..f50524244b115 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/InnerHitsContext.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/InnerHitsContext.java @@ -58,6 +58,8 @@ /** * Context used for inner hits retrieval + * + * @opensearch.internal */ public final class InnerHitsContext { private final Map innerHits; diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/InnerHitsPhase.java b/server/src/main/java/org/opensearch/search/fetch/subphase/InnerHitsPhase.java index 56020d334a446..0b07dc35f13bb 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/InnerHitsPhase.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/InnerHitsPhase.java @@ -49,6 +49,11 @@ import java.util.HashMap; import java.util.Map; +/** + * Gets the inner hits of a document during search + * + * @opensearch.internal + */ public final class InnerHitsPhase implements FetchSubPhase { private final FetchPhase fetchPhase; diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/MatchedQueriesPhase.java b/server/src/main/java/org/opensearch/search/fetch/subphase/MatchedQueriesPhase.java index 9d69d54488734..6c589438d6b4c 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/MatchedQueriesPhase.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/MatchedQueriesPhase.java @@ -48,6 +48,11 @@ import java.util.List; import java.util.Map; +/** + * Fetches queries that match the document during search phase + * + * @opensearch.internal + */ public final class MatchedQueriesPhase implements FetchSubPhase { @Override diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/ScriptFieldsContext.java b/server/src/main/java/org/opensearch/search/fetch/subphase/ScriptFieldsContext.java index e3a6c6951c405..04bbe9457661c 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/ScriptFieldsContext.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/ScriptFieldsContext.java @@ -37,6 +37,11 @@ import java.util.ArrayList; import java.util.List; +/** + * Context used for script fields + * + * @opensearch.internal + */ public class ScriptFieldsContext { public static class ScriptField { diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/ScriptFieldsPhase.java b/server/src/main/java/org/opensearch/search/fetch/subphase/ScriptFieldsPhase.java index d2425abbc0997..aad20f0746f58 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/ScriptFieldsPhase.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/ScriptFieldsPhase.java @@ -45,6 +45,11 @@ import java.util.Collections; import java.util.List; +/** + * Gets the scripted fields during search phase + * + * @opensearch.internal + */ public final class ScriptFieldsPhase implements FetchSubPhase { @Override diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/SeqNoPrimaryTermPhase.java b/server/src/main/java/org/opensearch/search/fetch/subphase/SeqNoPrimaryTermPhase.java index fa02031991928..b3926cfd70e4d 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/SeqNoPrimaryTermPhase.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/SeqNoPrimaryTermPhase.java @@ -41,6 +41,11 @@ import java.io.IOException; +/** + * Fetches the sequence number of the primary term during search phase + * + * @opensearch.internal + */ public final class SeqNoPrimaryTermPhase implements FetchSubPhase { @Override diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/AbstractHighlighterBuilder.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/AbstractHighlighterBuilder.java index acf065bc9c0f3..e935d46ea1fb0 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/AbstractHighlighterBuilder.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/AbstractHighlighterBuilder.java @@ -62,6 +62,8 @@ /** * This abstract class holds parameters shared by {@link HighlightBuilder} and {@link HighlightBuilder.Field} * and provides the common setters, equality, hashCode calculation and common serialization + * + * @opensearch.internal */ public abstract class AbstractHighlighterBuilder> implements diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/CustomQueryScorer.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/CustomQueryScorer.java index 48db8a7f68168..d0fb0f6da53c4 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/CustomQueryScorer.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/CustomQueryScorer.java @@ -43,6 +43,11 @@ import java.io.IOException; import java.util.Map; +/** + * Internally used for custom scoring + * + * @opensearch.internal + */ public final class CustomQueryScorer extends QueryScorer { public CustomQueryScorer(Query query, IndexReader reader, String field, String defaultField) { diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/FastVectorHighlighter.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/FastVectorHighlighter.java index e5bfb5d2c94c1..77f8e82df50f2 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/FastVectorHighlighter.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/FastVectorHighlighter.java @@ -64,6 +64,11 @@ import java.util.Map; import java.util.function.Function; +/** + * Uses Lucene's Fast Vector Highlighting + * + * @opensearch.internal + */ public class FastVectorHighlighter implements Highlighter { private static final BoundaryScanner DEFAULT_SIMPLE_BOUNDARY_SCANNER = new SimpleBoundaryScanner(); private static final BoundaryScanner DEFAULT_SENTENCE_BOUNDARY_SCANNER = new BreakIteratorBoundaryScanner( diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/FieldHighlightContext.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/FieldHighlightContext.java index 5d2758a04e750..2b4587fe6f40f 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/FieldHighlightContext.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/FieldHighlightContext.java @@ -38,6 +38,11 @@ import java.util.Map; +/** + * Context used during field level highlighting + * + * @opensearch.internal + */ public class FieldHighlightContext { public final String fieldName; diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/FragmentBuilderHelper.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/FragmentBuilderHelper.java index 1b1931c171a5a..e037ae5544a07 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/FragmentBuilderHelper.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/FragmentBuilderHelper.java @@ -49,6 +49,8 @@ /** * Simple helper class for {@link FastVectorHighlighter} {@link FragmentsBuilder} implementations. + * + * @opensearch.internal */ public final class FragmentBuilderHelper { diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightBuilder.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightBuilder.java index 1d998eeb578fa..7c2cc5ae1def3 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightBuilder.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightBuilder.java @@ -67,6 +67,8 @@ * are summarized to show only selected snippets ("fragments") containing search terms. * * @see org.opensearch.search.builder.SearchSourceBuilder#highlight() + * + * @opensearch.internal */ public class HighlightBuilder extends AbstractHighlighterBuilder { /** default for whether to highlight fields based on the source even if stored separately */ diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightField.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightField.java index 9cdcee3bfe8ae..638e1619a3658 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightField.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightField.java @@ -51,6 +51,8 @@ /** * A field highlighted with its highlighted fragments. + * + * @opensearch.internal */ public class HighlightField implements ToXContentFragment, Writeable { diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightPhase.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightPhase.java index 4673477ac1772..2fc9b214e3ebb 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightPhase.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightPhase.java @@ -51,6 +51,11 @@ import java.util.Map; import java.util.function.Function; +/** + * Highlight Phase of the search request. + * + * @opensearch.internal + */ public class HighlightPhase implements FetchSubPhase { private final Map highlighters; diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightUtils.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightUtils.java index 3265a339595f5..e37d56b1f86b2 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightUtils.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/HighlightUtils.java @@ -46,6 +46,11 @@ import static java.util.Collections.singleton; +/** + * Utility class used during the highlight phase of the search request. + * + * @opensearch.internal + */ public final class HighlightUtils { // U+2029 PARAGRAPH SEPARATOR (PS): each value holds a discrete passage for highlighting (unified highlighter) diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/Highlighter.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/Highlighter.java index 417b2acd5fe24..0c9bffde6c517 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/Highlighter.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/Highlighter.java @@ -37,6 +37,8 @@ /** * Highlights a search result. + * + * @opensearch.internal */ public interface Highlighter { diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/PlainHighlighter.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/PlainHighlighter.java index d2699c650d887..f19039b2c0af3 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/PlainHighlighter.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/PlainHighlighter.java @@ -61,6 +61,11 @@ import static org.opensearch.search.fetch.subphase.highlight.UnifiedHighlighter.convertFieldValue; +/** + * Standard Lucene Highlighter implementation + * + * @opensearch.internal + */ public class PlainHighlighter implements Highlighter { private static final String CACHE_KEY = "highlight-plain"; diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SearchHighlightContext.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SearchHighlightContext.java index 71c18d2217faa..6072c738d9d80 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SearchHighlightContext.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SearchHighlightContext.java @@ -43,6 +43,11 @@ import java.util.Map; import java.util.Set; +/** + * Search context used during highlighting phase + * + * @opensearch.internal + */ public class SearchHighlightContext { private final Map fields; diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SimpleFragmentsBuilder.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SimpleFragmentsBuilder.java index 47a89b4699901..89da5f6edbdcf 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SimpleFragmentsBuilder.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SimpleFragmentsBuilder.java @@ -40,6 +40,8 @@ /** * Direct Subclass of Lucene's org.apache.lucene.search.vectorhighlight.SimpleFragmentsBuilder * that corrects offsets for broken analysis chains. + * + * @opensearch.internal */ public class SimpleFragmentsBuilder extends org.apache.lucene.search.vectorhighlight.SimpleFragmentsBuilder { protected final MappedFieldType fieldType; diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SourceScoreOrderFragmentsBuilder.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SourceScoreOrderFragmentsBuilder.java index c62ef40a8771a..17866b0b69798 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SourceScoreOrderFragmentsBuilder.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SourceScoreOrderFragmentsBuilder.java @@ -44,6 +44,11 @@ import java.io.IOException; import java.util.List; +/** + * Internal builder used during source score lookup + * + * @opensearch.internal + */ public class SourceScoreOrderFragmentsBuilder extends ScoreOrderFragmentsBuilder { private final MappedFieldType fieldType; diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SourceSimpleFragmentsBuilder.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SourceSimpleFragmentsBuilder.java index aae0c78ed0741..838883b18f762 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SourceSimpleFragmentsBuilder.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/SourceSimpleFragmentsBuilder.java @@ -41,6 +41,11 @@ import java.io.IOException; import java.util.List; +/** + * Internal builder used during simple highlighting + * + * @opensearch.internal + */ public class SourceSimpleFragmentsBuilder extends SimpleFragmentsBuilder { private final SourceLookup sourceLookup; diff --git a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/UnifiedHighlighter.java b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/UnifiedHighlighter.java index 8e97fc3a27ffb..ddf32064d7f59 100644 --- a/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/UnifiedHighlighter.java +++ b/server/src/main/java/org/opensearch/search/fetch/subphase/highlight/UnifiedHighlighter.java @@ -66,6 +66,11 @@ import static org.apache.lucene.search.uhighlight.CustomUnifiedHighlighter.MULTIVAL_SEP_CHAR; +/** + * Uses lucene's unified highlighter implementation + * + * @opensearch.internal + */ public class UnifiedHighlighter implements Highlighter { @Override public boolean canHighlight(MappedFieldType fieldType) { diff --git a/server/src/main/java/org/opensearch/search/internal/AliasFilter.java b/server/src/main/java/org/opensearch/search/internal/AliasFilter.java index b4864a9beddb0..b0d8b3cf47bec 100644 --- a/server/src/main/java/org/opensearch/search/internal/AliasFilter.java +++ b/server/src/main/java/org/opensearch/search/internal/AliasFilter.java @@ -46,6 +46,8 @@ /** * Represents a {@link QueryBuilder} and a list of alias names that filters the builder is composed of. + * + * @opensearch.internal */ public final class AliasFilter implements Writeable, Rewriteable { diff --git a/server/src/main/java/org/opensearch/search/internal/CancellableBulkScorer.java b/server/src/main/java/org/opensearch/search/internal/CancellableBulkScorer.java index 2999f5aa5476f..585d0baba8717 100644 --- a/server/src/main/java/org/opensearch/search/internal/CancellableBulkScorer.java +++ b/server/src/main/java/org/opensearch/search/internal/CancellableBulkScorer.java @@ -42,6 +42,8 @@ /** * A {@link BulkScorer} wrapper that runs a {@link Runnable} on a regular basis * so that the query can be interrupted. + * + * @opensearch.internal */ final class CancellableBulkScorer extends BulkScorer { diff --git a/server/src/main/java/org/opensearch/search/internal/ContextIndexSearcher.java b/server/src/main/java/org/opensearch/search/internal/ContextIndexSearcher.java index 2fb5ababe19ad..efd288fd1cf42 100644 --- a/server/src/main/java/org/opensearch/search/internal/ContextIndexSearcher.java +++ b/server/src/main/java/org/opensearch/search/internal/ContextIndexSearcher.java @@ -84,6 +84,8 @@ /** * Context-aware extension of {@link IndexSearcher}. + * + * @opensearch.internal */ public class ContextIndexSearcher extends IndexSearcher implements Releasable { /** diff --git a/server/src/main/java/org/opensearch/search/internal/ExitableDirectoryReader.java b/server/src/main/java/org/opensearch/search/internal/ExitableDirectoryReader.java index 9664fe3cb9085..83ecd11a493ef 100644 --- a/server/src/main/java/org/opensearch/search/internal/ExitableDirectoryReader.java +++ b/server/src/main/java/org/opensearch/search/internal/ExitableDirectoryReader.java @@ -51,6 +51,8 @@ /** * Wraps an {@link IndexReader} with a {@link QueryCancellation} * which checks for cancelled or timed-out query. + * + * @opensearch.internal */ class ExitableDirectoryReader extends FilterDirectoryReader { diff --git a/server/src/main/java/org/opensearch/search/internal/FilteredSearchContext.java b/server/src/main/java/org/opensearch/search/internal/FilteredSearchContext.java index 961d45b0011ef..ffb180614c3b2 100644 --- a/server/src/main/java/org/opensearch/search/internal/FilteredSearchContext.java +++ b/server/src/main/java/org/opensearch/search/internal/FilteredSearchContext.java @@ -70,6 +70,11 @@ import java.util.List; import java.util.Map; +/** + * Context used during a filtered search + * + * @opensearch.internal + */ public abstract class FilteredSearchContext extends SearchContext { private final SearchContext in; diff --git a/server/src/main/java/org/opensearch/search/internal/InternalScrollSearchRequest.java b/server/src/main/java/org/opensearch/search/internal/InternalScrollSearchRequest.java index afa4dc7be7bf2..b546ba886a3db 100644 --- a/server/src/main/java/org/opensearch/search/internal/InternalScrollSearchRequest.java +++ b/server/src/main/java/org/opensearch/search/internal/InternalScrollSearchRequest.java @@ -44,6 +44,11 @@ import java.io.IOException; import java.util.Map; +/** + * Internal request used during scroll search + * + * @opensearch.internal + */ public class InternalScrollSearchRequest extends TransportRequest { private ShardSearchContextId contextId; diff --git a/server/src/main/java/org/opensearch/search/internal/InternalSearchResponse.java b/server/src/main/java/org/opensearch/search/internal/InternalSearchResponse.java index 0f64adb37ab95..fb36e856df3b4 100644 --- a/server/src/main/java/org/opensearch/search/internal/InternalSearchResponse.java +++ b/server/src/main/java/org/opensearch/search/internal/InternalSearchResponse.java @@ -46,6 +46,8 @@ /** * {@link SearchResponseSections} subclass that can be serialized over the wire. + * + * @opensearch.internal */ public class InternalSearchResponse extends SearchResponseSections implements Writeable, ToXContentFragment { public static InternalSearchResponse empty() { diff --git a/server/src/main/java/org/opensearch/search/internal/LegacyReaderContext.java b/server/src/main/java/org/opensearch/search/internal/LegacyReaderContext.java index 7c3b36e9e55f9..05ab12d5ae809 100644 --- a/server/src/main/java/org/opensearch/search/internal/LegacyReaderContext.java +++ b/server/src/main/java/org/opensearch/search/internal/LegacyReaderContext.java @@ -40,6 +40,11 @@ import java.util.Objects; +/** + * Reader context that does not hold a reference to a point in time Searcher + * + * @opensearch.internal + */ public class LegacyReaderContext extends ReaderContext { private final ShardSearchRequest shardSearchRequest; private final ScrollContext scrollContext; diff --git a/server/src/main/java/org/opensearch/search/internal/ReaderContext.java b/server/src/main/java/org/opensearch/search/internal/ReaderContext.java index 31d7a44d9bbd2..5bcc491f4ffdb 100644 --- a/server/src/main/java/org/opensearch/search/internal/ReaderContext.java +++ b/server/src/main/java/org/opensearch/search/internal/ReaderContext.java @@ -56,6 +56,8 @@ * in {@link org.opensearch.search.SearchService} a SearchContext can be closed concurrently due to independent events * ie. when an index gets removed. To prevent accessing closed IndexReader / IndexSearcher instances the SearchContext * can be guarded by a reference count and fail if it's been closed by an external event. + * + * @opensearch.internal */ public class ReaderContext implements Releasable { private final ShardSearchContextId id; diff --git a/server/src/main/java/org/opensearch/search/internal/ScrollContext.java b/server/src/main/java/org/opensearch/search/internal/ScrollContext.java index 2df274d373bcb..ae4074930e0c0 100644 --- a/server/src/main/java/org/opensearch/search/internal/ScrollContext.java +++ b/server/src/main/java/org/opensearch/search/internal/ScrollContext.java @@ -36,7 +36,11 @@ import org.apache.lucene.search.TotalHits; import org.opensearch.search.Scroll; -/** Wrapper around information that needs to stay around when scrolling. */ +/** + * Wrapper around information that needs to stay around when scrolling. + * + * @opensearch.internal + */ public final class ScrollContext { public TotalHits totalHits = null; public float maxScore = Float.NaN; diff --git a/server/src/main/java/org/opensearch/search/internal/SearchContext.java b/server/src/main/java/org/opensearch/search/internal/SearchContext.java index 0c24fbee76335..60438014f8d53 100644 --- a/server/src/main/java/org/opensearch/search/internal/SearchContext.java +++ b/server/src/main/java/org/opensearch/search/internal/SearchContext.java @@ -83,6 +83,8 @@ * This class encapsulates the state needed to execute a search. It holds a reference to the * shards point in time snapshot (IndexReader / ContextIndexSearcher) and allows passing on * state from one query / fetch phase to another. + * + * @opensearch.internal */ public abstract class SearchContext implements Releasable { diff --git a/server/src/main/java/org/opensearch/search/internal/ShardSearchContextId.java b/server/src/main/java/org/opensearch/search/internal/ShardSearchContextId.java index e9d1279915f95..e3c946b5aaeae 100644 --- a/server/src/main/java/org/opensearch/search/internal/ShardSearchContextId.java +++ b/server/src/main/java/org/opensearch/search/internal/ShardSearchContextId.java @@ -40,6 +40,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Used to support Point in Time Searching + * + * @opensearch.internal + */ public final class ShardSearchContextId implements Writeable { private final String sessionId; private final long id; diff --git a/server/src/main/java/org/opensearch/search/internal/ShardSearchRequest.java b/server/src/main/java/org/opensearch/search/internal/ShardSearchRequest.java index f41f7fae8b786..a4d7b2bed516c 100644 --- a/server/src/main/java/org/opensearch/search/internal/ShardSearchRequest.java +++ b/server/src/main/java/org/opensearch/search/internal/ShardSearchRequest.java @@ -81,6 +81,8 @@ * Shard level request that represents a search. * It provides all the methods that the {@link SearchContext} needs. * Provides a cache key based on its content that can be used to cache shard level response. + * + * @opensearch.internal */ public class ShardSearchRequest extends TransportRequest implements IndicesRequest { private final String clusterAlias; diff --git a/server/src/main/java/org/opensearch/search/internal/SubSearchContext.java b/server/src/main/java/org/opensearch/search/internal/SubSearchContext.java index 842c6a514f112..55315013ea8c9 100644 --- a/server/src/main/java/org/opensearch/search/internal/SubSearchContext.java +++ b/server/src/main/java/org/opensearch/search/internal/SubSearchContext.java @@ -49,6 +49,11 @@ import java.util.List; +/** + * Context for a sub search phase + * + * @opensearch.internal + */ public class SubSearchContext extends FilteredSearchContext { // By default return 3 hits per bucket. A higher default would make the response really large by default, since diff --git a/server/src/main/java/org/opensearch/search/lookup/DocLookup.java b/server/src/main/java/org/opensearch/search/lookup/DocLookup.java index 13e86c235db57..069d9dd02ce2b 100644 --- a/server/src/main/java/org/opensearch/search/lookup/DocLookup.java +++ b/server/src/main/java/org/opensearch/search/lookup/DocLookup.java @@ -38,6 +38,11 @@ import java.util.function.Function; +/** + * Looks up a document + * + * @opensearch.internal + */ public class DocLookup { private final MapperService mapperService; diff --git a/server/src/main/java/org/opensearch/search/lookup/FieldLookup.java b/server/src/main/java/org/opensearch/search/lookup/FieldLookup.java index 6d5b60d016212..6219c3bfb9eaf 100644 --- a/server/src/main/java/org/opensearch/search/lookup/FieldLookup.java +++ b/server/src/main/java/org/opensearch/search/lookup/FieldLookup.java @@ -37,6 +37,11 @@ import java.util.List; import java.util.Map; +/** + * Look up a field + * + * @opensearch.internal + */ public class FieldLookup { // we can cached fieldType completely per name, since its on an index/shard level (the lookup, and it does not change within the scope diff --git a/server/src/main/java/org/opensearch/search/lookup/FieldsLookup.java b/server/src/main/java/org/opensearch/search/lookup/FieldsLookup.java index 9af22c65aba28..fff2f5f4c814e 100644 --- a/server/src/main/java/org/opensearch/search/lookup/FieldsLookup.java +++ b/server/src/main/java/org/opensearch/search/lookup/FieldsLookup.java @@ -34,6 +34,11 @@ import org.apache.lucene.index.LeafReaderContext; import org.opensearch.index.mapper.MapperService; +/** + * looks up multiple fields from a leaf reader + * + * @opensearch.internal + */ public class FieldsLookup { private final MapperService mapperService; diff --git a/server/src/main/java/org/opensearch/search/lookup/LeafDocLookup.java b/server/src/main/java/org/opensearch/search/lookup/LeafDocLookup.java index 716476101ac48..fe911ed799646 100644 --- a/server/src/main/java/org/opensearch/search/lookup/LeafDocLookup.java +++ b/server/src/main/java/org/opensearch/search/lookup/LeafDocLookup.java @@ -47,6 +47,11 @@ import java.util.Set; import java.util.function.Function; +/** + * Looks up a doc from a leaf reader + * + * @opensearch.internal + */ public class LeafDocLookup implements Map> { private final Map> localCacheFieldData = new HashMap<>(4); diff --git a/server/src/main/java/org/opensearch/search/lookup/LeafFieldsLookup.java b/server/src/main/java/org/opensearch/search/lookup/LeafFieldsLookup.java index 62b040dfdc8d7..007ee49b3e697 100644 --- a/server/src/main/java/org/opensearch/search/lookup/LeafFieldsLookup.java +++ b/server/src/main/java/org/opensearch/search/lookup/LeafFieldsLookup.java @@ -47,6 +47,11 @@ import static java.util.Collections.singletonMap; +/** + * looks up multiple leaf fields + * + * @opensearch.internal + */ public class LeafFieldsLookup implements Map { private final MapperService mapperService; diff --git a/server/src/main/java/org/opensearch/search/lookup/LeafSearchLookup.java b/server/src/main/java/org/opensearch/search/lookup/LeafSearchLookup.java index 75a4d7c8d167b..1c87f26053060 100644 --- a/server/src/main/java/org/opensearch/search/lookup/LeafSearchLookup.java +++ b/server/src/main/java/org/opensearch/search/lookup/LeafSearchLookup.java @@ -41,6 +41,8 @@ /** * Per-segment version of {@link SearchLookup}. + * + * @opensearch.internal */ public class LeafSearchLookup { diff --git a/server/src/main/java/org/opensearch/search/lookup/SearchLookup.java b/server/src/main/java/org/opensearch/search/lookup/SearchLookup.java index 11feb3f2f9e57..898d34dc02c01 100644 --- a/server/src/main/java/org/opensearch/search/lookup/SearchLookup.java +++ b/server/src/main/java/org/opensearch/search/lookup/SearchLookup.java @@ -44,6 +44,11 @@ import java.util.function.BiFunction; import java.util.function.Supplier; +/** + * Orchestrator class for search phase lookups + * + * @opensearch.internal + */ public class SearchLookup { /** * The maximum depth of field dependencies. diff --git a/server/src/main/java/org/opensearch/search/lookup/SourceLookup.java b/server/src/main/java/org/opensearch/search/lookup/SourceLookup.java index eea42bae17483..fe95b78c72b82 100644 --- a/server/src/main/java/org/opensearch/search/lookup/SourceLookup.java +++ b/server/src/main/java/org/opensearch/search/lookup/SourceLookup.java @@ -54,6 +54,11 @@ import static java.util.Collections.emptyMap; +/** + * Orchestrator class for source lookups + * + * @opensearch.internal + */ public class SourceLookup implements Map { private LeafReader reader; diff --git a/server/src/main/java/org/opensearch/search/profile/AbstractInternalProfileTree.java b/server/src/main/java/org/opensearch/search/profile/AbstractInternalProfileTree.java index e797f3749d52d..4d0949624ebed 100644 --- a/server/src/main/java/org/opensearch/search/profile/AbstractInternalProfileTree.java +++ b/server/src/main/java/org/opensearch/search/profile/AbstractInternalProfileTree.java @@ -40,6 +40,11 @@ import java.util.Deque; import java.util.List; +/** + * Base class for a profiling tree. + * + * @opensearch.internal + */ public abstract class AbstractInternalProfileTree, E> { protected ArrayList breakdowns; diff --git a/server/src/main/java/org/opensearch/search/profile/AbstractProfileBreakdown.java b/server/src/main/java/org/opensearch/search/profile/AbstractProfileBreakdown.java index d3bbd4d59e53e..a29d4f9a0ee20 100644 --- a/server/src/main/java/org/opensearch/search/profile/AbstractProfileBreakdown.java +++ b/server/src/main/java/org/opensearch/search/profile/AbstractProfileBreakdown.java @@ -42,6 +42,8 @@ * A record of timings for the various operations that may happen during query execution. * A node's time may be composed of several internal attributes (rewriting, weighting, * scoring, etc). + * + * @opensearch.internal */ public abstract class AbstractProfileBreakdown> { diff --git a/server/src/main/java/org/opensearch/search/profile/AbstractProfiler.java b/server/src/main/java/org/opensearch/search/profile/AbstractProfiler.java index b8e8ad2924cad..4db1cb87a231d 100644 --- a/server/src/main/java/org/opensearch/search/profile/AbstractProfiler.java +++ b/server/src/main/java/org/opensearch/search/profile/AbstractProfiler.java @@ -34,6 +34,11 @@ import java.util.List; +/** + * Base class for a profiler + * + * @opensearch.internal + */ public class AbstractProfiler, E> { protected final AbstractInternalProfileTree profileTree; diff --git a/server/src/main/java/org/opensearch/search/profile/ContextualProfileBreakdown.java b/server/src/main/java/org/opensearch/search/profile/ContextualProfileBreakdown.java index 42cb16e88b4a9..4f071f730cd45 100644 --- a/server/src/main/java/org/opensearch/search/profile/ContextualProfileBreakdown.java +++ b/server/src/main/java/org/opensearch/search/profile/ContextualProfileBreakdown.java @@ -11,6 +11,8 @@ /** * Provide contextual profile breakdowns which are associated with freestyle context. Used when concurrent * search over segments is activated and each collector needs own non-shareable profile breakdown instance. + * + * @opensearch.internal */ public abstract class ContextualProfileBreakdown> extends AbstractProfileBreakdown { public ContextualProfileBreakdown(Class clazz) { diff --git a/server/src/main/java/org/opensearch/search/profile/NetworkTime.java b/server/src/main/java/org/opensearch/search/profile/NetworkTime.java index 8a9c72af5dcb0..17ae53e8a5828 100644 --- a/server/src/main/java/org/opensearch/search/profile/NetworkTime.java +++ b/server/src/main/java/org/opensearch/search/profile/NetworkTime.java @@ -15,6 +15,11 @@ import java.io.IOException; +/** + * Utility class to track time of network operations + * + * @opensearch.internal + */ public class NetworkTime implements Writeable { private long inboundNetworkTime; private long outboundNetworkTime; diff --git a/server/src/main/java/org/opensearch/search/profile/ProfileResult.java b/server/src/main/java/org/opensearch/search/profile/ProfileResult.java index ad14431797ea2..c05c574b77942 100644 --- a/server/src/main/java/org/opensearch/search/profile/ProfileResult.java +++ b/server/src/main/java/org/opensearch/search/profile/ProfileResult.java @@ -61,6 +61,8 @@ *

    * Each InternalProfileResult has a List of InternalProfileResults, which will contain * "children" queries if applicable + * + * @opensearch.internal */ public final class ProfileResult implements Writeable, ToXContentObject { static final ParseField TYPE = new ParseField("type"); diff --git a/server/src/main/java/org/opensearch/search/profile/ProfileShardResult.java b/server/src/main/java/org/opensearch/search/profile/ProfileShardResult.java index c368225473f3d..01a0612f14c8a 100644 --- a/server/src/main/java/org/opensearch/search/profile/ProfileShardResult.java +++ b/server/src/main/java/org/opensearch/search/profile/ProfileShardResult.java @@ -43,6 +43,11 @@ import java.util.Collections; import java.util.List; +/** + * Shard level profile results + * + * @opensearch.internal + */ public class ProfileShardResult implements Writeable { private final List queryProfileResults; diff --git a/server/src/main/java/org/opensearch/search/profile/Profilers.java b/server/src/main/java/org/opensearch/search/profile/Profilers.java index 3cc9b1710d420..2bc2f3a5a3920 100644 --- a/server/src/main/java/org/opensearch/search/profile/Profilers.java +++ b/server/src/main/java/org/opensearch/search/profile/Profilers.java @@ -40,7 +40,11 @@ import java.util.Collections; import java.util.List; -/** Wrapper around all the profilers that makes management easier. */ +/** + * Wrapper around all the profilers that makes management easier. + * + * @opensearch.internal + */ public final class Profilers { private final ContextIndexSearcher searcher; diff --git a/server/src/main/java/org/opensearch/search/profile/SearchProfileShardResults.java b/server/src/main/java/org/opensearch/search/profile/SearchProfileShardResults.java index 4765b7651900b..32cabb5e1638a 100644 --- a/server/src/main/java/org/opensearch/search/profile/SearchProfileShardResults.java +++ b/server/src/main/java/org/opensearch/search/profile/SearchProfileShardResults.java @@ -57,6 +57,8 @@ /** * A container class to hold all the profile results across all shards. Internally * holds a map of shard ID -> Profiled results + * + * @opensearch.internal */ public final class SearchProfileShardResults implements Writeable, ToXContentFragment { private static final String SEARCHES_FIELD = "searches"; diff --git a/server/src/main/java/org/opensearch/search/profile/Timer.java b/server/src/main/java/org/opensearch/search/profile/Timer.java index d392110e53382..231324b4a5598 100644 --- a/server/src/main/java/org/opensearch/search/profile/Timer.java +++ b/server/src/main/java/org/opensearch/search/profile/Timer.java @@ -45,6 +45,8 @@ * timer.stop(); * } * + * + * @opensearch.internal */ public class Timer { diff --git a/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationProfileBreakdown.java b/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationProfileBreakdown.java index 4c3b22a02cc3e..24eccba575e77 100644 --- a/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationProfileBreakdown.java +++ b/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationProfileBreakdown.java @@ -41,6 +41,8 @@ /** * {@linkplain AbstractProfileBreakdown} customized to work with aggregations. + * + * @opensearch.internal */ public class AggregationProfileBreakdown extends AbstractProfileBreakdown { private final Map extra = new HashMap<>(); diff --git a/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationProfileShardResult.java b/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationProfileShardResult.java index 1638b3ee4d8c7..de91fe8a855fc 100644 --- a/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationProfileShardResult.java +++ b/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationProfileShardResult.java @@ -50,6 +50,8 @@ /** * A container class to hold the profile results for a single shard in the request. * Contains a list of query profiles, a collector tree and a total rewrite tree. + * + * @opensearch.internal */ public final class AggregationProfileShardResult implements Writeable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationProfiler.java b/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationProfiler.java index 7a1115e8b9e4c..1d2cf424ee5a7 100644 --- a/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationProfiler.java +++ b/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationProfiler.java @@ -40,6 +40,11 @@ import java.util.List; import java.util.Map; +/** + * Main class to profile aggregations + * + * @opensearch.internal + */ public class AggregationProfiler extends AbstractProfiler { private final Map, AggregationProfileBreakdown> profileBreakdownLookup = new HashMap<>(); diff --git a/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationTimingType.java b/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationTimingType.java index d71ca06941fbc..8c5ea2613e926 100644 --- a/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationTimingType.java +++ b/server/src/main/java/org/opensearch/search/profile/aggregation/AggregationTimingType.java @@ -34,6 +34,11 @@ import java.util.Locale; +/** + * Timing levels for aggregations + * + * @opensearch.internal + */ public enum AggregationTimingType { INITIALIZE, BUILD_LEAF_COLLECTOR, diff --git a/server/src/main/java/org/opensearch/search/profile/aggregation/InternalAggregationProfileTree.java b/server/src/main/java/org/opensearch/search/profile/aggregation/InternalAggregationProfileTree.java index 026d1aeaf9644..36cfc53f41ccd 100644 --- a/server/src/main/java/org/opensearch/search/profile/aggregation/InternalAggregationProfileTree.java +++ b/server/src/main/java/org/opensearch/search/profile/aggregation/InternalAggregationProfileTree.java @@ -35,6 +35,11 @@ import org.opensearch.search.aggregations.Aggregator; import org.opensearch.search.profile.AbstractInternalProfileTree; +/** + * The profiling tree for different levels of agg profiling + * + * @opensearch.internal + */ public class InternalAggregationProfileTree extends AbstractInternalProfileTree { @Override diff --git a/server/src/main/java/org/opensearch/search/profile/aggregation/ProfilingAggregator.java b/server/src/main/java/org/opensearch/search/profile/aggregation/ProfilingAggregator.java index 8d1cebebf3d33..a07dba125d67e 100644 --- a/server/src/main/java/org/opensearch/search/profile/aggregation/ProfilingAggregator.java +++ b/server/src/main/java/org/opensearch/search/profile/aggregation/ProfilingAggregator.java @@ -45,6 +45,9 @@ import java.io.IOException; import java.util.Iterator; +/** + * An aggregator that aggregates the performance profiling of other aggregations + */ public class ProfilingAggregator extends Aggregator { private final Aggregator delegate; diff --git a/server/src/main/java/org/opensearch/search/profile/aggregation/ProfilingLeafBucketCollector.java b/server/src/main/java/org/opensearch/search/profile/aggregation/ProfilingLeafBucketCollector.java index 17e451c09a5d4..56c79465c4575 100644 --- a/server/src/main/java/org/opensearch/search/profile/aggregation/ProfilingLeafBucketCollector.java +++ b/server/src/main/java/org/opensearch/search/profile/aggregation/ProfilingLeafBucketCollector.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * The collector for the agg profiles + * + * @opensearch.internal + */ public class ProfilingLeafBucketCollector extends LeafBucketCollector { private LeafBucketCollector delegate; diff --git a/server/src/main/java/org/opensearch/search/profile/query/CollectorResult.java b/server/src/main/java/org/opensearch/search/profile/query/CollectorResult.java index 1366bfd79abc9..8e513d47f66fd 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/CollectorResult.java +++ b/server/src/main/java/org/opensearch/search/profile/query/CollectorResult.java @@ -53,6 +53,8 @@ * Public interface and serialization container for profiled timings of the * Collectors used in the search. Children CollectorResult's may be * embedded inside of a parent CollectorResult + * + * @opensearch.internal */ public class CollectorResult implements ToXContentObject, Writeable { diff --git a/server/src/main/java/org/opensearch/search/profile/query/ConcurrentQueryProfileBreakdown.java b/server/src/main/java/org/opensearch/search/profile/query/ConcurrentQueryProfileBreakdown.java index 08f43e72d73dc..74ef78bc93c5f 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/ConcurrentQueryProfileBreakdown.java +++ b/server/src/main/java/org/opensearch/search/profile/query/ConcurrentQueryProfileBreakdown.java @@ -19,6 +19,8 @@ * A record of timings for the various operations that may happen during query execution. * A node's time may be composed of several internal attributes (rewriting, weighting, * scoring, etc). The class supports profiling the concurrent search over segments. + * + * @opensearch.internal */ public final class ConcurrentQueryProfileBreakdown extends ContextualProfileBreakdown { private final Map> contexts = new ConcurrentHashMap<>(); diff --git a/server/src/main/java/org/opensearch/search/profile/query/InternalProfileCollector.java b/server/src/main/java/org/opensearch/search/profile/query/InternalProfileCollector.java index d6ada27cbf65f..1300782ae1194 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/InternalProfileCollector.java +++ b/server/src/main/java/org/opensearch/search/profile/query/InternalProfileCollector.java @@ -50,6 +50,8 @@ * - needsScores() * * InternalProfiler facilitates the linking of the Collector graph + * + * @opensearch.internal */ public class InternalProfileCollector implements Collector, InternalProfileComponent { diff --git a/server/src/main/java/org/opensearch/search/profile/query/InternalProfileCollectorManager.java b/server/src/main/java/org/opensearch/search/profile/query/InternalProfileCollectorManager.java index a35c22a6a2457..2732b2ccffc79 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/InternalProfileCollectorManager.java +++ b/server/src/main/java/org/opensearch/search/profile/query/InternalProfileCollectorManager.java @@ -18,6 +18,11 @@ import java.util.Collection; import java.util.List; +/** + * Collector Manager for internal agg profiling + * + * @opensearch.internal + */ public class InternalProfileCollectorManager implements ProfileCollectorManager, diff --git a/server/src/main/java/org/opensearch/search/profile/query/InternalProfileComponent.java b/server/src/main/java/org/opensearch/search/profile/query/InternalProfileComponent.java index 9d0d32960a817..1752d76e27f06 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/InternalProfileComponent.java +++ b/server/src/main/java/org/opensearch/search/profile/query/InternalProfileComponent.java @@ -10,6 +10,11 @@ import java.util.Collection; +/** + * Container for an agg profiling component + * + * @opensearch.internal + */ public interface InternalProfileComponent { /** * @return profile component name diff --git a/server/src/main/java/org/opensearch/search/profile/query/InternalQueryProfileTree.java b/server/src/main/java/org/opensearch/search/profile/query/InternalQueryProfileTree.java index e72f70300e092..40c6a29384491 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/InternalQueryProfileTree.java +++ b/server/src/main/java/org/opensearch/search/profile/query/InternalQueryProfileTree.java @@ -41,6 +41,8 @@ * This class tracks the dependency tree for queries (scoring and rewriting) and * generates {@link QueryProfileBreakdown} for each node in the tree. It also finalizes the tree * and returns a list of {@link ProfileResult} that can be serialized back to the client + * + * @opensearch.internal */ final class InternalQueryProfileTree extends AbstractInternalProfileTree, Query> { diff --git a/server/src/main/java/org/opensearch/search/profile/query/ProfileCollector.java b/server/src/main/java/org/opensearch/search/profile/query/ProfileCollector.java index 299beb01aacee..837145c287faf 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/ProfileCollector.java +++ b/server/src/main/java/org/opensearch/search/profile/query/ProfileCollector.java @@ -42,7 +42,11 @@ import java.io.IOException; -/** A collector that profiles how much time is spent calling it. */ +/** + * A collector that profiles how much time is spent calling it. + * + * @opensearch.internal + */ final class ProfileCollector extends FilterCollector { private long time; diff --git a/server/src/main/java/org/opensearch/search/profile/query/ProfileCollectorManager.java b/server/src/main/java/org/opensearch/search/profile/query/ProfileCollectorManager.java index 7037988401fce..5a8566e6dfa71 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/ProfileCollectorManager.java +++ b/server/src/main/java/org/opensearch/search/profile/query/ProfileCollectorManager.java @@ -13,5 +13,7 @@ /** * Collector manager which supports profiling + * + * @opensearch.internal */ public interface ProfileCollectorManager extends CollectorManager, InternalProfileComponent {} diff --git a/server/src/main/java/org/opensearch/search/profile/query/ProfileScorer.java b/server/src/main/java/org/opensearch/search/profile/query/ProfileScorer.java index 3c0ddee7cfcb5..319281449195b 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/ProfileScorer.java +++ b/server/src/main/java/org/opensearch/search/profile/query/ProfileScorer.java @@ -45,6 +45,8 @@ /** * {@link Scorer} wrapper that will compute how much time is spent on moving * the iterator, confirming matches and computing scores. + * + * @opensearch.internal */ final class ProfileScorer extends Scorer { diff --git a/server/src/main/java/org/opensearch/search/profile/query/ProfileWeight.java b/server/src/main/java/org/opensearch/search/profile/query/ProfileWeight.java index 56b69ab3fb265..12f9a7184d84a 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/ProfileWeight.java +++ b/server/src/main/java/org/opensearch/search/profile/query/ProfileWeight.java @@ -48,6 +48,8 @@ * Weight wrapper that will compute how much time it takes to build the * {@link Scorer} and then return a {@link Scorer} that is wrapped in * order to compute timings as well. + * + * @opensearch.internal */ public final class ProfileWeight extends Weight { diff --git a/server/src/main/java/org/opensearch/search/profile/query/QueryProfileBreakdown.java b/server/src/main/java/org/opensearch/search/profile/query/QueryProfileBreakdown.java index 3e0ee8db4df56..3514a80e39d85 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/QueryProfileBreakdown.java +++ b/server/src/main/java/org/opensearch/search/profile/query/QueryProfileBreakdown.java @@ -39,6 +39,8 @@ * A record of timings for the various operations that may happen during query execution. * A node's time may be composed of several internal attributes (rewriting, weighting, * scoring, etc). + * + * @opensearch.internal */ public final class QueryProfileBreakdown extends ContextualProfileBreakdown { diff --git a/server/src/main/java/org/opensearch/search/profile/query/QueryProfileShardResult.java b/server/src/main/java/org/opensearch/search/profile/query/QueryProfileShardResult.java index 283adddaba5b7..e77fef681c8b4 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/QueryProfileShardResult.java +++ b/server/src/main/java/org/opensearch/search/profile/query/QueryProfileShardResult.java @@ -50,6 +50,8 @@ /** * A container class to hold the profile results for a single shard in the request. * Contains a list of query profiles, a collector tree and a total rewrite tree. + * + * @opensearch.internal */ public final class QueryProfileShardResult implements Writeable, ToXContentObject { diff --git a/server/src/main/java/org/opensearch/search/profile/query/QueryProfiler.java b/server/src/main/java/org/opensearch/search/profile/query/QueryProfiler.java index e78347713353c..9527e010005c3 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/QueryProfiler.java +++ b/server/src/main/java/org/opensearch/search/profile/query/QueryProfiler.java @@ -48,6 +48,8 @@ * A Profiler is associated with every Search, not per Search-Request. E.g. a * request may execute two searches (query + global agg). A Profiler just * represents one of those + * + * @opensearch.internal */ public final class QueryProfiler extends AbstractProfiler, Query> { diff --git a/server/src/main/java/org/opensearch/search/profile/query/QueryTimingType.java b/server/src/main/java/org/opensearch/search/profile/query/QueryTimingType.java index 7748b76cb1611..0cc7d1315ad61 100644 --- a/server/src/main/java/org/opensearch/search/profile/query/QueryTimingType.java +++ b/server/src/main/java/org/opensearch/search/profile/query/QueryTimingType.java @@ -34,6 +34,11 @@ import java.util.Locale; +/** + * Different profile levels of the query + * + * @opensearch.internal + */ public enum QueryTimingType { CREATE_WEIGHT, BUILD_SCORER, diff --git a/server/src/main/java/org/opensearch/search/query/EarlyTerminatingCollector.java b/server/src/main/java/org/opensearch/search/query/EarlyTerminatingCollector.java index 56cb49835dcc4..5b86a70d64fff 100644 --- a/server/src/main/java/org/opensearch/search/query/EarlyTerminatingCollector.java +++ b/server/src/main/java/org/opensearch/search/query/EarlyTerminatingCollector.java @@ -43,6 +43,8 @@ /** * A {@link Collector} that early terminates collection after maxCountHits docs have been collected. + * + * @opensearch.internal */ public class EarlyTerminatingCollector extends FilterCollector { static final class EarlyTerminationException extends RuntimeException { diff --git a/server/src/main/java/org/opensearch/search/query/EarlyTerminatingCollectorManager.java b/server/src/main/java/org/opensearch/search/query/EarlyTerminatingCollectorManager.java index 32fbb24d16436..e8153fd384b5d 100644 --- a/server/src/main/java/org/opensearch/search/query/EarlyTerminatingCollectorManager.java +++ b/server/src/main/java/org/opensearch/search/query/EarlyTerminatingCollectorManager.java @@ -16,6 +16,11 @@ import java.util.Collection; import java.util.List; +/** + * Manager for the EarlyTerminatingCollector + * + * @opensearch.internal + */ public class EarlyTerminatingCollectorManager implements CollectorManager, diff --git a/server/src/main/java/org/opensearch/search/query/EarlyTerminatingListener.java b/server/src/main/java/org/opensearch/search/query/EarlyTerminatingListener.java index dd6793266a7ca..340fb26923cf7 100644 --- a/server/src/main/java/org/opensearch/search/query/EarlyTerminatingListener.java +++ b/server/src/main/java/org/opensearch/search/query/EarlyTerminatingListener.java @@ -11,6 +11,8 @@ /** * Early termination event listener. It is used during concurrent segment search * to propagate the early termination intent. + * + * @opensearch.internal */ public interface EarlyTerminatingListener { /** diff --git a/server/src/main/java/org/opensearch/search/query/FilteredCollectorManager.java b/server/src/main/java/org/opensearch/search/query/FilteredCollectorManager.java index ef47cf2a388f3..96f449daf912e 100644 --- a/server/src/main/java/org/opensearch/search/query/FilteredCollectorManager.java +++ b/server/src/main/java/org/opensearch/search/query/FilteredCollectorManager.java @@ -17,6 +17,11 @@ import java.util.ArrayList; import java.util.Collection; +/** + * Manager for the FilteredCollector + * + * @opensearch.internal + */ class FilteredCollectorManager implements CollectorManager { private final CollectorManager manager; private final Weight filter; diff --git a/server/src/main/java/org/opensearch/search/query/MinimumCollectorManager.java b/server/src/main/java/org/opensearch/search/query/MinimumCollectorManager.java index 22b25222b639d..ed99f3dd8cc5c 100644 --- a/server/src/main/java/org/opensearch/search/query/MinimumCollectorManager.java +++ b/server/src/main/java/org/opensearch/search/query/MinimumCollectorManager.java @@ -16,6 +16,9 @@ import java.util.ArrayList; import java.util.Collection; +/** + * Manager for the MinimumCollector + */ class MinimumCollectorManager implements CollectorManager { private final CollectorManager manager; private final float minimumScore; diff --git a/server/src/main/java/org/opensearch/search/query/MultiCollectorWrapper.java b/server/src/main/java/org/opensearch/search/query/MultiCollectorWrapper.java index 0ee423b48caeb..7c57193349b91 100644 --- a/server/src/main/java/org/opensearch/search/query/MultiCollectorWrapper.java +++ b/server/src/main/java/org/opensearch/search/query/MultiCollectorWrapper.java @@ -22,6 +22,8 @@ /** * Wraps MultiCollector and provide access to underlying collectors. * Please check out https://github.com/apache/lucene/pull/455. + * + * @opensearch.internal */ public class MultiCollectorWrapper implements Collector { private final MultiCollector delegate; diff --git a/server/src/main/java/org/opensearch/search/query/QueryCollectorContext.java b/server/src/main/java/org/opensearch/search/query/QueryCollectorContext.java index 95ad514adf97d..9ce4a73c97c8d 100644 --- a/server/src/main/java/org/opensearch/search/query/QueryCollectorContext.java +++ b/server/src/main/java/org/opensearch/search/query/QueryCollectorContext.java @@ -56,6 +56,11 @@ import static org.opensearch.search.profile.query.CollectorResult.REASON_SEARCH_POST_FILTER; import static org.opensearch.search.profile.query.CollectorResult.REASON_SEARCH_TERMINATE_AFTER_COUNT; +/** + * The context used during query collection + * + * @opensearch.internal + */ public abstract class QueryCollectorContext { private static final Collector EMPTY_COLLECTOR = new SimpleCollector() { @Override diff --git a/server/src/main/java/org/opensearch/search/query/QueryCollectorManagerContext.java b/server/src/main/java/org/opensearch/search/query/QueryCollectorManagerContext.java index c98f4884bb030..3fa5003cdbfbe 100644 --- a/server/src/main/java/org/opensearch/search/query/QueryCollectorManagerContext.java +++ b/server/src/main/java/org/opensearch/search/query/QueryCollectorManagerContext.java @@ -19,6 +19,11 @@ import java.util.Collection; import java.util.List; +/** + * Context used for the query collector manager + * + * @opensearch.internal + */ public abstract class QueryCollectorManagerContext { private static class QueryCollectorManager implements CollectorManager { private final MultiCollectorManager manager; diff --git a/server/src/main/java/org/opensearch/search/query/QueryPhase.java b/server/src/main/java/org/opensearch/search/query/QueryPhase.java index 1501067ec7983..0b935baf6419b 100644 --- a/server/src/main/java/org/opensearch/search/query/QueryPhase.java +++ b/server/src/main/java/org/opensearch/search/query/QueryPhase.java @@ -84,6 +84,8 @@ /** * Query phase of a search request, used to run the query and get back from each shard information about the matching documents * (document ids and score or sort criteria) so that matches can be reduced on the coordinating node + * + * @opensearch.internal */ public class QueryPhase { private static final Logger LOGGER = LogManager.getLogger(QueryPhase.class); diff --git a/server/src/main/java/org/opensearch/search/query/QueryPhaseExecutionException.java b/server/src/main/java/org/opensearch/search/query/QueryPhaseExecutionException.java index 45d038393637a..50dd5f04418f2 100644 --- a/server/src/main/java/org/opensearch/search/query/QueryPhaseExecutionException.java +++ b/server/src/main/java/org/opensearch/search/query/QueryPhaseExecutionException.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Thrown if there are any errors in the query phase + * + * @opensearch.internal + */ public class QueryPhaseExecutionException extends SearchException { public QueryPhaseExecutionException(SearchShardTarget shardTarget, String msg, Throwable cause) { diff --git a/server/src/main/java/org/opensearch/search/query/QueryPhaseSearcher.java b/server/src/main/java/org/opensearch/search/query/QueryPhaseSearcher.java index 9a48f030fe147..1995137e8b52e 100644 --- a/server/src/main/java/org/opensearch/search/query/QueryPhaseSearcher.java +++ b/server/src/main/java/org/opensearch/search/query/QueryPhaseSearcher.java @@ -19,6 +19,8 @@ /** * The extension point which allows to plug in custom search implementation to be * used at {@link QueryPhase}. + * + * @opensearch.internal */ public interface QueryPhaseSearcher { /** diff --git a/server/src/main/java/org/opensearch/search/query/QuerySearchRequest.java b/server/src/main/java/org/opensearch/search/query/QuerySearchRequest.java index 0e7cacf013993..ae2f9e8fab989 100644 --- a/server/src/main/java/org/opensearch/search/query/QuerySearchRequest.java +++ b/server/src/main/java/org/opensearch/search/query/QuerySearchRequest.java @@ -51,6 +51,11 @@ import java.io.IOException; import java.util.Map; +/** + * Transport request for query search + * + * @opensearch.internal + */ public class QuerySearchRequest extends TransportRequest implements IndicesRequest { private final ShardSearchContextId contextId; diff --git a/server/src/main/java/org/opensearch/search/query/QuerySearchResult.java b/server/src/main/java/org/opensearch/search/query/QuerySearchResult.java index ee506bbc6ed67..dceacd57d623e 100644 --- a/server/src/main/java/org/opensearch/search/query/QuerySearchResult.java +++ b/server/src/main/java/org/opensearch/search/query/QuerySearchResult.java @@ -58,6 +58,11 @@ import static org.opensearch.common.lucene.Lucene.readTopDocs; import static org.opensearch.common.lucene.Lucene.writeTopDocs; +/** + * The result of the query search + * + * @opensearch.internal + */ public final class QuerySearchResult extends SearchPhaseResult { private int from; diff --git a/server/src/main/java/org/opensearch/search/query/ReduceableSearchResult.java b/server/src/main/java/org/opensearch/search/query/ReduceableSearchResult.java index 48e8d7198ea3b..dbfaa70e1968f 100644 --- a/server/src/main/java/org/opensearch/search/query/ReduceableSearchResult.java +++ b/server/src/main/java/org/opensearch/search/query/ReduceableSearchResult.java @@ -12,6 +12,8 @@ /** * The search result callback returned by reduce phase of the collector manager. + * + * @opensearch.internal */ public interface ReduceableSearchResult { /** diff --git a/server/src/main/java/org/opensearch/search/query/ScrollQuerySearchResult.java b/server/src/main/java/org/opensearch/search/query/ScrollQuerySearchResult.java index 278a1ee2b09d0..ef0827bd0b187 100644 --- a/server/src/main/java/org/opensearch/search/query/ScrollQuerySearchResult.java +++ b/server/src/main/java/org/opensearch/search/query/ScrollQuerySearchResult.java @@ -39,6 +39,11 @@ import java.io.IOException; +/** + * Scrolled results from a query search request + * + * @opensearch.internal + */ public final class ScrollQuerySearchResult extends SearchPhaseResult { private final QuerySearchResult result; diff --git a/server/src/main/java/org/opensearch/search/query/TopDocsCollectorContext.java b/server/src/main/java/org/opensearch/search/query/TopDocsCollectorContext.java index 5f19462a2c33a..39c34f7c0d5d5 100644 --- a/server/src/main/java/org/opensearch/search/query/TopDocsCollectorContext.java +++ b/server/src/main/java/org/opensearch/search/query/TopDocsCollectorContext.java @@ -92,6 +92,8 @@ /** * A {@link QueryCollectorContext} that creates top docs collector + * + * @opensearch.internal */ public abstract class TopDocsCollectorContext extends QueryCollectorContext { protected final int numHits; diff --git a/server/src/main/java/org/opensearch/search/query/TotalHitCountCollectorManager.java b/server/src/main/java/org/opensearch/search/query/TotalHitCountCollectorManager.java index 6d4159c977743..b8810c76bbc07 100644 --- a/server/src/main/java/org/opensearch/search/query/TotalHitCountCollectorManager.java +++ b/server/src/main/java/org/opensearch/search/query/TotalHitCountCollectorManager.java @@ -21,6 +21,11 @@ import java.io.IOException; import java.util.Collection; +/** + * CollectorManager for the TotalHitCountCollector + * + * @opensearch.internal + */ public class TotalHitCountCollectorManager implements CollectorManager, From 1ee0f4818c1868123675a99c58316e2f9a6de156 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 10 May 2022 14:02:42 -0400 Subject: [PATCH 142/514] [Javadocs] add to o.o.search.aggs, builder, and collapse packages (#3254) (#3260) Adds class level javadocs to org.opensearch.search.aggregations, builder, and collapse packages. Signed-off-by: Nicholas Walter Knize (cherry picked from commit 625623f93228fee91a4578244a69c7dfb7a3e087) Co-authored-by: Nick Knize --- .../search/aggregations/AbstractAggregationBuilder.java | 2 ++ .../org/opensearch/search/aggregations/Aggregation.java | 2 ++ .../opensearch/search/aggregations/AggregationBuilder.java | 2 ++ .../opensearch/search/aggregations/AggregationBuilders.java | 2 ++ .../search/aggregations/AggregationExecutionException.java | 2 ++ .../aggregations/AggregationInitializationException.java | 2 ++ .../opensearch/search/aggregations/AggregationPhase.java | 2 ++ .../org/opensearch/search/aggregations/Aggregations.java | 2 ++ .../java/org/opensearch/search/aggregations/Aggregator.java | 2 ++ .../org/opensearch/search/aggregations/AggregatorBase.java | 2 ++ .../opensearch/search/aggregations/AggregatorFactories.java | 2 ++ .../opensearch/search/aggregations/AggregatorFactory.java | 5 +++++ .../search/aggregations/BaseAggregationBuilder.java | 2 ++ .../org/opensearch/search/aggregations/BucketCollector.java | 2 ++ .../org/opensearch/search/aggregations/BucketOrder.java | 2 ++ .../search/aggregations/CardinalityUpperBound.java | 2 ++ .../org/opensearch/search/aggregations/HasAggregations.java | 5 +++++ .../opensearch/search/aggregations/InternalAggregation.java | 2 ++ .../search/aggregations/InternalAggregations.java | 2 ++ .../search/aggregations/InternalMultiBucketAggregation.java | 5 +++++ .../org/opensearch/search/aggregations/InternalOrder.java | 2 ++ .../aggregations/InvalidAggregationPathException.java | 5 +++++ .../org/opensearch/search/aggregations/KeyComparable.java | 2 ++ .../opensearch/search/aggregations/LeafBucketCollector.java | 2 ++ .../search/aggregations/LeafBucketCollectorBase.java | 2 ++ .../search/aggregations/MultiBucketCollector.java | 2 ++ .../search/aggregations/MultiBucketConsumerService.java | 2 ++ .../search/aggregations/NonCollectingAggregator.java | 2 ++ .../opensearch/search/aggregations/ParsedAggregation.java | 2 ++ .../search/aggregations/ParsedMultiBucketAggregation.java | 5 +++++ .../search/aggregations/PipelineAggregationBuilder.java | 2 ++ .../search/aggregations/PipelineAggregatorBuilders.java | 5 +++++ .../search/aggregations/SearchContextAggregations.java | 2 ++ .../aggregations/bucket/BestBucketsDeferringCollector.java | 2 ++ .../opensearch/search/aggregations/bucket/BucketUtils.java | 2 ++ .../search/aggregations/bucket/BucketsAggregator.java | 5 +++++ .../aggregations/bucket/DeferableBucketAggregator.java | 5 +++++ .../aggregations/bucket/DeferringBucketCollector.java | 2 ++ .../bucket/InternalSingleBucketAggregation.java | 2 ++ .../search/aggregations/bucket/IteratorAndCurrent.java | 5 +++++ .../bucket/MergingBucketsDeferringCollector.java | 2 ++ .../search/aggregations/bucket/MultiBucketsAggregation.java | 2 ++ .../aggregations/bucket/ParsedSingleBucketAggregation.java | 2 ++ .../search/aggregations/bucket/SingleBucketAggregation.java | 2 ++ .../search/aggregations/bucket/SingleBucketAggregator.java | 2 ++ .../aggregations/bucket/adjacency/AdjacencyMatrix.java | 2 ++ .../bucket/adjacency/AdjacencyMatrixAggregationBuilder.java | 5 +++++ .../bucket/adjacency/AdjacencyMatrixAggregator.java | 1 + .../bucket/adjacency/AdjacencyMatrixAggregatorFactory.java | 5 +++++ .../bucket/adjacency/InternalAdjacencyMatrix.java | 5 +++++ .../bucket/adjacency/ParsedAdjacencyMatrix.java | 5 +++++ .../aggregations/bucket/composite/BinaryValuesSource.java | 2 ++ .../aggregations/bucket/composite/CompositeAggregation.java | 5 +++++ .../bucket/composite/CompositeAggregationBuilder.java | 5 +++++ .../bucket/composite/CompositeAggregationFactory.java | 5 +++++ .../aggregations/bucket/composite/CompositeAggregator.java | 5 +++++ .../search/aggregations/bucket/composite/CompositeKey.java | 2 ++ .../bucket/composite/CompositeValuesCollectorQueue.java | 2 ++ .../bucket/composite/CompositeValuesSourceBuilder.java | 2 ++ .../bucket/composite/CompositeValuesSourceConfig.java | 5 +++++ .../bucket/composite/CompositeValuesSourceParserHelper.java | 5 +++++ .../bucket/composite/DateHistogramValuesSourceBuilder.java | 2 ++ .../aggregations/bucket/composite/DoubleValuesSource.java | 2 ++ .../bucket/composite/GeoTileGridValuesSourceBuilder.java | 5 +++++ .../aggregations/bucket/composite/GeoTileValuesSource.java | 2 ++ .../bucket/composite/GlobalOrdinalValuesSource.java | 2 ++ .../bucket/composite/HistogramValuesSource.java | 5 +++++ .../bucket/composite/HistogramValuesSourceBuilder.java | 2 ++ .../aggregations/bucket/composite/InternalComposite.java | 5 +++++ .../aggregations/bucket/composite/LongValuesSource.java | 2 ++ .../aggregations/bucket/composite/ParsedComposite.java | 5 +++++ .../bucket/composite/PointsSortedDocsProducer.java | 2 ++ .../aggregations/bucket/composite/RoundingValuesSource.java | 2 ++ .../bucket/composite/SingleDimensionValuesSource.java | 2 ++ .../aggregations/bucket/composite/SortedDocsProducer.java | 2 ++ .../bucket/composite/TermsSortedDocsProducer.java | 2 ++ .../bucket/composite/TermsValuesSourceBuilder.java | 2 ++ .../search/aggregations/bucket/filter/Filter.java | 2 ++ .../bucket/filter/FilterAggregationBuilder.java | 5 +++++ .../search/aggregations/bucket/filter/FilterAggregator.java | 2 ++ .../aggregations/bucket/filter/FilterAggregatorFactory.java | 5 +++++ .../search/aggregations/bucket/filter/Filters.java | 2 ++ .../bucket/filter/FiltersAggregationBuilder.java | 5 +++++ .../aggregations/bucket/filter/FiltersAggregator.java | 5 +++++ .../bucket/filter/FiltersAggregatorFactory.java | 5 +++++ .../search/aggregations/bucket/filter/InternalFilter.java | 5 +++++ .../search/aggregations/bucket/filter/InternalFilters.java | 5 +++++ .../search/aggregations/bucket/filter/ParsedFilter.java | 5 +++++ .../search/aggregations/bucket/filter/ParsedFilters.java | 5 +++++ .../aggregations/bucket/geogrid/BoundedCellValues.java | 2 ++ .../aggregations/bucket/geogrid/BucketPriorityQueue.java | 5 +++++ .../search/aggregations/bucket/geogrid/CellIdSource.java | 2 ++ .../search/aggregations/bucket/geogrid/CellValues.java | 2 ++ .../search/aggregations/bucket/geogrid/GeoGrid.java | 2 ++ .../bucket/geogrid/GeoGridAggregationBuilder.java | 5 +++++ .../aggregations/bucket/geogrid/GeoGridAggregator.java | 2 ++ .../bucket/geogrid/GeoHashGridAggregationBuilder.java | 5 +++++ .../aggregations/bucket/geogrid/GeoHashGridAggregator.java | 2 ++ .../bucket/geogrid/GeoHashGridAggregatorFactory.java | 5 +++++ .../bucket/geogrid/GeoTileGridAggregationBuilder.java | 5 +++++ .../aggregations/bucket/geogrid/GeoTileGridAggregator.java | 2 ++ .../bucket/geogrid/GeoTileGridAggregatorFactory.java | 5 +++++ .../search/aggregations/bucket/geogrid/GeoTileUtils.java | 2 ++ .../search/aggregations/bucket/geogrid/InternalGeoGrid.java | 2 ++ .../aggregations/bucket/geogrid/InternalGeoGridBucket.java | 5 +++++ .../aggregations/bucket/geogrid/InternalGeoHashGrid.java | 2 ++ .../bucket/geogrid/InternalGeoHashGridBucket.java | 5 +++++ .../aggregations/bucket/geogrid/InternalGeoTileGrid.java | 2 ++ .../bucket/geogrid/InternalGeoTileGridBucket.java | 5 +++++ .../search/aggregations/bucket/geogrid/ParsedGeoGrid.java | 5 +++++ .../aggregations/bucket/geogrid/ParsedGeoGridBucket.java | 5 +++++ .../aggregations/bucket/geogrid/ParsedGeoHashGrid.java | 5 +++++ .../bucket/geogrid/ParsedGeoHashGridBucket.java | 5 +++++ .../aggregations/bucket/geogrid/ParsedGeoTileGrid.java | 5 +++++ .../bucket/geogrid/ParsedGeoTileGridBucket.java | 5 +++++ .../aggregations/bucket/geogrid/UnboundedCellValues.java | 2 ++ .../search/aggregations/bucket/global/Global.java | 2 ++ .../bucket/global/GlobalAggregationBuilder.java | 5 +++++ .../search/aggregations/bucket/global/GlobalAggregator.java | 5 +++++ .../aggregations/bucket/global/GlobalAggregatorFactory.java | 5 +++++ .../search/aggregations/bucket/global/InternalGlobal.java | 2 ++ .../search/aggregations/bucket/global/ParsedGlobal.java | 5 +++++ .../bucket/histogram/AbstractHistogramAggregator.java | 2 ++ .../histogram/AutoDateHistogramAggregationBuilder.java | 5 +++++ .../bucket/histogram/AutoDateHistogramAggregator.java | 2 ++ .../histogram/AutoDateHistogramAggregatorFactory.java | 5 +++++ .../histogram/AutoDateHistogramAggregatorSupplier.java | 5 +++++ .../bucket/histogram/DateHistogramAggregationBuilder.java | 2 ++ .../bucket/histogram/DateHistogramAggregationSupplier.java | 5 +++++ .../bucket/histogram/DateHistogramAggregator.java | 2 ++ .../bucket/histogram/DateHistogramAggregatorFactory.java | 5 +++++ .../bucket/histogram/DateHistogramInterval.java | 2 ++ .../aggregations/bucket/histogram/DateIntervalConsumer.java | 2 ++ .../aggregations/bucket/histogram/DateIntervalWrapper.java | 2 ++ .../bucket/histogram/DateRangeHistogramAggregator.java | 2 ++ .../search/aggregations/bucket/histogram/DoubleBounds.java | 2 ++ .../search/aggregations/bucket/histogram/Histogram.java | 2 ++ .../bucket/histogram/HistogramAggregationBuilder.java | 2 ++ .../bucket/histogram/HistogramAggregatorFactory.java | 2 ++ .../bucket/histogram/HistogramAggregatorSupplier.java | 5 +++++ .../aggregations/bucket/histogram/HistogramFactory.java | 6 +++++- .../bucket/histogram/InternalAutoDateHistogram.java | 2 ++ .../bucket/histogram/InternalDateHistogram.java | 2 ++ .../aggregations/bucket/histogram/InternalHistogram.java | 2 ++ .../bucket/histogram/InternalVariableWidthHistogram.java | 5 +++++ .../search/aggregations/bucket/histogram/LongBounds.java | 2 ++ .../bucket/histogram/NumericHistogramAggregator.java | 2 ++ .../bucket/histogram/ParsedAutoDateHistogram.java | 5 +++++ .../aggregations/bucket/histogram/ParsedDateHistogram.java | 5 +++++ .../aggregations/bucket/histogram/ParsedHistogram.java | 5 +++++ .../bucket/histogram/ParsedVariableWidthHistogram.java | 5 +++++ .../bucket/histogram/RangeHistogramAggregator.java | 5 +++++ .../bucket/histogram/SizedBucketAggregator.java | 2 ++ .../bucket/histogram/SizedBucketAggregatorBuilder.java | 2 ++ .../histogram/VariableWidthHistogramAggregationBuilder.java | 5 +++++ .../bucket/histogram/VariableWidthHistogramAggregator.java | 5 +++++ .../histogram/VariableWidthHistogramAggregatorFactory.java | 5 +++++ .../histogram/VariableWidthHistogramAggregatorSupplier.java | 5 +++++ .../search/aggregations/bucket/missing/Missing.java | 2 ++ .../bucket/missing/MissingAggregationBuilder.java | 5 +++++ .../aggregations/bucket/missing/MissingAggregator.java | 5 +++++ .../bucket/missing/MissingAggregatorFactory.java | 5 +++++ .../bucket/missing/MissingAggregatorSupplier.java | 5 +++++ .../search/aggregations/bucket/missing/MissingOrder.java | 2 ++ .../search/aggregations/bucket/missing/ParsedMissing.java | 5 +++++ .../search/aggregations/bucket/nested/InternalNested.java | 2 ++ .../aggregations/bucket/nested/InternalReverseNested.java | 2 ++ .../search/aggregations/bucket/nested/Nested.java | 2 ++ .../bucket/nested/NestedAggregationBuilder.java | 5 +++++ .../search/aggregations/bucket/nested/NestedAggregator.java | 5 +++++ .../aggregations/bucket/nested/NestedAggregatorFactory.java | 5 +++++ .../search/aggregations/bucket/nested/ParsedNested.java | 5 +++++ .../aggregations/bucket/nested/ParsedReverseNested.java | 5 +++++ .../search/aggregations/bucket/nested/ReverseNested.java | 2 ++ .../bucket/nested/ReverseNestedAggregationBuilder.java | 5 +++++ .../aggregations/bucket/nested/ReverseNestedAggregator.java | 5 +++++ .../bucket/nested/ReverseNestedAggregatorFactory.java | 5 +++++ .../bucket/range/AbstractRangeAggregatorFactory.java | 5 +++++ .../aggregations/bucket/range/AbstractRangeBuilder.java | 5 +++++ .../aggregations/bucket/range/BinaryRangeAggregator.java | 6 +++++- .../bucket/range/BinaryRangeAggregatorFactory.java | 5 +++++ .../bucket/range/DateRangeAggregationBuilder.java | 5 +++++ .../bucket/range/DateRangeAggregatorFactory.java | 5 +++++ .../bucket/range/GeoDistanceAggregationBuilder.java | 5 +++++ .../bucket/range/GeoDistanceAggregatorSupplier.java | 5 +++++ .../bucket/range/GeoDistanceRangeAggregatorFactory.java | 5 +++++ .../aggregations/bucket/range/InternalBinaryRange.java | 6 +++++- .../search/aggregations/bucket/range/InternalDateRange.java | 5 +++++ .../aggregations/bucket/range/InternalGeoDistance.java | 5 +++++ .../search/aggregations/bucket/range/InternalRange.java | 5 +++++ .../bucket/range/IpRangeAggregationBuilder.java | 5 +++++ .../bucket/range/IpRangeAggregatorSupplier.java | 5 +++++ .../search/aggregations/bucket/range/ParsedBinaryRange.java | 5 +++++ .../search/aggregations/bucket/range/ParsedDateRange.java | 5 +++++ .../search/aggregations/bucket/range/ParsedGeoDistance.java | 5 +++++ .../search/aggregations/bucket/range/ParsedRange.java | 5 +++++ .../opensearch/search/aggregations/bucket/range/Range.java | 2 ++ .../aggregations/bucket/range/RangeAggregationBuilder.java | 5 +++++ .../search/aggregations/bucket/range/RangeAggregator.java | 5 +++++ .../aggregations/bucket/range/RangeAggregatorFactory.java | 5 +++++ .../aggregations/bucket/range/RangeAggregatorSupplier.java | 5 +++++ .../bucket/sampler/BestDocsDeferringCollector.java | 2 ++ .../bucket/sampler/DiversifiedAggregationBuilder.java | 5 +++++ .../bucket/sampler/DiversifiedAggregatorFactory.java | 5 +++++ .../bucket/sampler/DiversifiedAggregatorSupplier.java | 5 +++++ .../sampler/DiversifiedBytesHashSamplerAggregator.java | 2 ++ .../bucket/sampler/DiversifiedMapSamplerAggregator.java | 5 +++++ .../bucket/sampler/DiversifiedNumericSamplerAggregator.java | 5 +++++ .../sampler/DiversifiedOrdinalsSamplerAggregator.java | 5 +++++ .../search/aggregations/bucket/sampler/InternalSampler.java | 5 +++++ .../search/aggregations/bucket/sampler/ParsedSampler.java | 5 +++++ .../search/aggregations/bucket/sampler/Sampler.java | 2 ++ .../bucket/sampler/SamplerAggregationBuilder.java | 5 +++++ .../aggregations/bucket/sampler/SamplerAggregator.java | 2 ++ .../bucket/sampler/SamplerAggregatorFactory.java | 5 +++++ .../search/aggregations/bucket/sampler/UnmappedSampler.java | 5 +++++ .../bucket/terms/AbstractRareTermsAggregator.java | 5 +++++ .../bucket/terms/AbstractStringTermsAggregator.java | 5 +++++ .../aggregations/bucket/terms/BucketPriorityQueue.java | 5 +++++ .../bucket/terms/BucketSignificancePriorityQueue.java | 5 +++++ .../aggregations/bucket/terms/BytesKeyedBucketOrds.java | 2 ++ .../search/aggregations/bucket/terms/DoubleTerms.java | 2 ++ .../bucket/terms/GlobalOrdinalsStringTermsAggregator.java | 2 ++ .../search/aggregations/bucket/terms/IncludeExclude.java | 2 ++ .../aggregations/bucket/terms/InternalMappedRareTerms.java | 5 +++++ .../bucket/terms/InternalMappedSignificantTerms.java | 5 +++++ .../aggregations/bucket/terms/InternalMappedTerms.java | 2 ++ .../aggregations/bucket/terms/InternalMultiTerms.java | 2 ++ .../search/aggregations/bucket/terms/InternalRareTerms.java | 5 +++++ .../aggregations/bucket/terms/InternalSignificantTerms.java | 2 ++ .../search/aggregations/bucket/terms/InternalTerms.java | 5 +++++ .../aggregations/bucket/terms/LongKeyedBucketOrds.java | 2 ++ .../search/aggregations/bucket/terms/LongRareTerms.java | 2 ++ .../aggregations/bucket/terms/LongRareTermsAggregator.java | 2 ++ .../search/aggregations/bucket/terms/LongTerms.java | 2 ++ .../aggregations/bucket/terms/MapStringTermsAggregator.java | 2 ++ .../bucket/terms/MultiTermsAggregationBuilder.java | 2 ++ .../bucket/terms/MultiTermsAggregationFactory.java | 2 ++ .../aggregations/bucket/terms/MultiTermsAggregator.java | 2 ++ .../aggregations/bucket/terms/NumericTermsAggregator.java | 5 +++++ .../search/aggregations/bucket/terms/ParsedDoubleTerms.java | 5 +++++ .../aggregations/bucket/terms/ParsedLongRareTerms.java | 5 +++++ .../search/aggregations/bucket/terms/ParsedLongTerms.java | 5 +++++ .../search/aggregations/bucket/terms/ParsedMultiTerms.java | 5 +++++ .../search/aggregations/bucket/terms/ParsedRareTerms.java | 5 +++++ .../bucket/terms/ParsedSignificantLongTerms.java | 5 +++++ .../bucket/terms/ParsedSignificantStringTerms.java | 5 +++++ .../aggregations/bucket/terms/ParsedSignificantTerms.java | 5 +++++ .../aggregations/bucket/terms/ParsedStringRareTerms.java | 5 +++++ .../search/aggregations/bucket/terms/ParsedStringTerms.java | 5 +++++ .../search/aggregations/bucket/terms/ParsedTerms.java | 5 +++++ .../search/aggregations/bucket/terms/RareTerms.java | 5 +++++ .../bucket/terms/RareTermsAggregationBuilder.java | 5 +++++ .../bucket/terms/RareTermsAggregatorFactory.java | 5 +++++ .../bucket/terms/RareTermsAggregatorSupplier.java | 5 +++++ .../aggregations/bucket/terms/SignificanceLookup.java | 2 ++ .../aggregations/bucket/terms/SignificantLongTerms.java | 2 ++ .../aggregations/bucket/terms/SignificantStringTerms.java | 2 ++ .../search/aggregations/bucket/terms/SignificantTerms.java | 2 ++ .../bucket/terms/SignificantTermsAggregationBuilder.java | 5 +++++ .../bucket/terms/SignificantTermsAggregatorFactory.java | 5 +++++ .../bucket/terms/SignificantTermsAggregatorSupplier.java | 5 +++++ .../bucket/terms/SignificantTextAggregationBuilder.java | 5 +++++ .../bucket/terms/SignificantTextAggregatorFactory.java | 5 +++++ .../search/aggregations/bucket/terms/StringRareTerms.java | 5 +++++ .../bucket/terms/StringRareTermsAggregator.java | 2 ++ .../search/aggregations/bucket/terms/StringTerms.java | 2 ++ .../opensearch/search/aggregations/bucket/terms/Terms.java | 2 ++ .../aggregations/bucket/terms/TermsAggregationBuilder.java | 5 +++++ .../search/aggregations/bucket/terms/TermsAggregator.java | 5 +++++ .../aggregations/bucket/terms/TermsAggregatorFactory.java | 5 +++++ .../aggregations/bucket/terms/TermsAggregatorSupplier.java | 5 +++++ .../search/aggregations/bucket/terms/UnmappedRareTerms.java | 2 ++ .../aggregations/bucket/terms/UnmappedSignificantTerms.java | 2 ++ .../search/aggregations/bucket/terms/UnmappedTerms.java | 2 ++ .../aggregations/bucket/terms/heuristic/ChiSquare.java | 5 +++++ .../search/aggregations/bucket/terms/heuristic/GND.java | 5 +++++ .../aggregations/bucket/terms/heuristic/JLHScore.java | 5 +++++ .../bucket/terms/heuristic/MutualInformation.java | 5 +++++ .../bucket/terms/heuristic/NXYSignificanceHeuristic.java | 5 +++++ .../bucket/terms/heuristic/PercentageScore.java | 5 +++++ .../bucket/terms/heuristic/ScriptHeuristic.java | 5 +++++ .../bucket/terms/heuristic/SignificanceHeuristic.java | 2 ++ .../terms/heuristic/SignificanceHeuristicBuilder.java | 5 +++++ .../aggregations/metrics/AbstractCardinalityAlgorithm.java | 2 ++ .../metrics/AbstractHDRPercentilesAggregator.java | 5 +++++ .../search/aggregations/metrics/AbstractHyperLogLog.java | 2 ++ .../aggregations/metrics/AbstractHyperLogLogPlusPlus.java | 2 ++ .../metrics/AbstractInternalHDRPercentiles.java | 5 +++++ .../metrics/AbstractInternalTDigestPercentiles.java | 5 +++++ .../search/aggregations/metrics/AbstractLinearCounting.java | 2 ++ .../metrics/AbstractPercentilesAggregationBuilder.java | 2 ++ .../metrics/AbstractTDigestPercentilesAggregator.java | 5 +++++ .../org/opensearch/search/aggregations/metrics/Avg.java | 2 ++ .../search/aggregations/metrics/AvgAggregationBuilder.java | 5 +++++ .../search/aggregations/metrics/AvgAggregator.java | 5 +++++ .../search/aggregations/metrics/AvgAggregatorFactory.java | 5 +++++ .../opensearch/search/aggregations/metrics/Cardinality.java | 2 ++ .../aggregations/metrics/CardinalityAggregationBuilder.java | 5 +++++ .../search/aggregations/metrics/CardinalityAggregator.java | 2 ++ .../aggregations/metrics/CardinalityAggregatorFactory.java | 5 +++++ .../aggregations/metrics/CardinalityAggregatorSupplier.java | 5 +++++ .../search/aggregations/metrics/CompensatedSum.java | 2 ++ .../search/aggregations/metrics/ExtendedStats.java | 2 ++ .../metrics/ExtendedStatsAggregationBuilder.java | 5 +++++ .../aggregations/metrics/ExtendedStatsAggregator.java | 5 +++++ .../metrics/ExtendedStatsAggregatorFactory.java | 5 +++++ .../metrics/ExtendedStatsAggregatorProvider.java | 3 +++ .../opensearch/search/aggregations/metrics/GeoBounds.java | 2 ++ .../aggregations/metrics/GeoBoundsAggregationBuilder.java | 5 +++++ .../search/aggregations/metrics/GeoBoundsAggregator.java | 5 +++++ .../aggregations/metrics/GeoBoundsAggregatorFactory.java | 5 +++++ .../aggregations/metrics/GeoBoundsAggregatorSupplier.java | 5 +++++ .../opensearch/search/aggregations/metrics/GeoCentroid.java | 2 ++ .../aggregations/metrics/GeoCentroidAggregationBuilder.java | 5 +++++ .../search/aggregations/metrics/GeoCentroidAggregator.java | 2 ++ .../aggregations/metrics/GeoCentroidAggregatorFactory.java | 5 +++++ .../aggregations/metrics/GeoGridAggregatorSupplier.java | 5 +++++ .../aggregations/metrics/HDRPercentileRanksAggregator.java | 5 +++++ .../aggregations/metrics/HDRPercentilesAggregator.java | 5 +++++ .../search/aggregations/metrics/HyperLogLogPlusPlus.java | 2 ++ .../aggregations/metrics/HyperLogLogPlusPlusSparse.java | 2 ++ .../opensearch/search/aggregations/metrics/InternalAvg.java | 5 +++++ .../search/aggregations/metrics/InternalCardinality.java | 5 +++++ .../search/aggregations/metrics/InternalExtendedStats.java | 5 +++++ .../search/aggregations/metrics/InternalGeoBounds.java | 5 +++++ .../search/aggregations/metrics/InternalGeoCentroid.java | 2 ++ .../aggregations/metrics/InternalHDRPercentileRanks.java | 5 +++++ .../search/aggregations/metrics/InternalHDRPercentiles.java | 5 +++++ .../opensearch/search/aggregations/metrics/InternalMax.java | 5 +++++ .../metrics/InternalMedianAbsoluteDeviation.java | 5 +++++ .../opensearch/search/aggregations/metrics/InternalMin.java | 5 +++++ .../metrics/InternalNumericMetricsAggregation.java | 5 +++++ .../search/aggregations/metrics/InternalScriptedMetric.java | 5 +++++ .../search/aggregations/metrics/InternalStats.java | 5 +++++ .../opensearch/search/aggregations/metrics/InternalSum.java | 5 +++++ .../metrics/InternalTDigestPercentileRanks.java | 5 +++++ .../aggregations/metrics/InternalTDigestPercentiles.java | 5 +++++ .../search/aggregations/metrics/InternalTopHits.java | 2 ++ .../search/aggregations/metrics/InternalValueCount.java | 2 ++ .../search/aggregations/metrics/InternalWeightedAvg.java | 5 +++++ .../org/opensearch/search/aggregations/metrics/Max.java | 2 ++ .../search/aggregations/metrics/MaxAggregationBuilder.java | 5 +++++ .../search/aggregations/metrics/MaxAggregator.java | 5 +++++ .../search/aggregations/metrics/MaxAggregatorFactory.java | 5 +++++ .../aggregations/metrics/MedianAbsoluteDeviation.java | 2 ++ .../metrics/MedianAbsoluteDeviationAggregationBuilder.java | 5 +++++ .../metrics/MedianAbsoluteDeviationAggregator.java | 5 +++++ .../metrics/MedianAbsoluteDeviationAggregatorFactory.java | 5 +++++ .../metrics/MedianAbsoluteDeviationAggregatorSupplier.java | 5 +++++ .../aggregations/metrics/MetricAggregatorSupplier.java | 5 +++++ .../search/aggregations/metrics/MetricInspectionHelper.java | 2 ++ .../search/aggregations/metrics/MetricsAggregator.java | 5 +++++ .../org/opensearch/search/aggregations/metrics/Min.java | 2 ++ .../search/aggregations/metrics/MinAggregationBuilder.java | 5 +++++ .../search/aggregations/metrics/MinAggregator.java | 5 +++++ .../search/aggregations/metrics/MinAggregatorFactory.java | 5 +++++ .../aggregations/metrics/NumericMetricsAggregation.java | 5 +++++ .../aggregations/metrics/NumericMetricsAggregator.java | 5 +++++ .../opensearch/search/aggregations/metrics/ParsedAvg.java | 5 +++++ .../search/aggregations/metrics/ParsedCardinality.java | 5 +++++ .../search/aggregations/metrics/ParsedExtendedStats.java | 5 +++++ .../search/aggregations/metrics/ParsedGeoBounds.java | 5 +++++ .../search/aggregations/metrics/ParsedGeoCentroid.java | 2 ++ .../aggregations/metrics/ParsedHDRPercentileRanks.java | 5 +++++ .../search/aggregations/metrics/ParsedHDRPercentiles.java | 5 +++++ .../opensearch/search/aggregations/metrics/ParsedMax.java | 5 +++++ .../aggregations/metrics/ParsedMedianAbsoluteDeviation.java | 5 +++++ .../opensearch/search/aggregations/metrics/ParsedMin.java | 5 +++++ .../search/aggregations/metrics/ParsedPercentileRanks.java | 5 +++++ .../search/aggregations/metrics/ParsedPercentiles.java | 5 +++++ .../search/aggregations/metrics/ParsedScriptedMetric.java | 5 +++++ .../metrics/ParsedSingleValueNumericMetricsAggregation.java | 5 +++++ .../opensearch/search/aggregations/metrics/ParsedStats.java | 5 +++++ .../opensearch/search/aggregations/metrics/ParsedSum.java | 5 +++++ .../aggregations/metrics/ParsedTDigestPercentileRanks.java | 5 +++++ .../aggregations/metrics/ParsedTDigestPercentiles.java | 5 +++++ .../search/aggregations/metrics/ParsedTopHits.java | 5 +++++ .../search/aggregations/metrics/ParsedValueCount.java | 5 +++++ .../search/aggregations/metrics/ParsedWeightedAvg.java | 5 +++++ .../opensearch/search/aggregations/metrics/Percentile.java | 5 +++++ .../search/aggregations/metrics/PercentileRanks.java | 2 ++ .../metrics/PercentileRanksAggregationBuilder.java | 5 +++++ .../metrics/PercentileRanksAggregatorFactory.java | 5 +++++ .../opensearch/search/aggregations/metrics/Percentiles.java | 2 ++ .../aggregations/metrics/PercentilesAggregationBuilder.java | 5 +++++ .../aggregations/metrics/PercentilesAggregatorFactory.java | 2 ++ .../aggregations/metrics/PercentilesAggregatorSupplier.java | 5 +++++ .../search/aggregations/metrics/PercentilesConfig.java | 2 ++ .../search/aggregations/metrics/PercentilesMethod.java | 2 ++ .../search/aggregations/metrics/ScriptedMetric.java | 2 ++ .../metrics/ScriptedMetricAggregationBuilder.java | 5 +++++ .../aggregations/metrics/ScriptedMetricAggregator.java | 5 +++++ .../metrics/ScriptedMetricAggregatorFactory.java | 5 +++++ .../org/opensearch/search/aggregations/metrics/Stats.java | 2 ++ .../aggregations/metrics/StatsAggregationBuilder.java | 5 +++++ .../search/aggregations/metrics/StatsAggregator.java | 5 +++++ .../search/aggregations/metrics/StatsAggregatorFactory.java | 5 +++++ .../org/opensearch/search/aggregations/metrics/Sum.java | 2 ++ .../search/aggregations/metrics/SumAggregationBuilder.java | 5 +++++ .../search/aggregations/metrics/SumAggregator.java | 5 +++++ .../search/aggregations/metrics/SumAggregatorFactory.java | 5 +++++ .../metrics/TDigestPercentileRanksAggregator.java | 5 +++++ .../aggregations/metrics/TDigestPercentilesAggregator.java | 5 +++++ .../search/aggregations/metrics/TDigestState.java | 2 ++ .../org/opensearch/search/aggregations/metrics/TopHits.java | 2 ++ .../aggregations/metrics/TopHitsAggregationBuilder.java | 5 +++++ .../search/aggregations/metrics/TopHitsAggregator.java | 5 +++++ .../aggregations/metrics/TopHitsAggregatorFactory.java | 5 +++++ .../opensearch/search/aggregations/metrics/ValueCount.java | 2 ++ .../aggregations/metrics/ValueCountAggregationBuilder.java | 5 +++++ .../search/aggregations/metrics/ValueCountAggregator.java | 2 ++ .../aggregations/metrics/ValueCountAggregatorFactory.java | 5 +++++ .../opensearch/search/aggregations/metrics/WeightedAvg.java | 2 ++ .../aggregations/metrics/WeightedAvgAggregationBuilder.java | 5 +++++ .../search/aggregations/metrics/WeightedAvgAggregator.java | 5 +++++ .../aggregations/metrics/WeightedAvgAggregatorFactory.java | 5 +++++ .../pipeline/AbstractPipelineAggregationBuilder.java | 2 ++ .../pipeline/AvgBucketPipelineAggregationBuilder.java | 5 +++++ .../aggregations/pipeline/AvgBucketPipelineAggregator.java | 5 +++++ .../search/aggregations/pipeline/BucketHelpers.java | 2 ++ .../search/aggregations/pipeline/BucketMetricValue.java | 5 +++++ .../search/aggregations/pipeline/BucketMetricsParser.java | 2 ++ .../pipeline/BucketMetricsPipelineAggregationBuilder.java | 5 +++++ .../pipeline/BucketMetricsPipelineAggregator.java | 2 ++ .../pipeline/BucketScriptPipelineAggregationBuilder.java | 5 +++++ .../pipeline/BucketScriptPipelineAggregator.java | 5 +++++ .../pipeline/BucketSelectorPipelineAggregationBuilder.java | 5 +++++ .../pipeline/BucketSelectorPipelineAggregator.java | 5 +++++ .../pipeline/BucketSortPipelineAggregationBuilder.java | 2 ++ .../aggregations/pipeline/BucketSortPipelineAggregator.java | 5 +++++ .../pipeline/CumulativeSumPipelineAggregationBuilder.java | 5 +++++ .../pipeline/CumulativeSumPipelineAggregator.java | 5 +++++ .../opensearch/search/aggregations/pipeline/Derivative.java | 5 +++++ .../pipeline/DerivativePipelineAggregationBuilder.java | 5 +++++ .../aggregations/pipeline/DerivativePipelineAggregator.java | 5 +++++ .../opensearch/search/aggregations/pipeline/EwmaModel.java | 2 ++ .../search/aggregations/pipeline/ExtendedStatsBucket.java | 2 ++ .../aggregations/pipeline/ExtendedStatsBucketParser.java | 5 +++++ .../ExtendedStatsBucketPipelineAggregationBuilder.java | 5 +++++ .../pipeline/ExtendedStatsBucketPipelineAggregator.java | 5 +++++ .../search/aggregations/pipeline/HoltLinearModel.java | 2 ++ .../search/aggregations/pipeline/HoltWintersModel.java | 2 ++ .../aggregations/pipeline/InternalBucketMetricValue.java | 5 +++++ .../search/aggregations/pipeline/InternalDerivative.java | 5 +++++ .../aggregations/pipeline/InternalExtendedStatsBucket.java | 5 +++++ .../aggregations/pipeline/InternalPercentilesBucket.java | 5 +++++ .../search/aggregations/pipeline/InternalSimpleValue.java | 5 +++++ .../search/aggregations/pipeline/InternalStatsBucket.java | 5 +++++ .../search/aggregations/pipeline/LinearModel.java | 2 ++ .../pipeline/MaxBucketPipelineAggregationBuilder.java | 5 +++++ .../aggregations/pipeline/MaxBucketPipelineAggregator.java | 5 +++++ .../pipeline/MinBucketPipelineAggregationBuilder.java | 5 +++++ .../aggregations/pipeline/MinBucketPipelineAggregator.java | 5 +++++ .../search/aggregations/pipeline/MovAvgModel.java | 5 +++++ .../search/aggregations/pipeline/MovAvgModelBuilder.java | 2 ++ .../pipeline/MovAvgPipelineAggregationBuilder.java | 5 +++++ .../aggregations/pipeline/MovAvgPipelineAggregator.java | 5 +++++ .../pipeline/MovFnPipelineAggregationBuilder.java | 5 +++++ .../aggregations/pipeline/MovFnPipelineAggregator.java | 2 ++ .../search/aggregations/pipeline/MovingFunctionScript.java | 2 ++ .../search/aggregations/pipeline/MovingFunctions.java | 2 ++ .../aggregations/pipeline/ParsedBucketMetricValue.java | 5 +++++ .../search/aggregations/pipeline/ParsedDerivative.java | 5 +++++ .../aggregations/pipeline/ParsedExtendedStatsBucket.java | 5 +++++ .../aggregations/pipeline/ParsedPercentilesBucket.java | 5 +++++ .../search/aggregations/pipeline/ParsedSimpleValue.java | 5 +++++ .../search/aggregations/pipeline/ParsedStatsBucket.java | 5 +++++ .../search/aggregations/pipeline/PercentilesBucket.java | 5 +++++ .../PercentilesBucketPipelineAggregationBuilder.java | 5 +++++ .../pipeline/PercentilesBucketPipelineAggregator.java | 5 +++++ .../search/aggregations/pipeline/PipelineAggregator.java | 5 +++++ .../pipeline/SerialDiffPipelineAggregationBuilder.java | 5 +++++ .../aggregations/pipeline/SerialDiffPipelineAggregator.java | 5 +++++ .../aggregations/pipeline/SiblingPipelineAggregator.java | 5 +++++ .../search/aggregations/pipeline/SimpleModel.java | 2 ++ .../search/aggregations/pipeline/SimpleValue.java | 5 +++++ .../aggregations/pipeline/SimulatedAnealingMinimizer.java | 2 ++ .../search/aggregations/pipeline/StatsBucket.java | 2 ++ .../pipeline/StatsBucketPipelineAggregationBuilder.java | 5 +++++ .../pipeline/StatsBucketPipelineAggregator.java | 5 +++++ .../pipeline/SumBucketPipelineAggregationBuilder.java | 5 +++++ .../aggregations/pipeline/SumBucketPipelineAggregator.java | 5 +++++ .../search/aggregations/support/AggregationInfo.java | 5 +++++ .../aggregations/support/AggregationInspectionHelper.java | 2 ++ .../search/aggregations/support/AggregationPath.java | 2 ++ .../aggregations/support/AggregationUsageService.java | 5 +++++ .../support/BaseMultiValuesSourceFieldConfig.java | 2 ++ .../search/aggregations/support/CoreValuesSourceType.java | 2 ++ .../search/aggregations/support/FieldContext.java | 2 ++ .../search/aggregations/support/MissingValues.java | 2 ++ .../aggregations/support/MultiTermsValuesSourceConfig.java | 2 ++ .../search/aggregations/support/MultiValuesSource.java | 2 ++ .../support/MultiValuesSourceAggregationBuilder.java | 2 ++ .../support/MultiValuesSourceAggregatorFactory.java | 5 +++++ .../aggregations/support/MultiValuesSourceFieldConfig.java | 5 +++++ .../aggregations/support/MultiValuesSourceParseHelper.java | 5 +++++ .../opensearch/search/aggregations/support/ValueType.java | 5 +++++ .../search/aggregations/support/ValuesSource.java | 5 +++++ .../support/ValuesSourceAggregationBuilder.java | 5 +++++ .../aggregations/support/ValuesSourceAggregatorFactory.java | 5 +++++ .../search/aggregations/support/ValuesSourceConfig.java | 2 ++ .../search/aggregations/support/ValuesSourceRegistry.java | 1 + .../search/aggregations/support/ValuesSourceType.java | 2 ++ .../aggregations/support/values/ScriptBytesValues.java | 2 ++ .../aggregations/support/values/ScriptDoubleValues.java | 2 ++ .../aggregations/support/values/ScriptLongValues.java | 2 ++ .../org/opensearch/search/builder/PointInTimeBuilder.java | 2 ++ .../org/opensearch/search/builder/SearchSourceBuilder.java | 2 ++ .../search/builder/SearchSourceBuilderException.java | 5 +++++ .../org/opensearch/search/collapse/CollapseBuilder.java | 2 ++ .../org/opensearch/search/collapse/CollapseContext.java | 2 ++ 512 files changed, 1959 insertions(+), 3 deletions(-) diff --git a/server/src/main/java/org/opensearch/search/aggregations/AbstractAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/AbstractAggregationBuilder.java index 8b5bbc9f28d8f..5863bf66f59f8 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/AbstractAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/AbstractAggregationBuilder.java @@ -43,6 +43,8 @@ /** * Base implementation of a {@link AggregationBuilder}. + * + * @opensearch.internal */ public abstract class AbstractAggregationBuilder> extends AggregationBuilder { diff --git a/server/src/main/java/org/opensearch/search/aggregations/Aggregation.java b/server/src/main/java/org/opensearch/search/aggregations/Aggregation.java index 6c4a4ce8dd664..66c3ec0477198 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/Aggregation.java +++ b/server/src/main/java/org/opensearch/search/aggregations/Aggregation.java @@ -39,6 +39,8 @@ /** * An aggregation. Extends {@link ToXContent} as it makes it easier to print out its content. + * + * @opensearch.internal */ public interface Aggregation extends ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/search/aggregations/AggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/AggregationBuilder.java index 1e372aff17cd4..5c76f0cc091c3 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/AggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/AggregationBuilder.java @@ -48,6 +48,8 @@ /** * A factory that knows how to create an {@link Aggregator} of a specific type. + * + * @opensearch.internal */ public abstract class AggregationBuilder implements diff --git a/server/src/main/java/org/opensearch/search/aggregations/AggregationBuilders.java b/server/src/main/java/org/opensearch/search/aggregations/AggregationBuilders.java index 69a9fd92ac459..01e0f95b0d750 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/AggregationBuilders.java +++ b/server/src/main/java/org/opensearch/search/aggregations/AggregationBuilders.java @@ -109,6 +109,8 @@ /** * Utility class to create aggregations. + * + * @opensearch.internal */ public class AggregationBuilders { diff --git a/server/src/main/java/org/opensearch/search/aggregations/AggregationExecutionException.java b/server/src/main/java/org/opensearch/search/aggregations/AggregationExecutionException.java index 5bb65bc33fcde..989783b11da3c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/AggregationExecutionException.java +++ b/server/src/main/java/org/opensearch/search/aggregations/AggregationExecutionException.java @@ -38,6 +38,8 @@ /** * Thrown when failing to execute an aggregation + * + * @opensearch.internal */ public class AggregationExecutionException extends OpenSearchException { diff --git a/server/src/main/java/org/opensearch/search/aggregations/AggregationInitializationException.java b/server/src/main/java/org/opensearch/search/aggregations/AggregationInitializationException.java index c73cd7670b3fd..87fcfece07064 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/AggregationInitializationException.java +++ b/server/src/main/java/org/opensearch/search/aggregations/AggregationInitializationException.java @@ -38,6 +38,8 @@ /** * Thrown when failing to execute an aggregation + * + * @opensearch.internal */ public class AggregationInitializationException extends OpenSearchException { diff --git a/server/src/main/java/org/opensearch/search/aggregations/AggregationPhase.java b/server/src/main/java/org/opensearch/search/aggregations/AggregationPhase.java index 5a837a6e14c5a..c091a1bc47c05 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/AggregationPhase.java +++ b/server/src/main/java/org/opensearch/search/aggregations/AggregationPhase.java @@ -51,6 +51,8 @@ /** * Aggregation phase of a search request, used to collect aggregations + * + * @opensearch.internal */ public class AggregationPhase { diff --git a/server/src/main/java/org/opensearch/search/aggregations/Aggregations.java b/server/src/main/java/org/opensearch/search/aggregations/Aggregations.java index 9360f03304cf2..4049d96d68817 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/Aggregations.java +++ b/server/src/main/java/org/opensearch/search/aggregations/Aggregations.java @@ -53,6 +53,8 @@ /** * Represents a set of {@link Aggregation}s + * + * @opensearch.internal */ public class Aggregations implements Iterable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/search/aggregations/Aggregator.java b/server/src/main/java/org/opensearch/search/aggregations/Aggregator.java index b38dfe123fdf4..99a54bbdc27b0 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/Aggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/Aggregator.java @@ -54,6 +54,8 @@ *

    * Be careful when adding methods to this class. If possible * make sure they have sensible default implementations. + * + * @opensearch.internal */ public abstract class Aggregator extends BucketCollector implements Releasable { diff --git a/server/src/main/java/org/opensearch/search/aggregations/AggregatorBase.java b/server/src/main/java/org/opensearch/search/aggregations/AggregatorBase.java index 09af84bc81144..db51f00056f72 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/AggregatorBase.java +++ b/server/src/main/java/org/opensearch/search/aggregations/AggregatorBase.java @@ -52,6 +52,8 @@ /** * Base implementation for concrete aggregators. + * + * @opensearch.internal */ public abstract class AggregatorBase extends Aggregator { diff --git a/server/src/main/java/org/opensearch/search/aggregations/AggregatorFactories.java b/server/src/main/java/org/opensearch/search/aggregations/AggregatorFactories.java index 1dde4c782c9dc..ec536578f7251 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/AggregatorFactories.java +++ b/server/src/main/java/org/opensearch/search/aggregations/AggregatorFactories.java @@ -77,6 +77,8 @@ /** * An immutable collection of {@link AggregatorFactories}. + * + * @opensearch.internal */ public class AggregatorFactories { public static final Pattern VALID_AGG_NAME = Pattern.compile("[^\\[\\]>]+"); diff --git a/server/src/main/java/org/opensearch/search/aggregations/AggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/AggregatorFactory.java index 65f44c8a34669..05686f35c2166 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/AggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/AggregatorFactory.java @@ -40,6 +40,11 @@ import static org.opensearch.search.aggregations.support.AggregationUsageService.OTHER_SUBTYPE; +/** + * Base factory to instantiate an internal aggregator + * + * @opensearch.internal + */ public abstract class AggregatorFactory { protected final String name; protected final AggregatorFactory parent; diff --git a/server/src/main/java/org/opensearch/search/aggregations/BaseAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/BaseAggregationBuilder.java index 24b34c2c111c0..2232367b16c51 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/BaseAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/BaseAggregationBuilder.java @@ -40,6 +40,8 @@ /** * Interface shared by {@link AggregationBuilder} and {@link PipelineAggregationBuilder} so they can conveniently share the same namespace * for {@link XContentParser#namedObject(Class, String, Object)}. + * + * @opensearch.internal */ public interface BaseAggregationBuilder { /** diff --git a/server/src/main/java/org/opensearch/search/aggregations/BucketCollector.java b/server/src/main/java/org/opensearch/search/aggregations/BucketCollector.java index e84f4d19e8080..5db683252a033 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/BucketCollector.java +++ b/server/src/main/java/org/opensearch/search/aggregations/BucketCollector.java @@ -40,6 +40,8 @@ /** * A Collector that can collect data in separate buckets. + * + * @opensearch.internal */ public abstract class BucketCollector implements Collector { diff --git a/server/src/main/java/org/opensearch/search/aggregations/BucketOrder.java b/server/src/main/java/org/opensearch/search/aggregations/BucketOrder.java index 423c143e6aaea..6dc8c9a61d864 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/BucketOrder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/BucketOrder.java @@ -49,6 +49,8 @@ * "complete" buckets using {@link #comparator()} or against a combination * of the buckets internals with its ordinal with * {@link #partiallyBuiltBucketComparator(ToLongFunction, Aggregator)}. + * + * @opensearch.internal */ public abstract class BucketOrder implements ToXContentObject, Writeable { /** diff --git a/server/src/main/java/org/opensearch/search/aggregations/CardinalityUpperBound.java b/server/src/main/java/org/opensearch/search/aggregations/CardinalityUpperBound.java index 984c8a0872903..7596cf471c4a3 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/CardinalityUpperBound.java +++ b/server/src/main/java/org/opensearch/search/aggregations/CardinalityUpperBound.java @@ -41,6 +41,8 @@ /** * Upper bound of how many {@code owningBucketOrds} that an {@link Aggregator} * will have to collect into. + * + * @opensearch.internal */ public abstract class CardinalityUpperBound { /** diff --git a/server/src/main/java/org/opensearch/search/aggregations/HasAggregations.java b/server/src/main/java/org/opensearch/search/aggregations/HasAggregations.java index 92b4d3f69bb6f..6d3c599eee05c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/HasAggregations.java +++ b/server/src/main/java/org/opensearch/search/aggregations/HasAggregations.java @@ -32,6 +32,11 @@ package org.opensearch.search.aggregations; +/** + * Base interface for buckets that have sub aggs + * + * @opensearch.internal + */ public interface HasAggregations { Aggregations getAggregations(); diff --git a/server/src/main/java/org/opensearch/search/aggregations/InternalAggregation.java b/server/src/main/java/org/opensearch/search/aggregations/InternalAggregation.java index 7c403bcb9dbbf..55c400218b06b 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/InternalAggregation.java +++ b/server/src/main/java/org/opensearch/search/aggregations/InternalAggregation.java @@ -58,6 +58,8 @@ /** * An internal implementation of {@link Aggregation}. Serves as a base class for all aggregation implementations. + * + * @opensearch.internal */ public abstract class InternalAggregation implements Aggregation, NamedWriteable { /** diff --git a/server/src/main/java/org/opensearch/search/aggregations/InternalAggregations.java b/server/src/main/java/org/opensearch/search/aggregations/InternalAggregations.java index 371a2b04ae019..fb8fb18598dac 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/InternalAggregations.java +++ b/server/src/main/java/org/opensearch/search/aggregations/InternalAggregations.java @@ -59,6 +59,8 @@ /** * An internal implementation of {@link Aggregations}. + * + * @opensearch.internal */ public final class InternalAggregations extends Aggregations implements Writeable { diff --git a/server/src/main/java/org/opensearch/search/aggregations/InternalMultiBucketAggregation.java b/server/src/main/java/org/opensearch/search/aggregations/InternalMultiBucketAggregation.java index 983f2cbe21ae1..b519334e6f92e 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/InternalMultiBucketAggregation.java +++ b/server/src/main/java/org/opensearch/search/aggregations/InternalMultiBucketAggregation.java @@ -45,6 +45,11 @@ import java.util.function.Consumer; import java.util.function.Function; +/** + * Base class for internal aggregations that are comprised of multiple buckets + * + * @opensearch.internal + */ public abstract class InternalMultiBucketAggregation< A extends InternalMultiBucketAggregation, B extends InternalMultiBucketAggregation.InternalBucket> extends InternalAggregation implements MultiBucketsAggregation { diff --git a/server/src/main/java/org/opensearch/search/aggregations/InternalOrder.java b/server/src/main/java/org/opensearch/search/aggregations/InternalOrder.java index 923650fbeac3f..491e08bc847d1 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/InternalOrder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/InternalOrder.java @@ -58,6 +58,8 @@ /** * Implementations for {@link Bucket} ordering strategies. + * + * @opensearch.internal */ public abstract class InternalOrder extends BucketOrder { // TODO merge the contents of this file into BucketOrder. The way it is now is relic. diff --git a/server/src/main/java/org/opensearch/search/aggregations/InvalidAggregationPathException.java b/server/src/main/java/org/opensearch/search/aggregations/InvalidAggregationPathException.java index 011206ddd049d..1222e3904ea5e 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/InvalidAggregationPathException.java +++ b/server/src/main/java/org/opensearch/search/aggregations/InvalidAggregationPathException.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Error thrown when an invalid agg is called + * + * @opensearch.internal + */ public class InvalidAggregationPathException extends OpenSearchException { public InvalidAggregationPathException(String msg) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/KeyComparable.java b/server/src/main/java/org/opensearch/search/aggregations/KeyComparable.java index 1e64ad8992a27..5acf32183a810 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/KeyComparable.java +++ b/server/src/main/java/org/opensearch/search/aggregations/KeyComparable.java @@ -39,6 +39,8 @@ * * @param {@link Bucket} of the same type that also implements {@link KeyComparable}. * @see BucketOrder#key(boolean) + * + * @opensearch.internal */ public interface KeyComparable> { diff --git a/server/src/main/java/org/opensearch/search/aggregations/LeafBucketCollector.java b/server/src/main/java/org/opensearch/search/aggregations/LeafBucketCollector.java index 0d29469f12d97..6694ba3e0a34d 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/LeafBucketCollector.java +++ b/server/src/main/java/org/opensearch/search/aggregations/LeafBucketCollector.java @@ -42,6 +42,8 @@ /** * Per-leaf bucket collector. + * + * @opensearch.internal */ public abstract class LeafBucketCollector implements LeafCollector { diff --git a/server/src/main/java/org/opensearch/search/aggregations/LeafBucketCollectorBase.java b/server/src/main/java/org/opensearch/search/aggregations/LeafBucketCollectorBase.java index 2da9f4307c40a..5b5f2b7a6f8cb 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/LeafBucketCollectorBase.java +++ b/server/src/main/java/org/opensearch/search/aggregations/LeafBucketCollectorBase.java @@ -41,6 +41,8 @@ * A {@link LeafBucketCollector} that delegates all calls to the sub leaf * aggregator and sets the scorer on its source of values if it implements * {@link ScorerAware}. + * + * @opensearch.internal */ public class LeafBucketCollectorBase extends LeafBucketCollector { diff --git a/server/src/main/java/org/opensearch/search/aggregations/MultiBucketCollector.java b/server/src/main/java/org/opensearch/search/aggregations/MultiBucketCollector.java index 6bb044b1d7ea8..80c7b37624fa5 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/MultiBucketCollector.java +++ b/server/src/main/java/org/opensearch/search/aggregations/MultiBucketCollector.java @@ -51,6 +51,8 @@ * {@link BucketCollector}s. It is similar to the {@link MultiCollector} except that the * {@link #wrap} method filters out the {@link BucketCollector#NO_OP_COLLECTOR}s and not * the null ones. + * + * @opensearch.internal */ public class MultiBucketCollector extends BucketCollector { diff --git a/server/src/main/java/org/opensearch/search/aggregations/MultiBucketConsumerService.java b/server/src/main/java/org/opensearch/search/aggregations/MultiBucketConsumerService.java index ce9527e812db5..d7c1796b1715f 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/MultiBucketConsumerService.java +++ b/server/src/main/java/org/opensearch/search/aggregations/MultiBucketConsumerService.java @@ -49,6 +49,8 @@ * The consumer is used by {@link BucketsAggregator} and {@link InternalMultiBucketAggregation} to limit the number of buckets created * in {@link Aggregator#buildAggregations} and {@link InternalAggregation#reduce}. * The limit can be set by changing the `search.max_buckets` cluster setting and defaults to 65535. + * + * @opensearch.internal */ public class MultiBucketConsumerService { public static final int DEFAULT_MAX_BUCKETS = 65535; diff --git a/server/src/main/java/org/opensearch/search/aggregations/NonCollectingAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/NonCollectingAggregator.java index 92a37b726469b..34d1d48d8ce21 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/NonCollectingAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/NonCollectingAggregator.java @@ -41,6 +41,8 @@ /** * An aggregator that is not collected, this can typically be used when running an aggregation over a field that doesn't have * a mapping. + * + * @opensearch.internal */ public abstract class NonCollectingAggregator extends AggregatorBase { /** diff --git a/server/src/main/java/org/opensearch/search/aggregations/ParsedAggregation.java b/server/src/main/java/org/opensearch/search/aggregations/ParsedAggregation.java index 64d2779dceb61..5d4803cd1ebca 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/ParsedAggregation.java +++ b/server/src/main/java/org/opensearch/search/aggregations/ParsedAggregation.java @@ -46,6 +46,8 @@ /** * An implementation of {@link Aggregation} that is parsed from a REST response. * Serves as a base class for all aggregation implementations that are parsed from REST. + * + * @opensearch.internal */ public abstract class ParsedAggregation implements Aggregation, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/search/aggregations/ParsedMultiBucketAggregation.java b/server/src/main/java/org/opensearch/search/aggregations/ParsedMultiBucketAggregation.java index 67310bc2a5ae2..6258295a2b733 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/ParsedMultiBucketAggregation.java +++ b/server/src/main/java/org/opensearch/search/aggregations/ParsedMultiBucketAggregation.java @@ -47,6 +47,11 @@ import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +/** + * A multi-bucket agg that has been parsed + * + * @opensearch.internal + */ public abstract class ParsedMultiBucketAggregation extends ParsedAggregation implements MultiBucketsAggregation { diff --git a/server/src/main/java/org/opensearch/search/aggregations/PipelineAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/PipelineAggregationBuilder.java index 3652f46350985..6aba50ec912d8 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/PipelineAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/PipelineAggregationBuilder.java @@ -52,6 +52,8 @@ /** * A factory that knows how to create an {@link PipelineAggregator} of a * specific type. + * + * @opensearch.internal */ public abstract class PipelineAggregationBuilder implements diff --git a/server/src/main/java/org/opensearch/search/aggregations/PipelineAggregatorBuilders.java b/server/src/main/java/org/opensearch/search/aggregations/PipelineAggregatorBuilders.java index 3e8d3325fd604..b025860b9e65b 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/PipelineAggregatorBuilders.java +++ b/server/src/main/java/org/opensearch/search/aggregations/PipelineAggregatorBuilders.java @@ -53,6 +53,11 @@ import java.util.List; import java.util.Map; +/** + * Builder utility class for pipeline aggs + * + * @opensearch.internal + */ public final class PipelineAggregatorBuilders { private PipelineAggregatorBuilders() {} diff --git a/server/src/main/java/org/opensearch/search/aggregations/SearchContextAggregations.java b/server/src/main/java/org/opensearch/search/aggregations/SearchContextAggregations.java index 229f6bf118f61..f51d5af23b049 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/SearchContextAggregations.java +++ b/server/src/main/java/org/opensearch/search/aggregations/SearchContextAggregations.java @@ -35,6 +35,8 @@ /** * The aggregation context that is part of the search context. + * + * @opensearch.internal */ public class SearchContextAggregations { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/BestBucketsDeferringCollector.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/BestBucketsDeferringCollector.java index 48e674d977231..f3addc9522a94 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/BestBucketsDeferringCollector.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/BestBucketsDeferringCollector.java @@ -61,6 +61,8 @@ * matches and then is able to replay a given subset of buckets which represent * the survivors from a pruning process performed by the aggregator that owns * this collector. + * + * @opensearch.internal */ public class BestBucketsDeferringCollector extends DeferringBucketCollector { static class Entry { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/BucketUtils.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/BucketUtils.java index 6dd064a501087..9a4f19910b36c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/BucketUtils.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/BucketUtils.java @@ -33,6 +33,8 @@ /** * Helper functions for common Bucketing functions + * + * @opensearch.internal */ public final class BucketUtils { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/BucketsAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/BucketsAggregator.java index f18f6fb83816d..9e35a2745fc90 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/BucketsAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/BucketsAggregator.java @@ -61,6 +61,11 @@ import java.util.function.LongUnaryOperator; import java.util.function.ToLongFunction; +/** + * Base class to collect all docs into buckets + * + * @opensearch.internal + */ public abstract class BucketsAggregator extends AggregatorBase { private final BigArrays bigArrays; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/DeferableBucketAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/DeferableBucketAggregator.java index 8efbad76b82cd..1ff065f39f359 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/DeferableBucketAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/DeferableBucketAggregator.java @@ -45,6 +45,11 @@ import java.util.Map; import java.util.function.BiConsumer; +/** + * Aggregator that defers collecting docs based on some metric + * + * @opensearch.internal + */ public abstract class DeferableBucketAggregator extends BucketsAggregator { /** * Wrapper that records collections. Non-null if any aggregations have diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/DeferringBucketCollector.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/DeferringBucketCollector.java index 8bb5074acbaad..d11fcfd104af1 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/DeferringBucketCollector.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/DeferringBucketCollector.java @@ -48,6 +48,8 @@ /** * A {@link BucketCollector} that records collected doc IDs and buckets and * allows to replay a subset of the collected buckets. + * + * @opensearch.internal */ public abstract class DeferringBucketCollector extends BucketCollector { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/InternalSingleBucketAggregation.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/InternalSingleBucketAggregation.java index bba1e526f6985..e47053e7501e7 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/InternalSingleBucketAggregation.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/InternalSingleBucketAggregation.java @@ -51,6 +51,8 @@ /** * A base class for all the single bucket aggregations. + * + * @opensearch.internal */ public abstract class InternalSingleBucketAggregation extends InternalAggregation implements SingleBucketAggregation { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/IteratorAndCurrent.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/IteratorAndCurrent.java index e0e14640d83f7..470fc0bc05389 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/IteratorAndCurrent.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/IteratorAndCurrent.java @@ -36,6 +36,11 @@ import java.util.Iterator; +/** + * Utility class for keeping track of a current item in an iterator + * + * @opensearch.internal + */ public class IteratorAndCurrent implements Iterator { private final Iterator iterator; private B current; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/MergingBucketsDeferringCollector.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/MergingBucketsDeferringCollector.java index 4edb13dbba676..8d35c1edc8cb0 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/MergingBucketsDeferringCollector.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/MergingBucketsDeferringCollector.java @@ -45,6 +45,8 @@ * matches and then is able to replay a given subset of buckets. Exposes * mergeBuckets, which can be invoked by the aggregator when increasing the * rounding interval. + * + * @opensearch.internal */ public class MergingBucketsDeferringCollector extends BestBucketsDeferringCollector { public MergingBucketsDeferringCollector(SearchContext context, boolean isGlobal) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/MultiBucketsAggregation.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/MultiBucketsAggregation.java index 437fc8a372d1c..5bd014c6e4df0 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/MultiBucketsAggregation.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/MultiBucketsAggregation.java @@ -41,6 +41,8 @@ /** * An aggregation that returns multiple buckets + * + * @opensearch.internal */ public interface MultiBucketsAggregation extends Aggregation { /** diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/ParsedSingleBucketAggregation.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/ParsedSingleBucketAggregation.java index ddbbb3ed4f830..373099b367c03 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/ParsedSingleBucketAggregation.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/ParsedSingleBucketAggregation.java @@ -47,6 +47,8 @@ /** * A base class for all the single bucket aggregations. + * + * @opensearch.internal */ public abstract class ParsedSingleBucketAggregation extends ParsedAggregation implements SingleBucketAggregation { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/SingleBucketAggregation.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/SingleBucketAggregation.java index b6e5acc39fee1..af0babcc1c22f 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/SingleBucketAggregation.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/SingleBucketAggregation.java @@ -38,6 +38,8 @@ /** * A single bucket aggregation + * + * @opensearch.internal */ public interface SingleBucketAggregation extends Aggregation, HasAggregations { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/SingleBucketAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/SingleBucketAggregator.java index b6b51f707ceba..268e5f2aaf90d 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/SingleBucketAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/SingleBucketAggregator.java @@ -33,5 +33,7 @@ /** * A bucket aggregator that doesn't create new buckets. + * + * @opensearch.internal */ public interface SingleBucketAggregator {} diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/AdjacencyMatrix.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/AdjacencyMatrix.java index 4bf071aa23bf9..5cb8af37323e5 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/AdjacencyMatrix.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/AdjacencyMatrix.java @@ -40,6 +40,8 @@ * A multi bucket aggregation where the buckets are defined by a set of filters * (a bucket is produced per filter plus a bucket for each non-empty filter * intersection so A, B and A&B). + * + * @opensearch.internal */ public interface AdjacencyMatrix extends MultiBucketsAggregation { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/AdjacencyMatrixAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/AdjacencyMatrixAggregationBuilder.java index 640cceacb197d..0eebd3e0bf3d6 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/AdjacencyMatrixAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/AdjacencyMatrixAggregationBuilder.java @@ -59,6 +59,11 @@ import java.util.Map.Entry; import java.util.Objects; +/** + * Aggregation Builder for adjacency_matrix agg + * + * @opensearch.internal + */ public class AdjacencyMatrixAggregationBuilder extends AbstractAggregationBuilder { public static final String NAME = "adjacency_matrix"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/AdjacencyMatrixAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/AdjacencyMatrixAggregator.java index b1054a01448f5..1cae870a378a5 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/AdjacencyMatrixAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/AdjacencyMatrixAggregator.java @@ -66,6 +66,7 @@ /** * Aggregation for adjacency matrices. * + * @opensearch.internal */ public class AdjacencyMatrixAggregator extends BucketsAggregator { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/AdjacencyMatrixAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/AdjacencyMatrixAggregatorFactory.java index 7fffcff7b5db2..fe1270e10c80e 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/AdjacencyMatrixAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/AdjacencyMatrixAggregatorFactory.java @@ -48,6 +48,11 @@ import java.util.List; import java.util.Map; +/** + * Aggregation Factory for adjacency_matrix agg + * + * @opensearch.internal + */ public class AdjacencyMatrixAggregatorFactory extends AggregatorFactory { private final String[] keys; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/InternalAdjacencyMatrix.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/InternalAdjacencyMatrix.java index 99a62621946e4..52a8d638d8e1d 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/InternalAdjacencyMatrix.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/InternalAdjacencyMatrix.java @@ -48,6 +48,11 @@ import java.util.Map; import java.util.Objects; +/** + * Internal class used to represent an adjacency matrix as a collection of buckets + * + * @opensearch.internal + */ public class InternalAdjacencyMatrix extends InternalMultiBucketAggregation implements AdjacencyMatrix { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/ParsedAdjacencyMatrix.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/ParsedAdjacencyMatrix.java index 27e0bf40ca017..f211c072cbd1f 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/ParsedAdjacencyMatrix.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/adjacency/ParsedAdjacencyMatrix.java @@ -41,6 +41,11 @@ import java.util.List; import java.util.Map; +/** + * Internal class used to hold a parsed adjacency matrix as a collection of buckets + * + * @opensearch.internal + */ public class ParsedAdjacencyMatrix extends ParsedMultiBucketAggregation implements AdjacencyMatrix { private Map bucketMap; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/BinaryValuesSource.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/BinaryValuesSource.java index 44a29e2251b13..54fd261f88c35 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/BinaryValuesSource.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/BinaryValuesSource.java @@ -55,6 +55,8 @@ /** * A {@link SingleDimensionValuesSource} for binary source ({@link BytesRef}). + * + * @opensearch.internal */ class BinaryValuesSource extends SingleDimensionValuesSource { private final LongConsumer breakerConsumer; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregation.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregation.java index e245aefcbbcc4..06ec7f8b1baf7 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregation.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregation.java @@ -39,6 +39,11 @@ import java.util.List; import java.util.Map; +/** + * Aggregation creates a composite of multiple aggs + * + * @opensearch.internal + */ public interface CompositeAggregation extends MultiBucketsAggregation { interface Bucket extends MultiBucketsAggregation.Bucket { Map getKey(); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregationBuilder.java index 0dfc1de3503e8..8b07df3f689bf 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregationBuilder.java @@ -55,6 +55,11 @@ import static org.opensearch.common.xcontent.ConstructingObjectParser.constructorArg; +/** + * Aggregation Builder for composite agg + * + * @opensearch.internal + */ public class CompositeAggregationBuilder extends AbstractAggregationBuilder { public static final String NAME = "composite"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregationFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregationFactory.java index d7383285ddd1c..09691a69c75f4 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregationFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregationFactory.java @@ -42,6 +42,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Factory for composite agg + * + * @opensearch.internal + */ class CompositeAggregationFactory extends AggregatorFactory { private final int size; private final CompositeValuesSourceConfig[] sources; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregator.java index 6af887201d994..94fc48708c41f 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeAggregator.java @@ -86,6 +86,11 @@ import static org.opensearch.search.aggregations.MultiBucketConsumerService.MAX_BUCKET_SETTING; +/** + * Main aggregator that aggregates docs from mulitple aggregations + * + * @opensearch.internal + */ final class CompositeAggregator extends BucketsAggregator { private final int size; private final List sourceNames; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeKey.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeKey.java index cb2801e625bfb..94b32c8c02ff0 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeKey.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeKey.java @@ -41,6 +41,8 @@ /** * A key that is composed of multiple {@link Comparable} values. + * + * @opensearch.internal */ class CompositeKey implements Writeable { private final Comparable[] values; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeValuesCollectorQueue.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeValuesCollectorQueue.java index a7963532235ec..ac50869b5d79b 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeValuesCollectorQueue.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeValuesCollectorQueue.java @@ -47,6 +47,8 @@ /** * A specialized {@link PriorityQueue} implementation for composite buckets. + * + * @opensearch.internal */ final class CompositeValuesCollectorQueue extends PriorityQueue implements Releasable { private class Slot { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeValuesSourceBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeValuesSourceBuilder.java index 9ac43c812e41c..7764d367a0cec 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeValuesSourceBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeValuesSourceBuilder.java @@ -55,6 +55,8 @@ /** * A {@link ValuesSource} builder for {@link CompositeAggregationBuilder} + * + * @opensearch.internal */ public abstract class CompositeValuesSourceBuilder> implements Writeable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeValuesSourceConfig.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeValuesSourceConfig.java index bcde67023b1ff..c85099976b297 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeValuesSourceConfig.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeValuesSourceConfig.java @@ -43,6 +43,11 @@ import java.util.function.LongConsumer; +/** + * Field configuration class for composite values + * + * @opensearch.internal + */ public class CompositeValuesSourceConfig { @FunctionalInterface diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeValuesSourceParserHelper.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeValuesSourceParserHelper.java index c1e64f57c10cc..60d7f277f7650 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeValuesSourceParserHelper.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/CompositeValuesSourceParserHelper.java @@ -50,6 +50,11 @@ import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +/** + * Helper class for obtaining values source parsers for different aggs + * + * @opensearch.internal + */ public class CompositeValuesSourceParserHelper { static , T> void declareValuesSourceFields(AbstractObjectParser objectParser) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/DateHistogramValuesSourceBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/DateHistogramValuesSourceBuilder.java index acab1790bfa21..ece8f506cbc4d 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/DateHistogramValuesSourceBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/DateHistogramValuesSourceBuilder.java @@ -69,6 +69,8 @@ /** * A {@link CompositeValuesSourceBuilder} that builds a {@link RoundingValuesSource} from a {@link Script} or * a field name using the provided interval. + * + * @opensearch.internal */ public class DateHistogramValuesSourceBuilder extends CompositeValuesSourceBuilder implements diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/DoubleValuesSource.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/DoubleValuesSource.java index fb94ff194b950..d05c78f540641 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/DoubleValuesSource.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/DoubleValuesSource.java @@ -50,6 +50,8 @@ /** * A {@link SingleDimensionValuesSource} for doubles. + * + * @opensearch.internal */ class DoubleValuesSource extends SingleDimensionValuesSource { private final CheckedFunction docValuesFunc; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/GeoTileGridValuesSourceBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/GeoTileGridValuesSourceBuilder.java index 5d47a44a26222..d4252d132ee12 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/GeoTileGridValuesSourceBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/GeoTileGridValuesSourceBuilder.java @@ -62,6 +62,11 @@ import java.util.function.LongConsumer; import java.util.function.LongUnaryOperator; +/** + * Builds values source for geotile_grid agg + * + * @opensearch.internal + */ public class GeoTileGridValuesSourceBuilder extends CompositeValuesSourceBuilder { @FunctionalInterface public interface GeoTileCompositeSuppier { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/GeoTileValuesSource.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/GeoTileValuesSource.java index 2daddc9647f44..819dfc573bbe4 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/GeoTileValuesSource.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/GeoTileValuesSource.java @@ -49,6 +49,8 @@ * * Since geotile values can be represented as long values, this class is almost the same as {@link LongValuesSource} * The main differences is {@link GeoTileValuesSource#setAfter(Comparable)} as it needs to accept geotile string values i.e. "zoom/x/y". + * + * @opensearch.internal */ class GeoTileValuesSource extends LongValuesSource { GeoTileValuesSource( diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/GlobalOrdinalValuesSource.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/GlobalOrdinalValuesSource.java index b4db4d8dd2a36..3e5c53d470f79 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/GlobalOrdinalValuesSource.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/GlobalOrdinalValuesSource.java @@ -54,6 +54,8 @@ /** * A {@link SingleDimensionValuesSource} for global ordinals. + * + * @opensearch.internal */ class GlobalOrdinalValuesSource extends SingleDimensionValuesSource { private final CheckedFunction docValuesFunc; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/HistogramValuesSource.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/HistogramValuesSource.java index 59625bc3300e5..d993578f757ad 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/HistogramValuesSource.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/HistogramValuesSource.java @@ -40,6 +40,11 @@ import java.io.IOException; +/** + * The values source for histogram agg + * + * @opensearch.internal + */ class HistogramValuesSource extends ValuesSource.Numeric { private final Numeric vs; private final double interval; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/HistogramValuesSourceBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/HistogramValuesSourceBuilder.java index 1f1ed3b6254ba..f087d2d0495dc 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/HistogramValuesSourceBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/HistogramValuesSourceBuilder.java @@ -57,6 +57,8 @@ /** * A {@link CompositeValuesSourceBuilder} that builds a {@link HistogramValuesSource} from another numeric values source * using the provided interval. + * + * @opensearch.internal */ public class HistogramValuesSourceBuilder extends CompositeValuesSourceBuilder { @FunctionalInterface diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/InternalComposite.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/InternalComposite.java index c102095d93184..8b28c1a7c5ae4 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/InternalComposite.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/InternalComposite.java @@ -58,6 +58,11 @@ import java.util.PriorityQueue; import java.util.Set; +/** + * Internal coordination class for composite aggs + * + * @opensearch.internal + */ public class InternalComposite extends InternalMultiBucketAggregation implements CompositeAggregation { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/LongValuesSource.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/LongValuesSource.java index 0ce147a138a96..a7ed50507288d 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/LongValuesSource.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/LongValuesSource.java @@ -63,6 +63,8 @@ /** * A {@link SingleDimensionValuesSource} for longs. + * + * @opensearch.internal */ class LongValuesSource extends SingleDimensionValuesSource { private final BigArrays bigArrays; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/ParsedComposite.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/ParsedComposite.java index 5cbda5dca130a..965dc42a1e011 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/ParsedComposite.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/ParsedComposite.java @@ -42,6 +42,11 @@ import java.util.List; import java.util.Map; +/** + * A composite result parsed between nodes + * + * @opensearch.internal + */ public class ParsedComposite extends ParsedMultiBucketAggregation implements CompositeAggregation { private static final ObjectParser PARSER = new ObjectParser<>( ParsedComposite.class.getSimpleName(), diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/PointsSortedDocsProducer.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/PointsSortedDocsProducer.java index 8dbb902b96186..3d6730203b6ae 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/PointsSortedDocsProducer.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/PointsSortedDocsProducer.java @@ -45,6 +45,8 @@ /** * A {@link SortedDocsProducer} that can sort documents based on numerics indexed in the provided field. + * + * @opensearch.internal */ class PointsSortedDocsProducer extends SortedDocsProducer { private final ToLongFunction bucketFunction; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/RoundingValuesSource.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/RoundingValuesSource.java index fc0dfe9a5a098..3c710a6e1d525 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/RoundingValuesSource.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/RoundingValuesSource.java @@ -44,6 +44,8 @@ /** * A wrapper for {@link ValuesSource.Numeric} that uses {@link Rounding} to transform the long values * produced by the underlying source. + * + * @opensearch.internal */ class RoundingValuesSource extends ValuesSource.Numeric { private final ValuesSource.Numeric vs; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/SingleDimensionValuesSource.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/SingleDimensionValuesSource.java index 94b108e863e3d..747a7017ec872 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/SingleDimensionValuesSource.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/SingleDimensionValuesSource.java @@ -50,6 +50,8 @@ /** * A source that can record and compare values of similar type. + * + * @opensearch.internal */ abstract class SingleDimensionValuesSource> implements Releasable { protected final BigArrays bigArrays; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/SortedDocsProducer.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/SortedDocsProducer.java index 9fe92c5f8d7fa..3cdbee6b119ec 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/SortedDocsProducer.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/SortedDocsProducer.java @@ -47,6 +47,8 @@ * A producer that visits composite buckets in the order of the value indexed in the leading source of the composite * definition. It can be used to control which documents should be collected to produce the top composite buckets * without visiting all documents in an index. + * + * @opensearch.internal */ abstract class SortedDocsProducer { protected final String field; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/TermsSortedDocsProducer.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/TermsSortedDocsProducer.java index c977ba3c7ecdb..89e7f4fae1321 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/TermsSortedDocsProducer.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/TermsSortedDocsProducer.java @@ -45,6 +45,8 @@ /** * A {@link SortedDocsProducer} that can sort documents based on terms indexed in the provided field. + * + * @opensearch.internal */ class TermsSortedDocsProducer extends SortedDocsProducer { TermsSortedDocsProducer(String field) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/TermsValuesSourceBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/TermsValuesSourceBuilder.java index c871e8d0c7d5b..ea1fc88e5cc32 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/TermsValuesSourceBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/composite/TermsValuesSourceBuilder.java @@ -58,6 +58,8 @@ /** * A {@link CompositeValuesSourceBuilder} that builds a {@link ValuesSource} from a {@link Script} or * a field name. + * + * @opensearch.internal */ public class TermsValuesSourceBuilder extends CompositeValuesSourceBuilder { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/Filter.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/Filter.java index 44ccea1204fdb..213e76f19c535 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/Filter.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/Filter.java @@ -35,5 +35,7 @@ /** * A {@code filter} aggregation. Defines a single bucket that holds all documents that match a specific filter. + * + * @opensearch.internal */ public interface Filter extends SingleBucketAggregation {} diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/FilterAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/FilterAggregationBuilder.java index 58c47fa3e5c5b..b1d829c33423b 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/FilterAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/FilterAggregationBuilder.java @@ -51,6 +51,11 @@ import static org.opensearch.index.query.AbstractQueryBuilder.parseInnerQueryBuilder; +/** + * Aggregation Builder for filter agg + * + * @opensearch.internal + */ public class FilterAggregationBuilder extends AbstractAggregationBuilder { public static final String NAME = "filter"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/FilterAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/FilterAggregator.java index 28bfb6071332c..0f73d3453b658 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/FilterAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/FilterAggregator.java @@ -51,6 +51,8 @@ /** * Aggregate all docs that match a filter. + * + * @opensearch.internal */ public class FilterAggregator extends BucketsAggregator implements SingleBucketAggregator { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/FilterAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/FilterAggregatorFactory.java index 07823f19e34b5..4ab573cf0a6b6 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/FilterAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/FilterAggregatorFactory.java @@ -48,6 +48,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Factory for filter agg + * + * @opensearch.internal + */ public class FilterAggregatorFactory extends AggregatorFactory { private Weight weight; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/Filters.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/Filters.java index b70cbd2586ebc..25153eb86d1d8 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/Filters.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/Filters.java @@ -39,6 +39,8 @@ /** * A multi bucket aggregation where the buckets are defined by a set of filters (a bucket per filter). Each bucket * will collect all documents matching its filter. + * + * @opensearch.internal */ public interface Filters extends MultiBucketsAggregation { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/FiltersAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/FiltersAggregationBuilder.java index a1a5d53bf2b30..cb491083fbf25 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/FiltersAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/FiltersAggregationBuilder.java @@ -59,6 +59,11 @@ import static org.opensearch.index.query.AbstractQueryBuilder.parseInnerQueryBuilder; +/** + * Aggregation Builder for filters agg + * + * @opensearch.internal + */ public class FiltersAggregationBuilder extends AbstractAggregationBuilder { public static final String NAME = "filters"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/FiltersAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/FiltersAggregator.java index e13a3c7557685..1b58d5372c5bf 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/FiltersAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/FiltersAggregator.java @@ -60,6 +60,11 @@ import java.util.Objects; import java.util.function.Supplier; +/** + * Aggregate all docs that match multiple filters. + * + * @opensearch.internal + */ public class FiltersAggregator extends BucketsAggregator { public static final ParseField FILTERS_FIELD = new ParseField("filters"); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/FiltersAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/FiltersAggregatorFactory.java index 50125c4cc50b0..8741213f98811 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/FiltersAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/FiltersAggregatorFactory.java @@ -49,6 +49,11 @@ import java.util.List; import java.util.Map; +/** + * Aggregation Factory for filters agg + * + * @opensearch.internal + */ public class FiltersAggregatorFactory extends AggregatorFactory { private final String[] keys; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/InternalFilter.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/InternalFilter.java index fc408366a8333..e3cf61a4ef816 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/InternalFilter.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/InternalFilter.java @@ -39,6 +39,11 @@ import java.io.IOException; import java.util.Map; +/** + * Implementation of filter agg + * + * @opensearch.internal + */ public class InternalFilter extends InternalSingleBucketAggregation implements Filter { InternalFilter(String name, long docCount, InternalAggregations subAggregations, Map metadata) { super(name, docCount, subAggregations, metadata); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/InternalFilters.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/InternalFilters.java index 3989400bb4958..ba7cb41f63abb 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/InternalFilters.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/InternalFilters.java @@ -47,6 +47,11 @@ import java.util.Map; import java.util.Objects; +/** + * Implementation of filters agg + * + * @opensearch.internal + */ public class InternalFilters extends InternalMultiBucketAggregation implements Filters { public static class InternalBucket extends InternalMultiBucketAggregation.InternalBucket implements Filters.Bucket { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/ParsedFilter.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/ParsedFilter.java index 1d922949d9983..b31df2cb178a2 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/ParsedFilter.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/ParsedFilter.java @@ -36,6 +36,11 @@ import java.io.IOException; +/** + * A filter agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedFilter extends ParsedSingleBucketAggregation implements Filter { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/ParsedFilters.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/ParsedFilters.java index bcecac0ac0350..0ac821b6c8a11 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/ParsedFilters.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/filter/ParsedFilters.java @@ -48,6 +48,11 @@ import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +/** + * A filters agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedFilters extends ParsedMultiBucketAggregation implements Filters { private Map bucketMap; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/BoundedCellValues.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/BoundedCellValues.java index cc4f5835cabf1..ba824fc8f21dd 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/BoundedCellValues.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/BoundedCellValues.java @@ -39,6 +39,8 @@ * according to whether they are within the specified {@link GeoBoundingBox}. * * The specified bounding box is assumed to be bounded. + * + * @opensearch.internal */ class BoundedCellValues extends CellValues { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/BucketPriorityQueue.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/BucketPriorityQueue.java index 3a8245a52adfc..d6cfde0c46eae 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/BucketPriorityQueue.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/BucketPriorityQueue.java @@ -33,6 +33,11 @@ import org.apache.lucene.util.PriorityQueue; +/** + * Internal priority queue for computing geogrid relations + * + * @opensearch.internal + */ class BucketPriorityQueue extends PriorityQueue { BucketPriorityQueue(int size) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/CellIdSource.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/CellIdSource.java index c9ea7696cd7f5..bf47fe218073b 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/CellIdSource.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/CellIdSource.java @@ -42,6 +42,8 @@ /** * Wrapper class to help convert {@link MultiGeoPointValues} * to numeric long values for bucketing. + * + * @opensearch.internal */ public class CellIdSource extends ValuesSource.Numeric { private final ValuesSource.GeoPoint valuesSource; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/CellValues.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/CellValues.java index 2e8344f203a39..9dc357659aae8 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/CellValues.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/CellValues.java @@ -40,6 +40,8 @@ * Class representing the long-encoded grid-cells belonging to * the geo-doc-values. Class must encode the values and then * sort them in order to account for the cells correctly. + * + * @opensearch.internal */ abstract class CellValues extends AbstractSortingNumericDocValues { private MultiGeoPointValues geoValues; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoGrid.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoGrid.java index 7521f9f58bd96..cfdb08f9ee3d7 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoGrid.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoGrid.java @@ -38,6 +38,8 @@ /** * A geo-grid aggregation. Defines multiple buckets, each representing a cell in a geo-grid of a specific * precision. + * + * @opensearch.internal */ public interface GeoGrid extends MultiBucketsAggregation { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoGridAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoGridAggregationBuilder.java index 5ec17c951d183..c235626e09a10 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoGridAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoGridAggregationBuilder.java @@ -57,6 +57,11 @@ import java.util.Objects; import java.util.function.Function; +/** + * Base Aggregation Builder for geohash_grid and geotile_grid aggs + * + * @opensearch.internal + */ public abstract class GeoGridAggregationBuilder extends ValuesSourceAggregationBuilder { /* recognized field names in JSON */ static final ParseField FIELD_PRECISION = new ParseField("precision"); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoGridAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoGridAggregator.java index 7eb05adf78e45..1ef8ba6c697f4 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoGridAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoGridAggregator.java @@ -54,6 +54,8 @@ /** * Aggregates data expressed as longs (for efficiency's sake) but formats results as aggregation-specific strings. + * + * @opensearch.internal */ public abstract class GeoGridAggregator extends BucketsAggregator { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoHashGridAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoHashGridAggregationBuilder.java index a1ae76eb034d0..4049bf2c73640 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoHashGridAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoHashGridAggregationBuilder.java @@ -48,6 +48,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Builder for geohash_grid + * + * @opensearch.internal + */ public class GeoHashGridAggregationBuilder extends GeoGridAggregationBuilder { public static final String NAME = "geohash_grid"; public static final int DEFAULT_PRECISION = 5; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoHashGridAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoHashGridAggregator.java index 74c8170458734..1106320c7431f 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoHashGridAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoHashGridAggregator.java @@ -44,6 +44,8 @@ /** * Aggregates data expressed as GeoHash longs (for efficiency's sake) but formats results as Geohash strings. + * + * @opensearch.internal */ public class GeoHashGridAggregator extends GeoGridAggregator { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoHashGridAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoHashGridAggregatorFactory.java index a52ee2018fdfe..cdc801aaedffb 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoHashGridAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoHashGridAggregatorFactory.java @@ -53,6 +53,11 @@ import static java.util.Collections.emptyList; +/** + * Aggregation Factory for geohash_grid agg + * + * @opensearch.internal + */ public class GeoHashGridAggregatorFactory extends ValuesSourceAggregatorFactory { private final int precision; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoTileGridAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoTileGridAggregationBuilder.java index 6828077cd4778..f73360e3cb826 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoTileGridAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoTileGridAggregationBuilder.java @@ -47,6 +47,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Builder for geotile_grid agg + * + * @opensearch.internal + */ public class GeoTileGridAggregationBuilder extends GeoGridAggregationBuilder { public static final String NAME = "geotile_grid"; public static final int DEFAULT_PRECISION = 7; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoTileGridAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoTileGridAggregator.java index 390f613686272..7a2b908148c4c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoTileGridAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoTileGridAggregator.java @@ -45,6 +45,8 @@ /** * Aggregates data expressed as geotile longs (for efficiency's sake) but formats results as geotile strings. + * + * @opensearch.internal */ public class GeoTileGridAggregator extends GeoGridAggregator { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoTileGridAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoTileGridAggregatorFactory.java index 616451474abc4..ef8cd11a22498 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoTileGridAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoTileGridAggregatorFactory.java @@ -51,6 +51,11 @@ import java.util.Collections; import java.util.Map; +/** + * Aggregation Factory for geo_tile grid agg + * + * @opensearch.internal + */ public class GeoTileGridAggregatorFactory extends ValuesSourceAggregatorFactory { private final int precision; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoTileUtils.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoTileUtils.java index d520cc995bbfb..5498b2b1a7109 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoTileUtils.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/GeoTileUtils.java @@ -54,6 +54,8 @@ * bits 58..63 -- zoom (0..29) * bits 29..57 -- X tile index (0..2^zoom) * bits 0..28 -- Y tile index (0..2^zoom) + * + * @opensearch.internal */ public final class GeoTileUtils { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/InternalGeoGrid.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/InternalGeoGrid.java index e7fed7c735b25..94a5ad5717854 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/InternalGeoGrid.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/InternalGeoGrid.java @@ -53,6 +53,8 @@ * Represents a grid of cells where each cell's location is determined by a specific geo hashing algorithm. * All geo-grid hash-encoding in a grid are of the same precision and held internally as a single long * for efficiency's sake. + * + * @opensearch.internal */ public abstract class InternalGeoGrid extends InternalMultiBucketAggregation< InternalGeoGrid, diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/InternalGeoGridBucket.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/InternalGeoGridBucket.java index 0ddfed84fbe99..a187bfefb661f 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/InternalGeoGridBucket.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/InternalGeoGridBucket.java @@ -42,6 +42,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Base implementation of geogrid aggs + * + * @opensearch.internal + */ public abstract class InternalGeoGridBucket extends InternalMultiBucketAggregation.InternalBucket implements GeoGrid.Bucket, diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/InternalGeoHashGrid.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/InternalGeoHashGrid.java index bae4f99d3bb5b..7811b8774d04f 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/InternalGeoHashGrid.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/InternalGeoHashGrid.java @@ -42,6 +42,8 @@ * Represents a grid of cells where each cell's location is determined by a geohash. * All geohashes in a grid are of the same precision and held internally as a single long * for efficiency's sake. + * + * @opensearch.internal */ public class InternalGeoHashGrid extends InternalGeoGrid { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/InternalGeoHashGridBucket.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/InternalGeoHashGridBucket.java index a5bead1f17280..f9c45dc41ceb1 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/InternalGeoHashGridBucket.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/InternalGeoHashGridBucket.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Implementation of geohash grid bucket + * + * @opensearch.internal + */ public class InternalGeoHashGridBucket extends InternalGeoGridBucket { InternalGeoHashGridBucket(long hashAsLong, long docCount, InternalAggregations aggregations) { super(hashAsLong, docCount, aggregations); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/InternalGeoTileGrid.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/InternalGeoTileGrid.java index d7ff2c0a2cd33..efbd9a05d6a4d 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/InternalGeoTileGrid.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/InternalGeoTileGrid.java @@ -42,6 +42,8 @@ * Represents a grid of cells where each cell's location is determined by a geohash. * All geohashes in a grid are of the same precision and held internally as a single long * for efficiency's sake. + * + * @opensearch.internal */ public class InternalGeoTileGrid extends InternalGeoGrid { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/InternalGeoTileGridBucket.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/InternalGeoTileGridBucket.java index b08ef55a71f5b..f200f55232e00 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/InternalGeoTileGridBucket.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/InternalGeoTileGridBucket.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Implementation of geotile grid bucket + * + * @opensearch.internal + */ public class InternalGeoTileGridBucket extends InternalGeoGridBucket { InternalGeoTileGridBucket(long hashAsLong, long docCount, InternalAggregations aggregations) { super(hashAsLong, docCount, aggregations); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/ParsedGeoGrid.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/ParsedGeoGrid.java index 59681a52b1c01..3f85cf350c89c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/ParsedGeoGrid.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/ParsedGeoGrid.java @@ -41,6 +41,11 @@ import java.util.List; import java.util.function.Supplier; +/** + * A geo grid result parsed between nodes + * + * @opensearch.internal + */ public abstract class ParsedGeoGrid extends ParsedMultiBucketAggregation implements GeoGrid { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/ParsedGeoGridBucket.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/ParsedGeoGridBucket.java index f09eb46fd8a48..08e5c15188ee6 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/ParsedGeoGridBucket.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/ParsedGeoGridBucket.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * A single geo grid bucket result parsed between nodes + * + * @opensearch.internal + */ public abstract class ParsedGeoGridBucket extends ParsedMultiBucketAggregation.ParsedBucket implements GeoGrid.Bucket { protected String hashAsString; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/ParsedGeoHashGrid.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/ParsedGeoHashGrid.java index 189bfb4b58c92..f20f972c1ce0a 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/ParsedGeoHashGrid.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/ParsedGeoHashGrid.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * A geohash grid result parsed between nodes + * + * @opensearch.internal + */ public class ParsedGeoHashGrid extends ParsedGeoGrid { private static final ObjectParser PARSER = createParser( diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/ParsedGeoHashGridBucket.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/ParsedGeoHashGridBucket.java index 3ed6cfe41ba77..05c7a1c8d1663 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/ParsedGeoHashGridBucket.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/ParsedGeoHashGridBucket.java @@ -36,6 +36,11 @@ import java.io.IOException; +/** + * A single geohash grid bucket result parsed between nodes + * + * @opensearch.internal + */ public class ParsedGeoHashGridBucket extends ParsedGeoGridBucket { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/ParsedGeoTileGrid.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/ParsedGeoTileGrid.java index 011fe2c9102c7..06915cc4210e1 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/ParsedGeoTileGrid.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/ParsedGeoTileGrid.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * A geotile grid result parsed between nodes + * + * @opensearch.internal + */ public class ParsedGeoTileGrid extends ParsedGeoGrid { private static final ObjectParser PARSER = createParser( diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/ParsedGeoTileGridBucket.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/ParsedGeoTileGridBucket.java index 5b2bdd163d8f2..c8dec16f322ef 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/ParsedGeoTileGridBucket.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/ParsedGeoTileGridBucket.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * A single geotile grid bucket result parsed between nodes + * + * @opensearch.internal + */ public class ParsedGeoTileGridBucket extends ParsedGeoGridBucket { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/UnboundedCellValues.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/UnboundedCellValues.java index 7dd7f155fb46e..f5a139cdb8d9d 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/UnboundedCellValues.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/geogrid/UnboundedCellValues.java @@ -37,6 +37,8 @@ /** * Class representing {@link CellValues} that are unbounded by any * {@link GeoBoundingBox}. + * + * @opensearch.internal */ class UnboundedCellValues extends CellValues { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/global/Global.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/global/Global.java index 4a5a484ea7565..9481d134adcb5 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/global/Global.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/global/Global.java @@ -35,5 +35,7 @@ /** * A {@code global} aggregation. Defines a single bucket the holds all the documents in the search context. + * + * @opensearch.internal */ public interface Global extends SingleBucketAggregation {} diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/global/GlobalAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/global/GlobalAggregationBuilder.java index ad3498043c538..2e8105b569afe 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/global/GlobalAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/global/GlobalAggregationBuilder.java @@ -45,6 +45,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Builder for global agg + * + * @opensearch.internal + */ public class GlobalAggregationBuilder extends AbstractAggregationBuilder { public static GlobalAggregationBuilder parse(XContentParser parser, String aggregationName) throws IOException { parser.nextToken(); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/global/GlobalAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/global/GlobalAggregator.java index 7b3c9399225ae..96cf8f8f7664a 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/global/GlobalAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/global/GlobalAggregator.java @@ -44,6 +44,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregate all docs from the global search scope. + * + * @opensearch.internal + */ public class GlobalAggregator extends BucketsAggregator implements SingleBucketAggregator { public GlobalAggregator(String name, AggregatorFactories subFactories, SearchContext aggregationContext, Map metadata) diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/global/GlobalAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/global/GlobalAggregatorFactory.java index 102e1befb0822..419ae9f16d9e6 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/global/GlobalAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/global/GlobalAggregatorFactory.java @@ -43,6 +43,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Factory for global agg + * + * @opensearch.internal + */ public class GlobalAggregatorFactory extends AggregatorFactory { public GlobalAggregatorFactory( diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/global/InternalGlobal.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/global/InternalGlobal.java index 20f49e4ce00df..68e4f1d4e2c10 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/global/InternalGlobal.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/global/InternalGlobal.java @@ -41,6 +41,8 @@ /** * A global scope get (the document set on which we aggregate is all documents in the search context (ie. index + type) * regardless the query. + * + * @opensearch.internal */ public class InternalGlobal extends InternalSingleBucketAggregation implements Global { InternalGlobal(String name, long docCount, InternalAggregations aggregations, Map metadata) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/global/ParsedGlobal.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/global/ParsedGlobal.java index 2e97e76ad3e28..ae96e509b3998 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/global/ParsedGlobal.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/global/ParsedGlobal.java @@ -36,6 +36,11 @@ import java.io.IOException; +/** + * A global agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedGlobal extends ParsedSingleBucketAggregation implements Global { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AbstractHistogramAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AbstractHistogramAggregator.java index adf3d973a2621..d3a4a51e5b6f2 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AbstractHistogramAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AbstractHistogramAggregator.java @@ -55,6 +55,8 @@ /** * Base class for functionality shared between aggregators for this * {@code histogram} aggregation. + * + * @opensearch.internal */ public abstract class AbstractHistogramAggregator extends BucketsAggregator { protected final DocValueFormat formatter; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregationBuilder.java index a9f5339ad4fdb..9321617174400 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregationBuilder.java @@ -60,6 +60,11 @@ import java.util.Map; import java.util.Objects; +/** + * Aggregation Builder for auto_gate_histogram agg + * + * @opensearch.internal + */ public class AutoDateHistogramAggregationBuilder extends ValuesSourceAggregationBuilder { public static final String NAME = "auto_date_histogram"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregator.java index 76812334ff235..587e838568046 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregator.java @@ -76,6 +76,8 @@ * standpoint but the simpler implementation is between 7% and 15% faster * when you can use it. This is an important aggregation and we need that * performance. + * + * @opensearch.internal */ abstract class AutoDateHistogramAggregator extends DeferableBucketAggregator { static AutoDateHistogramAggregator build( diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregatorFactory.java index 3cb2a3a7d0962..7434ef84ee92f 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregatorFactory.java @@ -50,6 +50,11 @@ import java.util.Map; import java.util.function.Function; +/** + * Aggregation Factory for auto_date_histogram + * + * @opensearch.internal + */ public final class AutoDateHistogramAggregatorFactory extends ValuesSourceAggregatorFactory { public static void registerAggregators(ValuesSourceRegistry.Builder builder) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregatorSupplier.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregatorSupplier.java index fe48c4ba95307..a9b62019bdeb5 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregatorSupplier.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/AutoDateHistogramAggregatorSupplier.java @@ -44,6 +44,11 @@ import java.util.Map; import java.util.function.Function; +/** + * Aggregator supplier interface for auto_date_histogram agg + * + * @opensearch.internal + */ @FunctionalInterface public interface AutoDateHistogramAggregatorSupplier { Aggregator build( diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateHistogramAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateHistogramAggregationBuilder.java index c416f6657b9ea..f8952ddca4cc3 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateHistogramAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateHistogramAggregationBuilder.java @@ -65,6 +65,8 @@ /** * A builder for histograms on date fields. + * + * @opensearch.internal */ public class DateHistogramAggregationBuilder extends ValuesSourceAggregationBuilder implements diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateHistogramAggregationSupplier.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateHistogramAggregationSupplier.java index dab69e86e4173..146eeedfbe933 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateHistogramAggregationSupplier.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateHistogramAggregationSupplier.java @@ -44,6 +44,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregator supplier interface for date_histogram agg + * + * @opensearch.internal + */ @FunctionalInterface public interface DateHistogramAggregationSupplier { Aggregator build( diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateHistogramAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateHistogramAggregator.java index d243c46a7a136..295dfec639de6 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateHistogramAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateHistogramAggregator.java @@ -62,6 +62,8 @@ * {@link Rounding}. * * @see Rounding + * + * @opensearch.internal */ class DateHistogramAggregator extends BucketsAggregator implements SizedBucketAggregator { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateHistogramAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateHistogramAggregatorFactory.java index 900262aaa10a2..eb22a857643c4 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateHistogramAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateHistogramAggregatorFactory.java @@ -49,6 +49,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Factory for date_histogram agg + * + * @opensearch.internal + */ public final class DateHistogramAggregatorFactory extends ValuesSourceAggregatorFactory { public static void registerAggregators(ValuesSourceRegistry.Builder builder) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateHistogramInterval.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateHistogramInterval.java index f3d3a56785931..c5ef4e7a075f5 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateHistogramInterval.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateHistogramInterval.java @@ -46,6 +46,8 @@ /** * The interval the date histogram is based on. + * + * @opensearch.internal */ public class DateHistogramInterval implements Writeable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateIntervalConsumer.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateIntervalConsumer.java index 79581fd31375c..a2c63cf25c0c2 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateIntervalConsumer.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateIntervalConsumer.java @@ -37,6 +37,8 @@ * * Provides definitions for the new fixed and calendar intervals, and deprecated * defintions for the old interval/dateHisto interval parameters + * + * @opensearch.internal */ public interface DateIntervalConsumer { @Deprecated diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateIntervalWrapper.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateIntervalWrapper.java index fb1287ac1716c..6c187f7924a19 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateIntervalWrapper.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateIntervalWrapper.java @@ -64,6 +64,8 @@ * After the deprecated parameters are removed, this class can be simplified greatly. The legacy options * will be removed, and the mutual-exclusion checks can be done in the setters directly removing the need * for the enum and the complicated "state machine" logic + * + * @opensearch.internal */ public class DateIntervalWrapper implements ToXContentFragment, Writeable { private static final DeprecationLogger DEPRECATION_LOGGER = DeprecationLogger.getLogger(DateHistogramAggregationBuilder.class); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateRangeHistogramAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateRangeHistogramAggregator.java index d81ac0ae44ac8..f70a5bb537300 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateRangeHistogramAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DateRangeHistogramAggregator.java @@ -69,6 +69,8 @@ * {@link Rounding}. * * @see Rounding + * + * @opensearch.internal */ class DateRangeHistogramAggregator extends BucketsAggregator { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DoubleBounds.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DoubleBounds.java index a822976517910..c2e44c55c3950 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DoubleBounds.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/DoubleBounds.java @@ -52,6 +52,8 @@ * * This class is similar to {@link LongBounds} used in date histograms, but is using longs to store data. LongBounds and DoubleBounds are * not used interchangeably and therefore don't share any common interfaces except for serialization. + * + * @opensearch.internal */ public class DoubleBounds implements ToXContentFragment, Writeable { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/Histogram.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/Histogram.java index 85c53243f41a4..0d9eb9b82dd34 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/Histogram.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/Histogram.java @@ -38,6 +38,8 @@ /** * A {@code histogram} aggregation. Defines multiple buckets, each representing an interval in a histogram. + * + * @opensearch.internal */ public interface Histogram extends MultiBucketsAggregation { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/HistogramAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/HistogramAggregationBuilder.java index 1ca2988a3e7c0..ceb7709907057 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/HistogramAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/HistogramAggregationBuilder.java @@ -60,6 +60,8 @@ /** * A builder for histograms on numeric fields. This builder can operate on either base numeric fields, or numeric range fields. IP range * fields are unsupported, and will throw at the factory layer. + * + * @opensearch.internal */ public class HistogramAggregationBuilder extends ValuesSourceAggregationBuilder { public static final String NAME = "histogram"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/HistogramAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/HistogramAggregatorFactory.java index 4978998e0824b..722bf87201631 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/HistogramAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/HistogramAggregatorFactory.java @@ -51,6 +51,8 @@ /** * Constructs the per-shard aggregator instance for histogram aggregation. Selects the numeric or range field implementation based on the * field type. + * + * @opensearch.internal */ public final class HistogramAggregatorFactory extends ValuesSourceAggregatorFactory { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/HistogramAggregatorSupplier.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/HistogramAggregatorSupplier.java index 68af0b10c122d..4462605209775 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/HistogramAggregatorSupplier.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/HistogramAggregatorSupplier.java @@ -41,6 +41,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregator supplier interface for histogram aggs + * + * @opensearch.internal + */ public interface HistogramAggregatorSupplier { Aggregator build( String name, diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/HistogramFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/HistogramFactory.java index d5566f540b5d2..4488b5bd2206e 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/HistogramFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/HistogramFactory.java @@ -38,7 +38,11 @@ import java.util.List; -/** Implemented by histogram aggregations and used by pipeline aggregations to insert buckets. */ +/** + * Implemented by histogram aggregations and used by pipeline aggregations to insert buckets. + * + * @opensearch.internal + */ // public so that pipeline aggs can use this API: can we fix it? public interface HistogramFactory { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalAutoDateHistogram.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalAutoDateHistogram.java index 83cd22934ab87..55ef48211bcb4 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalAutoDateHistogram.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalAutoDateHistogram.java @@ -59,6 +59,8 @@ /** * Implementation of {@link Histogram}. + * + * @opensearch.internal */ public final class InternalAutoDateHistogram extends InternalMultiBucketAggregation< InternalAutoDateHistogram, diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalDateHistogram.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalDateHistogram.java index 9f26242e203a9..068d6533c59b3 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalDateHistogram.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalDateHistogram.java @@ -60,6 +60,8 @@ /** * Implementation of {@link Histogram}. + * + * @opensearch.internal */ public final class InternalDateHistogram extends InternalMultiBucketAggregation implements diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalHistogram.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalHistogram.java index 98e1aadd8c100..c11f483392c25 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalHistogram.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalHistogram.java @@ -57,6 +57,8 @@ /** * Implementation of {@link Histogram}. + * + * @opensearch.internal */ public final class InternalHistogram extends InternalMultiBucketAggregation implements diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalVariableWidthHistogram.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalVariableWidthHistogram.java index 5a103771356d3..ec4be47e4a62f 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalVariableWidthHistogram.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/InternalVariableWidthHistogram.java @@ -53,6 +53,11 @@ import java.util.Map; import java.util.Objects; +/** + * Aggregator supplier interface for an internal variable width histogram agg + * + * @opensearch.internal + */ public class InternalVariableWidthHistogram extends InternalMultiBucketAggregation< InternalVariableWidthHistogram, InternalVariableWidthHistogram.Bucket> implements Histogram, HistogramFactory { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/LongBounds.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/LongBounds.java index 5e8087ef53e0e..ad287a158dba3 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/LongBounds.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/LongBounds.java @@ -57,6 +57,8 @@ * * This class is similar to {@link DoubleBounds} used in histograms, but is using longs to store data. LongBounds and DoubleBounds are * * not used interchangeably and therefore don't share any common interfaces except for serialization. + * + * @opensearch.internal */ public class LongBounds implements ToXContentFragment, Writeable { static final ParseField MIN_FIELD = new ParseField("min"); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/NumericHistogramAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/NumericHistogramAggregator.java index e6cddafc086a7..1cd44be431964 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/NumericHistogramAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/NumericHistogramAggregator.java @@ -53,6 +53,8 @@ * {@code offset} and {@code value}, it returns the highest number that can be * written as {@code interval * x + offset} and yet is less than or equal to * {@code value}. + * + * @opensearch.internal */ public class NumericHistogramAggregator extends AbstractHistogramAggregator { private final ValuesSource.Numeric valuesSource; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedAutoDateHistogram.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedAutoDateHistogram.java index 671f2700ace36..83f776d34a17e 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedAutoDateHistogram.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedAutoDateHistogram.java @@ -43,6 +43,11 @@ import java.time.ZoneOffset; import java.util.List; +/** + * A auto date histogram result parsed between nodes + * + * @opensearch.internal + */ public class ParsedAutoDateHistogram extends ParsedMultiBucketAggregation implements Histogram { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedDateHistogram.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedDateHistogram.java index efb681130ee66..248f41f213031 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedDateHistogram.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedDateHistogram.java @@ -42,6 +42,11 @@ import java.time.ZoneOffset; import java.util.List; +/** + * A date histogram result parsed between nodes + * + * @opensearch.internal + */ public class ParsedDateHistogram extends ParsedMultiBucketAggregation implements Histogram { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedHistogram.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedHistogram.java index 354c95efa98f9..1cc7865d22f45 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedHistogram.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedHistogram.java @@ -39,6 +39,11 @@ import java.io.IOException; import java.util.List; +/** + * A histogram result parsed between nodes + * + * @opensearch.internal + */ public class ParsedHistogram extends ParsedMultiBucketAggregation implements Histogram { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedVariableWidthHistogram.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedVariableWidthHistogram.java index 727e34d3e7608..c03221af74c15 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedVariableWidthHistogram.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/ParsedVariableWidthHistogram.java @@ -46,6 +46,11 @@ import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +/** + * A variable width histogram result parsed between nodes + * + * @opensearch.internal + */ public class ParsedVariableWidthHistogram extends ParsedMultiBucketAggregation implements Histogram { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/RangeHistogramAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/RangeHistogramAggregator.java index 919815c988fcc..fe77033f5a287 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/RangeHistogramAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/RangeHistogramAggregator.java @@ -51,6 +51,11 @@ import java.util.List; import java.util.Map; +/** + * Aggregate all docs that match a given range + * + * @opensearch.internal + */ public class RangeHistogramAggregator extends AbstractHistogramAggregator { private final ValuesSource.Range valuesSource; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/SizedBucketAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/SizedBucketAggregator.java index 21b085e297322..cfa154a6e9018 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/SizedBucketAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/SizedBucketAggregator.java @@ -36,6 +36,8 @@ /** * An aggregator capable of reporting bucket sizes in milliseconds. Used by RateAggregator for calendar-based buckets. + * + * @opensearch.internal */ public interface SizedBucketAggregator { double bucketSize(long bucket, Rounding.DateTimeUnit unit); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/SizedBucketAggregatorBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/SizedBucketAggregatorBuilder.java index 9edb76443f9a4..a87de32d0e18b 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/SizedBucketAggregatorBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/SizedBucketAggregatorBuilder.java @@ -36,6 +36,8 @@ /** * An aggregator capable of reporting bucket sizes in milliseconds. Used by RateAggregator for calendar-based buckets. + * + * @opensearch.internal */ public interface SizedBucketAggregatorBuilder { double calendarDivider(TimeUnit timeUnit); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/VariableWidthHistogramAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/VariableWidthHistogramAggregationBuilder.java index 169d219e76c42..55b3903efa349 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/VariableWidthHistogramAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/VariableWidthHistogramAggregationBuilder.java @@ -55,6 +55,11 @@ import java.util.Map; import java.util.Objects; +/** + * Aggregation Builder for variable_width_histogram agg + * + * @opensearch.internal + */ public class VariableWidthHistogramAggregationBuilder extends ValuesSourceAggregationBuilder { public static final String NAME = "variable_width_histogram"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/VariableWidthHistogramAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/VariableWidthHistogramAggregator.java index 2dc9d50e10015..11ff7dbc407cb 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/VariableWidthHistogramAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/VariableWidthHistogramAggregator.java @@ -66,6 +66,11 @@ import java.util.function.Function; import java.util.function.LongUnaryOperator; +/** + * Aggregate all docs that match variable width buckets. + * + * @opensearch.internal + */ public class VariableWidthHistogramAggregator extends DeferableBucketAggregator { /** diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/VariableWidthHistogramAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/VariableWidthHistogramAggregatorFactory.java index 644c41cc6f534..d9d9a74eb958f 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/VariableWidthHistogramAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/VariableWidthHistogramAggregatorFactory.java @@ -46,6 +46,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Factory for variable_width_histogram + * + * @opensearch.internal + */ public class VariableWidthHistogramAggregatorFactory extends ValuesSourceAggregatorFactory { public static void registerAggregators(ValuesSourceRegistry.Builder builder) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/VariableWidthHistogramAggregatorSupplier.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/VariableWidthHistogramAggregatorSupplier.java index 80936ef0c27dc..153d7f1df7b41 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/VariableWidthHistogramAggregatorSupplier.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/histogram/VariableWidthHistogramAggregatorSupplier.java @@ -41,6 +41,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregator supplier interface for variable_width_histogram agg + * + * @opensearch.internal + */ @FunctionalInterface public interface VariableWidthHistogramAggregatorSupplier { Aggregator build( diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/Missing.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/Missing.java index 3f2a4197680e8..9918ae1f4b384 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/Missing.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/Missing.java @@ -35,5 +35,7 @@ /** * A {@code missing} aggregation. Defines a single bucket of all documents that are missing a specific field. + * + * @opensearch.internal */ public interface Missing extends SingleBucketAggregation {} diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/MissingAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/MissingAggregationBuilder.java index 75a74a02d3d4d..b322b13bb33a0 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/MissingAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/MissingAggregationBuilder.java @@ -51,6 +51,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Builder for missing agg + * + * @opensearch.internal + */ public class MissingAggregationBuilder extends ValuesSourceAggregationBuilder { public static final String NAME = "missing"; public static final ValuesSourceRegistry.RegistryKey REGISTRY_KEY = new ValuesSourceRegistry.RegistryKey<>( diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/MissingAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/MissingAggregator.java index f189c3cf5e111..5f7b4b5a91e44 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/MissingAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/MissingAggregator.java @@ -48,6 +48,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregate all docs that are missing a value. + * + * @opensearch.internal + */ public class MissingAggregator extends BucketsAggregator implements SingleBucketAggregator { private final ValuesSource valuesSource; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/MissingAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/MissingAggregatorFactory.java index 37b3f784e8715..cfa2bd3f7097c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/MissingAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/MissingAggregatorFactory.java @@ -46,6 +46,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Factory for missing agg + * + * @opensearch.internal + */ public class MissingAggregatorFactory extends ValuesSourceAggregatorFactory { public static void registerAggregators(ValuesSourceRegistry.Builder builder) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/MissingAggregatorSupplier.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/MissingAggregatorSupplier.java index 6b273514bb649..f9d99b1c7223a 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/MissingAggregatorSupplier.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/MissingAggregatorSupplier.java @@ -41,6 +41,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregator supplier interface for missing agg + * + * @opensearch.internal + */ @FunctionalInterface public interface MissingAggregatorSupplier { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/MissingOrder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/MissingOrder.java index 06086f507f665..b0b987065c647 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/MissingOrder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/MissingOrder.java @@ -18,6 +18,8 @@ /** * Composite Aggregation Missing bucket order. + * + * @opensearch.internal */ public enum MissingOrder implements Writeable { /** diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/ParsedMissing.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/ParsedMissing.java index 1a4a88e69754f..81a57818a0d0a 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/ParsedMissing.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/missing/ParsedMissing.java @@ -36,6 +36,11 @@ import java.io.IOException; +/** + * A missing agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedMissing extends ParsedSingleBucketAggregation implements Missing { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/InternalNested.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/InternalNested.java index a90134ebb8756..c3346c66d1733 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/InternalNested.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/InternalNested.java @@ -40,6 +40,8 @@ /** * Result of the {@link NestedAggregator}. + * + * @opensearch.internal */ public class InternalNested extends InternalSingleBucketAggregation implements Nested { InternalNested(String name, long docCount, InternalAggregations aggregations, Map metadata) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/InternalReverseNested.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/InternalReverseNested.java index 1754a856b7a26..95b4714bdba9b 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/InternalReverseNested.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/InternalReverseNested.java @@ -40,6 +40,8 @@ /** * Result of the {@link ReverseNestedAggregator}. + * + * @opensearch.internal */ public class InternalReverseNested extends InternalSingleBucketAggregation implements ReverseNested { public InternalReverseNested(String name, long docCount, InternalAggregations aggregations, Map metadata) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/Nested.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/Nested.java index 9e3775bb095a9..e5d52e9e01e5b 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/Nested.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/Nested.java @@ -35,5 +35,7 @@ /** * A {@code nested} aggregation. Defines a single bucket that holds all the nested documents of a specific path. + * + * @opensearch.internal */ public interface Nested extends SingleBucketAggregation {} diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/NestedAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/NestedAggregationBuilder.java index 385ce67ffefa7..b99336de16997 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/NestedAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/NestedAggregationBuilder.java @@ -49,6 +49,11 @@ import java.util.Map; import java.util.Objects; +/** + * Aggregation Builder for nested agg + * + * @opensearch.internal + */ public class NestedAggregationBuilder extends AbstractAggregationBuilder { public static final String NAME = "nested"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/NestedAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/NestedAggregator.java index a003f1380253b..dc536aebc0cde 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/NestedAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/NestedAggregator.java @@ -60,6 +60,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregate all docs that match a nested path + * + * @opensearch.internal + */ public class NestedAggregator extends BucketsAggregator implements SingleBucketAggregator { static final ParseField PATH_FIELD = new ParseField("path"); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/NestedAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/NestedAggregatorFactory.java index 0102d1724351c..22b87280c8534 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/NestedAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/NestedAggregatorFactory.java @@ -45,6 +45,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Factory for nested agg + * + * @opensearch.internal + */ public class NestedAggregatorFactory extends AggregatorFactory { private final ObjectMapper parentObjectMapper; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/ParsedNested.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/ParsedNested.java index 01e7593ecb95c..abf069c662d3c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/ParsedNested.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/ParsedNested.java @@ -36,6 +36,11 @@ import java.io.IOException; +/** + * A nested agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedNested extends ParsedSingleBucketAggregation implements Nested { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/ParsedReverseNested.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/ParsedReverseNested.java index 66a789f4c35d2..cd0cf8cb97106 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/ParsedReverseNested.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/ParsedReverseNested.java @@ -36,6 +36,11 @@ import java.io.IOException; +/** + * A reverse nested agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedReverseNested extends ParsedSingleBucketAggregation implements ReverseNested { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/ReverseNested.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/ReverseNested.java index 871c185d50210..1bc2383573e6c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/ReverseNested.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/ReverseNested.java @@ -36,5 +36,7 @@ /** * A {@code reverse nested} aggregation. Defines a single bucket that holds all the parent documents for a specific nested path. + * + * @opensearch.internal */ public interface ReverseNested extends SingleBucketAggregation {} diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/ReverseNestedAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/ReverseNestedAggregationBuilder.java index 72854b36f2167..42105ebc71af0 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/ReverseNestedAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/ReverseNestedAggregationBuilder.java @@ -50,6 +50,11 @@ import java.util.Map; import java.util.Objects; +/** + * Aggregation Builder for reverse_nested agg + * + * @opensearch.internal + */ public class ReverseNestedAggregationBuilder extends AbstractAggregationBuilder { public static final String NAME = "reverse_nested"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/ReverseNestedAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/ReverseNestedAggregator.java index 689304215e9c7..0513e9235e3b0 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/ReverseNestedAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/ReverseNestedAggregator.java @@ -53,6 +53,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregates documents that match a nested path. + * + * @opensearch.internal + */ public class ReverseNestedAggregator extends BucketsAggregator implements SingleBucketAggregator { static final ParseField PATH_FIELD = new ParseField("path"); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/ReverseNestedAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/ReverseNestedAggregatorFactory.java index 202645c8638ab..2929df697ea58 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/ReverseNestedAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/nested/ReverseNestedAggregatorFactory.java @@ -45,6 +45,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Factory for reverse_nested agg + * + * @opensearch.internal + */ public class ReverseNestedAggregatorFactory extends AggregatorFactory { private final boolean unmapped; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/AbstractRangeAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/AbstractRangeAggregatorFactory.java index 973ef10881e68..90ae2e994caf1 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/AbstractRangeAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/AbstractRangeAggregatorFactory.java @@ -49,6 +49,11 @@ import java.io.IOException; import java.util.Map; +/** + * Base Aggregation Factory for range aggs + * + * @opensearch.internal + */ public class AbstractRangeAggregatorFactory extends ValuesSourceAggregatorFactory { private final InternalRange.Factory rangeFactory; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/AbstractRangeBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/AbstractRangeBuilder.java index 083d80bba4efe..b6d709d319698 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/AbstractRangeBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/AbstractRangeBuilder.java @@ -49,6 +49,11 @@ import java.util.Objects; import java.util.function.Function; +/** + * Base Aggregation Builder for range aggs + * + * @opensearch.internal + */ public abstract class AbstractRangeBuilder, R extends Range> extends ValuesSourceAggregationBuilder< AB> { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/BinaryRangeAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/BinaryRangeAggregator.java index c4b4728db5364..c846ba6c48b20 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/BinaryRangeAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/BinaryRangeAggregator.java @@ -55,7 +55,11 @@ import static java.util.Collections.emptyList; -/** A range aggregator for values that are stored in SORTED_SET doc values. */ +/** + * A range aggregator for values that are stored in SORTED_SET doc values. + * + * @opensearch.internal + */ public final class BinaryRangeAggregator extends BucketsAggregator { public static class Range { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/BinaryRangeAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/BinaryRangeAggregatorFactory.java index d1cadb9b9ec99..0ee440ecc8487 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/BinaryRangeAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/BinaryRangeAggregatorFactory.java @@ -46,6 +46,11 @@ import java.util.List; import java.util.Map; +/** + * Aggregation Factory for binary_range + * + * @opensearch.internal + */ public class BinaryRangeAggregatorFactory extends ValuesSourceAggregatorFactory { public static void registerAggregators(ValuesSourceRegistry.Builder builder) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/DateRangeAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/DateRangeAggregationBuilder.java index bf0d012be55bb..76b9370be4626 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/DateRangeAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/DateRangeAggregationBuilder.java @@ -49,6 +49,11 @@ import java.time.ZonedDateTime; import java.util.Map; +/** + * Aggregation Builder for date_range agg + * + * @opensearch.internal + */ public class DateRangeAggregationBuilder extends AbstractRangeBuilder { public static final String NAME = "date_range"; public static final ValuesSourceRegistry.RegistryKey REGISTRY_KEY = new ValuesSourceRegistry.RegistryKey<>( diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/DateRangeAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/DateRangeAggregatorFactory.java index c9d9eb39ff9ba..d243a89c632d7 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/DateRangeAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/DateRangeAggregatorFactory.java @@ -40,6 +40,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Factory for date_range agg + * + * @opensearch.internal + */ public class DateRangeAggregatorFactory extends AbstractRangeAggregatorFactory { public DateRangeAggregatorFactory( diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/GeoDistanceAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/GeoDistanceAggregationBuilder.java index 8e332cfd4a63a..701f46719b8e3 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/GeoDistanceAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/GeoDistanceAggregationBuilder.java @@ -65,6 +65,11 @@ import static org.opensearch.search.aggregations.bucket.range.RangeAggregator.Range.KEY_FIELD; import static org.opensearch.search.aggregations.bucket.range.RangeAggregator.Range.TO_FIELD; +/** + * Aggregation Builder for geo_distance agg + * + * @opensearch.internal + */ public class GeoDistanceAggregationBuilder extends ValuesSourceAggregationBuilder { public static final String NAME = "geo_distance"; public static final ValuesSourceRegistry.RegistryKey REGISTRY_KEY = diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/GeoDistanceAggregatorSupplier.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/GeoDistanceAggregatorSupplier.java index 430cbf4176c55..c4a9efda18bda 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/GeoDistanceAggregatorSupplier.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/GeoDistanceAggregatorSupplier.java @@ -44,6 +44,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregator supplier interface for geo_distance agg + * + * @opensearch.internal + */ public interface GeoDistanceAggregatorSupplier { Aggregator build( String name, diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/GeoDistanceRangeAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/GeoDistanceRangeAggregatorFactory.java index ba054357b4af2..cd8179f00a842 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/GeoDistanceRangeAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/GeoDistanceRangeAggregatorFactory.java @@ -57,6 +57,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Factory for geo_distance agg + * + * @opensearch.internal + */ public class GeoDistanceRangeAggregatorFactory extends ValuesSourceAggregatorFactory { public static void registerAggregators(ValuesSourceRegistry.Builder builder) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/InternalBinaryRange.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/InternalBinaryRange.java index 506593113a0f8..95e04d3f47e7e 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/InternalBinaryRange.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/InternalBinaryRange.java @@ -52,7 +52,11 @@ import static java.util.Collections.unmodifiableList; -/** A range aggregation for data that is encoded in doc values using a binary representation. */ +/** + * A range aggregation for data that is encoded in doc values using a binary representation. + * + * @opensearch.internal + */ public final class InternalBinaryRange extends InternalMultiBucketAggregation implements Range { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/InternalDateRange.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/InternalDateRange.java index 6becf1f692cb2..8ce01370ad160 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/InternalDateRange.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/InternalDateRange.java @@ -43,6 +43,11 @@ import java.util.List; import java.util.Map; +/** + * Implementation of date range bucket + * + * @opensearch.internal + */ public class InternalDateRange extends InternalRange { public static final Factory FACTORY = new Factory(); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/InternalGeoDistance.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/InternalGeoDistance.java index 6b3a19e1113e3..0cbe572e31917 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/InternalGeoDistance.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/InternalGeoDistance.java @@ -42,6 +42,11 @@ import java.util.List; import java.util.Map; +/** + * Implementation of geo_distance bucket + * + * @opensearch.internal + */ public class InternalGeoDistance extends InternalRange { public static final Factory FACTORY = new Factory(); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/InternalRange.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/InternalRange.java index ff61a0fd87e58..8da0d132fd54f 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/InternalRange.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/InternalRange.java @@ -49,6 +49,11 @@ import java.util.Map; import java.util.Objects; +/** + * Implementation of range bucket + * + * @opensearch.internal + */ public class InternalRange> extends InternalMultiBucketAggregation implements Range { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/IpRangeAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/IpRangeAggregationBuilder.java index 1a691a074a5e2..843733d736bc0 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/IpRangeAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/IpRangeAggregationBuilder.java @@ -65,6 +65,11 @@ import java.util.Map; import java.util.Objects; +/** + * Aggregation Builder for ip_range agg + * + * @opensearch.internal + */ public final class IpRangeAggregationBuilder extends ValuesSourceAggregationBuilder { public static final String NAME = "ip_range"; public static final ValuesSourceRegistry.RegistryKey REGISTRY_KEY = new ValuesSourceRegistry.RegistryKey<>( diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/IpRangeAggregatorSupplier.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/IpRangeAggregatorSupplier.java index e3de71a9b3cda..5efe9d952911b 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/IpRangeAggregatorSupplier.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/IpRangeAggregatorSupplier.java @@ -43,6 +43,11 @@ import java.util.List; import java.util.Map; +/** + * Aggregator supplier interface for ip_range agg + * + * @opensearch.internal + */ public interface IpRangeAggregatorSupplier { Aggregator build( diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedBinaryRange.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedBinaryRange.java index 13f52759ea1a1..68f8aae9aefb9 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedBinaryRange.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedBinaryRange.java @@ -46,6 +46,11 @@ import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +/** + * A binary range agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedBinaryRange extends ParsedMultiBucketAggregation implements Range { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedDateRange.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedDateRange.java index a388fdd3d20be..889b57b1a128c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedDateRange.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedDateRange.java @@ -40,6 +40,11 @@ import java.time.ZoneOffset; import java.time.ZonedDateTime; +/** + * A date range agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedDateRange extends ParsedRange { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedGeoDistance.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedGeoDistance.java index 1877a951f38b1..86fa2555c727c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedGeoDistance.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedGeoDistance.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * A geo distance range agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedGeoDistance extends ParsedRange { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedRange.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedRange.java index ea7f4456bbdce..0ad192636c0a7 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedRange.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/ParsedRange.java @@ -48,6 +48,11 @@ import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +/** + * A range agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedRange extends ParsedMultiBucketAggregation implements Range { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/Range.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/Range.java index 55619acf233a3..0a979a9a1625b 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/Range.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/Range.java @@ -38,6 +38,8 @@ /** * A {@code range} aggregation. Defines multiple buckets, each associated with a pre-defined value range of a field, * and where the value of that fields in all documents in each bucket fall in the bucket's range. + * + * @opensearch.internal */ public interface Range extends MultiBucketsAggregation { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/RangeAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/RangeAggregationBuilder.java index c50bcc1b61493..649f4e6dbb781 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/RangeAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/RangeAggregationBuilder.java @@ -47,6 +47,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Builder for range agg + * + * @opensearch.internal + */ public class RangeAggregationBuilder extends AbstractRangeBuilder { public static final String NAME = "range"; public static final ValuesSourceRegistry.RegistryKey REGISTRY_KEY = new ValuesSourceRegistry.RegistryKey<>( diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/RangeAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/RangeAggregator.java index 9786bc63405b5..4d2b0437adb08 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/RangeAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/RangeAggregator.java @@ -65,6 +65,11 @@ import static org.opensearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +/** + * Aggregate all docs that match given ranges. + * + * @opensearch.internal + */ public class RangeAggregator extends BucketsAggregator { public static final ParseField RANGES_FIELD = new ParseField("ranges"); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/RangeAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/RangeAggregatorFactory.java index b2a1b1046aaa2..803bceaf57fb5 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/RangeAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/RangeAggregatorFactory.java @@ -42,6 +42,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Factory for range aggregators + * + * @opensearch.internal + */ public class RangeAggregatorFactory extends AbstractRangeAggregatorFactory { public RangeAggregatorFactory( diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/RangeAggregatorSupplier.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/RangeAggregatorSupplier.java index ecc6c6cde442d..de9b979a56107 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/range/RangeAggregatorSupplier.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/range/RangeAggregatorSupplier.java @@ -41,6 +41,11 @@ import java.io.IOException; import java.util.Map; +/** + * Base Aggregator supplier interface for range aggs + * + * @opensearch.internal + */ public interface RangeAggregatorSupplier { Aggregator build( String name, diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/BestDocsDeferringCollector.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/BestDocsDeferringCollector.java index 42ef44e642d4e..080142185f82e 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/BestDocsDeferringCollector.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/BestDocsDeferringCollector.java @@ -64,6 +64,8 @@ * {@link BestDocsDeferringCollector#createTopDocsCollector(int)} is designed to * be overridden and allows subclasses to choose a custom collector * implementation for determining the top N matches. + * + * @opensearch.internal */ public class BestDocsDeferringCollector extends DeferringBucketCollector implements Releasable { private final List entries = new ArrayList<>(); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/DiversifiedAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/DiversifiedAggregationBuilder.java index dc1ddddaa4721..1fc31f8ffe0ae 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/DiversifiedAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/DiversifiedAggregationBuilder.java @@ -51,6 +51,11 @@ import java.util.Map; import java.util.Objects; +/** + * Aggregation Builder for diversified_sampler agg + * + * @opensearch.internal + */ public class DiversifiedAggregationBuilder extends ValuesSourceAggregationBuilder { public static final String NAME = "diversified_sampler"; public static final ValuesSourceRegistry.RegistryKey REGISTRY_KEY = diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/DiversifiedAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/DiversifiedAggregatorFactory.java index f7b43a0da2337..f8d3040620a51 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/DiversifiedAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/DiversifiedAggregatorFactory.java @@ -49,6 +49,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Factory for diversified_sampler agg + * + * @opensearch.internal + */ public class DiversifiedAggregatorFactory extends ValuesSourceAggregatorFactory { public static void registerAggregators(ValuesSourceRegistry.Builder builder) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/DiversifiedAggregatorSupplier.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/DiversifiedAggregatorSupplier.java index 9992a18aa13ea..8f8b4f970ee84 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/DiversifiedAggregatorSupplier.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/DiversifiedAggregatorSupplier.java @@ -40,6 +40,11 @@ import java.io.IOException; import java.util.Map; +/** + * Base Aggregator supplier interface for diversified sampling aggs + * + * @opensearch.internal + */ public interface DiversifiedAggregatorSupplier { Aggregator build( String name, diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/DiversifiedBytesHashSamplerAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/DiversifiedBytesHashSamplerAggregator.java index c0b3536838430..555e45460b844 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/DiversifiedBytesHashSamplerAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/DiversifiedBytesHashSamplerAggregator.java @@ -55,6 +55,8 @@ /** * Alternative, faster implementation for converting String keys to longs but * with the potential for hash collisions. + * + * @opensearch.internal */ public class DiversifiedBytesHashSamplerAggregator extends SamplerAggregator { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/DiversifiedMapSamplerAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/DiversifiedMapSamplerAggregator.java index fdb00eed24c0d..cb880759887e4 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/DiversifiedMapSamplerAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/DiversifiedMapSamplerAggregator.java @@ -54,6 +54,11 @@ import java.util.Map; import java.util.function.Consumer; +/** + * Aggregate all docs that match the diversified map sample + * + * @opensearch.internal + */ public class DiversifiedMapSamplerAggregator extends SamplerAggregator { private ValuesSource valuesSource; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/DiversifiedNumericSamplerAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/DiversifiedNumericSamplerAggregator.java index 8b4bed89e678c..472cc1beb82f8 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/DiversifiedNumericSamplerAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/DiversifiedNumericSamplerAggregator.java @@ -51,6 +51,11 @@ import java.util.Map; import java.util.function.Consumer; +/** + * Aggregate all docs that match the diversified numeric sample + * + * @opensearch.internal + */ public class DiversifiedNumericSamplerAggregator extends SamplerAggregator { private ValuesSource.Numeric valuesSource; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/DiversifiedOrdinalsSamplerAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/DiversifiedOrdinalsSamplerAggregator.java index 62caa017eddba..953a45971919c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/DiversifiedOrdinalsSamplerAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/DiversifiedOrdinalsSamplerAggregator.java @@ -52,6 +52,11 @@ import java.util.Map; import java.util.function.Consumer; +/** + * Aggregate all docs that match the diversified ordinal sample + * + * @opensearch.internal + */ public class DiversifiedOrdinalsSamplerAggregator extends SamplerAggregator { private ValuesSource.Bytes.WithOrdinals.FieldData valuesSource; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/InternalSampler.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/InternalSampler.java index 593c3c50ee19d..8b6f4d32bed3c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/InternalSampler.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/InternalSampler.java @@ -38,6 +38,11 @@ import java.io.IOException; import java.util.Map; +/** + * Implementation of sampler bucket + * + * @opensearch.internal + */ public class InternalSampler extends InternalSingleBucketAggregation implements Sampler { public static final String NAME = "mapped_sampler"; // InternalSampler and UnmappedSampler share the same parser name, so we use this when identifying the aggregation type diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/ParsedSampler.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/ParsedSampler.java index 6c4fe2927d7bd..005a6a40a4640 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/ParsedSampler.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/ParsedSampler.java @@ -36,6 +36,11 @@ import java.io.IOException; +/** + * A sampler result parsed between nodes + * + * @opensearch.internal + */ public class ParsedSampler extends ParsedSingleBucketAggregation implements Sampler { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/Sampler.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/Sampler.java index 45fbf6913fd04..a9c2a76a69b85 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/Sampler.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/Sampler.java @@ -37,5 +37,7 @@ * A {@code filter} aggregation that defines a single bucket to hold a sample of * top-matching documents. Computation of child aggregations is deferred until * the top-matching documents on a shard have been determined. + * + * @opensearch.internal */ public interface Sampler extends SingleBucketAggregation {} diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/SamplerAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/SamplerAggregationBuilder.java index 42aebe384f0f9..09c4ad0bb3384 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/SamplerAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/SamplerAggregationBuilder.java @@ -47,6 +47,11 @@ import java.util.Map; import java.util.Objects; +/** + * Aggregation Builder for sampler agg + * + * @opensearch.internal + */ public class SamplerAggregationBuilder extends AbstractAggregationBuilder { public static final String NAME = "sampler"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/SamplerAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/SamplerAggregator.java index a7855c2b400f1..fd1d7bf2997ac 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/SamplerAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/SamplerAggregator.java @@ -62,6 +62,8 @@ * as the basis for generating de-dup values. Their syntax for creating bucket * values would be preferable to users having to recreate this logic in a * 'script' e.g. to turn a datetime in milliseconds into a month key value. + * + * @opensearch.internal */ public class SamplerAggregator extends DeferableBucketAggregator implements SingleBucketAggregator { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/SamplerAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/SamplerAggregatorFactory.java index 35e3a618dfad3..fa98c799352a6 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/SamplerAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/SamplerAggregatorFactory.java @@ -42,6 +42,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Factory for sampler agg + * + * @opensearch.internal + */ public class SamplerAggregatorFactory extends AggregatorFactory { private final int shardSize; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/UnmappedSampler.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/UnmappedSampler.java index 620a6e02c2b9a..a8abbb3e65dff 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/UnmappedSampler.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/sampler/UnmappedSampler.java @@ -41,6 +41,11 @@ import java.util.List; import java.util.Map; +/** + * Implementation of an unmapped sampler + * + * @opensearch.internal + */ public class UnmappedSampler extends InternalSampler { public static final String NAME = "unmapped_sampler"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/AbstractRareTermsAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/AbstractRareTermsAggregator.java index 5820652b179d2..6ca66b38408a0 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/AbstractRareTermsAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/AbstractRareTermsAggregator.java @@ -47,6 +47,11 @@ import java.util.Map; import java.util.Random; +/** + * Base class to Aggregate all docs that contain rare terms + * + * @opensearch.internal + */ public abstract class AbstractRareTermsAggregator extends DeferableBucketAggregator { static final BucketOrder ORDER = BucketOrder.compound(BucketOrder.count(true), BucketOrder.key(true)); // sort by count ascending diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/AbstractStringTermsAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/AbstractStringTermsAggregator.java index 9e83891067237..9551be10e52b8 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/AbstractStringTermsAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/AbstractStringTermsAggregator.java @@ -46,6 +46,11 @@ import static java.util.Collections.emptyList; +/** + * Base Aggregator to collect all docs that contain significant terms + * + * @opensearch.internal + */ abstract class AbstractStringTermsAggregator extends TermsAggregator { protected final boolean showTermDocCountError; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/BucketPriorityQueue.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/BucketPriorityQueue.java index 258a6c43c49ab..29314c08cfab9 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/BucketPriorityQueue.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/BucketPriorityQueue.java @@ -35,6 +35,11 @@ import java.util.Comparator; +/** + * Internal priority queue for computing terms aggs + * + * @opensearch.internal + */ public class BucketPriorityQueue extends PriorityQueue { private final Comparator comparator; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/BucketSignificancePriorityQueue.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/BucketSignificancePriorityQueue.java index 7a112135567b9..25e016fb77c9f 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/BucketSignificancePriorityQueue.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/BucketSignificancePriorityQueue.java @@ -34,6 +34,11 @@ import org.apache.lucene.util.PriorityQueue; +/** + * Priority queue for computing bucket significance + * + * @opensearch.internal + */ public class BucketSignificancePriorityQueue extends PriorityQueue { public BucketSignificancePriorityQueue(int size) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/BytesKeyedBucketOrds.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/BytesKeyedBucketOrds.java index 1cdf4f509537b..7bfeff7615b83 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/BytesKeyedBucketOrds.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/BytesKeyedBucketOrds.java @@ -41,6 +41,8 @@ /** * Maps {@link BytesRef} bucket keys to bucket ordinals. + * + * @opensearch.internal */ public abstract class BytesKeyedBucketOrds implements Releasable { /** diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/DoubleTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/DoubleTerms.java index c556dd1144b24..7f2765657781a 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/DoubleTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/DoubleTerms.java @@ -47,6 +47,8 @@ /** * Result of the {@link TermsAggregator} when the field is some kind of decimal number like a float, double, or distance. + * + * @opensearch.internal */ public class DoubleTerms extends InternalMappedTerms { public static final String NAME = "dterms"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/GlobalOrdinalsStringTermsAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/GlobalOrdinalsStringTermsAggregator.java index 40b43d11c5b3b..4be90ac2f9b7a 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/GlobalOrdinalsStringTermsAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/GlobalOrdinalsStringTermsAggregator.java @@ -76,6 +76,8 @@ /** * An aggregator of string values that relies on global ordinals in order to build buckets. + * + * @opensearch.internal */ public class GlobalOrdinalsStringTermsAggregator extends AbstractStringTermsAggregator { protected final ResultStrategy resultStrategy; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/IncludeExclude.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/IncludeExclude.java index f32abd1892592..4464e4eb54760 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/IncludeExclude.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/IncludeExclude.java @@ -68,6 +68,8 @@ /** * Defines the include/exclude regular expression filtering for string terms aggregation. In this filtering logic, * exclusion has precedence, where the {@code include} is evaluated first and then the {@code exclude}. + * + * @opensearch.internal */ public class IncludeExclude implements Writeable, ToXContentFragment { public static final ParseField INCLUDE_FIELD = new ParseField("include"); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalMappedRareTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalMappedRareTerms.java index 7086fb4cba7d3..1d8e47b0d3ea7 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalMappedRareTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalMappedRareTerms.java @@ -53,6 +53,11 @@ import java.util.function.Function; import java.util.stream.Collectors; +/** + * Implementation of mapped rare terms + * + * @opensearch.internal + */ public abstract class InternalMappedRareTerms, B extends InternalRareTerms.Bucket> extends InternalRareTerms { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalMappedSignificantTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalMappedSignificantTerms.java index ab47a220a6524..d72162c81e00e 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalMappedSignificantTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalMappedSignificantTerms.java @@ -46,6 +46,11 @@ import java.util.function.Function; import java.util.stream.Collectors; +/** + * Implementation of mapped significant terms + * + * @opensearch.internal + */ public abstract class InternalMappedSignificantTerms< A extends InternalMappedSignificantTerms, B extends InternalSignificantTerms.Bucket> extends InternalSignificantTerms { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalMappedTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalMappedTerms.java index 5070b6e8fefec..c38dd55fdfd9a 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalMappedTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalMappedTerms.java @@ -47,6 +47,8 @@ /** * Common superclass for results of the terms aggregation on mapped fields. + * + * @opensearch.internal */ public abstract class InternalMappedTerms, B extends InternalTerms.Bucket> extends InternalTerms { protected final DocValueFormat format; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalMultiTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalMultiTerms.java index fd1758d3ea8ba..f9207fb17a431 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalMultiTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalMultiTerms.java @@ -30,6 +30,8 @@ /** * Result of the {@link MultiTermsAggregator}. + * + * @opensearch.internal */ public class InternalMultiTerms extends InternalTerms { /** diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalRareTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalRareTerms.java index 8f51ede1bc2a7..441a0783536d5 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalRareTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalRareTerms.java @@ -50,6 +50,11 @@ import java.util.Map; import java.util.Objects; +/** + * Implementation of rare terms + * + * @opensearch.internal + */ public abstract class InternalRareTerms, B extends InternalRareTerms.Bucket> extends InternalMultiBucketAggregation implements diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalSignificantTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalSignificantTerms.java index 4122e8b26e348..80fd4e2f5dc7a 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalSignificantTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalSignificantTerms.java @@ -51,6 +51,8 @@ /** * Result of the significant terms aggregation. + * + * @opensearch.internal */ public abstract class InternalSignificantTerms, B extends InternalSignificantTerms.Bucket> extends InternalMultiBucketAggregation diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalTerms.java index 8fae5720a9082..a376d7fab900b 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/InternalTerms.java @@ -62,6 +62,11 @@ import static org.opensearch.search.aggregations.InternalOrder.isKeyAsc; import static org.opensearch.search.aggregations.InternalOrder.isKeyOrder; +/** + * Implementation of terms + * + * @opensearch.internal + */ public abstract class InternalTerms, B extends InternalTerms.AbstractInternalBucket> extends InternalMultiBucketAggregation implements diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/LongKeyedBucketOrds.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/LongKeyedBucketOrds.java index 0964d8aa8adb7..d60c774adaa3c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/LongKeyedBucketOrds.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/LongKeyedBucketOrds.java @@ -40,6 +40,8 @@ /** * Maps long bucket keys to bucket ordinals. + * + * @opensearch.internal */ public abstract class LongKeyedBucketOrds implements Releasable { /** diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/LongRareTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/LongRareTerms.java index f8ea5c4231cac..f65401f913a89 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/LongRareTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/LongRareTerms.java @@ -46,6 +46,8 @@ /** * Result of the RareTerms aggregation when the field is some kind of whole number like a integer, long, or a date. + * + * @opensearch.internal */ public class LongRareTerms extends InternalMappedRareTerms { public static final String NAME = "lrareterms"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/LongRareTermsAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/LongRareTermsAggregator.java index 1a44c41c1f15f..6e4cd895e7496 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/LongRareTermsAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/LongRareTermsAggregator.java @@ -56,6 +56,8 @@ /** * An aggregator that finds "rare" string values (e.g. terms agg that orders ascending) + * + * @opensearch.internal */ public class LongRareTermsAggregator extends AbstractRareTermsAggregator { private final ValuesSource.Numeric valuesSource; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/LongTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/LongTerms.java index 265fa532574be..2a92749943256 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/LongTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/LongTerms.java @@ -47,6 +47,8 @@ /** * Result of the {@link TermsAggregator} when the field is some kind of whole number like a integer, long, or a date. + * + * @opensearch.internal */ public class LongTerms extends InternalMappedTerms { public static final String NAME = "lterms"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MapStringTermsAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MapStringTermsAggregator.java index a1c7d22bd29e0..2450a5a3692e1 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MapStringTermsAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MapStringTermsAggregator.java @@ -68,6 +68,8 @@ /** * An aggregator of string values that hashes the strings on the fly rather * than up front like the {@link GlobalOrdinalsStringTermsAggregator}. + * + * @opensearch.internal */ public class MapStringTermsAggregator extends AbstractStringTermsAggregator { private final CollectorSource collectorSource; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregationBuilder.java index 78be4f980bce5..cb2549a69b683 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregationBuilder.java @@ -102,6 +102,8 @@ * Notes: The current implementation focuses on adding new type aggregates. Performance (latency) is not good,mainly because of * simply encoding/decoding a list of values as bucket keys. *

    + * + * @opensearch.internal */ public class MultiTermsAggregationBuilder extends AbstractAggregationBuilder { public static final String NAME = "multi_terms"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregationFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregationFactory.java index d5600bc030bf2..695972564f720 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregationFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregationFactory.java @@ -34,6 +34,8 @@ /** * Factory of {@link MultiTermsAggregator}. + * + * @opensearch.internal */ public class MultiTermsAggregationFactory extends AggregatorFactory { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregator.java index 36bf710f74398..e5461ff7a03aa 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/MultiTermsAggregator.java @@ -51,6 +51,8 @@ /** * An aggregator that aggregate with multi_terms. + * + * @opensearch.internal */ public class MultiTermsAggregator extends DeferableBucketAggregator { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/NumericTermsAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/NumericTermsAggregator.java index 4ea341caa0fed..2c4c502b86695 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/NumericTermsAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/NumericTermsAggregator.java @@ -70,6 +70,11 @@ import static java.util.Collections.emptyList; import static org.opensearch.search.aggregations.InternalOrder.isKeyOrder; +/** + * Aggregate all docs that contain numeric terms + * + * @opensearch.internal + */ public class NumericTermsAggregator extends TermsAggregator { private final ResultStrategy resultStrategy; private final ValuesSource.Numeric valuesSource; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedDoubleTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedDoubleTerms.java index 5be42312656f2..2ace6b637e6df 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedDoubleTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedDoubleTerms.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * A double numeric terms result parsed between nodes + * + * @opensearch.internal + */ public class ParsedDoubleTerms extends ParsedTerms { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedLongRareTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedLongRareTerms.java index e84c00519acd8..c66f3cd676893 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedLongRareTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedLongRareTerms.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * A long numeric term result parsed between nodes + * + * @opensearch.internal + */ public class ParsedLongRareTerms extends ParsedRareTerms { @Override public String getType() { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedLongTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedLongTerms.java index f75d1695819a0..45f51854aa603 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedLongTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedLongTerms.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * A long term agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedLongTerms extends ParsedTerms { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedMultiTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedMultiTerms.java index 8686d329fa3b2..3e1c6f6533b06 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedMultiTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedMultiTerms.java @@ -15,6 +15,11 @@ import java.io.IOException; import java.util.List; +/** + * A multi terms result parsed between nodes + * + * @opensearch.internal + */ public class ParsedMultiTerms extends ParsedTerms { @Override public String getType() { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedRareTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedRareTerms.java index a9fcd6e0277e6..f195028244913 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedRareTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedRareTerms.java @@ -47,6 +47,11 @@ import java.util.List; import java.util.function.Supplier; +/** + * A rare term result parsed between nodes + * + * @opensearch.internal + */ public abstract class ParsedRareTerms extends ParsedMultiBucketAggregation implements RareTerms { @Override public List getBuckets() { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedSignificantLongTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedSignificantLongTerms.java index 1488588a6847a..23c29b2745f73 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedSignificantLongTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedSignificantLongTerms.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * A significant long terms result parsed between nodes + * + * @opensearch.internal + */ public class ParsedSignificantLongTerms extends ParsedSignificantTerms { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedSignificantStringTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedSignificantStringTerms.java index 961e4881f1eb8..ce508687aed6c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedSignificantStringTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedSignificantStringTerms.java @@ -40,6 +40,11 @@ import java.io.IOException; import java.nio.CharBuffer; +/** + * A significant string terms result parsed between nodes + * + * @opensearch.internal + */ public class ParsedSignificantStringTerms extends ParsedSignificantTerms { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedSignificantTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedSignificantTerms.java index b57635a50d2d9..1d6b64f3dcd0b 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedSignificantTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedSignificantTerms.java @@ -52,6 +52,11 @@ import java.util.function.Function; import java.util.stream.Collectors; +/** + * A significant terms result parsed between nodes + * + * @opensearch.internal + */ public abstract class ParsedSignificantTerms extends ParsedMultiBucketAggregation implements SignificantTerms { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedStringRareTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedStringRareTerms.java index 65a3090bee827..ecf5bd84097b0 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedStringRareTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedStringRareTerms.java @@ -40,6 +40,11 @@ import org.opensearch.common.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentParser; +/** + * A significant rare result parsed between nodes + * + * @opensearch.internal + */ public class ParsedStringRareTerms extends ParsedRareTerms { @Override public String getType() { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedStringTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedStringTerms.java index faf34c6da5fec..c849d6c8c8840 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedStringTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedStringTerms.java @@ -40,6 +40,11 @@ import java.io.IOException; import java.nio.CharBuffer; +/** + * A string result parsed between nodes + * + * @opensearch.internal + */ public class ParsedStringTerms extends ParsedTerms { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedTerms.java index 054ea7d827053..68de52a253188 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/ParsedTerms.java @@ -50,6 +50,11 @@ import static org.opensearch.search.aggregations.bucket.terms.InternalTerms.DOC_COUNT_ERROR_UPPER_BOUND_FIELD_NAME; import static org.opensearch.search.aggregations.bucket.terms.InternalTerms.SUM_OF_OTHER_DOC_COUNTS; +/** + * A terms result parsed between nodes + * + * @opensearch.internal + */ public abstract class ParsedTerms extends ParsedMultiBucketAggregation implements Terms { protected long docCountErrorUpperBound; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTerms.java index 4e9c9be2cd255..6e26503c149c5 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTerms.java @@ -35,6 +35,11 @@ import java.util.List; +/** + * Rare terms interface + * + * @opensearch.internal + */ public interface RareTerms extends MultiBucketsAggregation { /** diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTermsAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTermsAggregationBuilder.java index 2b419d1a45219..64436e1b2fb16 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTermsAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTermsAggregationBuilder.java @@ -52,6 +52,11 @@ import java.util.Map; import java.util.Objects; +/** + * Aggregation Builder for rare_terms agg + * + * @opensearch.internal + */ public class RareTermsAggregationBuilder extends ValuesSourceAggregationBuilder { public static final String NAME = "rare_terms"; public static final ValuesSourceRegistry.RegistryKey REGISTRY_KEY = new ValuesSourceRegistry.RegistryKey<>( diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTermsAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTermsAggregatorFactory.java index ed70a9b310ea1..b689865ac8c99 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTermsAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTermsAggregatorFactory.java @@ -53,6 +53,11 @@ import java.util.Arrays; import java.util.Map; +/** + * Aggregation Factory for rare_terms agg + * + * @opensearch.internal + */ public class RareTermsAggregatorFactory extends ValuesSourceAggregatorFactory { private final IncludeExclude includeExclude; private final int maxDocCount; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTermsAggregatorSupplier.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTermsAggregatorSupplier.java index 7fe05adc7c610..5f8888e2819c2 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTermsAggregatorSupplier.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/RareTermsAggregatorSupplier.java @@ -41,6 +41,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregator supplier interface for rare_terms agg + * + * @opensearch.internal + */ interface RareTermsAggregatorSupplier { Aggregator build( String name, diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificanceLookup.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificanceLookup.java index 3911352568356..aee4caa67afa1 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificanceLookup.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificanceLookup.java @@ -60,6 +60,8 @@ /** * Looks up values used for {@link SignificanceHeuristic}s. + * + * @opensearch.internal */ class SignificanceLookup { /** diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantLongTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantLongTerms.java index 1aebdc663737e..6e2b48f55796e 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantLongTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantLongTerms.java @@ -45,6 +45,8 @@ /** * Result of the running the significant terms aggregation on a numeric field. + * + * @opensearch.internal */ public class SignificantLongTerms extends InternalMappedSignificantTerms { public static final String NAME = "siglterms"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantStringTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantStringTerms.java index 9c0f075ea5b22..3795df964b0c4 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantStringTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantStringTerms.java @@ -46,6 +46,8 @@ /** * Result of the running the significant terms aggregation on a String field. + * + * @opensearch.internal */ public class SignificantStringTerms extends InternalMappedSignificantTerms { public static final String NAME = "sigsterms"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTerms.java index 299a6d29f1b85..a5d1c29b0ee0a 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTerms.java @@ -37,6 +37,8 @@ /** * An aggregation that collects significant terms in comparison to a background set. + * + * @opensearch.internal */ public interface SignificantTerms extends MultiBucketsAggregation, Iterable { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTermsAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTermsAggregationBuilder.java index 3c9c5797fff7a..c50436b6223b7 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTermsAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTermsAggregationBuilder.java @@ -60,6 +60,11 @@ import static org.opensearch.index.query.AbstractQueryBuilder.parseInnerQueryBuilder; +/** + * Aggregation Builder for significant terms agg + * + * @opensearch.internal + */ public class SignificantTermsAggregationBuilder extends ValuesSourceAggregationBuilder { public static final String NAME = "significant_terms"; public static final ValuesSourceRegistry.RegistryKey REGISTRY_KEY = diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTermsAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTermsAggregatorFactory.java index 8935c9715a1e0..ff35d128ef524 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTermsAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTermsAggregatorFactory.java @@ -58,6 +58,11 @@ import java.util.Arrays; import java.util.Map; +/** + * Aggregation Factory for significant_terms agg + * + * @opensearch.internal + */ public class SignificantTermsAggregatorFactory extends ValuesSourceAggregatorFactory { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(SignificantTermsAggregatorFactory.class); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTermsAggregatorSupplier.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTermsAggregatorSupplier.java index 2d07527d61ede..a1fa7ab9d061e 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTermsAggregatorSupplier.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTermsAggregatorSupplier.java @@ -42,6 +42,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregator supplier interface for significant_terms agg + * + * @opensearch.internal + */ interface SignificantTermsAggregatorSupplier { Aggregator build( String name, diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTextAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTextAggregationBuilder.java index bdfcf0e27fa58..7be04b13f0d6b 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTextAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTextAggregationBuilder.java @@ -55,6 +55,11 @@ import java.util.Map; import java.util.Objects; +/** + * Aggregation Builder for significant text agg + * + * @opensearch.internal + */ public class SignificantTextAggregationBuilder extends AbstractAggregationBuilder { public static final String NAME = "significant_text"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTextAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTextAggregatorFactory.java index 9085df1ccd749..a509cbfd49ffd 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTextAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/SignificantTextAggregatorFactory.java @@ -68,6 +68,11 @@ import java.util.Map; import java.util.function.LongConsumer; +/** + * Aggregation Factory for significant_text agg + * + * @opensearch.internal + */ public class SignificantTextAggregatorFactory extends AggregatorFactory { private static final int MEMORY_GROWTH_REPORTING_INTERVAL_BYTES = 5000; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/StringRareTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/StringRareTerms.java index 58473c715563c..f6a925c5340a1 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/StringRareTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/StringRareTerms.java @@ -45,6 +45,11 @@ import java.util.Map; import java.util.Objects; +/** + * Implementation of string rare terms + * + * @opensearch.internal + */ public class StringRareTerms extends InternalMappedRareTerms { public static final String NAME = "srareterms"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/StringRareTermsAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/StringRareTermsAggregator.java index b4093a73f7305..c796faa6a8b76 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/StringRareTermsAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/StringRareTermsAggregator.java @@ -58,6 +58,8 @@ /** * An aggregator that finds "rare" string values (e.g. terms agg that orders ascending) + * + * @opensearch.internal */ public class StringRareTermsAggregator extends AbstractRareTermsAggregator { private final ValuesSource.Bytes valuesSource; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/StringTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/StringTerms.java index 3e70428472c37..829ec07c91087 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/StringTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/StringTerms.java @@ -46,6 +46,8 @@ /** * Result of the {@link TermsAggregator} when the field is a String. + * + * @opensearch.internal */ public class StringTerms extends InternalMappedTerms { public static final String NAME = "sterms"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/Terms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/Terms.java index e6cb64928c0d8..df2028c81b1eb 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/Terms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/Terms.java @@ -38,6 +38,8 @@ /** * A {@code terms} aggregation. Defines multiple bucket, each associated with a unique term for a specific field. * All documents in a bucket has the bucket's term in that field. + * + * @opensearch.internal */ public interface Terms extends MultiBucketsAggregation { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregationBuilder.java index 11a51f51d53c1..ae1c2bff2c327 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregationBuilder.java @@ -60,6 +60,11 @@ import java.util.Map; import java.util.Objects; +/** + * Aggregation Builder for terms agg + * + * @opensearch.internal + */ public class TermsAggregationBuilder extends ValuesSourceAggregationBuilder { public static final String NAME = "terms"; public static final ValuesSourceRegistry.RegistryKey REGISTRY_KEY = new ValuesSourceRegistry.RegistryKey<>( diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregator.java index a5ee44ffa222e..d60d1609ae9d4 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregator.java @@ -56,6 +56,11 @@ import java.util.Objects; import java.util.Set; +/** + * Base aggregator class to aggregate documents by terms + * + * @opensearch.internal + */ public abstract class TermsAggregator extends DeferableBucketAggregator { public static class BucketCountThresholds implements Writeable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregatorFactory.java index b320126dff24b..abbd7945bdde4 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregatorFactory.java @@ -62,6 +62,11 @@ import java.util.Map; import java.util.function.Function; +/** + * Aggregation Factory for terms agg + * + * @opensearch.internal + */ public class TermsAggregatorFactory extends ValuesSourceAggregatorFactory { static Boolean REMAP_GLOBAL_ORDS, COLLECT_SEGMENT_ORDS; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregatorSupplier.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregatorSupplier.java index a9b319378937d..27e5adf031483 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregatorSupplier.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/TermsAggregatorSupplier.java @@ -42,6 +42,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregator supplier interface for terms agg + * + * @opensearch.internal + */ interface TermsAggregatorSupplier { Aggregator build( String name, diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/UnmappedRareTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/UnmappedRareTerms.java index ef759cf4e7475..279bbf95641e0 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/UnmappedRareTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/UnmappedRareTerms.java @@ -48,6 +48,8 @@ /** * Result of the RareTerms aggregation when the field is unmapped. + * + * @opensearch.internal */ public class UnmappedRareTerms extends InternalRareTerms { public static final String NAME = "umrareterms"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/UnmappedSignificantTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/UnmappedSignificantTerms.java index a99f013327a88..535a6b58059a5 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/UnmappedSignificantTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/UnmappedSignificantTerms.java @@ -50,6 +50,8 @@ /** * Result of the running the significant terms aggregation on an unmapped field. + * + * @opensearch.internal */ public class UnmappedSignificantTerms extends InternalSignificantTerms { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/UnmappedTerms.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/UnmappedTerms.java index ad499aed451d1..9b792720b492a 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/UnmappedTerms.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/UnmappedTerms.java @@ -48,6 +48,8 @@ /** * Result of the {@link TermsAggregator} when the field is unmapped. + * + * @opensearch.internal */ public class UnmappedTerms extends InternalTerms { public static final String NAME = "umterms"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/ChiSquare.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/ChiSquare.java index 3083fa2b86814..1597976986beb 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/ChiSquare.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/ChiSquare.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * ChiSquare significance heuristic for significant terms agg + * + * @opensearch.internal + */ public class ChiSquare extends NXYSignificanceHeuristic { public static final String NAME = "chi_square"; public static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/GND.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/GND.java index 4e88ad992bde0..4f315836d9b3c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/GND.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/GND.java @@ -41,6 +41,11 @@ import static org.opensearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +/** + * GND significance heuristic for significant terms agg + * + * @opensearch.internal + */ public class GND extends NXYSignificanceHeuristic { public static final String NAME = "gnd"; public static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>(NAME, args -> { diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/JLHScore.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/JLHScore.java index b3cc463f71e1b..1b36947f72d02 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/JLHScore.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/JLHScore.java @@ -39,6 +39,11 @@ import org.opensearch.common.xcontent.ObjectParser; import org.opensearch.common.xcontent.XContentBuilder; +/** + * JLHScore heuristic for significant terms agg + * + * @opensearch.internal + */ public class JLHScore extends SignificanceHeuristic { public static final String NAME = "jlh"; public static final ObjectParser PARSER = new ObjectParser<>(NAME, JLHScore::new); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/MutualInformation.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/MutualInformation.java index 3114aa940f2ef..761e1cf31da10 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/MutualInformation.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/MutualInformation.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Mutual Information significance heuristic for significant terms agg + * + * @opensearch.internal + */ public class MutualInformation extends NXYSignificanceHeuristic { public static final String NAME = "mutual_information"; public static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/NXYSignificanceHeuristic.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/NXYSignificanceHeuristic.java index a194765209a40..e385bea5a7c11 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/NXYSignificanceHeuristic.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/NXYSignificanceHeuristic.java @@ -44,6 +44,11 @@ import static org.opensearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +/** + * NXY significance heuristic for significant terms agg + * + * @opensearch.internal + */ public abstract class NXYSignificanceHeuristic extends SignificanceHeuristic { protected static final ParseField BACKGROUND_IS_SUPERSET = new ParseField("background_is_superset"); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/PercentageScore.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/PercentageScore.java index fa80ba67a7b5a..5e976d0fd67b4 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/PercentageScore.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/PercentageScore.java @@ -42,6 +42,11 @@ import java.io.IOException; +/** + * Percentage score significance heuristic for significant terms agg + * + * @opensearch.internal + */ public class PercentageScore extends SignificanceHeuristic { public static final String NAME = "percentage"; public static final ObjectParser PARSER = new ObjectParser<>(NAME, PercentageScore::new); diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/ScriptHeuristic.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/ScriptHeuristic.java index eeebdabda45fb..65f3ec4bd752d 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/ScriptHeuristic.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/ScriptHeuristic.java @@ -48,6 +48,11 @@ import static org.opensearch.common.xcontent.ConstructingObjectParser.constructorArg; +/** + * Script significance heuristic for significant terms agg + * + * @opensearch.internal + */ public class ScriptHeuristic extends SignificanceHeuristic { public static final String NAME = "script_heuristic"; public static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/SignificanceHeuristic.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/SignificanceHeuristic.java index b63cc483e58aa..7644c84bf2282 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/SignificanceHeuristic.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/SignificanceHeuristic.java @@ -40,6 +40,8 @@ /** * Heuristic for that {@link SignificantTerms} uses to pick out significant terms. + * + * @opensearch.internal */ public abstract class SignificanceHeuristic implements NamedWriteable, ToXContentFragment { /** diff --git a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/SignificanceHeuristicBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/SignificanceHeuristicBuilder.java index b824652bdbe08..576247b0989fc 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/SignificanceHeuristicBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/bucket/terms/heuristic/SignificanceHeuristicBuilder.java @@ -34,4 +34,9 @@ import org.opensearch.common.xcontent.ToXContentFragment; +/** + * Base builder class for significance heuristics + * + * @opensearch.internal + */ public interface SignificanceHeuristicBuilder extends ToXContentFragment {} diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractCardinalityAlgorithm.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractCardinalityAlgorithm.java index 8851313f61e5a..a8a7b513d01e5 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractCardinalityAlgorithm.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractCardinalityAlgorithm.java @@ -34,6 +34,8 @@ /** * Base class for cardinality related algorithms. + * + * @opensearch.internal */ abstract class AbstractCardinalityAlgorithm { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractHDRPercentilesAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractHDRPercentilesAggregator.java index abf63ee0b73e6..a0d86b382eef0 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractHDRPercentilesAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractHDRPercentilesAggregator.java @@ -50,6 +50,11 @@ import java.io.IOException; import java.util.Map; +/** + * Base aggregator for HDR percentiles agg + * + * @opensearch.internal + */ abstract class AbstractHDRPercentilesAggregator extends NumericMetricsAggregator.MultiValue { private static int indexOfKey(double[] keys, double key) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractHyperLogLog.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractHyperLogLog.java index 8008d70f664a6..89b77eb840dd2 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractHyperLogLog.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractHyperLogLog.java @@ -38,6 +38,8 @@ * https://docs.google.com/document/d/1gyjfMHy43U9OWBXxfaeG-3MjGzejW1dlpyMwEYAAWEI/view?fullscreen * * Trying to understand what this class does without having read the paper is considered adventurous. + * + * @opensearch.internal */ public abstract class AbstractHyperLogLog extends AbstractCardinalityAlgorithm { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractHyperLogLogPlusPlus.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractHyperLogLogPlusPlus.java index 75d9dea7ef86a..4ea9c48e360ef 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractHyperLogLogPlusPlus.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractHyperLogLogPlusPlus.java @@ -48,6 +48,8 @@ * Base class for HLL++ algorithms. * * It contains methods for cloning and serializing the data structure. + * + * @opensearch.internal */ public abstract class AbstractHyperLogLogPlusPlus extends AbstractCardinalityAlgorithm implements Releasable { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractInternalHDRPercentiles.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractInternalHDRPercentiles.java index 0dc2803d5f6c3..568305cf6ff2c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractInternalHDRPercentiles.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractInternalHDRPercentiles.java @@ -47,6 +47,11 @@ import java.util.Objects; import java.util.zip.DataFormatException; +/** + * Base implementation of HDR percentiles + * + * @opensearch.internal + */ abstract class AbstractInternalHDRPercentiles extends InternalNumericMetricsAggregation.MultiValue { protected final double[] keys; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractInternalTDigestPercentiles.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractInternalTDigestPercentiles.java index 5ac87df3e139c..5b881da804146 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractInternalTDigestPercentiles.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractInternalTDigestPercentiles.java @@ -44,6 +44,11 @@ import java.util.Map; import java.util.Objects; +/** + * Base implementation of TDigest percentiles + * + * @opensearch.internal + */ abstract class AbstractInternalTDigestPercentiles extends InternalNumericMetricsAggregation.MultiValue { protected final double[] keys; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractLinearCounting.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractLinearCounting.java index 71a97e1456fab..3b607b3a86784 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractLinearCounting.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractLinearCounting.java @@ -42,6 +42,8 @@ * Trying to understand what this class does without having read the paper is considered adventurous. * * The algorithm just keep a record of all distinct values provided encoded as an integer. + * + * @opensearch.internal */ public abstract class AbstractLinearCounting extends AbstractCardinalityAlgorithm { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractPercentilesAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractPercentilesAggregationBuilder.java index ac0baf18dfb55..a580d17099ec2 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractPercentilesAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractPercentilesAggregationBuilder.java @@ -55,6 +55,8 @@ * This provides a base class for aggregations that are building percentiles or percentiles-like functionality (e.g. percentile ranks). * It provides a set of common fields/functionality for setting the available algorithms (TDigest and HDRHistogram), * as well as algorithm-specific settings via a {@link PercentilesConfig} object + * + * @opensearch.internal */ public abstract class AbstractPercentilesAggregationBuilder> extends ValuesSourceAggregationBuilder.LeafOnly { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractTDigestPercentilesAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractTDigestPercentilesAggregator.java index 80bfcb55f7391..8c79a80a26b9e 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractTDigestPercentilesAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/AbstractTDigestPercentilesAggregator.java @@ -49,6 +49,11 @@ import java.io.IOException; import java.util.Map; +/** + * Base aggregator for the TDigest agg + * + * @opensearch.internal + */ abstract class AbstractTDigestPercentilesAggregator extends NumericMetricsAggregator.MultiValue { private static int indexOfKey(double[] keys, double key) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/Avg.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/Avg.java index 0c662423b2407..4deffd60f28d8 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/Avg.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/Avg.java @@ -33,6 +33,8 @@ /** * An aggregation that computes the average of the values in the current bucket. + * + * @opensearch.internal */ public interface Avg extends NumericMetricsAggregation.SingleValue { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/AvgAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/AvgAggregationBuilder.java index 8fd3febc4d2a9..96a131117c34c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/AvgAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/AvgAggregationBuilder.java @@ -50,6 +50,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Builder for avg agg + * + * @opensearch.internal + */ public class AvgAggregationBuilder extends ValuesSourceAggregationBuilder.LeafOnly { public static final String NAME = "avg"; public static final ValuesSourceRegistry.RegistryKey REGISTRY_KEY = new ValuesSourceRegistry.RegistryKey<>( diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/AvgAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/AvgAggregator.java index 24cebdf289790..e58466b56df2a 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/AvgAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/AvgAggregator.java @@ -50,6 +50,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregate all docs into an average + * + * @opensearch.internal + */ class AvgAggregator extends NumericMetricsAggregator.SingleValue { final ValuesSource.Numeric valuesSource; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/AvgAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/AvgAggregatorFactory.java index 696d65ec9d8aa..727304f8a5254 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/AvgAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/AvgAggregatorFactory.java @@ -46,6 +46,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Factory for avg agg + * + * @opensearch.internal + */ class AvgAggregatorFactory extends ValuesSourceAggregatorFactory { AvgAggregatorFactory( diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/Cardinality.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/Cardinality.java index 749c2554cf479..dab281aa7ec6f 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/Cardinality.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/Cardinality.java @@ -34,6 +34,8 @@ /** * An aggregation that computes approximate numbers of unique terms. + * + * @opensearch.internal */ public interface Cardinality extends NumericMetricsAggregation.SingleValue { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/CardinalityAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/CardinalityAggregationBuilder.java index 12771f06e3192..8cb5e80597a20 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/CardinalityAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/CardinalityAggregationBuilder.java @@ -53,6 +53,11 @@ import java.util.Map; import java.util.Objects; +/** + * Aggregation Builder for cardinality agg + * + * @opensearch.internal + */ public final class CardinalityAggregationBuilder extends ValuesSourceAggregationBuilder.LeafOnly< ValuesSource, CardinalityAggregationBuilder> { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/CardinalityAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/CardinalityAggregator.java index 61cb08ba28ab0..1c1530843a66a 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/CardinalityAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/CardinalityAggregator.java @@ -63,6 +63,8 @@ /** * An aggregator that computes approximate counts of unique values. + * + * @opensearch.internal */ public class CardinalityAggregator extends NumericMetricsAggregator.SingleValue { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/CardinalityAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/CardinalityAggregatorFactory.java index 944cc4dc90771..47084436d3d4f 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/CardinalityAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/CardinalityAggregatorFactory.java @@ -46,6 +46,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Factory for cardinality agg + * + * @opensearch.internal + */ class CardinalityAggregatorFactory extends ValuesSourceAggregatorFactory { private final Long precisionThreshold; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/CardinalityAggregatorSupplier.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/CardinalityAggregatorSupplier.java index 8ecd0fba9158a..d5cb0242762fd 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/CardinalityAggregatorSupplier.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/CardinalityAggregatorSupplier.java @@ -39,6 +39,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregator supplier interface for cardinality agg + * + * @opensearch.internal + */ public interface CardinalityAggregatorSupplier { Aggregator build( String name, diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/CompensatedSum.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/CompensatedSum.java index 0cf637885cfa2..151b0d5073909 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/CompensatedSum.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/CompensatedSum.java @@ -40,6 +40,8 @@ * truncation and rounding. These errors can lead to numerical instability. * * @see Kahan Summation Algorithm + * + * @opensearch.internal */ public class CompensatedSum { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ExtendedStats.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ExtendedStats.java index ed8ffc1e19e36..36e9c1f93866c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ExtendedStats.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ExtendedStats.java @@ -33,6 +33,8 @@ /** * Statistics over a set of values (either aggregated over field data or scripts) + * + * @opensearch.internal */ public interface ExtendedStats extends Stats { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ExtendedStatsAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ExtendedStatsAggregationBuilder.java index cc01cba7c2a4a..649650b5a8d0b 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ExtendedStatsAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ExtendedStatsAggregationBuilder.java @@ -51,6 +51,11 @@ import java.util.Map; import java.util.Objects; +/** + * Aggregation Builder for extended stats agg + * + * @opensearch.internal + */ public class ExtendedStatsAggregationBuilder extends ValuesSourceAggregationBuilder.LeafOnly< ValuesSource.Numeric, ExtendedStatsAggregationBuilder> { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ExtendedStatsAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ExtendedStatsAggregator.java index b973f2cb74213..203fcd30b6300 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ExtendedStatsAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ExtendedStatsAggregator.java @@ -51,6 +51,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregate all docs into their extended statistics + * + * @opensearch.internal + */ class ExtendedStatsAggregator extends NumericMetricsAggregator.MultiValue { static final ParseField SIGMA_FIELD = new ParseField("sigma"); diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ExtendedStatsAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ExtendedStatsAggregatorFactory.java index f08d9630e8692..20203b22b2459 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ExtendedStatsAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ExtendedStatsAggregatorFactory.java @@ -47,6 +47,11 @@ import java.util.Arrays; import java.util.Map; +/** + * Aggregation Factory for extended_stats agg + * + * @opensearch.internal + */ class ExtendedStatsAggregatorFactory extends ValuesSourceAggregatorFactory { private final double sigma; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ExtendedStatsAggregatorProvider.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ExtendedStatsAggregatorProvider.java index ac86ebc2fc8aa..88cdf60b7aebe 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ExtendedStatsAggregatorProvider.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ExtendedStatsAggregatorProvider.java @@ -38,6 +38,9 @@ import java.io.IOException; import java.util.Map; +/** + * Base supplier of an ExtendesStats aggregator + */ public interface ExtendedStatsAggregatorProvider { Aggregator build( diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoBounds.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoBounds.java index ba0e115c383dc..380fbce85ada7 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoBounds.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoBounds.java @@ -37,6 +37,8 @@ /** * An aggregation that computes a bounding box in which all documents of the current bucket are. + * + * @opensearch.internal */ public interface GeoBounds extends Aggregation { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoBoundsAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoBoundsAggregationBuilder.java index 30ba6988325e6..64e27fa7e13d1 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoBoundsAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoBoundsAggregationBuilder.java @@ -50,6 +50,11 @@ import java.util.Map; import java.util.Objects; +/** + * Aggregation Builder for geo_bounds agg + * + * @opensearch.internal + */ public class GeoBoundsAggregationBuilder extends ValuesSourceAggregationBuilder { public static final String NAME = "geo_bounds"; public static final ValuesSourceRegistry.RegistryKey REGISTRY_KEY = new ValuesSourceRegistry.RegistryKey<>( diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoBoundsAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoBoundsAggregator.java index 6d3b0796ac520..054e8d4cb1c6c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoBoundsAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoBoundsAggregator.java @@ -50,6 +50,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregate all docs into a geographic bounds + * + * @opensearch.internal + */ final class GeoBoundsAggregator extends MetricsAggregator { static final ParseField WRAP_LONGITUDE_FIELD = new ParseField("wrap_longitude"); diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoBoundsAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoBoundsAggregatorFactory.java index 27744a549c748..2c6b75842b6f5 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoBoundsAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoBoundsAggregatorFactory.java @@ -46,6 +46,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Factory for geo_bounds agg + * + * @opensearch.internal + */ class GeoBoundsAggregatorFactory extends ValuesSourceAggregatorFactory { private final boolean wrapLongitude; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoBoundsAggregatorSupplier.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoBoundsAggregatorSupplier.java index 38e2fc919cf5e..4fd2b7be494ea 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoBoundsAggregatorSupplier.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoBoundsAggregatorSupplier.java @@ -39,6 +39,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregator supplier interface for geo_bounds agg + * + * @opensearch.internal + */ @FunctionalInterface public interface GeoBoundsAggregatorSupplier { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoCentroid.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoCentroid.java index 69f835e54ff0a..a5c13d15bacce 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoCentroid.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoCentroid.java @@ -37,6 +37,8 @@ /** * Interface for {@link GeoCentroidAggregator} + * + * @opensearch.internal */ public interface GeoCentroid extends Aggregation { GeoPoint centroid(); diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoCentroidAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoCentroidAggregationBuilder.java index dff3950fbe97b..b8c0b9ad1b2e9 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoCentroidAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoCentroidAggregationBuilder.java @@ -50,6 +50,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Builder for geo_centroid agg + * + * @opensearch.internal + */ public class GeoCentroidAggregationBuilder extends ValuesSourceAggregationBuilder.LeafOnly< ValuesSource.GeoPoint, GeoCentroidAggregationBuilder> { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoCentroidAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoCentroidAggregator.java index a8e8907b61ccf..656211608433a 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoCentroidAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoCentroidAggregator.java @@ -52,6 +52,8 @@ /** * A geo metric aggregator that computes a geo-centroid from a {@code geo_point} type field + * + * @opensearch.internal */ final class GeoCentroidAggregator extends MetricsAggregator { private final ValuesSource.GeoPoint valuesSource; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoCentroidAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoCentroidAggregatorFactory.java index d8ad21d532522..1d450eeae98d8 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoCentroidAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoCentroidAggregatorFactory.java @@ -46,6 +46,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Factory for geo_centroid agg + * + * @opensearch.internal + */ class GeoCentroidAggregatorFactory extends ValuesSourceAggregatorFactory { GeoCentroidAggregatorFactory( diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoGridAggregatorSupplier.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoGridAggregatorSupplier.java index 3c29c3558eb35..183c64f4e4af2 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoGridAggregatorSupplier.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/GeoGridAggregatorSupplier.java @@ -43,6 +43,11 @@ import java.io.IOException; import java.util.Map; +/** + * Base Aggregator supplier interface for geo grid aggs + * + * @opensearch.internal + */ @FunctionalInterface public interface GeoGridAggregatorSupplier { GeoGridAggregator build( diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/HDRPercentileRanksAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/HDRPercentileRanksAggregator.java index 959f0f82da4b8..8dea6c3a4b649 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/HDRPercentileRanksAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/HDRPercentileRanksAggregator.java @@ -41,6 +41,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregate all docs into an HDR percentile ranks values + * + * @opensearch.internal + */ class HDRPercentileRanksAggregator extends AbstractHDRPercentilesAggregator { HDRPercentileRanksAggregator( diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/HDRPercentilesAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/HDRPercentilesAggregator.java index 83c6cf051cbd1..e8b1e73db689e 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/HDRPercentilesAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/HDRPercentilesAggregator.java @@ -41,6 +41,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregate all docs into a single HDR percentile + * + * @opensearch.internal + */ class HDRPercentilesAggregator extends AbstractHDRPercentilesAggregator { HDRPercentilesAggregator( diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/HyperLogLogPlusPlus.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/HyperLogLogPlusPlus.java index 3408e8cf3bb5f..bfc121627bfe7 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/HyperLogLogPlusPlus.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/HyperLogLogPlusPlus.java @@ -60,6 +60,8 @@ * to the HyperLogLog algorithm and then this is used. * * It supports storing several HyperLogLogPlusPlus structures which are identified by a bucket number. + * + * @opensearch.internal */ public final class HyperLogLogPlusPlus extends AbstractHyperLogLogPlusPlus { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/HyperLogLogPlusPlusSparse.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/HyperLogLogPlusPlusSparse.java index 1a7a544d26bc9..9a042726423e7 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/HyperLogLogPlusPlusSparse.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/HyperLogLogPlusPlusSparse.java @@ -43,6 +43,8 @@ * * This structure expects all the added values to be distinct and therefore there are no checks * if an element has been previously added. + * + * @opensearch.internal */ final class HyperLogLogPlusPlusSparse extends AbstractHyperLogLogPlusPlus implements Releasable { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalAvg.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalAvg.java index ddbae8b37b33f..0dff1c7a9c2ab 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalAvg.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalAvg.java @@ -42,6 +42,11 @@ import java.util.Map; import java.util.Objects; +/** + * Implementation of internal agg + * + * @opensearch.internal + */ public class InternalAvg extends InternalNumericMetricsAggregation.SingleValue implements Avg { private final double sum; private final long count; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalCardinality.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalCardinality.java index 234e20393fa98..b4105084560f8 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalCardinality.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalCardinality.java @@ -44,6 +44,11 @@ import java.util.Map; import java.util.Objects; +/** + * Implementation of cardinality agg + * + * @opensearch.internal + */ public final class InternalCardinality extends InternalNumericMetricsAggregation.SingleValue implements Cardinality { private final AbstractHyperLogLogPlusPlus counts; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalExtendedStats.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalExtendedStats.java index 34d87d92dbbdb..75a4dbb4e74dd 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalExtendedStats.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalExtendedStats.java @@ -42,6 +42,11 @@ import java.util.Map; import java.util.Objects; +/** + * Implementation of extended stats agg + * + * @opensearch.internal + */ public class InternalExtendedStats extends InternalStats implements ExtendedStats { enum Metrics { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalGeoBounds.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalGeoBounds.java index 84a46ed6c71d6..87018242ee8df 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalGeoBounds.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalGeoBounds.java @@ -44,6 +44,11 @@ import java.util.Map; import java.util.Objects; +/** + * Implementation of geo bounds agg + * + * @opensearch.internal + */ public class InternalGeoBounds extends InternalAggregation implements GeoBounds { public final double top; public final double bottom; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalGeoCentroid.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalGeoCentroid.java index c043cca5d6c6f..262f8cc890192 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalGeoCentroid.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalGeoCentroid.java @@ -48,6 +48,8 @@ /** * Serialization and merge logic for {@link GeoCentroidAggregator}. + * + * @opensearch.internal */ public class InternalGeoCentroid extends InternalAggregation implements GeoCentroid { private final GeoPoint centroid; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalHDRPercentileRanks.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalHDRPercentileRanks.java index eb11d4bda33e3..ba3c917d1b5e6 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalHDRPercentileRanks.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalHDRPercentileRanks.java @@ -39,6 +39,11 @@ import java.util.Iterator; import java.util.Map; +/** + * Implementation of HDR percentiles ranks + * + * @opensearch.internal + */ public class InternalHDRPercentileRanks extends AbstractInternalHDRPercentiles implements PercentileRanks { public static final String NAME = "hdr_percentile_ranks"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalHDRPercentiles.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalHDRPercentiles.java index 2ba910fee43c9..2b1da6387494b 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalHDRPercentiles.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalHDRPercentiles.java @@ -39,6 +39,11 @@ import java.util.Iterator; import java.util.Map; +/** + * Implementation of HDR percentiles agg + * + * @opensearch.internal + */ public class InternalHDRPercentiles extends AbstractInternalHDRPercentiles implements Percentiles { public static final String NAME = "hdr_percentiles"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalMax.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalMax.java index 675f82eda8add..6c9dcb29e2355 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalMax.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalMax.java @@ -42,6 +42,11 @@ import java.util.Map; import java.util.Objects; +/** + * Implementation of max agg + * + * @opensearch.internal + */ public class InternalMax extends InternalNumericMetricsAggregation.SingleValue implements Max { private final double max; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalMedianAbsoluteDeviation.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalMedianAbsoluteDeviation.java index 9066709b8bfaa..864894f7547ee 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalMedianAbsoluteDeviation.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalMedianAbsoluteDeviation.java @@ -43,6 +43,11 @@ import java.util.Map; import java.util.Objects; +/** + * Implementation of median absolute deviation agg + * + * @opensearch.internal + */ public class InternalMedianAbsoluteDeviation extends InternalNumericMetricsAggregation.SingleValue implements MedianAbsoluteDeviation { static double computeMedianAbsoluteDeviation(TDigestState valuesSketch) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalMin.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalMin.java index ba00bc457ff83..8f28a714ba840 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalMin.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalMin.java @@ -42,6 +42,11 @@ import java.util.Map; import java.util.Objects; +/** + * Implementation of min agg + * + * @opensearch.internal + */ public class InternalMin extends InternalNumericMetricsAggregation.SingleValue implements Min { private final double min; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalNumericMetricsAggregation.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalNumericMetricsAggregation.java index e7c43794d3963..2c66321ecb331 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalNumericMetricsAggregation.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalNumericMetricsAggregation.java @@ -42,6 +42,11 @@ import java.util.Map; import java.util.Objects; +/** + * Base aggregation to aggregate all docs into a single numeric metric + * + * @opensearch.internal + */ public abstract class InternalNumericMetricsAggregation extends InternalAggregation { private static final DocValueFormat DEFAULT_FORMAT = DocValueFormat.RAW; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalScriptedMetric.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalScriptedMetric.java index a9924916de1de..9244d661a699e 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalScriptedMetric.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalScriptedMetric.java @@ -51,6 +51,11 @@ import static java.util.Collections.singletonList; +/** + * Implementation of scripted metric agg + * + * @opensearch.internal + */ public class InternalScriptedMetric extends InternalAggregation implements ScriptedMetric { final Script reduceScript; private final List aggregations; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalStats.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalStats.java index 6c6953633c799..6bd48f221346b 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalStats.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalStats.java @@ -42,6 +42,11 @@ import java.util.Map; import java.util.Objects; +/** + * Implementation of stats agg + * + * @opensearch.internal + */ public class InternalStats extends InternalNumericMetricsAggregation.MultiValue implements Stats { enum Metrics { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalSum.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalSum.java index 174b697839659..0a89b5ed3d1a3 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalSum.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalSum.java @@ -42,6 +42,11 @@ import java.util.Map; import java.util.Objects; +/** + * Implementation of sum agg + * + * @opensearch.internal + */ public class InternalSum extends InternalNumericMetricsAggregation.SingleValue implements Sum { private final double sum; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalTDigestPercentileRanks.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalTDigestPercentileRanks.java index 65d3ece0bbb40..45ce6dc3ead3a 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalTDigestPercentileRanks.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalTDigestPercentileRanks.java @@ -38,6 +38,11 @@ import java.util.Iterator; import java.util.Map; +/** + * Implementation of TDigest percentiles rank agg + * + * @opensearch.internal + */ public class InternalTDigestPercentileRanks extends AbstractInternalTDigestPercentiles implements PercentileRanks { public static final String NAME = "tdigest_percentile_ranks"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalTDigestPercentiles.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalTDigestPercentiles.java index 1988d03ca5e4b..8cc224f2f08ec 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalTDigestPercentiles.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalTDigestPercentiles.java @@ -38,6 +38,11 @@ import java.util.Iterator; import java.util.Map; +/** + * Implementation of TDigest percentiles agg + * + * @opensearch.internal + */ public class InternalTDigestPercentiles extends AbstractInternalTDigestPercentiles implements Percentiles { public static final String NAME = "tdigest_percentiles"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalTopHits.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalTopHits.java index 24e7875a6ade9..0f17c6c9180eb 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalTopHits.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalTopHits.java @@ -53,6 +53,8 @@ /** * Results of the {@link TopHitsAggregator}. + * + * @opensearch.internal */ public class InternalTopHits extends InternalAggregation implements TopHits { private int from; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalValueCount.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalValueCount.java index 7e839a6874ee1..0f7aff1a674c8 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalValueCount.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalValueCount.java @@ -43,6 +43,8 @@ /** * An internal implementation of {@link ValueCount}. + * + * @opensearch.internal */ public class InternalValueCount extends InternalNumericMetricsAggregation.SingleValue implements ValueCount { private final long value; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalWeightedAvg.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalWeightedAvg.java index 6e2cf0dc6d326..b2855f8bd15ac 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalWeightedAvg.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/InternalWeightedAvg.java @@ -42,6 +42,11 @@ import java.util.Map; import java.util.Objects; +/** + * Implementation of weighted avg agg + * + * @opensearch.internal + */ public class InternalWeightedAvg extends InternalNumericMetricsAggregation.SingleValue implements WeightedAvg { private final double sum; private final double weight; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/Max.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/Max.java index 24a0c834b597d..5834173e10ea5 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/Max.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/Max.java @@ -33,6 +33,8 @@ /** * An aggregation that computes the maximum of the values in the current bucket. + * + * @opensearch.internal */ public interface Max extends NumericMetricsAggregation.SingleValue { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/MaxAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/MaxAggregationBuilder.java index 4cdc73a08dd20..55c5a6ca3ce42 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/MaxAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/MaxAggregationBuilder.java @@ -50,6 +50,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Builder for max agg + * + * @opensearch.internal + */ public class MaxAggregationBuilder extends ValuesSourceAggregationBuilder.LeafOnly { public static final String NAME = "max"; public static final ValuesSourceRegistry.RegistryKey REGISTRY_KEY = new ValuesSourceRegistry.RegistryKey<>( diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/MaxAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/MaxAggregator.java index b755d54de0fe5..8108b8a726856 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/MaxAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/MaxAggregator.java @@ -57,6 +57,11 @@ import java.util.Map; import java.util.function.Function; +/** + * Aggregate all docs into a max value + * + * @opensearch.internal + */ class MaxAggregator extends NumericMetricsAggregator.SingleValue { final ValuesSource.Numeric valuesSource; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/MaxAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/MaxAggregatorFactory.java index 2541f8fdf0bbb..3ec24ad04d9aa 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/MaxAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/MaxAggregatorFactory.java @@ -46,6 +46,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Factory for max agg + * + * @opensearch.internal + */ class MaxAggregatorFactory extends ValuesSourceAggregatorFactory { static void registerAggregators(ValuesSourceRegistry.Builder builder) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/MedianAbsoluteDeviation.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/MedianAbsoluteDeviation.java index 34437b7c91621..0c989f627309d 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/MedianAbsoluteDeviation.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/MedianAbsoluteDeviation.java @@ -36,6 +36,8 @@ * An aggregation that approximates the median absolute deviation of a numeric field * * @see https://en.wikipedia.org/wiki/Median_absolute_deviation + * + * @opensearch.internal */ public interface MedianAbsoluteDeviation extends NumericMetricsAggregation.SingleValue { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregationBuilder.java index 09faa958f821c..e6a8de6b4edc2 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregationBuilder.java @@ -54,6 +54,11 @@ import java.util.Map; import java.util.Objects; +/** + * Aggregation Builder for median_absolute_deviation agg + * + * @opensearch.internal + */ public class MedianAbsoluteDeviationAggregationBuilder extends LeafOnly { public static final String NAME = "median_absolute_deviation"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregator.java index 24c26d695c715..0b4684452a8dc 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregator.java @@ -53,6 +53,11 @@ import static org.opensearch.search.aggregations.metrics.InternalMedianAbsoluteDeviation.computeMedianAbsoluteDeviation; +/** + * Aggregate all docs into a median absolute deviation + * + * @opensearch.internal + */ public class MedianAbsoluteDeviationAggregator extends NumericMetricsAggregator.SingleValue { private final ValuesSource.Numeric valuesSource; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregatorFactory.java index e749fe4db0866..9776595d5a76d 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregatorFactory.java @@ -46,6 +46,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Factory for median_absolute_deviation agg + * + * @opensearch.internal + */ public class MedianAbsoluteDeviationAggregatorFactory extends ValuesSourceAggregatorFactory { private final double compression; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregatorSupplier.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregatorSupplier.java index 6ae211719217b..986e32cf438cd 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregatorSupplier.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/MedianAbsoluteDeviationAggregatorSupplier.java @@ -39,6 +39,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregator supplier interface for median_absolute_deviation agg + * + * @opensearch.internal + */ public interface MedianAbsoluteDeviationAggregatorSupplier { Aggregator build( String name, diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/MetricAggregatorSupplier.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/MetricAggregatorSupplier.java index f260da8a2638c..4e70d417c4b91 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/MetricAggregatorSupplier.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/MetricAggregatorSupplier.java @@ -38,6 +38,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregator supplier interface for metric aggs + * + * @opensearch.internal + */ public interface MetricAggregatorSupplier { Aggregator build( String name, diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/MetricInspectionHelper.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/MetricInspectionHelper.java index 2ed48a97bc381..47e27da5394b3 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/MetricInspectionHelper.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/MetricInspectionHelper.java @@ -38,6 +38,8 @@ * helpers for some aggs that have package-private getters. AggregationInspectionHelper delegates to these * helpers when needed, and consumers should prefer to use AggregationInspectionHelper instead of these * helpers. + * + * @opensearch.internal */ public class MetricInspectionHelper { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/MetricsAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/MetricsAggregator.java index f59daeb469009..0929fc60b02c9 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/MetricsAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/MetricsAggregator.java @@ -42,6 +42,11 @@ import java.io.IOException; import java.util.Map; +/** + * Base aggregator to aggregate all docs into a single metric + * + * @opensearch.internal + */ public abstract class MetricsAggregator extends AggregatorBase { protected MetricsAggregator(String name, SearchContext context, Aggregator parent, Map metadata) throws IOException { super(name, AggregatorFactories.EMPTY, context, parent, CardinalityUpperBound.NONE, metadata); diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/Min.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/Min.java index dd3aea059e826..b99e08c9df86c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/Min.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/Min.java @@ -33,6 +33,8 @@ /** * An aggregation that computes the minimum of the values in the current bucket. + * + * @opensearch.internal */ public interface Min extends NumericMetricsAggregation.SingleValue { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/MinAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/MinAggregationBuilder.java index 89797710a40f7..45c69363bce6a 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/MinAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/MinAggregationBuilder.java @@ -50,6 +50,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Builder for min agg + * + * @opensearch.internal + */ public class MinAggregationBuilder extends ValuesSourceAggregationBuilder.LeafOnly { public static final String NAME = "min"; public static final ValuesSourceRegistry.RegistryKey REGISTRY_KEY = new ValuesSourceRegistry.RegistryKey<>( diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/MinAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/MinAggregator.java index 372fd936fa766..946057e42ac88 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/MinAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/MinAggregator.java @@ -56,6 +56,11 @@ import java.util.Map; import java.util.function.Function; +/** + * Aggregate all docs into a min value + * + * @opensearch.internal + */ class MinAggregator extends NumericMetricsAggregator.SingleValue { private static final int MAX_BKD_LOOKUPS = 1024; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/MinAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/MinAggregatorFactory.java index 3db64aa05bb6c..1b24b88d6f068 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/MinAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/MinAggregatorFactory.java @@ -46,6 +46,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Factory for min agg + * + * @opensearch.internal + */ class MinAggregatorFactory extends ValuesSourceAggregatorFactory { static void registerAggregators(ValuesSourceRegistry.Builder builder) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/NumericMetricsAggregation.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/NumericMetricsAggregation.java index acde7bc6f3d4e..88e292f4d4bd3 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/NumericMetricsAggregation.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/NumericMetricsAggregation.java @@ -34,6 +34,11 @@ import org.opensearch.search.aggregations.Aggregation; +/** + * Base numeric metrics aggregation class + * + * @opensearch.internal + */ public interface NumericMetricsAggregation extends Aggregation { interface SingleValue extends NumericMetricsAggregation { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/NumericMetricsAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/NumericMetricsAggregator.java index 9a4c0be0b7c47..96d2d525e8386 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/NumericMetricsAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/NumericMetricsAggregator.java @@ -39,6 +39,11 @@ import java.io.IOException; import java.util.Map; +/** + * Base class to aggregate all docs into a single numeric metric value. + * + * @opensearch.internal + */ public abstract class NumericMetricsAggregator extends MetricsAggregator { private NumericMetricsAggregator(String name, SearchContext context, Aggregator parent, Map metadata) diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedAvg.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedAvg.java index 1242f61e75ac8..cc12044cba09d 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedAvg.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedAvg.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * An average agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedAvg extends ParsedSingleValueNumericMetricsAggregation implements Avg { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedCardinality.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedCardinality.java index 99bb36b900c23..4c6e3f7c78877 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedCardinality.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedCardinality.java @@ -39,6 +39,11 @@ import java.io.IOException; +/** + * A cardinality agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedCardinality extends ParsedAggregation implements Cardinality { private long cardinalityValue; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedExtendedStats.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedExtendedStats.java index 1cc0ab59030db..0378ffff9980d 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedExtendedStats.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedExtendedStats.java @@ -48,6 +48,11 @@ import static org.opensearch.common.xcontent.ConstructingObjectParser.constructorArg; import static org.opensearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +/** + * An extended stats agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedExtendedStats extends ParsedStats implements ExtendedStats { protected double sumOfSquares; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedGeoBounds.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedGeoBounds.java index e0c734e4dc8c5..a482fcfdf08dd 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedGeoBounds.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedGeoBounds.java @@ -51,6 +51,11 @@ import static org.opensearch.common.geo.GeoBoundingBox.TOP_LEFT_FIELD; import static org.opensearch.common.xcontent.ConstructingObjectParser.constructorArg; +/** + * A geo bounds agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedGeoBounds extends ParsedAggregation implements GeoBounds { // A top of Double.NEGATIVE_INFINITY yields an empty xContent, so the bounding box is null diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedGeoCentroid.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedGeoCentroid.java index 06e099f9709ea..04feb4a96dd56 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedGeoCentroid.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedGeoCentroid.java @@ -43,6 +43,8 @@ /** * Serialization and merge logic for {@link GeoCentroidAggregator}. + * + * @opensearch.internal */ public class ParsedGeoCentroid extends ParsedAggregation implements GeoCentroid { private GeoPoint centroid; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedHDRPercentileRanks.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedHDRPercentileRanks.java index 5faa795d8b630..e3c4ac5d3a4ab 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedHDRPercentileRanks.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedHDRPercentileRanks.java @@ -38,6 +38,11 @@ import java.io.IOException; import java.util.Iterator; +/** + * An HDR agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedHDRPercentileRanks extends ParsedPercentileRanks { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedHDRPercentiles.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedHDRPercentiles.java index f7a4afb86be3e..3a2f510ebb4e3 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedHDRPercentiles.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedHDRPercentiles.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * An HDR percentiles agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedHDRPercentiles extends ParsedPercentiles implements Percentiles { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedMax.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedMax.java index 2862a629ab747..ae91e4a3873cf 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedMax.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedMax.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * A max agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedMax extends ParsedSingleValueNumericMetricsAggregation implements Max { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedMedianAbsoluteDeviation.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedMedianAbsoluteDeviation.java index 001e44736ae2a..9e2dc3025450f 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedMedianAbsoluteDeviation.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedMedianAbsoluteDeviation.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * A median absolute deviation agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedMedianAbsoluteDeviation extends ParsedSingleValueNumericMetricsAggregation implements MedianAbsoluteDeviation { private static final ObjectParser PARSER = new ObjectParser<>( diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedMin.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedMin.java index 711a4e94b0e7a..f5d571b58e45c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedMin.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedMin.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * A min agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedMin extends ParsedSingleValueNumericMetricsAggregation implements Min { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedPercentileRanks.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedPercentileRanks.java index 71773e80405e9..be57e85962e8d 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedPercentileRanks.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedPercentileRanks.java @@ -32,6 +32,11 @@ package org.opensearch.search.aggregations.metrics; +/** + * A percentiles agg result parsed between nodes + * + * @opensearch.internal + */ abstract class ParsedPercentileRanks extends ParsedPercentiles implements PercentileRanks { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedPercentiles.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedPercentiles.java index 06f8eba1f46ff..f6efeed0b96cb 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedPercentiles.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedPercentiles.java @@ -43,6 +43,11 @@ import java.util.LinkedHashMap; import java.util.Map; +/** + * A single percentiles agg result parsed between nodes + * + * @opensearch.internal + */ public abstract class ParsedPercentiles extends ParsedAggregation implements Iterable { protected final Map percentiles = new LinkedHashMap<>(); diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedScriptedMetric.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedScriptedMetric.java index b7bc5a7d2c39c..afd89bb9f9ef6 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedScriptedMetric.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedScriptedMetric.java @@ -44,6 +44,11 @@ import java.util.Collections; import java.util.List; +/** + * A scripted metric result parsed between nodes + * + * @opensearch.internal + */ public class ParsedScriptedMetric extends ParsedAggregation implements ScriptedMetric { private List aggregation; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedSingleValueNumericMetricsAggregation.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedSingleValueNumericMetricsAggregation.java index ae657e203fc2f..ebcf34b77facb 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedSingleValueNumericMetricsAggregation.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedSingleValueNumericMetricsAggregation.java @@ -35,6 +35,11 @@ import org.opensearch.common.xcontent.ObjectParser.ValueType; import org.opensearch.search.aggregations.ParsedAggregation; +/** + * A single value numeric agg result parsed between nodes + * + * @opensearch.internal + */ public abstract class ParsedSingleValueNumericMetricsAggregation extends ParsedAggregation implements NumericMetricsAggregation.SingleValue { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedStats.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedStats.java index 55258f1e10973..0c83417a82604 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedStats.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedStats.java @@ -44,6 +44,11 @@ import java.util.HashMap; import java.util.Map; +/** + * A stats agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedStats extends ParsedAggregation implements Stats { protected long count; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedSum.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedSum.java index 2f5d8fca16636..73024e26128a3 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedSum.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedSum.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * A sum agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedSum extends ParsedSingleValueNumericMetricsAggregation implements Sum { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedTDigestPercentileRanks.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedTDigestPercentileRanks.java index f1cfaf3f08848..c7cf92f6a0873 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedTDigestPercentileRanks.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedTDigestPercentileRanks.java @@ -38,6 +38,11 @@ import java.io.IOException; import java.util.Iterator; +/** + * A TDigest percentiles rank agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedTDigestPercentileRanks extends ParsedPercentileRanks { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedTDigestPercentiles.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedTDigestPercentiles.java index 9b6090c3de2e3..36531ad7e699a 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedTDigestPercentiles.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedTDigestPercentiles.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * A single TDigest percentiles result parsed between nodes + * + * @opensearch.internal + */ public class ParsedTDigestPercentiles extends ParsedPercentiles implements Percentiles { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedTopHits.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedTopHits.java index 9d52e71cbfe6b..b0c5709c9bab0 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedTopHits.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedTopHits.java @@ -41,6 +41,11 @@ import java.io.IOException; +/** + * A top_hits agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedTopHits extends ParsedAggregation implements TopHits { private SearchHits searchHits; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedValueCount.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedValueCount.java index 305cee740648c..0e3f8f5633174 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedValueCount.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedValueCount.java @@ -39,6 +39,11 @@ import java.io.IOException; +/** + * A value count agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedValueCount extends ParsedAggregation implements ValueCount { private long valueCount; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedWeightedAvg.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedWeightedAvg.java index 680f6274c8e21..f67fd13a8ccd4 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedWeightedAvg.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ParsedWeightedAvg.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * A weighted average agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedWeightedAvg extends ParsedSingleValueNumericMetricsAggregation implements WeightedAvg { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/Percentile.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/Percentile.java index d797e602b2d80..50ebd6f343fc2 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/Percentile.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/Percentile.java @@ -34,6 +34,11 @@ import java.util.Objects; +/** + * Implementation of a percentile + * + * @opensearch.internal + */ public class Percentile { private final double percent; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentileRanks.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentileRanks.java index 00725b20f8015..b4a6dc39a442e 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentileRanks.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentileRanks.java @@ -34,6 +34,8 @@ /** * An aggregation that computes approximate percentiles given values. + * + * @opensearch.internal */ public interface PercentileRanks extends NumericMetricsAggregation.MultiValue, Iterable { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentileRanksAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentileRanksAggregationBuilder.java index 037830c63ecdf..e63830fa7edac 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentileRanksAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentileRanksAggregationBuilder.java @@ -49,6 +49,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Builder for percentile_ranks agg + * + * @opensearch.internal + */ public class PercentileRanksAggregationBuilder extends AbstractPercentilesAggregationBuilder { public static final String NAME = PercentileRanks.TYPE_NAME; public static final ValuesSourceRegistry.RegistryKey REGISTRY_KEY = diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentileRanksAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentileRanksAggregatorFactory.java index 059b9dd7d0d1c..19352d30a5177 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentileRanksAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentileRanksAggregatorFactory.java @@ -47,6 +47,11 @@ import java.util.Arrays; import java.util.Map; +/** + * Base Aggregation Factory for ranks aggs + * + * @opensearch.internal + */ class PercentileRanksAggregatorFactory extends ValuesSourceAggregatorFactory { private final double[] percents; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/Percentiles.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/Percentiles.java index 5b40a2ce8f2f3..f6bf9d1f82348 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/Percentiles.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/Percentiles.java @@ -33,6 +33,8 @@ /** * An aggregation that computes approximate percentiles. + * + * @opensearch.internal */ public interface Percentiles extends NumericMetricsAggregation.MultiValue, Iterable { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentilesAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentilesAggregationBuilder.java index 323723bb6deb1..ef80e86661ce0 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentilesAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentilesAggregationBuilder.java @@ -50,6 +50,11 @@ import java.util.Arrays; import java.util.Map; +/** + * Aggregation Builder for percentiles agg + * + * @opensearch.internal + */ public class PercentilesAggregationBuilder extends AbstractPercentilesAggregationBuilder { public static final String NAME = Percentiles.TYPE_NAME; public static final ValuesSourceRegistry.RegistryKey REGISTRY_KEY = diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentilesAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentilesAggregatorFactory.java index 15f3010719916..e249863e25313 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentilesAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentilesAggregatorFactory.java @@ -50,6 +50,8 @@ /** * This factory is used to generate both TDigest and HDRHisto aggregators, depending * on the selected method + * + * @opensearch.internal */ class PercentilesAggregatorFactory extends ValuesSourceAggregatorFactory { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentilesAggregatorSupplier.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentilesAggregatorSupplier.java index d65619be5bc0e..8f6e36a3ac8e1 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentilesAggregatorSupplier.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentilesAggregatorSupplier.java @@ -39,6 +39,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregator supplier interface for percentiles aggs + * + * @opensearch.internal + */ public interface PercentilesAggregatorSupplier { Aggregator build( String name, diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentilesConfig.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentilesConfig.java index 26ef2727832bc..f20cf2eb22350 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentilesConfig.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentilesConfig.java @@ -50,6 +50,8 @@ * A small config object that carries algo-specific settings. This allows the factory to have * a single unified constructor for both algos, but internally switch execution * depending on which algo is selected + * + * @opensearch.internal */ public abstract class PercentilesConfig implements ToXContent, Writeable { private final PercentilesMethod method; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentilesMethod.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentilesMethod.java index b167251861bc2..ee7b745382632 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentilesMethod.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/PercentilesMethod.java @@ -42,6 +42,8 @@ /** * An enum representing the methods for calculating percentiles + * + * @opensearch.internal */ public enum PercentilesMethod implements Writeable { /** diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ScriptedMetric.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ScriptedMetric.java index 3cf6da01e0f43..487e7c9de22d6 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ScriptedMetric.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ScriptedMetric.java @@ -36,6 +36,8 @@ /** * A metric aggregation that computes both its final and intermediate states using scripts. + * + * @opensearch.internal */ public interface ScriptedMetric extends Aggregation { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ScriptedMetricAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ScriptedMetricAggregationBuilder.java index 4564977f09471..7a2b733a67d5d 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ScriptedMetricAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ScriptedMetricAggregationBuilder.java @@ -52,6 +52,11 @@ import static org.opensearch.common.xcontent.ConstructingObjectParser.constructorArg; +/** + * Aggregation Builder for scripted_metric agg + * + * @opensearch.internal + */ public class ScriptedMetricAggregationBuilder extends AbstractAggregationBuilder { public static final String NAME = "scripted_metric"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ScriptedMetricAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ScriptedMetricAggregator.java index 8ff0e33afbcf9..2a2943e93150f 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ScriptedMetricAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ScriptedMetricAggregator.java @@ -56,6 +56,11 @@ import static java.util.Collections.singletonList; +/** + * Aggregate all docs based on a value script + * + * @opensearch.internal + */ class ScriptedMetricAggregator extends MetricsAggregator { /** * Estimated cost to maintain a bucket. Since this aggregator uses diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ScriptedMetricAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ScriptedMetricAggregatorFactory.java index 53e865b2f04b7..7b5848fc79197 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ScriptedMetricAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ScriptedMetricAggregatorFactory.java @@ -50,6 +50,11 @@ import java.util.List; import java.util.Map; +/** + * Aggregation Factory for scripted_metrics agg + * + * @opensearch.internal + */ class ScriptedMetricAggregatorFactory extends AggregatorFactory { private final ScriptedMetricAggContexts.MapScript.Factory mapScript; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/Stats.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/Stats.java index 4228996f426df..4e854196f387b 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/Stats.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/Stats.java @@ -33,6 +33,8 @@ /** * Statistics over a set of values (either aggregated over field data or scripts) + * + * @opensearch.internal */ public interface Stats extends NumericMetricsAggregation.MultiValue { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/StatsAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/StatsAggregationBuilder.java index da38127c80d2d..9de5e4d9f9b96 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/StatsAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/StatsAggregationBuilder.java @@ -50,6 +50,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Builder for stats agg + * + * @opensearch.internal + */ public class StatsAggregationBuilder extends ValuesSourceAggregationBuilder.LeafOnly { public static final String NAME = "stats"; public static final ValuesSourceRegistry.RegistryKey REGISTRY_KEY = new ValuesSourceRegistry.RegistryKey<>( diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/StatsAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/StatsAggregator.java index 069721e37531f..c52638fe4b9c6 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/StatsAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/StatsAggregator.java @@ -50,6 +50,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregate all docs into their basic descriptive statistics + * + * @opensearch.internal + */ class StatsAggregator extends NumericMetricsAggregator.MultiValue { final ValuesSource.Numeric valuesSource; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/StatsAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/StatsAggregatorFactory.java index 01772df17a925..6e343ed9a31d1 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/StatsAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/StatsAggregatorFactory.java @@ -46,6 +46,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Factory for stats agg + * + * @opensearch.internal + */ class StatsAggregatorFactory extends ValuesSourceAggregatorFactory { StatsAggregatorFactory( diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/Sum.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/Sum.java index cee960280e052..e58a9e504cf04 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/Sum.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/Sum.java @@ -33,6 +33,8 @@ /** * An aggregation that computes the sum of the values in the current bucket. + * + * @opensearch.internal */ public interface Sum extends NumericMetricsAggregation.SingleValue { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/SumAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/SumAggregationBuilder.java index dee421d8bd38a..d6d33eae90c96 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/SumAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/SumAggregationBuilder.java @@ -50,6 +50,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Builder for sum agg + * + * @opensearch.internal + */ public class SumAggregationBuilder extends ValuesSourceAggregationBuilder.LeafOnly { public static final String NAME = "sum"; public static final ValuesSourceRegistry.RegistryKey REGISTRY_KEY = new ValuesSourceRegistry.RegistryKey<>( diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/SumAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/SumAggregator.java index 82799d8e9f3a1..4b8e882cd69bc 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/SumAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/SumAggregator.java @@ -49,6 +49,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregate all docs into a single sum value + * + * @opensearch.internal + */ public class SumAggregator extends NumericMetricsAggregator.SingleValue { private final ValuesSource.Numeric valuesSource; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/SumAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/SumAggregatorFactory.java index c05b438b0680f..c94949bca09e6 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/SumAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/SumAggregatorFactory.java @@ -46,6 +46,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Factory for sum agg + * + * @opensearch.internal + */ class SumAggregatorFactory extends ValuesSourceAggregatorFactory { SumAggregatorFactory( diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/TDigestPercentileRanksAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/TDigestPercentileRanksAggregator.java index c61a55950b7d2..8c7b71561ed9d 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/TDigestPercentileRanksAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/TDigestPercentileRanksAggregator.java @@ -40,6 +40,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregate all docs into a the TDigenst Percentile Ranks + * + * @opensearch.internal + */ class TDigestPercentileRanksAggregator extends AbstractTDigestPercentilesAggregator { TDigestPercentileRanksAggregator( diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/TDigestPercentilesAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/TDigestPercentilesAggregator.java index 4c9213f35d10c..a5844858d29c4 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/TDigestPercentilesAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/TDigestPercentilesAggregator.java @@ -40,6 +40,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregate all docs into a single TDigest Percentile + * + * @opensearch.internal + */ class TDigestPercentilesAggregator extends AbstractTDigestPercentilesAggregator { TDigestPercentilesAggregator( diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/TDigestState.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/TDigestState.java index c6ea32d6e9620..e551d0e9d4fa2 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/TDigestState.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/TDigestState.java @@ -41,6 +41,8 @@ /** * Extension of {@link com.tdunning.math.stats.TDigest} with custom serialization. + * + * @opensearch.internal */ public class TDigestState extends AVLTreeDigest { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/TopHits.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/TopHits.java index dc6b02636d627..101af7daafad6 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/TopHits.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/TopHits.java @@ -36,6 +36,8 @@ /** * Accumulation of the most relevant hits for a bucket this aggregation falls into. + * + * @opensearch.internal */ public interface TopHits extends Aggregation { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/TopHitsAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/TopHitsAggregationBuilder.java index d1097aaa20612..f88a47fc745d4 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/TopHitsAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/TopHitsAggregationBuilder.java @@ -72,6 +72,11 @@ import java.util.Optional; import java.util.Set; +/** + * Aggregation Builder for top_hits agg + * + * @opensearch.internal + */ public class TopHitsAggregationBuilder extends AbstractAggregationBuilder { public static final String NAME = "top_hits"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/TopHitsAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/TopHitsAggregator.java index 94425501de3e2..2964ede7979cb 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/TopHitsAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/TopHitsAggregator.java @@ -70,6 +70,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregate all docs into the top hits + * + * @opensearch.internal + */ class TopHitsAggregator extends MetricsAggregator { private static class Collectors { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/TopHitsAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/TopHitsAggregatorFactory.java index b9699964a611e..e312983cd6d24 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/TopHitsAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/TopHitsAggregatorFactory.java @@ -53,6 +53,11 @@ import java.util.Map; import java.util.Optional; +/** + * Aggregation Factory for top_hits agg + * + * @opensearch.internal + */ class TopHitsAggregatorFactory extends AggregatorFactory { private final int from; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ValueCount.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ValueCount.java index 158c29eca4cbc..8c35a6a7ac72e 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ValueCount.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ValueCount.java @@ -34,6 +34,8 @@ /** * An get that holds the number of values that the current document set has for a specific * field. + * + * @opensearch.internal */ public interface ValueCount extends NumericMetricsAggregation.SingleValue { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ValueCountAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ValueCountAggregationBuilder.java index 246609f518547..2a459bb8430c1 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ValueCountAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ValueCountAggregationBuilder.java @@ -51,6 +51,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Builder for value_count agg + * + * @opensearch.internal + */ public class ValueCountAggregationBuilder extends ValuesSourceAggregationBuilder.LeafOnly { public static final String NAME = "value_count"; public static final ValuesSourceRegistry.RegistryKey REGISTRY_KEY = new ValuesSourceRegistry.RegistryKey<>( diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ValueCountAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ValueCountAggregator.java index 4ba2245e9779e..be98df384fc28 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ValueCountAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ValueCountAggregator.java @@ -55,6 +55,8 @@ * * This aggregator works in a multi-bucket mode, that is, when serves as a sub-aggregator, a single aggregator instance aggregates the * counts for all buckets owned by the parent aggregator) + * + * @opensearch.internal */ public class ValueCountAggregator extends NumericMetricsAggregator.SingleValue { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/ValueCountAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/ValueCountAggregatorFactory.java index 1542f25dd49c2..feed42e911856 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/ValueCountAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/ValueCountAggregatorFactory.java @@ -46,6 +46,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Factory for value_count agg + * + * @opensearch.internal + */ class ValueCountAggregatorFactory extends ValuesSourceAggregatorFactory { public static void registerAggregators(ValuesSourceRegistry.Builder builder) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/WeightedAvg.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/WeightedAvg.java index 8afd013f7306e..b81520f8790ca 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/WeightedAvg.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/WeightedAvg.java @@ -33,6 +33,8 @@ /** * An aggregation that computes the average of the values in the current bucket. + * + * @opensearch.internal */ public interface WeightedAvg extends NumericMetricsAggregation.SingleValue { diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/WeightedAvgAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/WeightedAvgAggregationBuilder.java index 6afad18ddd282..1dccbba0ec54d 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/WeightedAvgAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/WeightedAvgAggregationBuilder.java @@ -58,6 +58,11 @@ import java.util.Map; import java.util.Objects; +/** + * Aggregation Builder for weighted_avg agg + * + * @opensearch.internal + */ public class WeightedAvgAggregationBuilder extends MultiValuesSourceAggregationBuilder.LeafOnly { public static final String NAME = "weighted_avg"; public static final ParseField VALUE_FIELD = new ParseField("value"); diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/WeightedAvgAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/WeightedAvgAggregator.java index 6498674e83847..d85ee651cb5e0 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/WeightedAvgAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/WeightedAvgAggregator.java @@ -52,6 +52,11 @@ import static org.opensearch.search.aggregations.metrics.WeightedAvgAggregationBuilder.VALUE_FIELD; import static org.opensearch.search.aggregations.metrics.WeightedAvgAggregationBuilder.WEIGHT_FIELD; +/** + * Aggregate all docs into a weighted average + * + * @opensearch.internal + */ class WeightedAvgAggregator extends NumericMetricsAggregator.SingleValue { private final MultiValuesSource.NumericMultiValuesSource valuesSources; diff --git a/server/src/main/java/org/opensearch/search/aggregations/metrics/WeightedAvgAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/metrics/WeightedAvgAggregatorFactory.java index add0933d40066..9a27e9801d5fe 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/metrics/WeightedAvgAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/metrics/WeightedAvgAggregatorFactory.java @@ -48,6 +48,11 @@ import static org.opensearch.search.aggregations.metrics.WeightedAvgAggregationBuilder.VALUE_FIELD; +/** + * Aggregation Factory for weighted_avg agg + * + * @opensearch.internal + */ class WeightedAvgAggregatorFactory extends MultiValuesSourceAggregatorFactory { WeightedAvgAggregatorFactory( diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/AbstractPipelineAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/AbstractPipelineAggregationBuilder.java index 290e13b2ee4bc..5d7acc0ec3dc2 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/AbstractPipelineAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/AbstractPipelineAggregationBuilder.java @@ -44,6 +44,8 @@ /** * Base implementation of a {@link PipelineAggregationBuilder}. + * + * @opensearch.internal */ public abstract class AbstractPipelineAggregationBuilder> extends PipelineAggregationBuilder { diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/AvgBucketPipelineAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/AvgBucketPipelineAggregationBuilder.java index 619d7aa5d4407..e0c1abc304b41 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/AvgBucketPipelineAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/AvgBucketPipelineAggregationBuilder.java @@ -39,6 +39,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Builder for avg_bucket agg + * + * @opensearch.internal + */ public class AvgBucketPipelineAggregationBuilder extends BucketMetricsPipelineAggregationBuilder { public static final String NAME = "avg_bucket"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/AvgBucketPipelineAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/AvgBucketPipelineAggregator.java index 5aea6e1893c04..e9e1f13a80766 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/AvgBucketPipelineAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/AvgBucketPipelineAggregator.java @@ -40,6 +40,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregate all docs into an average bucket + * + * @opensearch.internal + */ public class AvgBucketPipelineAggregator extends BucketMetricsPipelineAggregator { private int count = 0; private double sum = 0; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketHelpers.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketHelpers.java index d73b7a2330041..d7f82f36a3a5e 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketHelpers.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketHelpers.java @@ -54,6 +54,8 @@ /** * A set of static helpers to simplify working with aggregation buckets, in * particular providing utilities that help pipeline aggregations. + * + * @opensearch.internal */ public class BucketHelpers { diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketMetricValue.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketMetricValue.java index 04335c2200e5b..bada4fedceca4 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketMetricValue.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketMetricValue.java @@ -34,6 +34,11 @@ import org.opensearch.search.aggregations.metrics.NumericMetricsAggregation; +/** + * Base class of a metric value for a bucket + * + * @opensearch.internal + */ public interface BucketMetricValue extends NumericMetricsAggregation.SingleValue { String[] keys(); diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketMetricsParser.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketMetricsParser.java index b6c78f63687e3..d1de39600ad73 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketMetricsParser.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketMetricsParser.java @@ -45,6 +45,8 @@ /** * A parser for parsing requests for a {@link BucketMetricsPipelineAggregator} + * + * @opensearch.internal */ public abstract class BucketMetricsParser implements PipelineAggregator.Parser { diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketMetricsPipelineAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketMetricsPipelineAggregationBuilder.java index 239a8e61595a3..f0d7ee4246a29 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketMetricsPipelineAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketMetricsPipelineAggregationBuilder.java @@ -44,6 +44,11 @@ import java.util.Objects; import java.util.Optional; +/** + * Base Aggregation Builder for bucket metrics pipeline aggs + * + * @opensearch.internal + */ public abstract class BucketMetricsPipelineAggregationBuilder> extends AbstractPipelineAggregationBuilder { diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketMetricsPipelineAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketMetricsPipelineAggregator.java index 5f690725b29ff..4836428027f08 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketMetricsPipelineAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketMetricsPipelineAggregator.java @@ -50,6 +50,8 @@ /** * A class of sibling pipeline aggregations which calculate metrics across the * buckets of a sibling aggregation + * + * @opensearch.internal */ public abstract class BucketMetricsPipelineAggregator extends SiblingPipelineAggregator { diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketScriptPipelineAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketScriptPipelineAggregationBuilder.java index 9c633ddfa4093..d238791cddaf0 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketScriptPipelineAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketScriptPipelineAggregationBuilder.java @@ -56,6 +56,11 @@ import static org.opensearch.search.aggregations.pipeline.PipelineAggregator.Parser.FORMAT; import static org.opensearch.search.aggregations.pipeline.PipelineAggregator.Parser.GAP_POLICY; +/** + * Aggregation Builder for bucket_script agg + * + * @opensearch.internal + */ public class BucketScriptPipelineAggregationBuilder extends AbstractPipelineAggregationBuilder { public static final String NAME = "bucket_script"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketScriptPipelineAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketScriptPipelineAggregator.java index 3c100bae08a95..abf98b6ea4a6f 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketScriptPipelineAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketScriptPipelineAggregator.java @@ -53,6 +53,11 @@ import static org.opensearch.search.aggregations.pipeline.BucketHelpers.resolveBucketValue; +/** + * Aggregate all docs into a bucket defined by a script + * + * @opensearch.internal + */ public class BucketScriptPipelineAggregator extends PipelineAggregator { private final DocValueFormat formatter; private final GapPolicy gapPolicy; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketSelectorPipelineAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketSelectorPipelineAggregationBuilder.java index b2887ffc7e7a4..929dcd30e5a78 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketSelectorPipelineAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketSelectorPipelineAggregationBuilder.java @@ -51,6 +51,11 @@ import static org.opensearch.search.aggregations.pipeline.PipelineAggregator.Parser.BUCKETS_PATH; import static org.opensearch.search.aggregations.pipeline.PipelineAggregator.Parser.GAP_POLICY; +/** + * Aggregation Builder for bucket_selector agg + * + * @opensearch.internal + */ public class BucketSelectorPipelineAggregationBuilder extends AbstractPipelineAggregationBuilder { public static final String NAME = "bucket_selector"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketSelectorPipelineAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketSelectorPipelineAggregator.java index 316dee93f1c55..8f5426eae83a4 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketSelectorPipelineAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketSelectorPipelineAggregator.java @@ -49,6 +49,11 @@ import static org.opensearch.search.aggregations.pipeline.BucketHelpers.resolveBucketValue; +/** + * Aggregate all docs into a selected bucket + * + * @opensearch.internal + */ public class BucketSelectorPipelineAggregator extends PipelineAggregator { private GapPolicy gapPolicy; private Script script; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketSortPipelineAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketSortPipelineAggregationBuilder.java index cc780829bf99e..ce9d3150437f5 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketSortPipelineAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketSortPipelineAggregationBuilder.java @@ -60,6 +60,8 @@ * aggregation. The bucket {@code _key}, {@code _count} or sub-aggregations may be used as sort * keys. Parameters {@code from} and {@code size} may also be set in order to truncate the * result bucket list. + * + * @opensearch.internal */ public class BucketSortPipelineAggregationBuilder extends AbstractPipelineAggregationBuilder { public static final String NAME = "bucket_sort"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketSortPipelineAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketSortPipelineAggregator.java index 77058809e719e..809514614b1f2 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketSortPipelineAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/BucketSortPipelineAggregator.java @@ -48,6 +48,11 @@ import java.util.List; import java.util.Map; +/** + * Aggregate all docs into sorted buckets + * + * @opensearch.internal + */ public class BucketSortPipelineAggregator extends PipelineAggregator { private final List sorts; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/CumulativeSumPipelineAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/CumulativeSumPipelineAggregationBuilder.java index fd31bbc6d4abc..80321016867ff 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/CumulativeSumPipelineAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/CumulativeSumPipelineAggregationBuilder.java @@ -46,6 +46,11 @@ import static org.opensearch.common.xcontent.ConstructingObjectParser.constructorArg; import static org.opensearch.search.aggregations.pipeline.PipelineAggregator.Parser.FORMAT; +/** + * Aggregation Builder for cumulative_sum pipeline agg + * + * @opensearch.internal + */ public class CumulativeSumPipelineAggregationBuilder extends AbstractPipelineAggregationBuilder { public static final String NAME = "cumulative_sum"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/CumulativeSumPipelineAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/CumulativeSumPipelineAggregator.java index 0903fbf858160..cba35c89cc639 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/CumulativeSumPipelineAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/CumulativeSumPipelineAggregator.java @@ -52,6 +52,11 @@ import static org.opensearch.search.aggregations.pipeline.BucketHelpers.resolveBucketValue; +/** + * Aggregate all docs into a cumulative sum bucket + * + * @opensearch.internal + */ public class CumulativeSumPipelineAggregator extends PipelineAggregator { private final DocValueFormat formatter; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/Derivative.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/Derivative.java index bbe87f5c27d2d..eb92a78f716dd 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/Derivative.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/Derivative.java @@ -32,6 +32,11 @@ package org.opensearch.search.aggregations.pipeline; +/** + * Base class of a derivitive + * + * @opensearch.internal + */ public interface Derivative extends SimpleValue { /** diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/DerivativePipelineAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/DerivativePipelineAggregationBuilder.java index b5d6f3d20663c..1455c2d6d8780 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/DerivativePipelineAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/DerivativePipelineAggregationBuilder.java @@ -51,6 +51,11 @@ import java.util.Map; import java.util.Objects; +/** + * Aggregation Builder for derivative agg + * + * @opensearch.internal + */ public class DerivativePipelineAggregationBuilder extends AbstractPipelineAggregationBuilder { public static final String NAME = "derivative"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/DerivativePipelineAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/DerivativePipelineAggregator.java index 6312b479e32f1..3603d1c5a0c58 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/DerivativePipelineAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/DerivativePipelineAggregator.java @@ -52,6 +52,11 @@ import static org.opensearch.search.aggregations.pipeline.BucketHelpers.resolveBucketValue; +/** + * Aggregate all docs into a derivative value + * + * @opensearch.internal + */ public class DerivativePipelineAggregator extends PipelineAggregator { private final DocValueFormat formatter; private final GapPolicy gapPolicy; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/EwmaModel.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/EwmaModel.java index 6545db9117e2d..1fc86dce35390 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/EwmaModel.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/EwmaModel.java @@ -46,6 +46,8 @@ /** * Calculate a exponentially weighted moving average + * + * @opensearch.internal */ public class EwmaModel extends MovAvgModel { public static final String NAME = "ewma"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/ExtendedStatsBucket.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/ExtendedStatsBucket.java index 253901a40d01b..1e74c18e5f82f 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/ExtendedStatsBucket.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/ExtendedStatsBucket.java @@ -36,5 +36,7 @@ /** * Extended Statistics over a set of buckets + * + * @opensearch.internal */ public interface ExtendedStatsBucket extends ExtendedStats {} diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/ExtendedStatsBucketParser.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/ExtendedStatsBucketParser.java index d9f7765dc515e..aac7e2b0852ea 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/ExtendedStatsBucketParser.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/ExtendedStatsBucketParser.java @@ -38,6 +38,11 @@ import java.io.IOException; import java.util.Map; +/** + * Parses extended stats values + * + * @opensearch.internal + */ public class ExtendedStatsBucketParser extends BucketMetricsParser { static final ParseField SIGMA = new ParseField("sigma"); diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/ExtendedStatsBucketPipelineAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/ExtendedStatsBucketPipelineAggregationBuilder.java index 1c44a7c7c1caf..746d80d9e58ca 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/ExtendedStatsBucketPipelineAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/ExtendedStatsBucketPipelineAggregationBuilder.java @@ -40,6 +40,11 @@ import java.util.Map; import java.util.Objects; +/** + * Aggregation Builder for extended_stats agg + * + * @opensearch.internal + */ public class ExtendedStatsBucketPipelineAggregationBuilder extends BucketMetricsPipelineAggregationBuilder< ExtendedStatsBucketPipelineAggregationBuilder> { public static final String NAME = "extended_stats_bucket"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/ExtendedStatsBucketPipelineAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/ExtendedStatsBucketPipelineAggregator.java index 0c6121217dce5..a63a1da332d08 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/ExtendedStatsBucketPipelineAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/ExtendedStatsBucketPipelineAggregator.java @@ -41,6 +41,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregate all docs into their extended stats + * + * @opensearch.internal + */ public class ExtendedStatsBucketPipelineAggregator extends BucketMetricsPipelineAggregator { private final double sigma; private double sum = 0; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/HoltLinearModel.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/HoltLinearModel.java index 51ed0466d0b33..510f3396cf8a6 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/HoltLinearModel.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/HoltLinearModel.java @@ -45,6 +45,8 @@ /** * Calculate a doubly exponential weighted moving average + * + * @opensearch.internal */ public class HoltLinearModel extends MovAvgModel { public static final String NAME = "holt"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/HoltWintersModel.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/HoltWintersModel.java index 474c91573c528..1dccb17d78b84 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/HoltWintersModel.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/HoltWintersModel.java @@ -50,6 +50,8 @@ /** * Calculate a triple exponential weighted moving average + * + * @opensearch.internal */ public class HoltWintersModel extends MovAvgModel { public static final String NAME = "holt_winters"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/InternalBucketMetricValue.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/InternalBucketMetricValue.java index 4e0566250ebd2..4769ef941505a 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/InternalBucketMetricValue.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/InternalBucketMetricValue.java @@ -46,6 +46,11 @@ import java.util.Map; import java.util.Objects; +/** + * Implementation of a bucket metric value + * + * @opensearch.internal + */ public class InternalBucketMetricValue extends InternalNumericMetricsAggregation.SingleValue implements BucketMetricValue { public static final String NAME = "bucket_metric_value"; static final ParseField KEYS_FIELD = new ParseField("keys"); diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/InternalDerivative.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/InternalDerivative.java index 81fcbe091768d..2fd5074437c33 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/InternalDerivative.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/InternalDerivative.java @@ -42,6 +42,11 @@ import java.util.Map; import java.util.Objects; +/** + * Implementation of derivitive pipeline + * + * @opensearch.internal + */ public class InternalDerivative extends InternalSimpleValue implements Derivative { private final double normalizationFactor; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/InternalExtendedStatsBucket.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/InternalExtendedStatsBucket.java index b01b7be6a9c80..26781eba3e0be 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/InternalExtendedStatsBucket.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/InternalExtendedStatsBucket.java @@ -41,6 +41,11 @@ import java.util.List; import java.util.Map; +/** + * Implementation of extended stats pipeline + * + * @opensearch.internal + */ public class InternalExtendedStatsBucket extends InternalExtendedStats implements ExtendedStatsBucket { InternalExtendedStatsBucket( String name, diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/InternalPercentilesBucket.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/InternalPercentilesBucket.java index 4603d68325513..95028c5a560a5 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/InternalPercentilesBucket.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/InternalPercentilesBucket.java @@ -50,6 +50,11 @@ import java.util.Map; import java.util.Objects; +/** + * Implementation of percentiles pipeline + * + * @opensearch.internal + */ public class InternalPercentilesBucket extends InternalNumericMetricsAggregation.MultiValue implements PercentilesBucket { private double[] percentiles; private double[] percents; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/InternalSimpleValue.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/InternalSimpleValue.java index e3f505e52b2a2..66bef03622337 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/InternalSimpleValue.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/InternalSimpleValue.java @@ -44,6 +44,11 @@ import java.util.Map; import java.util.Objects; +/** + * Implementation of simple value pipeline + * + * @opensearch.internal + */ public class InternalSimpleValue extends InternalNumericMetricsAggregation.SingleValue implements SimpleValue { public static final String NAME = "simple_value"; protected final double value; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/InternalStatsBucket.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/InternalStatsBucket.java index 44916c80cab7e..2754376059daf 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/InternalStatsBucket.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/InternalStatsBucket.java @@ -41,6 +41,11 @@ import java.util.List; import java.util.Map; +/** + * Implementation of stats pipeline + * + * @opensearch.internal + */ public class InternalStatsBucket extends InternalStats implements StatsBucket { public InternalStatsBucket( String name, diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/LinearModel.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/LinearModel.java index 0e1ffdbedcfa8..1595c0f5f4514 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/LinearModel.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/LinearModel.java @@ -46,6 +46,8 @@ /** * Calculate a linearly weighted moving average, such that older values are * linearly less important. "Time" is determined by position in collection + * + * @opensearch.internal */ public class LinearModel extends MovAvgModel { public static final String NAME = "linear"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/MaxBucketPipelineAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/MaxBucketPipelineAggregationBuilder.java index 854ea18021bf6..ecf4e59bb8a46 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/MaxBucketPipelineAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/MaxBucketPipelineAggregationBuilder.java @@ -39,6 +39,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Builder for max_bucket agg + * + * @opensearch.internal + */ public class MaxBucketPipelineAggregationBuilder extends BucketMetricsPipelineAggregationBuilder { public static final String NAME = "max_bucket"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/MaxBucketPipelineAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/MaxBucketPipelineAggregator.java index 03bf1c78a8220..1e327919755c7 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/MaxBucketPipelineAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/MaxBucketPipelineAggregator.java @@ -42,6 +42,11 @@ import java.util.List; import java.util.Map; +/** + * Aggregate all docs into a max bucket + * + * @opensearch.internal + */ public class MaxBucketPipelineAggregator extends BucketMetricsPipelineAggregator { private List maxBucketKeys; private double maxValue; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/MinBucketPipelineAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/MinBucketPipelineAggregationBuilder.java index 96ab48b01c115..ec2b9ab07f562 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/MinBucketPipelineAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/MinBucketPipelineAggregationBuilder.java @@ -39,6 +39,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Builder for min_bucket + * + * @opensearch.internal + */ public class MinBucketPipelineAggregationBuilder extends BucketMetricsPipelineAggregationBuilder { public static final String NAME = "min_bucket"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/MinBucketPipelineAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/MinBucketPipelineAggregator.java index 137aac02b83cf..2b57aac14ea1e 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/MinBucketPipelineAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/MinBucketPipelineAggregator.java @@ -42,6 +42,11 @@ import java.util.List; import java.util.Map; +/** + * Aggregate all docs into a min bucket + * + * @opensearch.internal + */ public class MinBucketPipelineAggregator extends BucketMetricsPipelineAggregator { private List minBucketKeys; private double minValue; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovAvgModel.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovAvgModel.java index b63fee917ce9e..6b7497235efd9 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovAvgModel.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovAvgModel.java @@ -43,6 +43,11 @@ import java.util.Collection; import java.util.Map; +/** + * Base moving average model class + * + * @opensearch.internal + */ public abstract class MovAvgModel implements NamedWriteable, ToXContentFragment { /** diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovAvgModelBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovAvgModelBuilder.java index c369a127c164c..d89abb61db11c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovAvgModelBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovAvgModelBuilder.java @@ -37,6 +37,8 @@ /** * Represents the common interface that all moving average models share. Moving * average models are used by the MovAvg aggregation + * + * @opensearch.internal */ public interface MovAvgModelBuilder extends ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovAvgPipelineAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovAvgPipelineAggregationBuilder.java index 298720785f461..5f94c21da395e 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovAvgPipelineAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovAvgPipelineAggregationBuilder.java @@ -54,6 +54,11 @@ import org.opensearch.search.DocValueFormat; import org.opensearch.search.aggregations.pipeline.BucketHelpers.GapPolicy; +/** + * Aggregation Builder for moving_avg + * + * @opensearch.internal + */ public class MovAvgPipelineAggregationBuilder extends AbstractPipelineAggregationBuilder { public static final String NAME = "moving_avg"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovAvgPipelineAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovAvgPipelineAggregator.java index d4ce4170e10b4..2e3c44ac3902d 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovAvgPipelineAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovAvgPipelineAggregator.java @@ -55,6 +55,11 @@ import static org.opensearch.search.aggregations.pipeline.BucketHelpers.resolveBucketValue; +/** + * Aggregate all docs into a moving average bucket + * + * @opensearch.internal + */ public class MovAvgPipelineAggregator extends PipelineAggregator { private final DocValueFormat formatter; private final GapPolicy gapPolicy; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovFnPipelineAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovFnPipelineAggregationBuilder.java index 56f7ab0c33336..33c09e04bd4b0 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovFnPipelineAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovFnPipelineAggregationBuilder.java @@ -55,6 +55,11 @@ import static org.opensearch.search.aggregations.pipeline.PipelineAggregator.Parser.FORMAT; import static org.opensearch.search.aggregations.pipeline.PipelineAggregator.Parser.GAP_POLICY; +/** + * Aggregation Builder for moving_fn + * + * @opensearch.internal + */ public class MovFnPipelineAggregationBuilder extends AbstractPipelineAggregationBuilder { public static final String NAME = "moving_fn"; private static final ParseField WINDOW = new ParseField("window"); diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovFnPipelineAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovFnPipelineAggregator.java index 7f1bb8965ed94..70652e7ddce44 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovFnPipelineAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovFnPipelineAggregator.java @@ -69,6 +69,8 @@ * - holtWintersMovAvg * * The user can also define any arbitrary logic via their own scripting, or combine with the above methods. + * + * @opensearch.internal */ public class MovFnPipelineAggregator extends PipelineAggregator { private final DocValueFormat formatter; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovingFunctionScript.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovingFunctionScript.java index 23fcd8b25b342..ff5a4f254e666 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovingFunctionScript.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovingFunctionScript.java @@ -40,6 +40,8 @@ /** * This class provides a custom script context for the Moving Function pipeline aggregation, * so that we can expose a number of pre-baked moving functions like min, max, movavg, etc + * + * @opensearch.internal */ public abstract class MovingFunctionScript { /** diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovingFunctions.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovingFunctions.java index e3a57654f94cf..bac486576f537 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovingFunctions.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/MovingFunctions.java @@ -36,6 +36,8 @@ /** * Provides a collection of static utility methods that can be referenced from MovingFunction script contexts + * + * @opensearch.internal */ public class MovingFunctions { diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/ParsedBucketMetricValue.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/ParsedBucketMetricValue.java index 7ecbd64d9cff4..e91d31586c092 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/ParsedBucketMetricValue.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/ParsedBucketMetricValue.java @@ -41,6 +41,11 @@ import java.util.Collections; import java.util.List; +/** + * A bucket metric agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedBucketMetricValue extends ParsedSingleValueNumericMetricsAggregation implements BucketMetricValue { private List keys = Collections.emptyList(); diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/ParsedDerivative.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/ParsedDerivative.java index 0ce2c121f0658..62fac352bb818 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/ParsedDerivative.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/ParsedDerivative.java @@ -40,6 +40,11 @@ import java.io.IOException; +/** + * A derivative agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedDerivative extends ParsedSimpleValue implements Derivative { private double normalizedValue; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/ParsedExtendedStatsBucket.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/ParsedExtendedStatsBucket.java index 0a518a8363ab6..6be430d49c954 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/ParsedExtendedStatsBucket.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/ParsedExtendedStatsBucket.java @@ -36,6 +36,11 @@ import org.opensearch.common.xcontent.XContentParser; import org.opensearch.search.aggregations.metrics.ParsedExtendedStats; +/** + * An extended stats agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedExtendedStatsBucket extends ParsedExtendedStats implements ExtendedStatsBucket { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/ParsedPercentilesBucket.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/ParsedPercentilesBucket.java index fe274862c0698..96a877dcda650 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/ParsedPercentilesBucket.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/ParsedPercentilesBucket.java @@ -41,6 +41,11 @@ import java.io.IOException; import java.util.Map.Entry; +/** + * A percentiles bucket agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedPercentilesBucket extends ParsedPercentiles implements Percentiles { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/ParsedSimpleValue.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/ParsedSimpleValue.java index 30cffd8fdf48a..a5b9833814cd3 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/ParsedSimpleValue.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/ParsedSimpleValue.java @@ -39,6 +39,11 @@ import java.io.IOException; +/** + * A simple value agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedSimpleValue extends ParsedSingleValueNumericMetricsAggregation implements SimpleValue { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/ParsedStatsBucket.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/ParsedStatsBucket.java index fc20befbd5c1b..e0731dd9e9c07 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/ParsedStatsBucket.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/ParsedStatsBucket.java @@ -36,6 +36,11 @@ import org.opensearch.common.xcontent.XContentParser; import org.opensearch.search.aggregations.metrics.ParsedStats; +/** + * A stats agg result parsed between nodes + * + * @opensearch.internal + */ public class ParsedStatsBucket extends ParsedStats implements StatsBucket { @Override diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/PercentilesBucket.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/PercentilesBucket.java index e335dbbaa3ddb..fadc32192a6fb 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/PercentilesBucket.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/PercentilesBucket.java @@ -34,4 +34,9 @@ import org.opensearch.search.aggregations.metrics.Percentiles; +/** + * Base noop bucket implementation for percentiles + * + * @opensearch.internal + */ public interface PercentilesBucket extends Percentiles {} diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/PercentilesBucketPipelineAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/PercentilesBucketPipelineAggregationBuilder.java index 01d30185917f1..bef97bbbaa83a 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/PercentilesBucketPipelineAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/PercentilesBucketPipelineAggregationBuilder.java @@ -46,6 +46,11 @@ import java.util.Map; import java.util.Objects; +/** + * Aggregation Builder for percentiles_bucket + * + * @opensearch.internal + */ public class PercentilesBucketPipelineAggregationBuilder extends BucketMetricsPipelineAggregationBuilder< PercentilesBucketPipelineAggregationBuilder> { public static final String NAME = "percentiles_bucket"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/PercentilesBucketPipelineAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/PercentilesBucketPipelineAggregator.java index 02cb75b37c6a7..bd838fe23da8b 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/PercentilesBucketPipelineAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/PercentilesBucketPipelineAggregator.java @@ -45,6 +45,11 @@ import java.util.List; import java.util.Map; +/** + * Aggregate all docs into a percentiles bucket + * + * @opensearch.internal + */ public class PercentilesBucketPipelineAggregator extends BucketMetricsPipelineAggregator { private final double[] percents; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/PipelineAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/PipelineAggregator.java index ae0a81f27bfd1..da4a3b90b273b 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/PipelineAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/PipelineAggregator.java @@ -49,6 +49,11 @@ import static java.util.Collections.emptyList; import static java.util.Collections.emptyMap; +/** + * Base aggregator for pipline aggs + * + * @opensearch.internal + */ public abstract class PipelineAggregator implements NamedWriteable { /** * Parse the {@link PipelineAggregationBuilder} from a {@link XContentParser}. diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/SerialDiffPipelineAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/SerialDiffPipelineAggregationBuilder.java index 2b07442b80719..e3140ed77d3d5 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/SerialDiffPipelineAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/SerialDiffPipelineAggregationBuilder.java @@ -50,6 +50,11 @@ import static org.opensearch.search.aggregations.pipeline.PipelineAggregator.Parser.BUCKETS_PATH; import static org.opensearch.search.aggregations.pipeline.PipelineAggregator.Parser.FORMAT; +/** + * Aggregation Builder for serial_diff agg + * + * @opensearch.internal + */ public class SerialDiffPipelineAggregationBuilder extends AbstractPipelineAggregationBuilder { public static final String NAME = "serial_diff"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/SerialDiffPipelineAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/SerialDiffPipelineAggregator.java index eea9f76d5d091..b06b6aa51211e 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/SerialDiffPipelineAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/SerialDiffPipelineAggregator.java @@ -54,6 +54,11 @@ import static org.opensearch.search.aggregations.pipeline.BucketHelpers.resolveBucketValue; +/** + * Aggregate all docs into a serial diff bucket + * + * @opensearch.internal + */ public class SerialDiffPipelineAggregator extends PipelineAggregator { private DocValueFormat formatter; private GapPolicy gapPolicy; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/SiblingPipelineAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/SiblingPipelineAggregator.java index 2375b75d30af1..40cf1ab115af4 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/SiblingPipelineAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/SiblingPipelineAggregator.java @@ -42,6 +42,11 @@ import java.util.List; import java.util.Map; +/** + * Aggregate all docs into a sibling bucket + * + * @opensearch.internal + */ public abstract class SiblingPipelineAggregator extends PipelineAggregator { protected SiblingPipelineAggregator(String name, String[] bucketsPaths, Map metadata) { super(name, bucketsPaths, metadata); diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/SimpleModel.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/SimpleModel.java index b133308b61ed5..4336311c82ba2 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/SimpleModel.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/SimpleModel.java @@ -45,6 +45,8 @@ /** * Calculate a simple unweighted (arithmetic) moving average + * + * @opensearch.internal */ public class SimpleModel extends MovAvgModel { public static final String NAME = "simple"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/SimpleValue.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/SimpleValue.java index 4e3a7b65eb9b8..f062164adab8e 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/SimpleValue.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/SimpleValue.java @@ -34,6 +34,11 @@ import org.opensearch.search.aggregations.metrics.NumericMetricsAggregation; +/** + * Base noop class for simple values + * + * @opensearch.internal + */ public interface SimpleValue extends NumericMetricsAggregation.SingleValue { } diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/SimulatedAnealingMinimizer.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/SimulatedAnealingMinimizer.java index 19d06cec15f72..a61a866228161 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/SimulatedAnealingMinimizer.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/SimulatedAnealingMinimizer.java @@ -46,6 +46,8 @@ * anyway. This allows the algo to sample the problem space widely. As iterations progress, * the temperature decreases and the algorithm rejects poor solutions more regularly, * theoretically honing in on a global minimum. + * + * @opensearch.internal */ public class SimulatedAnealingMinimizer { diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/StatsBucket.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/StatsBucket.java index e846a7a90d6b5..6995307503256 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/StatsBucket.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/StatsBucket.java @@ -36,6 +36,8 @@ /** * Statistics over a set of buckets + * + * @opensearch.internal */ public interface StatsBucket extends Stats { diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/StatsBucketPipelineAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/StatsBucketPipelineAggregationBuilder.java index 1cb0f844eb7ca..196b13ed35c41 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/StatsBucketPipelineAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/StatsBucketPipelineAggregationBuilder.java @@ -39,6 +39,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Builder for stats_bucket agg + * + * @opensearch.internal + */ public class StatsBucketPipelineAggregationBuilder extends BucketMetricsPipelineAggregationBuilder { public static final String NAME = "stats_bucket"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/StatsBucketPipelineAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/StatsBucketPipelineAggregator.java index aa0f4a645fa02..577f66f94e90f 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/StatsBucketPipelineAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/StatsBucketPipelineAggregator.java @@ -40,6 +40,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregate all docs into a stats bucket + * + * @opensearch.internal + */ public class StatsBucketPipelineAggregator extends BucketMetricsPipelineAggregator { private double sum = 0; private long count = 0; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/SumBucketPipelineAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/SumBucketPipelineAggregationBuilder.java index e7cd3ae4f2a56..90e09cd7131c7 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/SumBucketPipelineAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/SumBucketPipelineAggregationBuilder.java @@ -39,6 +39,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregation Builder for sum_bucket agg + * + * @opensearch.internal + */ public class SumBucketPipelineAggregationBuilder extends BucketMetricsPipelineAggregationBuilder { public static final String NAME = "sum_bucket"; diff --git a/server/src/main/java/org/opensearch/search/aggregations/pipeline/SumBucketPipelineAggregator.java b/server/src/main/java/org/opensearch/search/aggregations/pipeline/SumBucketPipelineAggregator.java index baf1fdecfc3ab..32a64fafa7a2d 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/pipeline/SumBucketPipelineAggregator.java +++ b/server/src/main/java/org/opensearch/search/aggregations/pipeline/SumBucketPipelineAggregator.java @@ -40,6 +40,11 @@ import java.io.IOException; import java.util.Map; +/** + * Aggregate all docs into a sum bucket + * + * @opensearch.internal + */ public class SumBucketPipelineAggregator extends BucketMetricsPipelineAggregator { private double sum = 0; diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/AggregationInfo.java b/server/src/main/java/org/opensearch/search/aggregations/support/AggregationInfo.java index 47ade91638017..c2983945d5a4c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/AggregationInfo.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/AggregationInfo.java @@ -46,6 +46,11 @@ import java.util.TreeSet; import java.util.concurrent.atomic.LongAdder; +/** + * Data describing an agg + * + * @opensearch.internal + */ public class AggregationInfo implements ReportingService.Info { private final Map> aggs; diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/AggregationInspectionHelper.java b/server/src/main/java/org/opensearch/search/aggregations/support/AggregationInspectionHelper.java index aca4cb8c36221..8d036503d1330 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/AggregationInspectionHelper.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/AggregationInspectionHelper.java @@ -88,6 +88,8 @@ * or because of summing to zero). Pipeline aggs in particular are not well supported * by these helpers since most share InternalSimpleValue and it's not clear which pipeline * generated the value. + * + * @opensearch.internal */ public class AggregationInspectionHelper { public static , B extends InternalTerms.Bucket> boolean hasValue(InternalTerms agg) { diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/AggregationPath.java b/server/src/main/java/org/opensearch/search/aggregations/support/AggregationPath.java index 98cd9e66d9e7e..d93d80493319a 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/AggregationPath.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/AggregationPath.java @@ -74,6 +74,8 @@ * * * + * + * @opensearch.internal */ public class AggregationPath { diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/AggregationUsageService.java b/server/src/main/java/org/opensearch/search/aggregations/support/AggregationUsageService.java index 8b6124cd9cc1f..f9b6a91444873 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/AggregationUsageService.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/AggregationUsageService.java @@ -38,6 +38,11 @@ import java.util.Map; import java.util.concurrent.atomic.LongAdder; +/** + * Service to track telemetry about aggregations + * + * @opensearch.internal + */ public class AggregationUsageService implements ReportingService { private final Map> aggs; private final AggregationInfo info; diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/BaseMultiValuesSourceFieldConfig.java b/server/src/main/java/org/opensearch/search/aggregations/support/BaseMultiValuesSourceFieldConfig.java index c75ab861439d3..8527eaae2ec4b 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/BaseMultiValuesSourceFieldConfig.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/BaseMultiValuesSourceFieldConfig.java @@ -30,6 +30,8 @@ /** * A configuration that tells aggregation how to retrieve data from index * in order to run a specific aggregation. + * + * @opensearch.internal */ public abstract class BaseMultiValuesSourceFieldConfig implements Writeable, ToXContentObject { private final String fieldName; diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/CoreValuesSourceType.java b/server/src/main/java/org/opensearch/search/aggregations/support/CoreValuesSourceType.java index 650b554efc1ff..209b996cc5e5e 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/CoreValuesSourceType.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/CoreValuesSourceType.java @@ -61,6 +61,8 @@ /** * {@link CoreValuesSourceType} holds the {@link ValuesSourceType} implementations for the core aggregations package. + * + * @opensearch.internal */ public enum CoreValuesSourceType implements ValuesSourceType { diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/FieldContext.java b/server/src/main/java/org/opensearch/search/aggregations/support/FieldContext.java index 451afb559c0ac..a6207917d52ea 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/FieldContext.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/FieldContext.java @@ -37,6 +37,8 @@ /** * Used by all field data based aggregators. This determine the context of the field data the aggregators are operating * in. It holds both the field names and the index field datas that are associated with them. + * + * @opensearch.internal */ public class FieldContext { diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/MissingValues.java b/server/src/main/java/org/opensearch/search/aggregations/support/MissingValues.java index 3bb14324058d8..6e0778f9a0a2d 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/MissingValues.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/MissingValues.java @@ -49,6 +49,8 @@ /** * Utility class that allows to return views of {@link ValuesSource}s that * replace the missing value with a configured value. + * + * @opensearch.internal */ public enum MissingValues { ; diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/MultiTermsValuesSourceConfig.java b/server/src/main/java/org/opensearch/search/aggregations/support/MultiTermsValuesSourceConfig.java index 3bc7f444c610d..def1191c70f12 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/MultiTermsValuesSourceConfig.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/MultiTermsValuesSourceConfig.java @@ -25,6 +25,8 @@ /** * A configuration that used by multi_terms aggregations. + * + * @opensearch.internal */ public class MultiTermsValuesSourceConfig extends BaseMultiValuesSourceFieldConfig { private final ValueType userValueTypeHint; diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSource.java b/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSource.java index ecc03b046e473..3ef949c6eebbb 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSource.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSource.java @@ -43,6 +43,8 @@ /** * Class to encapsulate a set of ValuesSource objects labeled by field name + * + * @opensearch.internal */ public abstract class MultiValuesSource { protected Map values; diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSourceAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSourceAggregationBuilder.java index 72d508de1d12e..7573f69e0833e 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSourceAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSourceAggregationBuilder.java @@ -53,6 +53,8 @@ * can pull values from multiple fields). * * A limitation of this class is that all the ValuesSource's being refereenced must be of the same type. + * + * @opensearch.internal */ public abstract class MultiValuesSourceAggregationBuilder> extends AbstractAggregationBuilder { diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSourceAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSourceAggregatorFactory.java index 0ce8e3ea9b5a9..499fa41096de8 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSourceAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSourceAggregatorFactory.java @@ -43,6 +43,11 @@ import java.io.IOException; import java.util.Map; +/** + * Base class for MultiValuesSource aggregator factories + * + * @opensearch.internal + */ public abstract class MultiValuesSourceAggregatorFactory extends AggregatorFactory { protected final Map configs; diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSourceFieldConfig.java b/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSourceFieldConfig.java index ea9bbe8019276..a7145ac871305 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSourceFieldConfig.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSourceFieldConfig.java @@ -48,6 +48,11 @@ import java.time.ZoneId; import java.util.Objects; +/** + * Base field configuration class for multi values + * + * @opensearch.internal + */ public class MultiValuesSourceFieldConfig extends BaseMultiValuesSourceFieldConfig { private final QueryBuilder filter; diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSourceParseHelper.java b/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSourceParseHelper.java index 82054ab53af41..e51465fb93004 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSourceParseHelper.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/MultiValuesSourceParseHelper.java @@ -38,6 +38,11 @@ import org.opensearch.common.xcontent.ObjectParser; import org.opensearch.common.xcontent.XContentParser; +/** + * Helper class to parse multi values sources + * + * @opensearch.internal + */ public final class MultiValuesSourceParseHelper { public static void declareCommon( diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/ValueType.java b/server/src/main/java/org/opensearch/search/aggregations/support/ValueType.java index 5912a01664e47..e55b78e61d9ba 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/ValueType.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/ValueType.java @@ -44,6 +44,11 @@ import java.util.Arrays; import java.util.List; +/** + * Enum to signal what kind of value type is used in the aggregator + * + * @opensearch.internal + */ public enum ValueType implements Writeable { STRING((byte) 1, "string", "string", CoreValuesSourceType.BYTES, DocValueFormat.RAW), diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSource.java b/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSource.java index a0875737f370e..9bcf7df85d098 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSource.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSource.java @@ -69,6 +69,11 @@ import java.util.function.Function; import java.util.function.LongUnaryOperator; +/** + * Base class for a ValuesSource; the primitive data for an agg + * + * @opensearch.internal + */ public abstract class ValuesSource { /** diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceAggregationBuilder.java b/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceAggregationBuilder.java index 70c36be06a9ae..5eb880642b983 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceAggregationBuilder.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceAggregationBuilder.java @@ -54,6 +54,11 @@ import java.util.Map; import java.util.Objects; +/** + * Base class for all values source agg builders + * + * @opensearch.internal + */ public abstract class ValuesSourceAggregationBuilder> extends AbstractAggregationBuilder { public static void declareFields( diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceAggregatorFactory.java b/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceAggregatorFactory.java index 14d0aa72535fa..69a4a5d8b6703 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceAggregatorFactory.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceAggregatorFactory.java @@ -42,6 +42,11 @@ import java.io.IOException; import java.util.Map; +/** + * Base class for all values source agg factories + * + * @opensearch.internal + */ public abstract class ValuesSourceAggregatorFactory extends AggregatorFactory { protected ValuesSourceConfig config; diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceConfig.java b/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceConfig.java index 623b88c595ce8..e956dd054eba9 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceConfig.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceConfig.java @@ -49,6 +49,8 @@ /** * A configuration that tells aggregations how to retrieve data from the index * in order to run a specific aggregation. + * + * @opensearch.internal */ public class ValuesSourceConfig { diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceRegistry.java b/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceRegistry.java index c1518491b09f9..430accde5c279 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceRegistry.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceRegistry.java @@ -49,6 +49,7 @@ * directly instantiate this class, instead get an already-configured copy from {@link QueryShardContext#getValuesSourceRegistry()}, or (in * the case of some test scenarios only) directly from {@link SearchModule#getValuesSourceRegistry()} * + * @opensearch.internal */ public class ValuesSourceRegistry { diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceType.java b/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceType.java index 6f7a9ec0cc955..86102e63297d1 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceType.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/ValuesSourceType.java @@ -57,6 +57,8 @@ * if logically the type needs a more restricted use (e.g. even though dates are stored as numbers, it doesn't make sense to pass them to * a sum aggregation). When adding a new ValuesSourceType, new aggregators should be added and registered at the same time, to add support * for the new type to existing aggregations, as appropriate. + * + * @opensearch.internal */ public interface ValuesSourceType { /** diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/values/ScriptBytesValues.java b/server/src/main/java/org/opensearch/search/aggregations/support/values/ScriptBytesValues.java index 327437aa2baa2..e53d9b83a814c 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/values/ScriptBytesValues.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/values/ScriptBytesValues.java @@ -44,6 +44,8 @@ /** * {@link SortedBinaryDocValues} implementation that reads values from a script. + * + * @opensearch.internal */ public class ScriptBytesValues extends SortingBinaryDocValues implements ScorerAware { diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/values/ScriptDoubleValues.java b/server/src/main/java/org/opensearch/search/aggregations/support/values/ScriptDoubleValues.java index ab9a36037c601..22d6fc707bec3 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/values/ScriptDoubleValues.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/values/ScriptDoubleValues.java @@ -46,6 +46,8 @@ /** * {@link SortingNumericDoubleValues} implementation which is based on a script + * + * @opensearch.internal */ public class ScriptDoubleValues extends SortingNumericDoubleValues implements ScorerAware { diff --git a/server/src/main/java/org/opensearch/search/aggregations/support/values/ScriptLongValues.java b/server/src/main/java/org/opensearch/search/aggregations/support/values/ScriptLongValues.java index 67a55383d101d..a14f6165b9ac2 100644 --- a/server/src/main/java/org/opensearch/search/aggregations/support/values/ScriptLongValues.java +++ b/server/src/main/java/org/opensearch/search/aggregations/support/values/ScriptLongValues.java @@ -48,6 +48,8 @@ /** * {@link LongValues} implementation which is based on a script + * + * @opensearch.internal */ public class ScriptLongValues extends AbstractSortingNumericDocValues implements ScorerAware { diff --git a/server/src/main/java/org/opensearch/search/builder/PointInTimeBuilder.java b/server/src/main/java/org/opensearch/search/builder/PointInTimeBuilder.java index 3cfd673d28c84..520ce124a19da 100644 --- a/server/src/main/java/org/opensearch/search/builder/PointInTimeBuilder.java +++ b/server/src/main/java/org/opensearch/search/builder/PointInTimeBuilder.java @@ -49,6 +49,8 @@ /** * A search request with a point in time will execute using the reader contexts associated with that point time * instead of the latest reader contexts. + * + * @opensearch.internal */ public final class PointInTimeBuilder implements Writeable, ToXContentObject { private static final ParseField ID_FIELD = new ParseField("id"); diff --git a/server/src/main/java/org/opensearch/search/builder/SearchSourceBuilder.java b/server/src/main/java/org/opensearch/search/builder/SearchSourceBuilder.java index 8c162e1fa4a33..88281b12f47eb 100644 --- a/server/src/main/java/org/opensearch/search/builder/SearchSourceBuilder.java +++ b/server/src/main/java/org/opensearch/search/builder/SearchSourceBuilder.java @@ -89,6 +89,8 @@ * {@link org.opensearch.search.builder.SearchSourceBuilder#searchSource()}. * * @see org.opensearch.action.search.SearchRequest#source(SearchSourceBuilder) + * + * @opensearch.internal */ public final class SearchSourceBuilder implements Writeable, ToXContentObject, Rewriteable { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(SearchSourceBuilder.class); diff --git a/server/src/main/java/org/opensearch/search/builder/SearchSourceBuilderException.java b/server/src/main/java/org/opensearch/search/builder/SearchSourceBuilderException.java index 700950cdf894c..a884e5d1be8b5 100644 --- a/server/src/main/java/org/opensearch/search/builder/SearchSourceBuilderException.java +++ b/server/src/main/java/org/opensearch/search/builder/SearchSourceBuilderException.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Error thrown on source builders during search phase + * + * @opensearch.internal + */ public class SearchSourceBuilderException extends OpenSearchException { public SearchSourceBuilderException(String msg) { diff --git a/server/src/main/java/org/opensearch/search/collapse/CollapseBuilder.java b/server/src/main/java/org/opensearch/search/collapse/CollapseBuilder.java index e4064eed55f30..be4d73349a39a 100644 --- a/server/src/main/java/org/opensearch/search/collapse/CollapseBuilder.java +++ b/server/src/main/java/org/opensearch/search/collapse/CollapseBuilder.java @@ -56,6 +56,8 @@ /** * A builder that enables field collapsing on search request. + * + * @opensearch.internal */ public class CollapseBuilder implements Writeable, ToXContentObject { public static final ParseField FIELD_FIELD = new ParseField("field"); diff --git a/server/src/main/java/org/opensearch/search/collapse/CollapseContext.java b/server/src/main/java/org/opensearch/search/collapse/CollapseContext.java index 75f340de4dd16..09a612a15d762 100644 --- a/server/src/main/java/org/opensearch/search/collapse/CollapseContext.java +++ b/server/src/main/java/org/opensearch/search/collapse/CollapseContext.java @@ -42,6 +42,8 @@ /** * Context used for field collapsing + * + * @opensearch.internal */ public class CollapseContext { private final String fieldName; From 59e8d043010541559da7839629828cb8751d0567 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 10 May 2022 14:05:24 -0400 Subject: [PATCH 143/514] Bump google-http-client-appengine from 1.35.0 to 1.41.8 in /plugins/repository-gcs (#3247) (#3259) * Bump google-http-client-appengine in /plugins/repository-gcs Bumps [google-http-client-appengine](https://github.com/googleapis/google-http-java-client) from 1.35.0 to 1.41.8. - [Release notes](https://github.com/googleapis/google-http-java-client/releases) - [Changelog](https://github.com/googleapis/google-http-java-client/blob/v1.41.8/CHANGELOG.md) - [Commits](https://github.com/googleapis/google-http-java-client/compare/v1.35.0...v1.41.8) --- updated-dependencies: - dependency-name: com.google.http-client:google-http-client-appengine dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Updating SHAs Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] (cherry picked from commit 7779078e1572f5ca6653019ab9e4f0d53ae93821) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- plugins/repository-gcs/build.gradle | 2 +- .../licenses/google-http-client-appengine-1.35.0.jar.sha1 | 1 - .../licenses/google-http-client-appengine-1.41.8.jar.sha1 | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 plugins/repository-gcs/licenses/google-http-client-appengine-1.35.0.jar.sha1 create mode 100644 plugins/repository-gcs/licenses/google-http-client-appengine-1.41.8.jar.sha1 diff --git a/plugins/repository-gcs/build.gradle b/plugins/repository-gcs/build.gradle index 4b674741611b4..b87cbe9b4f33d 100644 --- a/plugins/repository-gcs/build.gradle +++ b/plugins/repository-gcs/build.gradle @@ -71,7 +71,7 @@ dependencies { api 'com.google.auth:google-auth-library-oauth2-http:0.20.0' api 'com.google.oauth-client:google-oauth-client:1.33.1' api 'com.google.api-client:google-api-client:1.34.0' - api 'com.google.http-client:google-http-client-appengine:1.35.0' + api 'com.google.http-client:google-http-client-appengine:1.41.8' api 'com.google.http-client:google-http-client-jackson2:1.35.0' api 'com.google.http-client:google-http-client-gson:1.41.4' api 'com.google.api:gax-httpjson:0.62.0' diff --git a/plugins/repository-gcs/licenses/google-http-client-appengine-1.35.0.jar.sha1 b/plugins/repository-gcs/licenses/google-http-client-appengine-1.35.0.jar.sha1 deleted file mode 100644 index 8bf444887d30f..0000000000000 --- a/plugins/repository-gcs/licenses/google-http-client-appengine-1.35.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -394d1e1376538931ec3d4eeed654f9da911b95eb \ No newline at end of file diff --git a/plugins/repository-gcs/licenses/google-http-client-appengine-1.41.8.jar.sha1 b/plugins/repository-gcs/licenses/google-http-client-appengine-1.41.8.jar.sha1 new file mode 100644 index 0000000000000..052fdd3df85be --- /dev/null +++ b/plugins/repository-gcs/licenses/google-http-client-appengine-1.41.8.jar.sha1 @@ -0,0 +1 @@ +785f175ead3ccee43ded9ad0d7c0dbe4606d3230 \ No newline at end of file From dd5882aba3edb92079f5091c9e7a445871485860 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 10 May 2022 15:01:02 -0700 Subject: [PATCH 144/514] Bump reactor-netty from 1.0.17 to 1.0.18 in /plugins/repository-azure (#3246) (#3258) * Bump reactor-netty from 1.0.17 to 1.0.18 in /plugins/repository-azure Bumps [reactor-netty](https://github.com/reactor/reactor-netty) from 1.0.17 to 1.0.18. - [Release notes](https://github.com/reactor/reactor-netty/releases) - [Commits](https://github.com/reactor/reactor-netty/compare/v1.0.17...v1.0.18) --- updated-dependencies: - dependency-name: io.projectreactor.netty:reactor-netty dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Updating SHAs Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] (cherry picked from commit 3d8e54810f1ca46c6770313e1faae00f4d06aa3f) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- plugins/repository-azure/build.gradle | 2 +- plugins/repository-azure/licenses/reactor-netty-1.0.17.jar.sha1 | 1 - plugins/repository-azure/licenses/reactor-netty-1.0.18.jar.sha1 | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 plugins/repository-azure/licenses/reactor-netty-1.0.17.jar.sha1 create mode 100644 plugins/repository-azure/licenses/reactor-netty-1.0.18.jar.sha1 diff --git a/plugins/repository-azure/build.gradle b/plugins/repository-azure/build.gradle index 8f566fce7b470..3e33a730f94ef 100644 --- a/plugins/repository-azure/build.gradle +++ b/plugins/repository-azure/build.gradle @@ -57,7 +57,7 @@ dependencies { api 'com.azure:azure-storage-blob:12.15.0' api 'org.reactivestreams:reactive-streams:1.0.3' api 'io.projectreactor:reactor-core:3.4.17' - api 'io.projectreactor.netty:reactor-netty:1.0.17' + api 'io.projectreactor.netty:reactor-netty:1.0.18' api 'io.projectreactor.netty:reactor-netty-core:1.0.16' api 'io.projectreactor.netty:reactor-netty-http:1.0.18' api "org.slf4j:slf4j-api:${versions.slf4j}" diff --git a/plugins/repository-azure/licenses/reactor-netty-1.0.17.jar.sha1 b/plugins/repository-azure/licenses/reactor-netty-1.0.17.jar.sha1 deleted file mode 100644 index a1f6aa3686692..0000000000000 --- a/plugins/repository-azure/licenses/reactor-netty-1.0.17.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -7720beb4f58a4379e6294d62766d2e9e1bfaf646 \ No newline at end of file diff --git a/plugins/repository-azure/licenses/reactor-netty-1.0.18.jar.sha1 b/plugins/repository-azure/licenses/reactor-netty-1.0.18.jar.sha1 new file mode 100644 index 0000000000000..74e672b1d52c4 --- /dev/null +++ b/plugins/repository-azure/licenses/reactor-netty-1.0.18.jar.sha1 @@ -0,0 +1 @@ +8900bb8dcfc69f91f7c8f91a4b2a3ad9b56830d0 \ No newline at end of file From 84fc77e260968bcdd3fd0beda45c782a9c9f1dfb Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 10 May 2022 15:04:23 -0700 Subject: [PATCH 145/514] Upgrading ingest-attachment dependencies (#3111) (#3279) * Upgrading Tika from 1.24.1 to 2.1.0 and bumping xmlbeans version This major version upgrade requires an explicit dependency on tika-parsers-standard-package to import the parser implementations, and an update to the namespace of RTFParser. Also, LanguageIdentifier has been deprecated and replaced by LanguageDetector. This change includes a bump in xmlbeans version from 3.0.1 to 3.1.0 Signed-off-by: Kartik Ganesh * Upgrade Tika libraries from 2.1.0 to 2.2.0 This also requires a update of Apache Commons-IO from 2.7 to 2.11.0 Signed-off-by: Kartik Ganesh * Upgrade Tika libraries from 2.2.0 to 2.2.1 Also update PDFBox to 2.0.25 as per Tika release notes Signed-off-by: Kartik Ganesh * Upgraded Tika and xmlbeans libraries Tika libraries have been upgraded from 2.2.1 to 2.3.0. xmlbeans is now a subproject of POI, so POI was upgraded from 4.1.2 to 5.2.2. With POI 5.x the ooxml-schemas library has been moved to ooxml-lite/ooxml-full. Since ooxml-schemas no longer exists, the LICENSE and NOTICE files in the licenses/ directory have been removed. Finally, xmlbeans has been updated from 3.1.0 to 5.0.2 Signed-off-by: Kartik Ganesh * (In progress) Added tika-langdetect Signed-off-by: Kartik Ganesh * Upgrading tika libraries to 2.4.0 Signed-off-by: Kartik Ganesh * Switched from tika-langdetect to tika-langdetect-optimaize To fix the license check, the mapping regex was expanded to tika-.* This now means the tika-core LICENSE and NOTICE files are no longer needed. Signed-off-by: Kartik Ganesh * (Work in progress) Switching AttachmentProcessor to use OptimaizeLangDetector This is a concrete implementation of LanguageDetector. Using this requires bringing in the optimaize dependency. Signed-off-by: Kartik Ganesh * Manually added LICENSE and NOTICE files for Optimaize language-detector Signed-off-by: Kartik Ganesh * Move Optimaize dependency to runtimeOnly Also bring in transitive Guava dependency. This requires manual addition of LICENSE and NOTICE files as with other plugins. Signed-off-by: Kartik Ganesh * Fix Optimaize langDetector to load models first before detecting Signed-off-by: Kartik Ganesh * Fallback logic, and test updates Following the Tika library upgrade, some fallback logic is necessary: 1. "Author" is deprecated for MSOffice document parsing. It is recommended to use CREATOR from Tika Core Properties instead. 2. EPUB parsing no longer automatically extracts keywords. The convention to fall back to SUBJECT is now manually implemented in AttachmentProcessor Finally, unit tests have been upgraded to account for non-deterministic language results across library upgrades. Signed-off-by: Kartik Ganesh * Drop Guava version from 31.1 to 18.0 This is the version that Optimaize 0.6 depends on, and it allows for a smaller ignoreViolations list Signed-off-by: Kartik Ganesh * Fix ingest-attachment integration test to assert correct language Signed-off-by: Kartik Ganesh (cherry picked from commit fc0f446ab2178650671d93c6025e0bc11e70ffa1) Co-authored-by: Kartik Ganesh --- plugins/ingest-attachment/build.gradle | 30 +- .../licenses/commons-io-2.11.0.jar.sha1 | 1 + .../licenses/commons-io-2.7.jar.sha1 | 1 - .../licenses/fontbox-2.0.24.jar.sha1 | 1 - .../licenses/fontbox-2.0.25.jar.sha1 | 1 + .../licenses/guava-18.0.jar.sha1 | 1 + .../licenses/guava-LICENSE.txt | 202 ++++++++ .../licenses/guava-NOTICE.txt | 0 .../licenses/language-detector-0.6.jar.sha1 | 1 + .../licenses/language-detector-LICENSE.txt | 88 ++++ .../licenses/language-detector-NOTICE.txt | 0 .../licenses/pdfbox-2.0.24.jar.sha1 | 1 - .../licenses/pdfbox-2.0.25.jar.sha1 | 1 + .../licenses/poi-4.1.2.jar.sha1 | 1 - .../licenses/poi-5.2.2.jar.sha1 | 1 + .../licenses/poi-ooxml-4.1.2.jar.sha1 | 1 - .../licenses/poi-ooxml-5.2.2.jar.sha1 | 1 + .../licenses/poi-ooxml-lite-5.2.2.jar.sha1 | 1 + .../licenses/poi-ooxml-schemas-4.1.2.jar.sha1 | 1 - .../licenses/poi-ooxml-schemas-LICENSE.txt | 463 ------------------ .../licenses/poi-ooxml-schemas-NOTICE.txt | 23 - .../licenses/poi-scratchpad-4.1.2.jar.sha1 | 1 - .../licenses/poi-scratchpad-5.2.2.jar.sha1 | 1 + .../licenses/tika-core-1.24.1.jar.sha1 | 1 - .../licenses/tika-core-2.4.0.jar.sha1 | 1 + .../licenses/tika-core-LICENSE.txt | 372 -------------- .../licenses/tika-core-NOTICE.txt | 17 - .../tika-langdetect-optimaize-2.4.0.jar.sha1 | 1 + .../licenses/tika-parsers-1.24.1.jar.sha1 | 1 - ...ka-parsers-standard-package-2.4.0.jar.sha1 | 1 + .../licenses/xmlbeans-3.0.1.jar.sha1 | 1 - .../licenses/xmlbeans-5.0.2.jar.sha1 | 1 + .../attachment/AttachmentProcessor.java | 22 +- .../ingest/attachment/TikaImpl.java | 2 +- .../attachment/AttachmentProcessorTests.java | 7 +- .../ingest_attachment/30_files_supported.yml | 4 +- 36 files changed, 351 insertions(+), 902 deletions(-) create mode 100644 plugins/ingest-attachment/licenses/commons-io-2.11.0.jar.sha1 delete mode 100644 plugins/ingest-attachment/licenses/commons-io-2.7.jar.sha1 delete mode 100644 plugins/ingest-attachment/licenses/fontbox-2.0.24.jar.sha1 create mode 100644 plugins/ingest-attachment/licenses/fontbox-2.0.25.jar.sha1 create mode 100644 plugins/ingest-attachment/licenses/guava-18.0.jar.sha1 create mode 100644 plugins/ingest-attachment/licenses/guava-LICENSE.txt create mode 100644 plugins/ingest-attachment/licenses/guava-NOTICE.txt create mode 100644 plugins/ingest-attachment/licenses/language-detector-0.6.jar.sha1 create mode 100644 plugins/ingest-attachment/licenses/language-detector-LICENSE.txt create mode 100644 plugins/ingest-attachment/licenses/language-detector-NOTICE.txt delete mode 100644 plugins/ingest-attachment/licenses/pdfbox-2.0.24.jar.sha1 create mode 100644 plugins/ingest-attachment/licenses/pdfbox-2.0.25.jar.sha1 delete mode 100644 plugins/ingest-attachment/licenses/poi-4.1.2.jar.sha1 create mode 100644 plugins/ingest-attachment/licenses/poi-5.2.2.jar.sha1 delete mode 100644 plugins/ingest-attachment/licenses/poi-ooxml-4.1.2.jar.sha1 create mode 100644 plugins/ingest-attachment/licenses/poi-ooxml-5.2.2.jar.sha1 create mode 100644 plugins/ingest-attachment/licenses/poi-ooxml-lite-5.2.2.jar.sha1 delete mode 100644 plugins/ingest-attachment/licenses/poi-ooxml-schemas-4.1.2.jar.sha1 delete mode 100644 plugins/ingest-attachment/licenses/poi-ooxml-schemas-LICENSE.txt delete mode 100644 plugins/ingest-attachment/licenses/poi-ooxml-schemas-NOTICE.txt delete mode 100644 plugins/ingest-attachment/licenses/poi-scratchpad-4.1.2.jar.sha1 create mode 100644 plugins/ingest-attachment/licenses/poi-scratchpad-5.2.2.jar.sha1 delete mode 100644 plugins/ingest-attachment/licenses/tika-core-1.24.1.jar.sha1 create mode 100644 plugins/ingest-attachment/licenses/tika-core-2.4.0.jar.sha1 delete mode 100644 plugins/ingest-attachment/licenses/tika-core-LICENSE.txt delete mode 100644 plugins/ingest-attachment/licenses/tika-core-NOTICE.txt create mode 100644 plugins/ingest-attachment/licenses/tika-langdetect-optimaize-2.4.0.jar.sha1 delete mode 100644 plugins/ingest-attachment/licenses/tika-parsers-1.24.1.jar.sha1 create mode 100644 plugins/ingest-attachment/licenses/tika-parsers-standard-package-2.4.0.jar.sha1 delete mode 100644 plugins/ingest-attachment/licenses/xmlbeans-3.0.1.jar.sha1 create mode 100644 plugins/ingest-attachment/licenses/xmlbeans-5.0.2.jar.sha1 diff --git a/plugins/ingest-attachment/build.gradle b/plugins/ingest-attachment/build.gradle index 4474724a32eb6..4ad02f8d68aed 100644 --- a/plugins/ingest-attachment/build.gradle +++ b/plugins/ingest-attachment/build.gradle @@ -38,19 +38,26 @@ opensearchplugin { } versions << [ - 'tika' : '1.24.1', - 'pdfbox': '2.0.24', - 'poi' : '4.1.2', + 'tika' : '2.4.0', + 'pdfbox': '2.0.25', + 'poi' : '5.2.2', 'mime4j': '0.8.3' ] dependencies { // mandatory for tika api "org.apache.tika:tika-core:${versions.tika}" - // build against Jackson 2.9.5, but still works on our current version api "org.apache.tika:tika-parsers:${versions.tika}" + // Required for the various document parsers + api "org.apache.tika:tika-parsers-standard-package:${versions.tika}" + // Required for language detection + api "org.apache.tika:tika-langdetect-optimaize:${versions.tika}" + // Optimaize libraries/dependencies + runtimeOnly "com.optimaize.languagedetector:language-detector:0.6" + runtimeOnly 'com.google.guava:guava:18.0' + // Other dependencies api 'org.tukaani:xz:1.8' - api 'commons-io:commons-io:2.7' + api 'commons-io:commons-io:2.11.0' api "org.slf4j:slf4j-api:${versions.slf4j}" // character set detection @@ -70,9 +77,9 @@ dependencies { // OpenOffice api "org.apache.poi:poi-ooxml:${versions.poi}" api "org.apache.poi:poi:${versions.poi}" - api "org.apache.poi:poi-ooxml-schemas:${versions.poi}" + api "org.apache.poi:poi-ooxml-lite:${versions.poi}" api "commons-codec:commons-codec:${versions.commonscodec}" - api 'org.apache.xmlbeans:xmlbeans:3.0.1' + api 'org.apache.xmlbeans:xmlbeans:5.0.2' api 'org.apache.commons:commons-collections4:4.1' // MS Office api "org.apache.poi:poi-scratchpad:${versions.poi}" @@ -97,6 +104,8 @@ restResources { tasks.named("dependencyLicenses").configure { mapping from: /apache-mime4j-.*/, to: 'apache-mime4j' + mapping from: /tika-.*/, to: 'tika-parsers' + mapping from: /poi-ooxml-.*/, to: 'poi-ooxml' } forbiddenPatterns { @@ -109,6 +118,13 @@ forbiddenPatterns { thirdPartyAudit { ignoreMissingClasses() + ignoreViolations( + 'com.google.common.cache.Striped64', + 'com.google.common.cache.Striped64$1', + 'com.google.common.cache.Striped64$Cell', + 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator', + 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1' + ) } if (BuildParams.inFipsJvm) { diff --git a/plugins/ingest-attachment/licenses/commons-io-2.11.0.jar.sha1 b/plugins/ingest-attachment/licenses/commons-io-2.11.0.jar.sha1 new file mode 100644 index 0000000000000..8adec30bade49 --- /dev/null +++ b/plugins/ingest-attachment/licenses/commons-io-2.11.0.jar.sha1 @@ -0,0 +1 @@ +a2503f302b11ebde7ebc3df41daebe0e4eea3689 \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/commons-io-2.7.jar.sha1 b/plugins/ingest-attachment/licenses/commons-io-2.7.jar.sha1 deleted file mode 100644 index bbb1b15dd1e1e..0000000000000 --- a/plugins/ingest-attachment/licenses/commons-io-2.7.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -3f2bd4ba11c4162733c13cc90ca7c7ea09967102 \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/fontbox-2.0.24.jar.sha1 b/plugins/ingest-attachment/licenses/fontbox-2.0.24.jar.sha1 deleted file mode 100644 index 1f6388867917a..0000000000000 --- a/plugins/ingest-attachment/licenses/fontbox-2.0.24.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -df8ecb3006dfcd52355a5902096e5ec34f06112e \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/fontbox-2.0.25.jar.sha1 b/plugins/ingest-attachment/licenses/fontbox-2.0.25.jar.sha1 new file mode 100644 index 0000000000000..3191976e949f8 --- /dev/null +++ b/plugins/ingest-attachment/licenses/fontbox-2.0.25.jar.sha1 @@ -0,0 +1 @@ +f6644a1eb1d165eded719a88bf7bdcff91740b98 \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/guava-18.0.jar.sha1 b/plugins/ingest-attachment/licenses/guava-18.0.jar.sha1 new file mode 100644 index 0000000000000..87f7acb8158ec --- /dev/null +++ b/plugins/ingest-attachment/licenses/guava-18.0.jar.sha1 @@ -0,0 +1 @@ +cce0823396aa693798f8882e64213b1772032b09 \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/guava-LICENSE.txt b/plugins/ingest-attachment/licenses/guava-LICENSE.txt new file mode 100644 index 0000000000000..d645695673349 --- /dev/null +++ b/plugins/ingest-attachment/licenses/guava-LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/plugins/ingest-attachment/licenses/guava-NOTICE.txt b/plugins/ingest-attachment/licenses/guava-NOTICE.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/plugins/ingest-attachment/licenses/language-detector-0.6.jar.sha1 b/plugins/ingest-attachment/licenses/language-detector-0.6.jar.sha1 new file mode 100644 index 0000000000000..5c069b9095db6 --- /dev/null +++ b/plugins/ingest-attachment/licenses/language-detector-0.6.jar.sha1 @@ -0,0 +1 @@ +52fee1eaa101f8d3e30b7095e1b6e0054d514dde \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/language-detector-LICENSE.txt b/plugins/ingest-attachment/licenses/language-detector-LICENSE.txt new file mode 100644 index 0000000000000..a62d849a22618 --- /dev/null +++ b/plugins/ingest-attachment/licenses/language-detector-LICENSE.txt @@ -0,0 +1,88 @@ +Apache License, Version 2.0 + +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + You must give any other recipients of the Work or Derivative Works a copy of this License; and + You must cause any modified files to carry prominent notices stating that You changed the files; and + You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work + + To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/plugins/ingest-attachment/licenses/language-detector-NOTICE.txt b/plugins/ingest-attachment/licenses/language-detector-NOTICE.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/plugins/ingest-attachment/licenses/pdfbox-2.0.24.jar.sha1 b/plugins/ingest-attachment/licenses/pdfbox-2.0.24.jar.sha1 deleted file mode 100644 index 2eb2e357cbf1c..0000000000000 --- a/plugins/ingest-attachment/licenses/pdfbox-2.0.24.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -cb562ee5f43e29415af4477e62fbe668ef88d18b \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/pdfbox-2.0.25.jar.sha1 b/plugins/ingest-attachment/licenses/pdfbox-2.0.25.jar.sha1 new file mode 100644 index 0000000000000..165b3649e80bf --- /dev/null +++ b/plugins/ingest-attachment/licenses/pdfbox-2.0.25.jar.sha1 @@ -0,0 +1 @@ +c18cd03ff3a2dfc3c4a30d3a35173bd2690bcb92 \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/poi-4.1.2.jar.sha1 b/plugins/ingest-attachment/licenses/poi-4.1.2.jar.sha1 deleted file mode 100644 index dae936314bde1..0000000000000 --- a/plugins/ingest-attachment/licenses/poi-4.1.2.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -964bf41cf68bce08e4ef6b2279b559fdf8d454f4 \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/poi-5.2.2.jar.sha1 b/plugins/ingest-attachment/licenses/poi-5.2.2.jar.sha1 new file mode 100644 index 0000000000000..d9f58e72c9200 --- /dev/null +++ b/plugins/ingest-attachment/licenses/poi-5.2.2.jar.sha1 @@ -0,0 +1 @@ +5513d31545085c33809c4b6553c2009fd19a6016 \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/poi-ooxml-4.1.2.jar.sha1 b/plugins/ingest-attachment/licenses/poi-ooxml-4.1.2.jar.sha1 deleted file mode 100644 index b42c94ac3b33e..0000000000000 --- a/plugins/ingest-attachment/licenses/poi-ooxml-4.1.2.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -87d9a22aa9a7dd26e80c360e709f7ee02e32ab3b \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/poi-ooxml-5.2.2.jar.sha1 b/plugins/ingest-attachment/licenses/poi-ooxml-5.2.2.jar.sha1 new file mode 100644 index 0000000000000..7b3abffc1abd5 --- /dev/null +++ b/plugins/ingest-attachment/licenses/poi-ooxml-5.2.2.jar.sha1 @@ -0,0 +1 @@ +a201b5bdc92c0fae4bed4b8e5546388c4c2f9eb0 \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/poi-ooxml-lite-5.2.2.jar.sha1 b/plugins/ingest-attachment/licenses/poi-ooxml-lite-5.2.2.jar.sha1 new file mode 100644 index 0000000000000..f5137b1e5223e --- /dev/null +++ b/plugins/ingest-attachment/licenses/poi-ooxml-lite-5.2.2.jar.sha1 @@ -0,0 +1 @@ +5df31b69375131fc2163a5557093cb112be90ce1 \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/poi-ooxml-schemas-4.1.2.jar.sha1 b/plugins/ingest-attachment/licenses/poi-ooxml-schemas-4.1.2.jar.sha1 deleted file mode 100644 index 852e018a5970d..0000000000000 --- a/plugins/ingest-attachment/licenses/poi-ooxml-schemas-4.1.2.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -550cc22a598c0b0a51d1f55f8371e83c1229802d \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/poi-ooxml-schemas-LICENSE.txt b/plugins/ingest-attachment/licenses/poi-ooxml-schemas-LICENSE.txt deleted file mode 100644 index dd2cbd5fbc180..0000000000000 --- a/plugins/ingest-attachment/licenses/poi-ooxml-schemas-LICENSE.txt +++ /dev/null @@ -1,463 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - -APACHE POI SUBCOMPONENTS: - -Apache POI includes subcomponents with separate copyright notices and -license terms. Your use of these subcomponents is subject to the terms -and conditions of the following licenses: - - -Office Open XML schemas (ooxml-schemas-1.1.jar) - - The Office Open XML schema definitions used by Apache POI are - a part of the Office Open XML ECMA Specification (ECMA-376, [1]). - As defined in section 9.4 of the ECMA bylaws [2], this specification - is available to all interested parties without restriction: - - 9.4 All documents when approved shall be made available to - all interested parties without restriction. - - Furthermore, both Microsoft and Adobe have granted patent licenses - to this work [3,4,5]. - - [1] http://www.ecma-international.org/publications/standards/Ecma-376.htm - [2] http://www.ecma-international.org/memento/Ecmabylaws.htm - [3] http://www.microsoft.com/openspecifications/en/us/programs/osp/default.aspx - [4] http://www.ecma-international.org/publications/files/ECMA-ST/Ecma%20PATENT/Patent%20statements%20ok/ECMA-376%20Edition%202%20Microsoft%20Patent%20Declaration.pdf - [5] http://www.ecma-international.org/publications/files/ECMA-ST/Ecma%20PATENT/Patent%20statements%20ok/ECMA-376%20Adobe%20Patent%20Declaration.pdf - - -JUnit test library (junit-4.11.jar) - - Common Public License - v 1.0 - - THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON - PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION - OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - - 1. DEFINITIONS - - "Contribution" means: - - a) in the case of the initial Contributor, the initial code and - documentation distributed under this Agreement, and - - b) in the case of each subsequent Contributor: - - i) changes to the Program, and - - ii) additions to the Program; - - where such changes and/or additions to the Program originate from - and are distributed by that particular Contributor. A Contribution - 'originates' from a Contributor if it was added to the Program by - such Contributor itself or anyone acting on such Contributor's behalf. - Contributions do not include additions to the Program which: (i) are - separate modules of software distributed in conjunction with the - Program under their own license agreement, and (ii) are not derivative - works of the Program. - - "Contributor" means any person or entity that distributes the Program. - - "Licensed Patents " mean patent claims licensable by a Contributor which - are necessarily infringed by the use or sale of its Contribution alone - or when combined with the Program. - - "Program" means the Contributions distributed in accordance with this - Agreement. - - "Recipient" means anyone who receives the Program under this Agreement, - including all Contributors. - - 2. GRANT OF RIGHTS - - a) Subject to the terms of this Agreement, each Contributor hereby grants - Recipient a non-exclusive, worldwide, royalty-free copyright license - to reproduce, prepare derivative works of, publicly display, publicly - perform, distribute and sublicense the Contribution of such - Contributor, if any, and such derivative works, in source code and - object code form. - - b) Subject to the terms of this Agreement, each Contributor hereby grants - Recipient a non-exclusive, worldwide, royalty-free patent license under - Licensed Patents to make, use, sell, offer to sell, import and - otherwise transfer the Contribution of such Contributor, if any, in - source code and object code form. This patent license shall apply to - the combination of the Contribution and the Program if, at the time - the Contribution is added by the Contributor, such addition of the - Contribution causes such combination to be covered by the Licensed - Patents. The patent license shall not apply to any other combinations - which include the Contribution. No hardware per se is licensed - hereunder. - - c) Recipient understands that although each Contributor grants the - licenses to its Contributions set forth herein, no assurances are - provided by any Contributor that the Program does not infringe the - patent or other intellectual property rights of any other entity. - Each Contributor disclaims any liability to Recipient for claims - brought by any other entity based on infringement of intellectual - property rights or otherwise. As a condition to exercising the rights - and licenses granted hereunder, each Recipient hereby assumes sole - responsibility to secure any other intellectual property rights - needed, if any. For example, if a third party patent license is - required to allow Recipient to distribute the Program, it is - Recipient's responsibility to acquire that license before - distributing the Program. - - d) Each Contributor represents that to its knowledge it has sufficient - copyright rights in its Contribution, if any, to grant the copyright - license set forth in this Agreement. - - 3. REQUIREMENTS - - A Contributor may choose to distribute the Program in object code form - under its own license agreement, provided that: - - a) it complies with the terms and conditions of this Agreement; and - - b) its license agreement: - - i) effectively disclaims on behalf of all Contributors all warranties - and conditions, express and implied, including warranties or - conditions of title and non-infringement, and implied warranties - or conditions of merchantability and fitness for a particular - purpose; - - ii) effectively excludes on behalf of all Contributors all liability - for damages, including direct, indirect, special, incidental and - consequential damages, such as lost profits; - - iii) states that any provisions which differ from this Agreement are - offered by that Contributor alone and not by any other party; and - - iv) states that source code for the Program is available from such - Contributor, and informs licensees how to obtain it in a - reasonable manner on or through a medium customarily used for - software exchange. - - When the Program is made available in source code form: - - a) it must be made available under this Agreement; and - - b) a copy of this Agreement must be included with each copy of - the Program. - - Contributors may not remove or alter any copyright notices contained - within the Program. - - Each Contributor must identify itself as the originator of its - Contribution, if any, in a manner that reasonably allows subsequent - Recipients to identify the originator of the Contribution. - - 4. COMMERCIAL DISTRIBUTION - - Commercial distributors of software may accept certain responsibilities - with respect to end users, business partners and the like. While this - license is intended to facilitate the commercial use of the Program, - the Contributor who includes the Program in a commercial product offering - should do so in a manner which does not create potential liability for - other Contributors. Therefore, if a Contributor includes the Program - in a commercial product offering, such Contributor ("Commercial - Contributor") hereby agrees to defend and indemnify every other - Contributor ("Indemnified Contributor") against any losses, damages - and costs (collectively "Losses") arising from claims, lawsuits and - other legal actions brought by a third party against the Indemnified - Contributor to the extent caused by the acts or omissions of such - Commercial Contributor in connection with its distribution of the - Program in a commercial product offering. The obligations in this - section do not apply to any claims or Losses relating to any actual - or alleged intellectual property infringement. In order to qualify, - an Indemnified Contributor must: a) promptly notify the Commercial - Contributor in writing of such claim, and b) allow the Commercial - Contributor to control, and cooperate with the Commercial Contributor - in, the defense and any related settlement negotiations. The Indemnified - Contributor may participate in any such claim at its own expense. - - For example, a Contributor might include the Program in a commercial - product offering, Product X. That Contributor is then a Commercial - Contributor. If that Commercial Contributor then makes performance - claims, or offers warranties related to Product X, those performance - claims and warranties are such Commercial Contributor's responsibility - alone. Under this section, the Commercial Contributor would have to - defend claims against the other Contributors related to those - performance claims and warranties, and if a court requires any other - Contributor to pay any damages as a result, the Commercial Contributor - must pay those damages. - - 5. NO WARRANTY - - EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED - ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER - EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR - CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR - A PARTICULAR PURPOSE. Each Recipient is solely responsible for - determining the appropriateness of using and distributing the Program - and assumes all risks associated with its exercise of rights under this - Agreement, including but not limited to the risks and costs of program - errors, compliance with applicable laws, damage to or loss of data, - programs or equipment, and unavailability or interruption of operations. - - 6. DISCLAIMER OF LIABILITY - - EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR - ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING - WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR - DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED - HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - - 7. GENERAL - - If any provision of this Agreement is invalid or unenforceable under - applicable law, it shall not affect the validity or enforceability of - the remainder of the terms of this Agreement, and without further - action by the parties hereto, such provision shall be reformed to the - minimum extent necessary to make such provision valid and enforceable. - - If Recipient institutes patent litigation against a Contributor with - respect to a patent applicable to software (including a cross-claim or - counterclaim in a lawsuit), then any patent licenses granted by that - Contributor to such Recipient under this Agreement shall terminate as of - the date such litigation is filed. In addition, if Recipient institutes - patent litigation against any entity (including a cross-claim or - counterclaim in a lawsuit) alleging that the Program itself (excluding - combinations of the Program with other software or hardware) infringes - such Recipient's patent(s), then such Recipient's rights granted under - Section 2(b) shall terminate as of the date such litigation is filed. - - All Recipient's rights under this Agreement shall terminate if it fails - to comply with any of the material terms or conditions of this Agreement - and does not cure such failure in a reasonable period of time after - becoming aware of such noncompliance. If all Recipient's rights under - this Agreement terminate, Recipient agrees to cease use and distribution - of the Program as soon as reasonably practicable. However, Recipient's - obligations under this Agreement and any licenses granted by Recipient - relating to the Program shall continue and survive. - - Everyone is permitted to copy and distribute copies of this Agreement, - but in order to avoid inconsistency the Agreement is copyrighted and may - only be modified in the following manner. The Agreement Steward reserves - the right to publish new versions (including revisions) of this Agreement - from time to time. No one other than the Agreement Steward has the right - to modify this Agreement. IBM is the initial Agreement Steward. IBM may - assign the responsibility to serve as the Agreement Steward to a suitable - separate entity. Each new version of the Agreement will be given a - distinguishing version number. The Program (including Contributions) may - always be distributed subject to the version of the Agreement under which - it was received. In addition, after a new version of the Agreement is - published, Contributor may elect to distribute the Program (including - its Contributions) under the new version. Except as expressly stated in - Sections 2(a) and 2(b) above, Recipient receives no rights or licenses - to the intellectual property of any Contributor under this Agreement, - whether expressly, by implication, estoppel or otherwise. All rights in - the Program not expressly granted under this Agreement are reserved. - - This Agreement is governed by the laws of the State of New York and the - intellectual property laws of the United States of America. No party to - this Agreement will bring a legal action under this Agreement more than - one year after the cause of action arose. Each party waives its rights - to a jury trial in any resulting litigation. diff --git a/plugins/ingest-attachment/licenses/poi-ooxml-schemas-NOTICE.txt b/plugins/ingest-attachment/licenses/poi-ooxml-schemas-NOTICE.txt deleted file mode 100644 index 12ff265290de1..0000000000000 --- a/plugins/ingest-attachment/licenses/poi-ooxml-schemas-NOTICE.txt +++ /dev/null @@ -1,23 +0,0 @@ -Apache POI -Copyright 2003-2015 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - -This product contains parts that were originally based on software from BEA. -Copyright (c) 2000-2003, BEA Systems, . - -This product contains W3C XML Schema documents. Copyright 2001-2003 (c) -World Wide Web Consortium (Massachusetts Institute of Technology, European -Research Consortium for Informatics and Mathematics, Keio University) - -This product contains the Piccolo XML Parser for Java -(http://piccolo.sourceforge.net/). Copyright 2002 Yuval Oren. - -This product contains the chunks_parse_cmds.tbl file from the vsdump program. -Copyright (C) 2006-2007 Valek Filippov (frob@df.ru) - -This product contains parts of the eID Applet project -(http://eid-applet.googlecode.com). Copyright (c) 2009-2014 -FedICT (federal ICT department of Belgium), e-Contract.be BVBA (https://www.e-contract.be), -Bart Hanssens from FedICT diff --git a/plugins/ingest-attachment/licenses/poi-scratchpad-4.1.2.jar.sha1 b/plugins/ingest-attachment/licenses/poi-scratchpad-4.1.2.jar.sha1 deleted file mode 100644 index ed3d36c955a9e..0000000000000 --- a/plugins/ingest-attachment/licenses/poi-scratchpad-4.1.2.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -1be379e91d3d3fb0cd11425451acdbfb0d2264e7 \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/poi-scratchpad-5.2.2.jar.sha1 b/plugins/ingest-attachment/licenses/poi-scratchpad-5.2.2.jar.sha1 new file mode 100644 index 0000000000000..568dde5125c3f --- /dev/null +++ b/plugins/ingest-attachment/licenses/poi-scratchpad-5.2.2.jar.sha1 @@ -0,0 +1 @@ +8c5cd5f1b3e7b3656ab983b73bbbf8bf5f14f793 \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/tika-core-1.24.1.jar.sha1 b/plugins/ingest-attachment/licenses/tika-core-1.24.1.jar.sha1 deleted file mode 100644 index ba4f64ff8f078..0000000000000 --- a/plugins/ingest-attachment/licenses/tika-core-1.24.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -703e65fb300d1425d4ad7b68c21c7795bb7a95c3 \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/tika-core-2.4.0.jar.sha1 b/plugins/ingest-attachment/licenses/tika-core-2.4.0.jar.sha1 new file mode 100644 index 0000000000000..373b7ec63138a --- /dev/null +++ b/plugins/ingest-attachment/licenses/tika-core-2.4.0.jar.sha1 @@ -0,0 +1 @@ +97b2454943127857a8304319be658d6d7ff4fff1 \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/tika-core-LICENSE.txt b/plugins/ingest-attachment/licenses/tika-core-LICENSE.txt deleted file mode 100644 index 9537d733ea9bf..0000000000000 --- a/plugins/ingest-attachment/licenses/tika-core-LICENSE.txt +++ /dev/null @@ -1,372 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - -APACHE TIKA SUBCOMPONENTS - -Apache Tika includes a number of subcomponents with separate copyright notices -and license terms. Your use of these subcomponents is subject to the terms and -conditions of the following licenses. - -MIME type information from file-4.26.tar.gz (http://www.darwinsys.com/file/) - - Copyright (c) Ian F. Darwin 1986, 1987, 1989, 1990, 1991, 1992, 1994, 1995. - Software written by Ian F. Darwin and others; - maintained 1994- Christos Zoulas. - - This software is not subject to any export provision of the United States - Department of Commerce, and may be exported to any country or planet. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice immediately at the beginning of the file, without modification, - this list of conditions, and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - -Charset detection code from ICU4J (http://site.icu-project.org/) - - Copyright (c) 1995-2009 International Business Machines Corporation - and others - - All rights reserved. - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, and/or sell copies of the Software, and to permit persons - to whom the Software is furnished to do so, provided that the above - copyright notice(s) and this permission notice appear in all copies - of the Software and that both the above copyright notice(s) and this - permission notice appear in supporting documentation. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE - BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, - OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, - WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - SOFTWARE. - - Except as contained in this notice, the name of a copyright holder shall - not be used in advertising or otherwise to promote the sale, use or other - dealings in this Software without prior written authorization of the - copyright holder. - - -Parsing functionality provided by the NetCDF Java Library (http://www.unidata.ucar.edu/software/netcdf-java/) - - Copyright 1993-2010 University Corporation for Atmospheric Research/Unidata - - Portions of this software were developed by the Unidata Program at the University - Corporation for Atmospheric Research. - - Access and use of this software shall impose the following obligations and understandings - on the user. The user is granted the right, without any fee or cost, to use, copy, modify, - alter, enhance and distribute this software, and any derivative works thereof, and its - supporting documentation for any purpose whatsoever, provided that this entire notice - appears in all copies of the software, derivative works and supporting documentation. Further, - UCAR requests that the user credit UCAR/Unidata in any publications that result from the use - of this software or in any product that includes this software, although this is not an obligation. - The names UCAR and/or Unidata, however, may not be used in any advertising or publicity to endorse - or promote any products or commercial entity unless specific written permission is obtained from - UCAR/Unidata. The user also understands that UCAR/Unidata is not obligated to provide the user with - any support, consulting, training or assistance of any kind with regard to the use, operation and - performance of this software nor to provide the user with any updates, revisions, new versions or - "bug fixes." - - THIS SOFTWARE IS PROVIDED BY UCAR/UNIDATA "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, - BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL UCAR/UNIDATA BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL - DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE ACCESS, - USE OR PERFORMANCE OF THIS SOFTWARE. - - -IPTC Photo Metadata descriptions are taken from the IPTC Photo Metadata -Standard, July 2010, Copyright 2010 International Press Telecommunications -Council. - - 1. The Specifications and Materials are licensed for use only on the condition that you agree to be bound by the terms of this license. Subject to this and other licensing requirements contained herein, you may, on a non-exclusive basis, use the Specifications and Materials. - 2. The IPTC openly provides the Specifications and Materials for voluntary use by individuals, partnerships, companies, corporations, organizations and any other entity for use at the entity's own risk. This disclaimer, license and release is intended to apply to the IPTC, its officers, directors, agents, representatives, members, contributors, affiliates, contractors, or co-venturers acting jointly or severally. - 3. The Document and translations thereof may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the copyright and license notices and references to the IPTC appearing in the Document and the terms of this Specifications License Agreement are included on all such copies and derivative works. Further, upon the receipt of written permission from the IPTC, the Document may be modified for the purpose of developing applications that use IPTC Specifications or as required to translate the Document into languages other than English. - 4. Any use, duplication, distribution, or exploitation of the Document and Specifications and Materials in any manner is at your own risk. - 5. NO WARRANTY, EXPRESSED OR IMPLIED, IS MADE REGARDING THE ACCURACY, ADEQUACY, COMPLETENESS, LEGALITY, RELIABILITY OR USEFULNESS OF ANY INFORMATION CONTAINED IN THE DOCUMENT OR IN ANY SPECIFICATION OR OTHER PRODUCT OR SERVICE PRODUCED OR SPONSORED BY THE IPTC. THE DOCUMENT AND THE INFORMATION CONTAINED HEREIN AND INCLUDED IN ANY SPECIFICATION OR OTHER PRODUCT OR SERVICE OF THE IPTC IS PROVIDED ON AN "AS IS" BASIS. THE IPTC DISCLAIMS ALL WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY ACTUAL OR ASSERTED WARRANTY OF NON-INFRINGEMENT OF PROPRIETARY RIGHTS, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. NEITHER THE IPTC NOR ITS CONTRIBUTORS SHALL BE HELD LIABLE FOR ANY IMPROPER OR INCORRECT USE OF INFORMATION. NEITHER THE IPTC NOR ITS CONTRIBUTORS ASSUME ANY RESPONSIBILITY FOR ANYONE'S USE OF INFORMATION PROVIDED BY THE IPTC. IN NO EVENT SHALL THE IPTC OR ITS CONTRIBUTORS BE LIABLE TO ANYONE FOR DAMAGES OF ANY KIND, INCLUDING BUT NOT LIMITED TO, COMPENSATORY DAMAGES, LOST PROFITS, LOST DATA OR ANY FORM OF SPECIAL, INCIDENTAL, INDIRECT, CONSEQUENTIAL OR PUNITIVE DAMAGES OF ANY KIND WHETHER BASED ON BREACH OF CONTRACT OR WARRANTY, TORT, PRODUCT LIABILITY OR OTHERWISE. - 6. The IPTC takes no position regarding the validity or scope of any Intellectual Property or other rights that might be claimed to pertain to the implementation or use of the technology described in the Document or the extent to which any license under such rights might or might not be available. The IPTC does not represent that it has made any effort to identify any such rights. Copies of claims of rights made available for publication, assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of the Specifications and Materials, can be obtained from the Managing Director of the IPTC. - 7. By using the Specifications and Materials including the Document in any manner or for any purpose, you release the IPTC from all liabilities, claims, causes of action, allegations, losses, injuries, damages, or detriments of any nature arising from or relating to the use of the Specifications, Materials or any portion thereof. You further agree not to file a lawsuit, make a claim, or take any other formal or informal legal action against the IPTC, resulting from your acquisition, use, duplication, distribution, or exploitation of the Specifications, Materials or any portion thereof. Finally, you hereby agree that the IPTC is not liable for any direct, indirect, special or consequential damages arising from or relating to your acquisition, use, duplication, distribution, or exploitation of the Specifications, Materials or any portion thereof. - 8. Specifications and Materials may be downloaded or copied provided that ALL copies retain the ownership, copyright and license notices. - 9. Materials may not be edited, modified, or presented in a context that creates a misleading or false impression or statement as to the positions, actions, or statements of the IPTC. - 10. The name and trademarks of the IPTC may not be used in advertising, publicity, or in relation to products or services and their names without the specific, written prior permission of the IPTC. Any permitted use of the trademarks of the IPTC, whether registered or not, shall be accompanied by an appropriate mark and attribution, as agreed with the IPTC. - 11. Specifications may be extended by both members and non-members to provide additional functionality (Extension Specifications) provided that there is a clear recognition of the IPTC IP and its ownership in the Extension Specifications and the related documentation and provided that the extensions are clearly identified and provided that a perpetual license is granted by the creator of the Extension Specifications for other members and non-members to use the Extension Specifications and to continue extensions of the Extension Specifications. The IPTC does not waive any of its rights in the Specifications and Materials in this context. The Extension Specifications may be considered the intellectual property of their creator. The IPTC expressly disclaims any responsibility for damage caused by an extension to the Specifications. - 12. Specifications and Materials may be included in derivative work of both members and non-members provided that there is a clear recognition of the IPTC IP and its ownership in the derivative work and its related documentation. The IPTC does not waive any of its rights in the Specifications and Materials in this context. Derivative work in its entirety may be considered the intellectual property of the creator of the work .The IPTC expressly disclaims any responsibility for damage caused when its IP is used in a derivative context. - 13. This Specifications License Agreement is perpetual subject to your conformance to the terms of this Agreement. The IPTC may terminate this Specifications License Agreement immediately upon your breach of this Agreement and, upon such termination you will cease all use, duplication, distribution, and/or exploitation in any manner of the Specifications and Materials. - 14. This Specifications License Agreement reflects the entire agreement of the parties regarding the subject matter hereof and supersedes all prior agreements or representations regarding such matters, whether written or oral. To the extent any portion or provision of this Specifications License Agreement is found to be illegal or unenforceable, then the remaining provisions of this Specifications License Agreement will remain in full force and effect and the illegal or unenforceable provision will be construed to give it such effect as it may properly have that is consistent with the intentions of the parties. - 15. This Specifications License Agreement may only be modified in writing signed by an authorized representative of the IPTC. - 16. This Specifications License Agreement is governed by the law of United Kingdom, as such law is applied to contracts made and fully performed in the United Kingdom. Any disputes arising from or relating to this Specifications License Agreement will be resolved in the courts of the United Kingdom. You consent to the jurisdiction of such courts over you and covenant not to assert before such courts any objection to proceeding in such forums. - - -JUnRAR (https://github.com/edmund-wagner/junrar/) - - JUnRAR is based on the UnRAR tool, and covered by the same license - It was formerly available from http://java-unrar.svn.sourceforge.net/ - - ****** ***** ****** UnRAR - free utility for RAR archives - ** ** ** ** ** ** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ****** ******* ****** License for use and distribution of - ** ** ** ** ** ** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ** ** ** ** ** ** FREE portable version - ~~~~~~~~~~~~~~~~~~~~~ - - The source code of UnRAR utility is freeware. This means: - - 1. All copyrights to RAR and the utility UnRAR are exclusively - owned by the author - Alexander Roshal. - - 2. The UnRAR sources may be used in any software to handle RAR - archives without limitations free of charge, but cannot be used - to re-create the RAR compression algorithm, which is proprietary. - Distribution of modified UnRAR sources in separate form or as a - part of other software is permitted, provided that it is clearly - stated in the documentation and source comments that the code may - not be used to develop a RAR (WinRAR) compatible archiver. - - 3. The UnRAR utility may be freely distributed. It is allowed - to distribute UnRAR inside of other software packages. - - 4. THE RAR ARCHIVER AND THE UnRAR UTILITY ARE DISTRIBUTED "AS IS". - NO WARRANTY OF ANY KIND IS EXPRESSED OR IMPLIED. YOU USE AT - YOUR OWN RISK. THE AUTHOR WILL NOT BE LIABLE FOR DATA LOSS, - DAMAGES, LOSS OF PROFITS OR ANY OTHER KIND OF LOSS WHILE USING - OR MISUSING THIS SOFTWARE. - - 5. Installing and using the UnRAR utility signifies acceptance of - these terms and conditions of the license. - - 6. If you don't agree with terms of the license you must remove - UnRAR files from your storage devices and cease to use the - utility. - - Thank you for your interest in RAR and UnRAR. Alexander L. Roshal - -Sqlite (bundled in org.xerial's sqlite-jdbc) - This product bundles Sqlite, which is in the Public Domain. For details - see: https://www.sqlite.org/copyright.html diff --git a/plugins/ingest-attachment/licenses/tika-core-NOTICE.txt b/plugins/ingest-attachment/licenses/tika-core-NOTICE.txt deleted file mode 100644 index 8e94f644b8112..0000000000000 --- a/plugins/ingest-attachment/licenses/tika-core-NOTICE.txt +++ /dev/null @@ -1,17 +0,0 @@ -Apache Tika -Copyright 2015 The Apache Software Foundation - -This product includes software developed at -The Apache Software Foundation (http://www.apache.org/). - -Copyright 1993-2010 University Corporation for Atmospheric Research/Unidata -This software contains code derived from UCAR/Unidata's NetCDF library. - -Tika-server component uses CDDL-licensed dependencies: jersey (http://jersey.java.net/) and -Grizzly (http://grizzly.java.net/) - -Tika-parsers component uses CDDL/LGPL dual-licensed dependency: jhighlight (https://github.com/codelibs/jhighlight) - -OpenCSV: Copyright 2005 Bytecode Pty Ltd. Licensed under the Apache License, Version 2.0 - -IPTC Photo Metadata descriptions Copyright 2010 International Press Telecommunications Council. diff --git a/plugins/ingest-attachment/licenses/tika-langdetect-optimaize-2.4.0.jar.sha1 b/plugins/ingest-attachment/licenses/tika-langdetect-optimaize-2.4.0.jar.sha1 new file mode 100644 index 0000000000000..cf724f4ee1de4 --- /dev/null +++ b/plugins/ingest-attachment/licenses/tika-langdetect-optimaize-2.4.0.jar.sha1 @@ -0,0 +1 @@ +57901d6088b0e34999e25af6b363ccec959b5e61 \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/tika-parsers-1.24.1.jar.sha1 b/plugins/ingest-attachment/licenses/tika-parsers-1.24.1.jar.sha1 deleted file mode 100644 index 6ad33ac8eca37..0000000000000 --- a/plugins/ingest-attachment/licenses/tika-parsers-1.24.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -02ce8d709cef4ed6a1a51ff14ba15b2ba2e76f09 \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/tika-parsers-standard-package-2.4.0.jar.sha1 b/plugins/ingest-attachment/licenses/tika-parsers-standard-package-2.4.0.jar.sha1 new file mode 100644 index 0000000000000..ec03a055a6f6d --- /dev/null +++ b/plugins/ingest-attachment/licenses/tika-parsers-standard-package-2.4.0.jar.sha1 @@ -0,0 +1 @@ +83522360364a93e819eaec74f393bc56ed1d466a \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/xmlbeans-3.0.1.jar.sha1 b/plugins/ingest-attachment/licenses/xmlbeans-3.0.1.jar.sha1 deleted file mode 100644 index e1c74c67f214d..0000000000000 --- a/plugins/ingest-attachment/licenses/xmlbeans-3.0.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -50d94da791ab1e799a11d6f82410fd7d49f402ca \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/xmlbeans-5.0.2.jar.sha1 b/plugins/ingest-attachment/licenses/xmlbeans-5.0.2.jar.sha1 new file mode 100644 index 0000000000000..63d79922a7047 --- /dev/null +++ b/plugins/ingest-attachment/licenses/xmlbeans-5.0.2.jar.sha1 @@ -0,0 +1 @@ +ac85f740e3492e28662cf5595d67113ffadc547d \ No newline at end of file diff --git a/plugins/ingest-attachment/src/main/java/org/opensearch/ingest/attachment/AttachmentProcessor.java b/plugins/ingest-attachment/src/main/java/org/opensearch/ingest/attachment/AttachmentProcessor.java index 0eb864a2d9ac0..b8e8300755686 100644 --- a/plugins/ingest-attachment/src/main/java/org/opensearch/ingest/attachment/AttachmentProcessor.java +++ b/plugins/ingest-attachment/src/main/java/org/opensearch/ingest/attachment/AttachmentProcessor.java @@ -33,7 +33,8 @@ package org.opensearch.ingest.attachment; import org.apache.tika.exception.ZeroByteFileException; -import org.apache.tika.language.LanguageIdentifier; +import org.apache.tika.langdetect.optimaize.OptimaizeLangDetector; +import org.apache.tika.language.detect.LanguageResult; import org.apache.tika.metadata.Metadata; import org.apache.tika.metadata.TikaCoreProperties; @@ -134,9 +135,10 @@ public IngestDocument execute(IngestDocument ingestDocument) { } if (properties.contains(Property.LANGUAGE) && Strings.hasLength(parsedContent)) { - // TODO: stop using LanguageIdentifier... - LanguageIdentifier identifier = new LanguageIdentifier(parsedContent); - String language = identifier.getLanguage(); + OptimaizeLangDetector langDetector = new OptimaizeLangDetector(); + langDetector.loadModels(); + LanguageResult result = langDetector.detect(parsedContent); + String language = result.getLanguage(); additionalFields.put(Property.LANGUAGE.toLowerCase(), language); } @@ -158,6 +160,12 @@ public IngestDocument execute(IngestDocument ingestDocument) { String author = metadata.get("Author"); if (Strings.hasLength(author)) { additionalFields.put(Property.AUTHOR.toLowerCase(), author); + } else { + // The MSOffice parser has deprecated "Author" in favor of "Creator" + author = metadata.get(TikaCoreProperties.CREATOR); + if (Strings.hasLength(author)) { + additionalFields.put(Property.AUTHOR.toLowerCase(), author); + } } } @@ -165,6 +173,12 @@ public IngestDocument execute(IngestDocument ingestDocument) { String keywords = metadata.get("Keywords"); if (Strings.hasLength(keywords)) { additionalFields.put(Property.KEYWORDS.toLowerCase(), keywords); + } else { + // Fallback - EPUBs put their keywords as multiple subject fields by convention + keywords = metadata.get(TikaCoreProperties.SUBJECT); + if (Strings.hasLength(keywords)) { + additionalFields.put(Property.KEYWORDS.toLowerCase(), keywords); + } } } diff --git a/plugins/ingest-attachment/src/main/java/org/opensearch/ingest/attachment/TikaImpl.java b/plugins/ingest-attachment/src/main/java/org/opensearch/ingest/attachment/TikaImpl.java index aad490924d311..ce7ceb5e3d776 100644 --- a/plugins/ingest-attachment/src/main/java/org/opensearch/ingest/attachment/TikaImpl.java +++ b/plugins/ingest-attachment/src/main/java/org/opensearch/ingest/attachment/TikaImpl.java @@ -92,9 +92,9 @@ final class TikaImpl { private static final Parser PARSERS[] = new Parser[] { // documents new org.apache.tika.parser.html.HtmlParser(), - new org.apache.tika.parser.rtf.RTFParser(), new org.apache.tika.parser.pdf.PDFParser(), new org.apache.tika.parser.txt.TXTParser(), + new org.apache.tika.parser.microsoft.rtf.RTFParser(), new org.apache.tika.parser.microsoft.OfficeParser(), new org.apache.tika.parser.microsoft.OldExcelParser(), ParserDecorator.withoutTypes(new org.apache.tika.parser.microsoft.ooxml.OOXMLParser(), EXCLUDES), diff --git a/plugins/ingest-attachment/src/test/java/org/opensearch/ingest/attachment/AttachmentProcessorTests.java b/plugins/ingest-attachment/src/test/java/org/opensearch/ingest/attachment/AttachmentProcessorTests.java index e9c87ae3a6109..2fd29d5bfdeae 100644 --- a/plugins/ingest-attachment/src/test/java/org/opensearch/ingest/attachment/AttachmentProcessorTests.java +++ b/plugins/ingest-attachment/src/test/java/org/opensearch/ingest/attachment/AttachmentProcessorTests.java @@ -138,8 +138,8 @@ public void testUnknownLanguageDocument() throws Exception { Map attachmentData = parseDocument("text-gibberish.txt", processor); assertThat(attachmentData.keySet(), hasItem("language")); - // lt seems some standard for not detected - assertThat(attachmentData.get("language"), is("lt")); + // Note - this output is non-deterministic across library versions + assertThat(attachmentData.get("language"), is("sl")); } public void testEmptyTextDocument() throws Exception { @@ -378,8 +378,9 @@ public void testIndexedChars() throws Exception { attachmentData = parseDocument("text-in-english.txt", processor, Collections.singletonMap("max_length", 10)); + // Language detection is not accurate when the text to analyze is short assertThat(attachmentData.keySet(), containsInAnyOrder("language", "content", "content_type", "content_length")); - assertThat(attachmentData.get("language"), is("sk")); + assertThat(attachmentData.get("language"), not(is("en"))); assertThat(attachmentData.get("content"), is("\"God Save")); assertThat(attachmentData.get("content_type").toString(), containsString("text/plain")); assertThat(attachmentData.get("content_length"), is(10L)); diff --git a/plugins/ingest-attachment/src/yamlRestTest/resources/rest-api-spec/test/ingest_attachment/30_files_supported.yml b/plugins/ingest-attachment/src/yamlRestTest/resources/rest-api-spec/test/ingest_attachment/30_files_supported.yml index 7407c2a9326f6..58833b037b8cc 100644 --- a/plugins/ingest-attachment/src/yamlRestTest/resources/rest-api-spec/test/ingest_attachment/30_files_supported.yml +++ b/plugins/ingest-attachment/src/yamlRestTest/resources/rest-api-spec/test/ingest_attachment/30_files_supported.yml @@ -29,7 +29,7 @@ id: 1 - length: { _source.attachment: 6 } - match: { _source.attachment.content: "Test opensearch" } - - match: { _source.attachment.language: "pl" } + - match: { _source.attachment.language: "en" } - match: { _source.attachment.author: "OpenSearch" } - match: { _source.attachment.date: "2021-03-27T04:12:00Z" } - match: { _source.attachment.content_length: 16 } @@ -67,7 +67,7 @@ id: 1 - length: { _source.attachment: 6 } - match: { _source.attachment.content: "Test opensearch" } - - match: { _source.attachment.language: "pl" } + - match: { _source.attachment.language: "en" } - match: { _source.attachment.author: "OpenSearch" } - match: { _source.attachment.date: "2021-03-27T04:12:00Z" } - match: { _source.attachment.content_length: 16 } From 7f57f35f1161f19bf55e6c594d0d2e896443e39a Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 10 May 2022 15:51:55 -0700 Subject: [PATCH 146/514] Bump xz from 1.8 to 1.9 in /plugins/ingest-attachment (#3248) (#3280) * Bump xz from 1.8 to 1.9 in /plugins/ingest-attachment Bumps xz from 1.8 to 1.9. --- updated-dependencies: - dependency-name: org.tukaani:xz dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Updating SHAs Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] (cherry picked from commit 132eabd675d7e56c247eae43680de5cd237780d3) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- plugins/ingest-attachment/build.gradle | 2 +- plugins/ingest-attachment/licenses/xz-1.8.jar.sha1 | 1 - plugins/ingest-attachment/licenses/xz-1.9.jar.sha1 | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 plugins/ingest-attachment/licenses/xz-1.8.jar.sha1 create mode 100644 plugins/ingest-attachment/licenses/xz-1.9.jar.sha1 diff --git a/plugins/ingest-attachment/build.gradle b/plugins/ingest-attachment/build.gradle index 4ad02f8d68aed..9d91e69c8046e 100644 --- a/plugins/ingest-attachment/build.gradle +++ b/plugins/ingest-attachment/build.gradle @@ -56,7 +56,7 @@ dependencies { runtimeOnly "com.optimaize.languagedetector:language-detector:0.6" runtimeOnly 'com.google.guava:guava:18.0' // Other dependencies - api 'org.tukaani:xz:1.8' + api 'org.tukaani:xz:1.9' api 'commons-io:commons-io:2.11.0' api "org.slf4j:slf4j-api:${versions.slf4j}" diff --git a/plugins/ingest-attachment/licenses/xz-1.8.jar.sha1 b/plugins/ingest-attachment/licenses/xz-1.8.jar.sha1 deleted file mode 100644 index 7455feac7983b..0000000000000 --- a/plugins/ingest-attachment/licenses/xz-1.8.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -c4f7d054303948eb6a4066194253886c8af07128 \ No newline at end of file diff --git a/plugins/ingest-attachment/licenses/xz-1.9.jar.sha1 b/plugins/ingest-attachment/licenses/xz-1.9.jar.sha1 new file mode 100644 index 0000000000000..c3e22d167212f --- /dev/null +++ b/plugins/ingest-attachment/licenses/xz-1.9.jar.sha1 @@ -0,0 +1 @@ +1ea4bec1a921180164852c65006d928617bd2caf \ No newline at end of file From f101f67a09f18908f392de8c14c44375f31b924a Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 10 May 2022 20:48:46 -0400 Subject: [PATCH 147/514] Update bundled JDK to 17.0.3+7 (#3093) (#3274) Signed-off-by: Andriy Redko (cherry picked from commit a3030b5606956e3e6912c29d758ac9fa95d9b25b) Co-authored-by: Andriy Redko --- .../main/java/org/opensearch/gradle/test/DistroTestPlugin.java | 2 +- buildSrc/version.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/java/org/opensearch/gradle/test/DistroTestPlugin.java b/buildSrc/src/main/java/org/opensearch/gradle/test/DistroTestPlugin.java index a77155aacf723..c206860bb0117 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/test/DistroTestPlugin.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/test/DistroTestPlugin.java @@ -77,7 +77,7 @@ public class DistroTestPlugin implements Plugin { private static final String SYSTEM_JDK_VERSION = "8u242+b08"; private static final String SYSTEM_JDK_VENDOR = "adoptopenjdk"; - private static final String GRADLE_JDK_VERSION = "17.0.2+8"; + private static final String GRADLE_JDK_VERSION = "17.0.3+7"; private static final String GRADLE_JDK_VENDOR = "adoptium"; // all distributions used by distro tests. this is temporary until tests are per distribution diff --git a/buildSrc/version.properties b/buildSrc/version.properties index 09d7b195836ae..f4f2819c7e59b 100644 --- a/buildSrc/version.properties +++ b/buildSrc/version.properties @@ -2,7 +2,7 @@ opensearch = 2.1.0 lucene = 9.1.0 bundled_jdk_vendor = adoptium -bundled_jdk = 17.0.2+8 +bundled_jdk = 17.0.3+7 From 0cecf817b56ee805062dd46b57b42ace59cefca0 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 11 May 2022 19:33:12 -0400 Subject: [PATCH 148/514] [Javadocs] add to o.o.action, index, and transport (#3277) (#3281) Adds javadocs to internal classes in org.opensearch.action, index, and transport packages. Signed-off-by: Nicholas Walter Knize (cherry picked from commit b78176afefd8c09a19de6bc52907b40c8c4fedf2) Co-authored-by: Nick Knize --- .../opensearch/action/DocWriteResponse.java | 2 + .../TransportNodesHotThreadsAction.java | 5 + .../node/info/TransportNodesInfoAction.java | 5 + .../NodesReloadSecureSettingsResponse.java | 5 + ...nsportNodesReloadSecureSettingsAction.java | 5 + .../node/stats/TransportNodesStatsAction.java | 5 + .../cluster/node/tasks/list/TaskGroup.java | 5 + .../node/usage/TransportNodesUsageAction.java | 5 + .../verify/VerifyRepositoryResponse.java | 5 + .../TransportClusterRerouteAction.java | 5 + .../status/SnapshotIndexShardStatus.java | 5 + .../snapshots/status/SnapshotIndexStatus.java | 5 + .../snapshots/status/SnapshotShardsStats.java | 5 + .../snapshots/status/SnapshotStats.java | 5 + .../status/TransportNodesSnapshotsStatus.java | 20 ++++ .../cluster/stats/ClusterStatsIndices.java | 15 +++ .../cluster/stats/ClusterStatsNodes.java | 70 +++++++++++++ .../stats/TransportClusterStatsAction.java | 5 + .../tasks/PendingClusterTasksResponse.java | 5 + .../indices/alias/IndicesAliasesRequest.java | 2 + .../admin/indices/analyze/AnalyzeAction.java | 32 ++++++ .../analyze/TransportAnalyzeAction.java | 10 ++ .../indices/close/CloseIndexResponse.java | 15 +++ ...TransportVerifyShardBeforeCloseAction.java | 5 + .../indices/create/AutoCreateAction.java | 5 + .../list/ListDanglingIndicesResponse.java | 8 +- .../datastream/CreateDataStreamAction.java | 10 ++ .../datastream/DataStreamsStatsAction.java | 30 ++++++ .../datastream/DeleteDataStreamAction.java | 10 ++ .../datastream/GetDataStreamAction.java | 20 ++++ .../flush/TransportShardFlushAction.java | 10 ++ .../indices/forcemerge/ForceMergeRequest.java | 5 + .../mapping/get/GetFieldMappingsResponse.java | 5 + .../readonly/AddIndexBlockResponse.java | 15 +++ .../TransportVerifyShardIndexBlockAction.java | 7 ++ .../indices/resolve/ResolveIndexAction.java | 35 +++++++ .../admin/indices/rollover/Condition.java | 4 + .../rollover/MetadataRolloverService.java | 5 + .../segments/IndicesSegmentResponse.java | 5 + .../shards/IndicesShardStoresResponse.java | 9 ++ .../TransportIndicesShardStoresAction.java | 15 +++ .../admin/indices/stats/IndexStats.java | 5 + .../indices/stats/IndicesStatsResponse.java | 5 + .../admin/indices/stats/ShardStats.java | 5 + .../delete/DeleteComponentTemplateAction.java | 5 + .../DeleteComposableIndexTemplateAction.java | 5 + .../get/GetComponentTemplateAction.java | 7 ++ .../get/GetComposableIndexTemplateAction.java | 7 ++ .../template/post/SimulateTemplateAction.java | 5 + .../put/PutComponentTemplateAction.java | 2 + .../put/PutComposableIndexTemplateAction.java | 2 + .../upgrade/get/UpgradeStatusResponse.java | 5 + .../indices/upgrade/post/UpgradeRequest.java | 5 + .../opensearch/action/bulk/BackoffPolicy.java | 35 +++++++ .../action/bulk/BulkItemResponse.java | 2 + .../opensearch/action/bulk/BulkProcessor.java | 7 ++ .../org/opensearch/action/bulk/Retry.java | 5 + .../action/bulk/TransportBulkAction.java | 14 ++- .../action/delete/DeleteResponse.java | 2 + .../action/fieldcaps/FieldCapabilities.java | 10 ++ ...TransportFieldCapabilitiesIndexAction.java | 7 ++ .../action/get/MultiGetRequest.java | 2 + .../action/get/MultiGetResponse.java | 2 + .../action/index/IndexResponse.java | 2 + .../ingest/SimulatePipelineRequest.java | 5 + .../ingest/SimulatePipelineResponse.java | 5 + .../resync/ResyncReplicationRequest.java | 3 +- .../TransportResyncReplicationAction.java | 2 + .../search/AbstractSearchAsyncAction.java | 5 + .../search/CanMatchPreFilterSearchPhase.java | 5 + .../action/search/MultiSearchResponse.java | 7 ++ .../search/QueryPhaseResultConsumer.java | 15 +++ .../action/search/SearchPhaseController.java | 15 +++ .../action/search/SearchResponse.java | 2 + .../action/search/SearchResponseMerger.java | 7 ++ .../action/search/SearchTransportService.java | 20 ++++ .../search/TransportMultiSearchAction.java | 5 + .../action/search/TransportSearchAction.java | 7 ++ .../action/support/AutoCreateIndex.java | 5 + .../support/HandledTransportAction.java | 5 + .../action/support/ListenerTimeouts.java | 5 + .../TimeoutTaskCancellationUtility.java | 2 + .../action/support/TransportAction.java | 7 ++ .../broadcast/TransportBroadcastAction.java | 10 ++ .../node/TransportBroadcastByNodeAction.java | 22 +++++ .../master/TransportMasterNodeAction.java | 5 + .../support/nodes/TransportNodesAction.java | 10 ++ .../replication/ReplicationOperation.java | 5 + .../replication/ReplicationResponse.java | 10 ++ .../support/replication/ReplicationTask.java | 5 + .../TransportReplicationAction.java | 50 +++++++++- .../replication/TransportWriteAction.java | 8 ++ ...ransportInstanceSingleOperationAction.java | 10 ++ .../shard/TransportSingleShardAction.java | 17 ++++ .../support/tasks/TransportTasksAction.java | 20 ++++ .../termvectors/MultiTermVectorsResponse.java | 7 ++ .../action/termvectors/TermVectorsFields.java | 10 ++ .../action/termvectors/TermVectorsFilter.java | 10 ++ .../termvectors/TermVectorsRequest.java | 5 + .../termvectors/TermVectorsResponse.java | 5 + .../action/update/UpdateHelper.java | 7 ++ .../action/update/UpdateResponse.java | 2 + .../main/java/org/opensearch/index/Index.java | 2 + .../org/opensearch/index/IndexModule.java | 5 + .../org/opensearch/index/IndexService.java | 22 +++++ .../org/opensearch/index/IndexSortConfig.java | 5 + .../org/opensearch/index/IndexWarmer.java | 16 ++- .../org/opensearch/index/IndexingSlowLog.java | 5 + .../org/opensearch/index/SearchSlowLog.java | 5 + .../index/ShardIndexingPressureTracker.java | 10 ++ .../index/analysis/AnalysisRegistry.java | 5 + .../PreBuiltAnalyzerProviderFactory.java | 2 + .../analysis/ShingleTokenFilterFactory.java | 5 + .../index/cache/bitset/BitsetFilterCache.java | 7 ++ .../index/cache/query/QueryCacheStats.java | 5 + .../cache/request/RequestCacheStats.java | 5 + .../index/engine/CombinedDeletionPolicy.java | 2 + .../opensearch/index/engine/CommitStats.java | 5 + .../org/opensearch/index/engine/Engine.java | 98 ++++++++++++++++++- .../opensearch/index/engine/EngineConfig.java | 2 + .../index/engine/InternalEngine.java | 23 ++++- .../index/engine/LiveVersionMap.java | 10 ++ .../index/engine/LuceneChangesSnapshot.java | 5 + .../engine/PrunePostingsMergePolicy.java | 5 + .../RecoverySourcePruneMergePolicy.java | 25 +++++ .../index/engine/SegmentsStats.java | 5 + .../opensearch/index/fielddata/FieldData.java | 20 ++++ .../index/fielddata/IndexFieldData.java | 20 +++- .../index/fielddata/IndexFieldDataCache.java | 10 ++ .../fielddata/IndexNumericFieldData.java | 2 + .../index/fielddata/ScriptDocValues.java | 40 ++++++++ .../BytesRefFieldComparatorSource.java | 2 + .../fielddata/ordinals/MultiOrdinals.java | 10 ++ .../index/fielddata/ordinals/Ordinals.java | 5 + .../fielddata/ordinals/OrdinalsBuilder.java | 2 + .../ordinals/SinglePackedOrdinals.java | 5 + .../plain/AbstractIndexOrdinalsFieldData.java | 2 + .../AbstractLatLonPointIndexFieldData.java | 10 ++ .../fielddata/plain/BinaryIndexFieldData.java | 5 + .../plain/BytesBinaryIndexFieldData.java | 5 + .../plain/ConstantIndexFieldData.java | 10 ++ .../plain/PagedBytesIndexFieldData.java | 10 ++ .../plain/PagedBytesLeafFieldData.java | 5 + .../plain/SortedNumericIndexFieldData.java | 22 +++++ .../SortedSetOrdinalsIndexFieldData.java | 5 + .../opensearch/index/flush/FlushStats.java | 5 + .../org/opensearch/index/get/GetStats.java | 5 + .../mapper/AbstractGeometryFieldMapper.java | 29 ++++++ .../AbstractPointGeometryFieldMapper.java | 32 +++++- .../AbstractShapeGeometryFieldMapper.java | 25 +++++ .../index/mapper/BinaryFieldMapper.java | 15 +++ .../index/mapper/BooleanFieldMapper.java | 20 ++++ .../index/mapper/CompletionFieldMapper.java | 22 +++++ .../index/mapper/DataStreamFieldMapper.java | 15 +++ .../index/mapper/DateFieldMapper.java | 15 +++ .../index/mapper/DocValueFetcher.java | 5 + .../index/mapper/DocumentMapper.java | 5 + .../index/mapper/DynamicTemplate.java | 11 ++- .../index/mapper/FieldAliasMapper.java | 15 +++ .../opensearch/index/mapper/FieldMapper.java | 22 +++++ .../index/mapper/FieldNamesFieldMapper.java | 15 +++ .../index/mapper/GeoPointFieldMapper.java | 25 +++++ .../index/mapper/GeoShapeFieldMapper.java | 15 +++ .../index/mapper/GeoShapeIndexer.java | 5 + .../index/mapper/IdFieldMapper.java | 10 ++ .../index/mapper/IgnoredFieldMapper.java | 10 ++ .../index/mapper/IndexFieldMapper.java | 5 + .../index/mapper/IpFieldMapper.java | 15 +++ .../index/mapper/KeywordFieldMapper.java | 20 ++++ .../mapper/LegacyGeoShapeFieldMapper.java | 35 +++++++ .../index/mapper/MappedFieldType.java | 2 + .../org/opensearch/index/mapper/Mapper.java | 25 +++++ .../index/mapper/MapperService.java | 2 + .../index/mapper/MetadataFieldMapper.java | 17 ++++ .../index/mapper/NestedPathFieldMapper.java | 11 ++- .../index/mapper/NumberFieldMapper.java | 15 +++ .../opensearch/index/mapper/ObjectMapper.java | 25 +++++ .../index/mapper/ParametrizedFieldMapper.java | 11 +++ .../opensearch/index/mapper/ParseContext.java | 16 ++- .../index/mapper/RangeFieldMapper.java | 26 ++++- .../opensearch/index/mapper/RangeType.java | 5 + .../index/mapper/RootObjectMapper.java | 15 +++ .../index/mapper/RoutingFieldMapper.java | 15 +++ .../index/mapper/SeqNoFieldMapper.java | 7 ++ .../index/mapper/SourceFieldMapper.java | 15 +++ .../index/mapper/SourceToParse.java | 5 + .../index/mapper/TextFieldMapper.java | 55 +++++++++++ .../opensearch/index/mapper/TextParams.java | 5 + .../index/mapper/TextSearchInfo.java | 2 + .../index/mapper/VersionFieldMapper.java | 5 + .../opensearch/index/merge/MergeStats.java | 5 + .../query/AbstractGeometryQueryBuilder.java | 6 +- .../query/DistanceFeatureQueryBuilder.java | 5 + .../index/query/GeoShapeQueryBuilder.java | 5 + .../index/query/IntervalFilterScript.java | 10 ++ .../index/query/IntervalsSourceProvider.java | 45 +++++++++ .../index/query/MoreLikeThisQueryBuilder.java | 2 + .../index/query/MultiMatchQueryBuilder.java | 5 + .../index/query/NestedQueryBuilder.java | 10 ++ .../index/query/ScriptQueryBuilder.java | 5 + .../index/query/SpanNearQueryBuilder.java | 2 + .../index/query/SpanQueryBuilder.java | 5 + .../index/query/TermsSetQueryBuilder.java | 13 ++- .../query/VectorGeoShapeQueryProcessor.java | 5 + .../functionscore/DecayFunctionBuilder.java | 13 ++- .../ExponentialDecayFunctionBuilder.java | 5 + .../FunctionScoreQueryBuilder.java | 2 + .../GaussDecayFunctionBuilder.java | 5 + .../LinearDecayFunctionBuilder.java | 5 + .../index/recovery/RecoveryStats.java | 5 + .../index/reindex/BulkByScrollTask.java | 6 ++ .../reindex/ClientScrollableHitSource.java | 5 + .../reindex/LeaderBulkByScrollTaskState.java | 5 + .../index/reindex/ScrollableHitSource.java | 13 +++ .../opensearch/index/search/MatchQuery.java | 10 ++ .../index/search/MultiMatchQuery.java | 5 + .../search/SimpleQueryStringQueryParser.java | 2 + .../index/search/stats/SearchStats.java | 10 ++ .../index/search/stats/ShardSearchStats.java | 5 + .../seqno/GlobalCheckpointSyncAction.java | 5 + .../index/seqno/ReplicationTracker.java | 7 ++ .../index/seqno/RetentionLeaseActions.java | 65 ++++++++++++ .../RetentionLeaseBackgroundSyncAction.java | 5 + .../index/seqno/RetentionLeaseSyncAction.java | 10 ++ .../index/seqno/RetentionLeaseSyncer.java | 4 + .../index/seqno/SequenceNumbers.java | 5 + .../org/opensearch/index/shard/DocsStats.java | 5 + .../shard/GlobalCheckpointListeners.java | 2 + .../opensearch/index/shard/IndexShard.java | 12 +++ .../shard/IndexShardOperationPermits.java | 5 + .../index/shard/IndexShardState.java | 2 + .../opensearch/index/shard/IndexingStats.java | 10 ++ .../index/shard/InternalIndexingStats.java | 5 + .../index/shard/PrimaryReplicaSyncer.java | 25 +++++ .../RemoveCorruptedShardDataCommand.java | 5 + .../index/shard/ShardSplittingQuery.java | 4 + .../opensearch/index/shard/StoreRecovery.java | 2 + .../index/similarity/ScriptedSimilarity.java | 24 ++++- .../index/similarity/SimilarityService.java | 5 + .../snapshots/IndexShardSnapshotStatus.java | 4 + .../BlobStoreIndexShardSnapshot.java | 2 + .../BlobStoreIndexShardSnapshots.java | 10 ++ .../blobstore/RateLimitingInputStream.java | 5 + .../index/store/ByteSizeCachingDirectory.java | 5 + .../index/store/FsDirectoryFactory.java | 10 ++ .../org/opensearch/index/store/Store.java | 23 +++++ .../opensearch/index/store/StoreStats.java | 5 + .../index/termvectors/TermVectorsService.java | 6 +- .../index/translog/MultiSnapshot.java | 5 + .../opensearch/index/translog/Translog.java | 43 ++++++++ .../opensearch/index/warmer/WarmerStats.java | 5 + .../transport/ConnectionManager.java | 10 ++ .../transport/ConnectionProfile.java | 2 + .../transport/InboundAggregator.java | 5 + .../opensearch/transport/InboundHandler.java | 5 + .../opensearch/transport/OutboundHandler.java | 5 + .../opensearch/transport/OutboundMessage.java | 10 ++ .../transport/ProxyConnectionStrategy.java | 5 + .../transport/RemoteClusterService.java | 5 + .../transport/RemoteConnectionInfo.java | 5 + .../transport/RemoteConnectionStrategy.java | 5 + .../transport/SniffConnectionStrategy.java | 5 + .../org/opensearch/transport/TcpChannel.java | 5 + .../opensearch/transport/TcpTransport.java | 7 ++ .../org/opensearch/transport/Transport.java | 5 + .../transport/TransportActionProxy.java | 15 +++ .../transport/TransportRequest.java | 5 + .../transport/TransportRequestOptions.java | 10 ++ .../transport/TransportResponse.java | 5 + .../transport/TransportService.java | 20 ++++ 270 files changed, 2736 insertions(+), 26 deletions(-) diff --git a/server/src/main/java/org/opensearch/action/DocWriteResponse.java b/server/src/main/java/org/opensearch/action/DocWriteResponse.java index 5247b0264064a..b55624ff514e4 100644 --- a/server/src/main/java/org/opensearch/action/DocWriteResponse.java +++ b/server/src/main/java/org/opensearch/action/DocWriteResponse.java @@ -391,6 +391,8 @@ protected static void parseInnerToXContent(XContentParser parser, Builder contex * Base class of all {@link DocWriteResponse} builders. These {@link DocWriteResponse.Builder} are used during * xcontent parsing to temporarily store the parsed values, then the {@link Builder#build()} method is called to * instantiate the appropriate {@link DocWriteResponse} with the parsed values. + * + * @opensearch.internal */ public abstract static class Builder { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/TransportNodesHotThreadsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/TransportNodesHotThreadsAction.java index 4c4519c890d90..4274bc9be188c 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/TransportNodesHotThreadsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/TransportNodesHotThreadsAction.java @@ -107,6 +107,11 @@ protected NodeHotThreads nodeOperation(NodeRequest request) { } } + /** + * Inner node request + * + * @opensearch.internal + */ public static class NodeRequest extends BaseNodeRequest { NodesHotThreadsRequest request; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/info/TransportNodesInfoAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/info/TransportNodesInfoAction.java index 52f53f4c1368e..7aa04f029f3ba 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/info/TransportNodesInfoAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/info/TransportNodesInfoAction.java @@ -116,6 +116,11 @@ protected NodeInfo nodeOperation(NodeInfoRequest nodeRequest) { ); } + /** + * Inner Node Info Request + * + * @opensearch.internal + */ public static class NodeInfoRequest extends BaseNodeRequest { NodesInfoRequest request; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/NodesReloadSecureSettingsResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/NodesReloadSecureSettingsResponse.java index 9dd8596b86260..40bdee3d288a5 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/NodesReloadSecureSettingsResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/NodesReloadSecureSettingsResponse.java @@ -103,6 +103,11 @@ public String toString() { } } + /** + * Inner Node Response + * + * @opensearch.internal + */ public static class NodeResponse extends BaseNodeResponse { private Exception reloadException = null; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/TransportNodesReloadSecureSettingsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/TransportNodesReloadSecureSettingsAction.java index e51ba62c804d7..eeed105d8407b 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/TransportNodesReloadSecureSettingsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/TransportNodesReloadSecureSettingsAction.java @@ -178,6 +178,11 @@ protected NodesReloadSecureSettingsResponse.NodeResponse nodeOperation(NodeReque } } + /** + * Inner Node Request + * + * @opensearch.internal + */ public static class NodeRequest extends BaseNodeRequest { NodesReloadSecureSettingsRequest request; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/TransportNodesStatsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/TransportNodesStatsAction.java index b7ea714de4eb4..9daf67b2152e6 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/TransportNodesStatsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/TransportNodesStatsAction.java @@ -117,6 +117,11 @@ protected NodeStats nodeOperation(NodeStatsRequest nodeStatsRequest) { ); } + /** + * Inner Node Stats Request + * + * @opensearch.internal + */ public static class NodeStatsRequest extends BaseNodeRequest { NodesStatsRequest request; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/TaskGroup.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/TaskGroup.java index 6d1d96bfd7869..68e04141a3cfd 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/TaskGroup.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/TaskGroup.java @@ -60,6 +60,11 @@ public static Builder builder(TaskInfo taskInfo) { return new Builder(taskInfo); } + /** + * Builder for the Task Group + * + * @opensearch.internal + */ public static class Builder { private TaskInfo taskInfo; private List childTasks; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/TransportNodesUsageAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/TransportNodesUsageAction.java index 207a5eb41c85d..5906184b8b629 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/TransportNodesUsageAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/TransportNodesUsageAction.java @@ -107,6 +107,11 @@ protected NodeUsage nodeOperation(NodeUsageRequest nodeUsageRequest) { return new NodeUsage(clusterService.localNode(), System.currentTimeMillis(), sinceTime, restUsage, aggsUsage); } + /** + * Inner Node Usage Request + * + * @opensearch.internal + */ public static class NodeUsageRequest extends BaseNodeRequest { NodesUsageRequest request; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/verify/VerifyRepositoryResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/verify/VerifyRepositoryResponse.java index f31189f3073e0..97b69760c4f36 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/verify/VerifyRepositoryResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/verify/VerifyRepositoryResponse.java @@ -58,6 +58,11 @@ public class VerifyRepositoryResponse extends ActionResponse implements ToXConte static final String NODES = "nodes"; static final String NAME = "name"; + /** + * Inner Node View + * + * @opensearch.internal + */ public static class NodeView implements Writeable, ToXContentObject { private static final ObjectParser.NamedObjectParser PARSER; static { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/reroute/TransportClusterRerouteAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/reroute/TransportClusterRerouteAction.java index c0e3d30fdb702..385bd64d40f9a 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/reroute/TransportClusterRerouteAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/reroute/TransportClusterRerouteAction.java @@ -209,6 +209,11 @@ private void submitStateUpdate(final ClusterRerouteRequest request, final Action ); } + /** + * Inner Reroute Response Acknowledged the Cluster State Update + * + * @opensearch.internal + */ static class ClusterRerouteResponseAckedClusterStateUpdateTask extends AckedClusterStateUpdateTask { private final ClusterRerouteRequest request; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStatus.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStatus.java index 74ac12b951dc8..41ee6719f75e5 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStatus.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStatus.java @@ -161,6 +161,11 @@ public void writeTo(StreamOutput out) throws IOException { out.writeOptionalString(failure); } + /** + * Inner Fields used for creating XContent and parsing + * + * @opensearch.internal + */ static final class Fields { static final String STAGE = "stage"; static final String REASON = "reason"; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexStatus.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexStatus.java index 63cbc0a18ffff..ae85458a7acb1 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexStatus.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexStatus.java @@ -122,6 +122,11 @@ public Iterator iterator() { return indexShards.values().iterator(); } + /** + * Inner Fields used for creating XContent and parsing + * + * @opensearch.internal + */ static final class Fields { static final String SHARDS = "shards"; } diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotShardsStats.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotShardsStats.java index b945ba20afe80..be4299041e42e 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotShardsStats.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotShardsStats.java @@ -139,6 +139,11 @@ public int getTotalShards() { return totalShards; } + /** + * Inner Fields used for creating XContent and parsing + * + * @opensearch.internal + */ static final class Fields { static final String SHARDS_STATS = "shards_stats"; static final String INITIALIZING = "initializing"; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotStats.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotStats.java index 3f348e47c4f4a..74f5c5175882a 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotStats.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotStats.java @@ -165,6 +165,11 @@ public void writeTo(StreamOutput out) throws IOException { out.writeVLong(totalSize); } + /** + * Inner Fields used for creating XContent and parsing + * + * @opensearch.internal + */ static final class Fields { static final String STATS = "stats"; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/TransportNodesSnapshotsStatus.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/TransportNodesSnapshotsStatus.java index b5247141739b7..20e626ab02e68 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/TransportNodesSnapshotsStatus.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/TransportNodesSnapshotsStatus.java @@ -143,6 +143,11 @@ protected NodeSnapshotStatus nodeOperation(NodeRequest request) { } } + /** + * Inner Request + * + * @opensearch.internal + */ public static class Request extends BaseNodesRequest { private Snapshot[] snapshots; @@ -169,6 +174,11 @@ public void writeTo(StreamOutput out) throws IOException { } } + /** + * Inner Node Snapshot Status + * + * @opensearch.internal + */ public static class NodesSnapshotStatus extends BaseNodesResponse { public NodesSnapshotStatus(StreamInput in) throws IOException { @@ -190,6 +200,11 @@ protected void writeNodesTo(StreamOutput out, List nodes) th } } + /** + * Inner Node Request + * + * @opensearch.internal + */ public static class NodeRequest extends BaseNodeRequest { private final List snapshots; @@ -210,6 +225,11 @@ public void writeTo(StreamOutput out) throws IOException { } } + /** + * Inner Node Shapshot Status + * + * @opensearch.internal + */ public static class NodeSnapshotStatus extends BaseNodeResponse { private final Map> status; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsIndices.java b/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsIndices.java index dd74c2ad66a9b..6b9ba90dde9ea 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsIndices.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsIndices.java @@ -144,6 +144,11 @@ public AnalysisStats getAnalysis() { return analysis; } + /** + * Inner Fields used for creating XContent and parsing + * + * @opensearch.internal + */ static final class Fields { static final String COUNT = "count"; } @@ -167,6 +172,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Inner Shard Stats + * + * @opensearch.internal + */ public static class ShardStats implements ToXContentFragment { int indices; @@ -311,6 +321,11 @@ public void addIndexShardCount(ShardStats indexShardCount) { } } + /** + * Inner Fields used for creating XContent and parsing + * + * @opensearch.internal + */ static final class Fields { static final String SHARDS = "shards"; static final String TOTAL = "total"; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsNodes.java b/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsNodes.java index fbca94780f827..7d23ba6fa3a14 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsNodes.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsNodes.java @@ -145,6 +145,11 @@ public Set getPlugins() { return plugins; } + /** + * Inner Fields used for creating XContent and parsing + * + * @opensearch.internal + */ static final class Fields { static final String COUNT = "count"; static final String VERSIONS = "versions"; @@ -202,6 +207,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Inner Counts + * + * @opensearch.internal + */ public static class Counts implements ToXContentFragment { static final String COORDINATING_ONLY = "coordinating_only"; @@ -246,6 +256,11 @@ public Map getRoles() { return roles; } + /** + * Inner Fields used for creating XContent and parsing + * + * @opensearch.internal + */ static final class Fields { static final String TOTAL = "total"; } @@ -260,6 +275,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws } } + /** + * Inner Operating System Stats + * + * @opensearch.internal + */ public static class OsStats implements ToXContentFragment { final int availableProcessors; final int allocatedProcessors; @@ -318,6 +338,11 @@ public org.opensearch.monitor.os.OsStats.Mem getMem() { return mem; } + /** + * Inner Fields used for creating XContent and parsing + * + * @opensearch.internal + */ static final class Fields { static final String AVAILABLE_PROCESSORS = "available_processors"; static final String ALLOCATED_PROCESSORS = "allocated_processors"; @@ -361,6 +386,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws } } + /** + * Inner Process Stats + * + * @opensearch.internal + */ public static class ProcessStats implements ToXContentFragment { final int count; @@ -431,6 +461,11 @@ public long getMinOpenFileDescriptors() { return minOpenFileDescriptors; } + /** + * Inner Fields used for creating XContent and parsing + * + * @opensearch.internal + */ static final class Fields { static final String CPU = "cpu"; static final String PERCENT = "percent"; @@ -454,6 +489,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws } } + /** + * Inner JVM Stats + * + * @opensearch.internal + */ public static class JvmStats implements ToXContentFragment { private final ObjectIntHashMap versions; @@ -527,6 +567,11 @@ public ByteSizeValue getHeapMax() { return new ByteSizeValue(heapMax); } + /** + * Inner Fields used for creating XContent and parsing + * + * @opensearch.internal + */ static final class Fields { static final String VERSIONS = "versions"; static final String VERSION = "version"; @@ -572,6 +617,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws } } + /** + * Inner JVM Version + * + * @opensearch.internal + */ public static class JvmVersion { String version; String vmName; @@ -609,6 +659,11 @@ public int hashCode() { } } + /** + * Inner Network Types + * + * @opensearch.internal + */ static class NetworkTypes implements ToXContentFragment { private final Map transportTypes; @@ -652,6 +707,11 @@ public XContentBuilder toXContent(final XContentBuilder builder, final Params pa } + /** + * Inner Discovery Types + * + * @opensearch.internal + */ static class DiscoveryTypes implements ToXContentFragment { private final Map discoveryTypes; @@ -677,6 +737,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws } } + /** + * Inner Packaging Types + * + * @opensearch.internal + */ static class PackagingTypes implements ToXContentFragment { private final Map packagingTypes; @@ -709,6 +774,11 @@ public XContentBuilder toXContent(final XContentBuilder builder, final Params pa } + /** + * Inner Ingest Stats + * + * @opensearch.internal + */ static class IngestStats implements ToXContentFragment { final int pipelineCount; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/stats/TransportClusterStatsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/stats/TransportClusterStatsAction.java index c0d7519e79862..bf0deb71f4134 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/stats/TransportClusterStatsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/stats/TransportClusterStatsAction.java @@ -206,6 +206,11 @@ protected ClusterStatsNodeResponse nodeOperation(ClusterStatsNodeRequest nodeReq } + /** + * Inner Cluster Stats Node Request + * + * @opensearch.internal + */ public static class ClusterStatsNodeRequest extends BaseNodeRequest { ClusterStatsRequest request; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/tasks/PendingClusterTasksResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/tasks/PendingClusterTasksResponse.java index 5b355f9f00166..bab71f776c7d0 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/tasks/PendingClusterTasksResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/tasks/PendingClusterTasksResponse.java @@ -108,6 +108,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Inner Fields used for creating XContent and parsing + * + * @opensearch.internal + */ static final class Fields { static final String TASKS = "tasks"; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/alias/IndicesAliasesRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/alias/IndicesAliasesRequest.java index 9481e6287c878..587c5c3c7a5a8 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/alias/IndicesAliasesRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/alias/IndicesAliasesRequest.java @@ -97,6 +97,8 @@ public IndicesAliasesRequest() {} /** * Request to take one or more actions on one or more indexes and alias combinations. + * + * @opensearch.internal */ public static class AliasActions implements AliasesRequest, Writeable, ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/analyze/AnalyzeAction.java b/server/src/main/java/org/opensearch/action/admin/indices/analyze/AnalyzeAction.java index 592575d9b6019..aa4587b93ff87 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/analyze/AnalyzeAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/analyze/AnalyzeAction.java @@ -71,6 +71,8 @@ private AnalyzeAction() { /** * A request to analyze a text associated with a specific index. Allow to provide * the actual analyzer name to perform the analysis with. + * + * @opensearch.internal */ public static class Request extends SingleShardRequest { @@ -298,6 +300,11 @@ public static Request fromXContent(XContentParser parser, String index) throws I } + /** + * Inner Response + * + * @opensearch.internal + */ public static class Response extends ActionResponse implements ToXContentObject { private final DetailAnalyzeResponse detail; @@ -400,6 +407,11 @@ public String toString() { return Strings.toString(this, true, true); } + /** + * Inner Fields used for creating XContent and parsing + * + * @opensearch.internal + */ static final class Fields { static final String TOKENS = "tokens"; @@ -407,6 +419,11 @@ static final class Fields { } } + /** + * Inner Analyze Token + * + * @opensearch.internal + */ public static class AnalyzeToken implements Writeable, ToXContentObject { private final String term; private final int startOffset; @@ -540,6 +557,11 @@ public void writeTo(StreamOutput out) throws IOException { } } + /** + * Inner Detail Analyze Response + * + * @opensearch.internal + */ public static class DetailAnalyzeResponse implements Writeable, ToXContentFragment { private final boolean customAnalyzer; @@ -702,6 +724,11 @@ public void writeTo(StreamOutput out) throws IOException { } } + /** + * Inner Analyze Token List + * + * @opensearch.internal + */ public static class AnalyzeTokenList implements Writeable, ToXContentObject { private final String name; private final AnalyzeToken[] tokens; @@ -794,6 +821,11 @@ public void writeTo(StreamOutput out) throws IOException { } } + /** + * Inner character filtered text + * + * @opensearch.internal + */ public static class CharFilteredText implements Writeable, ToXContentObject { private final String name; private final String[] texts; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/analyze/TransportAnalyzeAction.java b/server/src/main/java/org/opensearch/action/admin/indices/analyze/TransportAnalyzeAction.java index cf578af8dbacb..f9fc16fe26e9a 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/analyze/TransportAnalyzeAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/analyze/TransportAnalyzeAction.java @@ -465,6 +465,11 @@ private static String writeCharStream(Reader input) { return sb.toString(); } + /** + * Inner Token Counter + * + * @opensearch.internal + */ private static class TokenCounter { private int tokenCount = 0; private int maxTokenCount; @@ -486,6 +491,11 @@ private void increment() { } } + /** + * Inner Token List Creator + * + * @opensearch.internal + */ private static class TokenListCreator { int lastPosition = -1; int lastOffset = 0; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/close/CloseIndexResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/close/CloseIndexResponse.java index 998ffc4af7028..93bf90f741a75 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/close/CloseIndexResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/close/CloseIndexResponse.java @@ -100,6 +100,11 @@ public String toString() { return Strings.toString(this); } + /** + * Inner index result + * + * @opensearch.internal + */ public static class IndexResult implements Writeable, ToXContentFragment { private final Index index; @@ -195,6 +200,11 @@ public String toString() { } } + /** + * Shard Result from Close Index Response + * + * @opensearch.internal + */ public static class ShardResult implements Writeable, ToXContentFragment { private final int id; @@ -248,6 +258,11 @@ public String toString() { return Strings.toString(this); } + /** + * Inner Failure if something goes wrong + * + * @opensearch.internal + */ public static class Failure extends DefaultShardOperationFailedException { private @Nullable String nodeId; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/close/TransportVerifyShardBeforeCloseAction.java b/server/src/main/java/org/opensearch/action/admin/indices/close/TransportVerifyShardBeforeCloseAction.java index 8baf1f5d851ad..642026c15d81e 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/close/TransportVerifyShardBeforeCloseAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/close/TransportVerifyShardBeforeCloseAction.java @@ -186,6 +186,11 @@ public void markShardCopyAsStaleIfNeeded( } } + /** + * Shard Request for verifying shards before closing + * + * @opensearch.internal + */ public static class ShardRequest extends ReplicationRequest { private final ClusterBlock clusterBlock; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/create/AutoCreateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/create/AutoCreateAction.java index 23cb728540ab3..fc4acf5abba0f 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/create/AutoCreateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/create/AutoCreateAction.java @@ -72,6 +72,11 @@ private AutoCreateAction() { super(NAME, CreateIndexResponse::new); } + /** + * Transport Action for Auto Create + * + * @opensearch.internal + */ public static final class TransportAction extends TransportMasterNodeAction { private final ActiveShardsObserver activeShardsObserver; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/ListDanglingIndicesResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/ListDanglingIndicesResponse.java index d412d3e323d68..4ba053078407a 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/ListDanglingIndicesResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/ListDanglingIndicesResponse.java @@ -126,7 +126,13 @@ protected void writeNodesTo(StreamOutput out, List implements IndicesRequest { private final String name; @@ -119,6 +124,11 @@ public IndicesOptions indicesOptions() { } } + /** + * Transport Action for Creating Data Stream + * + * @opensearch.internal + */ public static class TransportAction extends TransportMasterNodeAction { private final MetadataCreateDataStreamService metadataCreateDataStreamService; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/datastream/DataStreamsStatsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/datastream/DataStreamsStatsAction.java index cca6b83015ecc..ef2b7e566ce0d 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/datastream/DataStreamsStatsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/datastream/DataStreamsStatsAction.java @@ -87,6 +87,11 @@ public DataStreamsStatsAction() { super(NAME, DataStreamsStatsAction.Response::new); } + /** + * Request for Data Streams Stats + * + * @opensearch.internal + */ public static class Request extends BroadcastRequest { public Request() { super((String[]) null); @@ -97,6 +102,11 @@ public Request(StreamInput in) throws IOException { } } + /** + * Response for Data Streams Stats + * + * @opensearch.internal + */ public static class Response extends BroadcastResponse { private final int dataStreamCount; private final int backingIndices; @@ -198,6 +208,11 @@ public String toString() { } } + /** + * The Data Streams Stats container + * + * @opensearch.internal + */ public static class DataStreamStats implements ToXContentObject, Writeable { private final String dataStream; private final int backingIndices; @@ -289,6 +304,11 @@ public String toString() { } } + /** + * Per Shard Data Stream stats + * + * @opensearch.internal + */ public static class DataStreamShardStats implements Writeable { private final ShardRouting shardRouting; private final StoreStats storeStats; @@ -326,12 +346,22 @@ public long getMaxTimestamp() { } } + /** + * Aggregated data Stream stats + * + * @opensearch.internal + */ private static class AggregatedStats { Set backingIndices = new HashSet<>(); long storageBytes = 0L; long maxTimestamp = 0L; } + /** + * Transport Action for Data Stream Stats + * + * @opensearch.internal + */ public static class TransportAction extends TransportBroadcastByNodeAction { private final ClusterService clusterService; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/datastream/DeleteDataStreamAction.java b/server/src/main/java/org/opensearch/action/admin/indices/datastream/DeleteDataStreamAction.java index 5d79f51cbab65..0fcb343c59055 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/datastream/DeleteDataStreamAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/datastream/DeleteDataStreamAction.java @@ -84,6 +84,11 @@ private DeleteDataStreamAction() { super(NAME, AcknowledgedResponse::new); } + /** + * Request for deleting data streams + * + * @opensearch.internal + */ public static class Request extends MasterNodeRequest implements IndicesRequest.Replaceable { private String[] names; @@ -149,6 +154,11 @@ public IndicesRequest indices(String... indices) { } } + /** + * Transport action for deleting data streams + * + * @opensearch.internal + */ public static class TransportAction extends TransportMasterNodeAction { private final MetadataDeleteIndexService deleteIndexService; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/datastream/GetDataStreamAction.java b/server/src/main/java/org/opensearch/action/admin/indices/datastream/GetDataStreamAction.java index d519c80f6d6c2..3b57063034e7b 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/datastream/GetDataStreamAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/datastream/GetDataStreamAction.java @@ -82,6 +82,11 @@ private GetDataStreamAction() { super(NAME, Response::new); } + /** + * Request for getting data streams + * + * @opensearch.internal + */ public static class Request extends MasterNodeReadRequest implements IndicesRequest.Replaceable { private String[] names; @@ -143,9 +148,19 @@ public IndicesRequest indices(String... indices) { } } + /** + * Response for getting data streams + * + * @opensearch.internal + */ public static class Response extends ActionResponse implements ToXContentObject { public static final ParseField DATASTREAMS_FIELD = new ParseField("data_streams"); + /** + * Data streams information + * + * @opensearch.internal + */ public static class DataStreamInfo extends AbstractDiffable implements ToXContentObject { public static final ParseField STATUS_FIELD = new ParseField("status"); @@ -262,6 +277,11 @@ public int hashCode() { } } + /** + * Transport Action for getting data streams + * + * @opensearch.internal + */ public static class TransportAction extends TransportMasterNodeReadAction { private static final Logger logger = LogManager.getLogger(TransportAction.class); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/flush/TransportShardFlushAction.java b/server/src/main/java/org/opensearch/action/admin/indices/flush/TransportShardFlushAction.java index 53e774306e746..20ba92faaec41 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/flush/TransportShardFlushAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/flush/TransportShardFlushAction.java @@ -120,6 +120,11 @@ protected void shardOperationOnReplica(ShardFlushRequest request, IndexShard rep // TODO: Remove this transition in OpenSearch 3.0 private static final String PRE_SYNCED_FLUSH_ACTION_NAME = "internal:indices/flush/synced/pre"; + /** + * A Pre Shard Synced Flush Request + * + * @opensearch.internal + */ private static class PreShardSyncedFlushRequest extends TransportRequest { private final ShardId shardId; @@ -141,6 +146,11 @@ public void writeTo(StreamOutput out) throws IOException { } } + /** + * Pre synced flush handler for the transport layer + * + * @opensearch.internal + */ private static final class PreSyncedFlushTransportHandler implements TransportRequestHandler { private final IndicesService indicesService; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/forcemerge/ForceMergeRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/forcemerge/ForceMergeRequest.java index 605f39ffd1312..780c545dcdbae 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/forcemerge/ForceMergeRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/forcemerge/ForceMergeRequest.java @@ -57,6 +57,11 @@ */ public class ForceMergeRequest extends BroadcastRequest { + /** + * Defaults for the Force Merge Request + * + * @opensearch.internal + */ public static final class Defaults { public static final int MAX_NUM_SEGMENTS = -1; public static final boolean ONLY_EXPUNGE_DELETES = false; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsResponse.java index 12024ef455a32..7b37920e84d82 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsResponse.java @@ -173,6 +173,11 @@ private void addFieldMappingsToBuilder(XContentBuilder builder, Params params, M } } + /** + * Metadata for field mappings for toXContent + * + * @opensearch.internal + */ public static class FieldMappingMetadata implements ToXContentFragment { private static final ParseField FULL_NAME = new ParseField("full_name"); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/readonly/AddIndexBlockResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/readonly/AddIndexBlockResponse.java index 036a8ec635efc..5f67d6f491cfc 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/readonly/AddIndexBlockResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/readonly/AddIndexBlockResponse.java @@ -90,6 +90,11 @@ public String toString() { return Strings.toString(this); } + /** + * Result for adding a block + * + * @opensearch.internal + */ public static class AddBlockResult implements Writeable, ToXContentFragment { private final Index index; @@ -185,6 +190,11 @@ public String toString() { } } + /** + * Per shard result for adding a block + * + * @opensearch.internal + */ public static class AddBlockShardResult implements Writeable, ToXContentFragment { private final int id; @@ -239,6 +249,11 @@ public String toString() { return Strings.toString(this); } + /** + * Contains failure information + * + * @opensearch.internal + */ public static class Failure extends DefaultShardOperationFailedException { private @Nullable String nodeId; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/readonly/TransportVerifyShardIndexBlockAction.java b/server/src/main/java/org/opensearch/action/admin/indices/readonly/TransportVerifyShardIndexBlockAction.java index c96a94476c1fb..edf3efbbb190f 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/readonly/TransportVerifyShardIndexBlockAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/readonly/TransportVerifyShardIndexBlockAction.java @@ -168,6 +168,8 @@ protected ReplicationOperation.Replicas newReplicasProxy() { * A {@link ReplicasProxy} that marks as stale the shards that are unavailable during the verification * and the flush of the shard. This is done to ensure that such shards won't be later promoted as primary * or reopened in an unverified state with potential non flushed translog operations. + * + * @opensearch.internal */ class VerifyShardReadOnlyActionReplicasProxy extends ReplicasProxy { @Override @@ -181,6 +183,11 @@ public void markShardCopyAsStaleIfNeeded( } } + /** + * Per shard request + * + * @opensearch.internal + */ public static class ShardRequest extends ReplicationRequest { private final ClusterBlock clusterBlock; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/resolve/ResolveIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/resolve/ResolveIndexAction.java index 8a9df3f59bc4c..381fa6d933344 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/resolve/ResolveIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/resolve/ResolveIndexAction.java @@ -88,6 +88,11 @@ private ResolveIndexAction() { super(NAME, Response::new); } + /** + * Request for resolving an index + * + * @opensearch.internal + */ public static class Request extends ActionRequest implements IndicesRequest.Replaceable { public static final IndicesOptions DEFAULT_INDICES_OPTIONS = IndicesOptions.strictExpandOpen(); @@ -157,6 +162,11 @@ public boolean includeDataStreams() { } } + /** + * Abstraction class for resolving an index + * + * @opensearch.internal + */ public static class ResolvedIndexAbstraction { static final ParseField NAME_FIELD = new ParseField("name"); @@ -178,6 +188,11 @@ public String getName() { } } + /** + * The resolved index + * + * @opensearch.internal + */ public static class ResolvedIndex extends ResolvedIndexAbstraction implements Writeable, ToXContentObject { static final ParseField ALIASES_FIELD = new ParseField("aliases"); @@ -261,6 +276,11 @@ public int hashCode() { } } + /** + * The resolved index alias + * + * @opensearch.internal + */ public static class ResolvedAlias extends ResolvedIndexAbstraction implements Writeable, ToXContentObject { static final ParseField INDICES_FIELD = new ParseField("indices"); @@ -318,6 +338,11 @@ public int hashCode() { } } + /** + * The resolved data stream + * + * @opensearch.internal + */ public static class ResolvedDataStream extends ResolvedIndexAbstraction implements Writeable, ToXContentObject { static final ParseField BACKING_INDICES_FIELD = new ParseField("backing_indices"); @@ -385,6 +410,11 @@ public int hashCode() { } } + /** + * Response for resolving an index + * + * @opensearch.internal + */ public static class Response extends ActionResponse implements ToXContentObject { static final ParseField INDICES_FIELD = new ParseField("indices"); @@ -450,6 +480,11 @@ public int hashCode() { } } + /** + * Transport action for resolving an index + * + * @opensearch.internal + */ public static class TransportAction extends HandledTransportAction { private final ThreadPool threadPool; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/rollover/Condition.java b/server/src/main/java/org/opensearch/action/admin/indices/rollover/Condition.java index 7b2707ed16ca2..e997d9b00e17b 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/rollover/Condition.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/rollover/Condition.java @@ -93,6 +93,8 @@ public String name() { /** * Holder for index stats used to evaluate conditions + * + * @opensearch.internal */ public static class Stats { public final long numDocs; @@ -108,6 +110,8 @@ public Stats(long numDocs, long indexCreated, ByteSizeValue indexSize) { /** * Holder for evaluated condition result + * + * @opensearch.internal */ public static class Result { public final Condition condition; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/rollover/MetadataRolloverService.java b/server/src/main/java/org/opensearch/action/admin/indices/rollover/MetadataRolloverService.java index 19a7b8c95199b..3f85d9a1cd143 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/rollover/MetadataRolloverService.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/rollover/MetadataRolloverService.java @@ -92,6 +92,11 @@ public MetadataRolloverService( this.indexNameExpressionResolver = indexNameExpressionResolver; } + /** + * Result for rollover request + * + * @opensearch.internal + */ public static class RolloverResult { public final String rolloverIndexName; public final String sourceIndexName; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/segments/IndicesSegmentResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/segments/IndicesSegmentResponse.java index 82fe438236d0f..37433b91c1033 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/segments/IndicesSegmentResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/segments/IndicesSegmentResponse.java @@ -207,6 +207,11 @@ private static void toXContent(XContentBuilder builder, Accountable tree) throws builder.endObject(); } + /** + * Fields for parsing and toXContent + * + * @opensearch.internal + */ static final class Fields { static final String INDICES = "indices"; static final String SHARDS = "shards"; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/shards/IndicesShardStoresResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/shards/IndicesShardStoresResponse.java index d09bf99ca7258..0d050533ccbc4 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/shards/IndicesShardStoresResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/shards/IndicesShardStoresResponse.java @@ -61,6 +61,8 @@ public class IndicesShardStoresResponse extends ActionResponse implements ToXCon /** * Shard store information from a node + * + * @opensearch.internal */ public static class StoreStatus implements Writeable, ToXContentFragment, Comparable { private final DiscoveryNode node; @@ -231,6 +233,8 @@ public int compareTo(StoreStatus other) { /** * Single node failure while retrieving shard store information + * + * @opensearch.internal */ public static class Failure extends DefaultShardOperationFailedException { private String nodeId; @@ -367,6 +371,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Fields for parsing and toXContent + * + * @opensearch.internal + */ static final class Fields { static final String INDICES = "indices"; static final String SHARDS = "shards"; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/shards/TransportIndicesShardStoresAction.java b/server/src/main/java/org/opensearch/action/admin/indices/shards/TransportIndicesShardStoresAction.java index 32acd9e305130..6e3444e3758b1 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/shards/TransportIndicesShardStoresAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/shards/TransportIndicesShardStoresAction.java @@ -160,6 +160,11 @@ protected ClusterBlockException checkBlock(IndicesShardStoresRequest request, Cl .indicesBlockedException(ClusterBlockLevel.METADATA_READ, indexNameExpressionResolver.concreteIndexNames(state, request)); } + /** + * Information for async shard stores + * + * @opensearch.internal + */ private class AsyncShardStoresInfoFetches { private final DiscoveryNodes nodes; private final RoutingNodes routingNodes; @@ -193,6 +198,11 @@ void start() { } } + /** + * Internal async fetch + * + * @opensearch.internal + */ private class InternalAsyncFetch extends AsyncShardFetch { InternalAsyncFetch( @@ -307,6 +317,11 @@ protected void reroute(ShardId shardId, String reason) { // no-op } + /** + * Response for shard stores action + * + * @opensearch.internal + */ public class Response { private final ShardId shardId; private final List responses; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/stats/IndexStats.java b/server/src/main/java/org/opensearch/action/admin/indices/stats/IndexStats.java index f0eec4ebbd27a..b7cfe4ee6db33 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/stats/IndexStats.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/stats/IndexStats.java @@ -127,6 +127,11 @@ public CommonStats getPrimaries() { return stats; } + /** + * Builder for Index Stats + * + * @opensearch.internal + */ public static class IndexStatsBuilder { private final String indexName; private final String uuid; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/stats/IndicesStatsResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/stats/IndicesStatsResponse.java index 3614d8de6c884..38ad4a0dca481 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/stats/IndicesStatsResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/stats/IndicesStatsResponse.java @@ -208,6 +208,11 @@ protected void addCustomXContentFields(XContentBuilder builder, Params params) t } } + /** + * Fields for parsing and toXContent + * + * @opensearch.internal + */ static final class Fields { static final String INDICES = "indices"; static final String SHARDS = "shards"; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/stats/ShardStats.java b/server/src/main/java/org/opensearch/action/admin/indices/stats/ShardStats.java index c5d3fba2a5805..bab1d793f50b5 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/stats/ShardStats.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/stats/ShardStats.java @@ -172,6 +172,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Fields for parsing and toXContent + * + * @opensearch.internal + */ static final class Fields { static final String ROUTING = "routing"; static final String STATE = "state"; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/delete/DeleteComponentTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/delete/DeleteComponentTemplateAction.java index 1a4f0a1892ec7..3a05d99f65247 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/delete/DeleteComponentTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/delete/DeleteComponentTemplateAction.java @@ -52,6 +52,11 @@ private DeleteComponentTemplateAction() { super(NAME, AcknowledgedResponse::new); } + /** + * Inner Request class for deleting component template + * + * @opensearch.internal + */ public static class Request extends MasterNodeRequest { private String name; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/delete/DeleteComposableIndexTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/delete/DeleteComposableIndexTemplateAction.java index bc8b96f6259e8..635755e1be5ca 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/delete/DeleteComposableIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/delete/DeleteComposableIndexTemplateAction.java @@ -53,6 +53,11 @@ private DeleteComposableIndexTemplateAction() { super(NAME, AcknowledgedResponse::new); } + /** + * Inner Request class for deleting composable index template + * + * @opensearch.internal + */ public static class Request extends MasterNodeRequest { private String name; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetComponentTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetComponentTemplateAction.java index 7f01ec0717332..286be16ea9660 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetComponentTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetComponentTemplateAction.java @@ -62,6 +62,8 @@ private GetComponentTemplateAction() { /** * Request that to retrieve one or more component templates + * + * @opensearch.internal */ public static class Request extends MasterNodeReadRequest { @@ -106,6 +108,11 @@ public String name() { } } + /** + * Inner response for getting component template + * + * @opensearch.internal + */ public static class Response extends ActionResponse implements ToXContentObject { public static final ParseField NAME = new ParseField("name"); public static final ParseField COMPONENT_TEMPLATES = new ParseField("component_templates"); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetComposableIndexTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetComposableIndexTemplateAction.java index 5f7ccb0b4f90f..0dc30a57d650e 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetComposableIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetComposableIndexTemplateAction.java @@ -59,6 +59,8 @@ private GetComposableIndexTemplateAction() { /** * Request that to retrieve one or more index templates + * + * @opensearch.internal */ public static class Request extends MasterNodeReadRequest { @@ -120,6 +122,11 @@ public boolean equals(Object obj) { } } + /** + * Inner response for getting composable index template + * + * @opensearch.internal + */ public static class Response extends ActionResponse implements ToXContentObject { public static final ParseField NAME = new ParseField("name"); public static final ParseField INDEX_TEMPLATES = new ParseField("index_templates"); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/post/SimulateTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/post/SimulateTemplateAction.java index f53925e8abd50..744f401c87941 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/post/SimulateTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/post/SimulateTemplateAction.java @@ -57,6 +57,11 @@ private SimulateTemplateAction() { super(NAME, SimulateIndexTemplateResponse::new); } + /** + * Request for simulating a template action + * + * @opensearch.internal + */ public static class Request extends MasterNodeReadRequest { @Nullable diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/put/PutComponentTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/put/PutComponentTemplateAction.java index 69149b953cc08..ac9905fd6d0ab 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/put/PutComponentTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/put/PutComponentTemplateAction.java @@ -60,6 +60,8 @@ private PutComponentTemplateAction() { /** * A request for putting a single component template into the cluster state + * + * @opensearch.internal */ public static class Request extends MasterNodeRequest { private final String name; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/put/PutComposableIndexTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/put/PutComposableIndexTemplateAction.java index 059f3be745bb0..c3bd81edfb9d6 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/put/PutComposableIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/put/PutComposableIndexTemplateAction.java @@ -62,6 +62,8 @@ private PutComposableIndexTemplateAction() { /** * A request for putting a single index template into the cluster state + * + * @opensearch.internal */ public static class Request extends MasterNodeRequest implements IndicesRequest { private final String name; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/UpgradeStatusResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/UpgradeStatusResponse.java index a8bb5cfc8bba1..fbff92f197292 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/UpgradeStatusResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/UpgradeStatusResponse.java @@ -200,6 +200,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Fields for parsing and toXContent + * + * @opensearch.internal + */ static final class Fields { static final String INDICES = "indices"; static final String SHARDS = "shards"; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeRequest.java index 94d07075a8f3e..e9833c51b97a4 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeRequest.java @@ -47,6 +47,11 @@ */ public class UpgradeRequest extends BroadcastRequest { + /** + * Default config for Upgrade Requests + * + * @opensearch.internal + */ public static final class Defaults { public static final boolean UPGRADE_ONLY_ANCIENT_SEGMENTS = false; } diff --git a/server/src/main/java/org/opensearch/action/bulk/BackoffPolicy.java b/server/src/main/java/org/opensearch/action/bulk/BackoffPolicy.java index 0b20979c9673e..0b22ee04141ed 100644 --- a/server/src/main/java/org/opensearch/action/bulk/BackoffPolicy.java +++ b/server/src/main/java/org/opensearch/action/bulk/BackoffPolicy.java @@ -119,6 +119,11 @@ private static TimeValue checkDelay(TimeValue delay) { return delay; } + /** + * Concrete No Back Off Policy + * + * @opensearch.internal + */ private static class NoBackoff extends BackoffPolicy { @Override public Iterator iterator() { @@ -136,6 +141,11 @@ public TimeValue next() { } } + /** + * Concrete Exponential Back Off Policy + * + * @opensearch.internal + */ private static class ExponentialBackoff extends BackoffPolicy { private final int start; @@ -154,6 +164,11 @@ public Iterator iterator() { } } + /** + * Concrete Exponential Back Off Iterator + * + * @opensearch.internal + */ private static class ExponentialBackoffIterator implements Iterator { private final int numberOfElements; @@ -182,6 +197,11 @@ public TimeValue next() { } } + /** + * Concrete Constant Back Off Policy + * + * @opensearch.internal + */ private static final class ConstantBackoff extends BackoffPolicy { private final TimeValue delay; @@ -199,6 +219,11 @@ public Iterator iterator() { } } + /** + * Concrete Constant Back Off Iterator + * + * @opensearch.internal + */ private static final class ConstantBackoffIterator implements Iterator { private final TimeValue delay; private final int numberOfElements; @@ -224,6 +249,11 @@ public TimeValue next() { } } + /** + * Concrete Wrapped Back Off Policy + * + * @opensearch.internal + */ private static final class WrappedBackoffPolicy extends BackoffPolicy { private final BackoffPolicy delegate; private final Runnable onBackoff; @@ -239,6 +269,11 @@ public Iterator iterator() { } } + /** + * Concrete Wrapped Back Off Iterator + * + * @opensearch.internal + */ private static final class WrappedBackoffIterator implements Iterator { private final Iterator delegate; private final Runnable onBackoff; diff --git a/server/src/main/java/org/opensearch/action/bulk/BulkItemResponse.java b/server/src/main/java/org/opensearch/action/bulk/BulkItemResponse.java index e3252988c3b35..346e394bbb35e 100644 --- a/server/src/main/java/org/opensearch/action/bulk/BulkItemResponse.java +++ b/server/src/main/java/org/opensearch/action/bulk/BulkItemResponse.java @@ -178,6 +178,8 @@ public static BulkItemResponse fromXContent(XContentParser parser, int id) throw /** * Represents a failure. + * + * @opensearch.internal */ public static class Failure implements Writeable, ToXContentFragment { public static final String INDEX_FIELD = "index"; diff --git a/server/src/main/java/org/opensearch/action/bulk/BulkProcessor.java b/server/src/main/java/org/opensearch/action/bulk/BulkProcessor.java index 166c4a535aaad..0ee289e8f5af7 100644 --- a/server/src/main/java/org/opensearch/action/bulk/BulkProcessor.java +++ b/server/src/main/java/org/opensearch/action/bulk/BulkProcessor.java @@ -94,6 +94,8 @@ public interface Listener { /** * A builder used to create a build an instance of a bulk processor. + * + * @opensearch.internal */ public static class Builder { @@ -545,6 +547,11 @@ public void flush() { } } + /** + * Flush for bulk processor + * + * @opensearch.internal + */ class Flush implements Runnable { @Override public void run() { diff --git a/server/src/main/java/org/opensearch/action/bulk/Retry.java b/server/src/main/java/org/opensearch/action/bulk/Retry.java index 9c7e8cd685b28..fdd4447144008 100644 --- a/server/src/main/java/org/opensearch/action/bulk/Retry.java +++ b/server/src/main/java/org/opensearch/action/bulk/Retry.java @@ -94,6 +94,11 @@ public PlainActionFuture withBackoff( return future; } + /** + * Retry handler + * + * @opensearch.internal + */ static class RetryHandler implements ActionListener { private static final RestStatus RETRY_STATUS = RestStatus.TOO_MANY_REQUESTS; private static final Logger logger = LogManager.getLogger(RetryHandler.class); diff --git a/server/src/main/java/org/opensearch/action/bulk/TransportBulkAction.java b/server/src/main/java/org/opensearch/action/bulk/TransportBulkAction.java index e557b6c8e897e..1fabc3b1a7ea8 100644 --- a/server/src/main/java/org/opensearch/action/bulk/TransportBulkAction.java +++ b/server/src/main/java/org/opensearch/action/bulk/TransportBulkAction.java @@ -483,7 +483,9 @@ private long buildTookInMillis(long startTimeNanos) { /** * retries on retryable cluster blocks, resolves item requests, * constructs shard bulk requests and delegates execution to shard bulk action - * */ + * + * @opensearch.internal + */ private final class BulkOperation extends ActionRunnable { private final Task task; private BulkRequest bulkRequest; // set to null once all requests are sent out @@ -772,6 +774,11 @@ void executeBulk( new BulkOperation(task, bulkRequest, listener, responses, startTimeNanos, indicesThatCannotBeCreated).run(); } + /** + * Concrete indices + * + * @opensearch.internal + */ private static class ConcreteIndices { private final ClusterState state; private final IndexNameExpressionResolver indexNameExpressionResolver; @@ -874,6 +881,11 @@ public boolean isForceExecution() { ); } + /** + * A modifier for a bulk request + * + * @opensearch.internal + */ static final class BulkRequestModifier implements Iterator> { final BulkRequest bulkRequest; diff --git a/server/src/main/java/org/opensearch/action/delete/DeleteResponse.java b/server/src/main/java/org/opensearch/action/delete/DeleteResponse.java index 1d53524cd6c63..46049cdad58bd 100644 --- a/server/src/main/java/org/opensearch/action/delete/DeleteResponse.java +++ b/server/src/main/java/org/opensearch/action/delete/DeleteResponse.java @@ -111,6 +111,8 @@ public static void parseXContentFields(XContentParser parser, Builder context) t * Builder class for {@link DeleteResponse}. This builder is usually used during xcontent parsing to * temporarily store the parsed values, then the {@link DocWriteResponse.Builder#build()} method is called to * instantiate the {@link DeleteResponse}. + * + * @opensearch.internal */ public static class Builder extends DocWriteResponse.Builder { diff --git a/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilities.java b/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilities.java index 67fab82949c24..4fdf8d551af61 100644 --- a/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilities.java +++ b/server/src/main/java/org/opensearch/action/fieldcaps/FieldCapabilities.java @@ -298,6 +298,11 @@ public String toString() { return Strings.toString(this); } + /** + * Builder for field capabilities + * + * @opensearch.internal + */ static class Builder { private String name; private String type; @@ -387,6 +392,11 @@ FieldCapabilities build(boolean withIndices) { } } + /** + * Inner index capabilities + * + * @opensearch.internal + */ private static class IndexCaps { final String name; final boolean isSearchable; diff --git a/server/src/main/java/org/opensearch/action/fieldcaps/TransportFieldCapabilitiesIndexAction.java b/server/src/main/java/org/opensearch/action/fieldcaps/TransportFieldCapabilitiesIndexAction.java index 9b42bc12f82a7..99962741299ca 100644 --- a/server/src/main/java/org/opensearch/action/fieldcaps/TransportFieldCapabilitiesIndexAction.java +++ b/server/src/main/java/org/opensearch/action/fieldcaps/TransportFieldCapabilitiesIndexAction.java @@ -217,6 +217,8 @@ private ClusterBlockException checkRequestBlock(ClusterState state, String concr * An action that executes on each shard sequentially until it finds one that can match the provided * {@link FieldCapabilitiesIndexRequest#indexFilter()}. In which case the shard is used * to create the final {@link FieldCapabilitiesIndexResponse}. + * + * @opensearch.internal */ class AsyncShardsAction { private final FieldCapabilitiesIndexRequest request; @@ -341,6 +343,11 @@ public void handleException(TransportException exp) { } } + /** + * Shard transport handler for field capabilities index action + * + * @opensearch.internal + */ private class ShardTransportHandler implements TransportRequestHandler { @Override public void messageReceived(final FieldCapabilitiesIndexRequest request, final TransportChannel channel, Task task) diff --git a/server/src/main/java/org/opensearch/action/get/MultiGetRequest.java b/server/src/main/java/org/opensearch/action/get/MultiGetRequest.java index 1196b2f065312..00df8657736ae 100644 --- a/server/src/main/java/org/opensearch/action/get/MultiGetRequest.java +++ b/server/src/main/java/org/opensearch/action/get/MultiGetRequest.java @@ -90,6 +90,8 @@ public class MultiGetRequest extends ActionRequest /** * A single get item. + * + * @opensearch.internal */ public static class Item implements Writeable, IndicesRequest, ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/get/MultiGetResponse.java b/server/src/main/java/org/opensearch/action/get/MultiGetResponse.java index 674fd73650da1..b3664935b9489 100644 --- a/server/src/main/java/org/opensearch/action/get/MultiGetResponse.java +++ b/server/src/main/java/org/opensearch/action/get/MultiGetResponse.java @@ -66,6 +66,8 @@ public class MultiGetResponse extends ActionResponse implements Iterable { diff --git a/server/src/main/java/org/opensearch/action/resync/TransportResyncReplicationAction.java b/server/src/main/java/org/opensearch/action/resync/TransportResyncReplicationAction.java index f022e325dceb0..2249c7cace943 100644 --- a/server/src/main/java/org/opensearch/action/resync/TransportResyncReplicationAction.java +++ b/server/src/main/java/org/opensearch/action/resync/TransportResyncReplicationAction.java @@ -258,6 +258,8 @@ public void handleException(TransportException exp) { * A proxy for primary-replica resync operations which are performed on replicas when a new primary is promoted. * Replica shards fail to execute resync operations will be failed but won't be marked as stale. * This avoids marking shards as stale during cluster restart but enforces primary-replica resync mandatory. + * + * @opensearch.internal */ class ResyncActionReplicasProxy extends ReplicasProxy { diff --git a/server/src/main/java/org/opensearch/action/search/AbstractSearchAsyncAction.java b/server/src/main/java/org/opensearch/action/search/AbstractSearchAsyncAction.java index fd93d5f17fdef..1d6d3f284d546 100644 --- a/server/src/main/java/org/opensearch/action/search/AbstractSearchAsyncAction.java +++ b/server/src/main/java/org/opensearch/action/search/AbstractSearchAsyncAction.java @@ -751,6 +751,11 @@ void executeNext(Runnable runnable, Thread originalThread) { } } + /** + * Pending Executions + * + * @opensearch.internal + */ private static final class PendingExecutions { private final int permits; private int permitsTaken = 0; diff --git a/server/src/main/java/org/opensearch/action/search/CanMatchPreFilterSearchPhase.java b/server/src/main/java/org/opensearch/action/search/CanMatchPreFilterSearchPhase.java index 816ca45d13c10..ec4d45a0a7124 100644 --- a/server/src/main/java/org/opensearch/action/search/CanMatchPreFilterSearchPhase.java +++ b/server/src/main/java/org/opensearch/action/search/CanMatchPreFilterSearchPhase.java @@ -204,6 +204,11 @@ private static Comparator shardComparator( return comparator.thenComparing(index -> shardsIts.get(index).shardId()); } + /** + * Inner class for determining if canMatch search phase results + * + * @opensearch.internal + */ private static final class CanMatchSearchPhaseResults extends SearchPhaseResults { private final FixedBitSet possibleMatches; private final MinAndMax[] minAndMaxes; diff --git a/server/src/main/java/org/opensearch/action/search/MultiSearchResponse.java b/server/src/main/java/org/opensearch/action/search/MultiSearchResponse.java index 2349b3a0cab9a..6c25a16a65c75 100644 --- a/server/src/main/java/org/opensearch/action/search/MultiSearchResponse.java +++ b/server/src/main/java/org/opensearch/action/search/MultiSearchResponse.java @@ -77,6 +77,8 @@ public class MultiSearchResponse extends ActionResponse implements Iterable buffer = new ArrayList<>(); @@ -498,6 +503,11 @@ public synchronized List consumeAggs() { } } + /** + * A single merge result + * + * @opensearch.internal + */ private static class MergeResult { private final List processedShards; private final TopDocs reducedTopDocs; @@ -517,6 +527,11 @@ private MergeResult( } } + /** + * A single merge task + * + * @opensearch.internal + */ private static class MergeTask { private final List emptyResults; private QuerySearchResult[] buffer; diff --git a/server/src/main/java/org/opensearch/action/search/SearchPhaseController.java b/server/src/main/java/org/opensearch/action/search/SearchPhaseController.java index 4fb940675a5aa..d32e7753cd153 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchPhaseController.java +++ b/server/src/main/java/org/opensearch/action/search/SearchPhaseController.java @@ -613,6 +613,11 @@ static int getTopDocsSize(SearchRequest request) { : source.from()); } + /** + * The reduced query phase + * + * @opensearch.internal + */ public static final class ReducedQueryPhase { // the sum of all hits across all reduces shards final TotalHits totalHits; @@ -714,6 +719,11 @@ QueryPhaseResultConsumer newSearchPhaseResults( ); } + /** + * The top docs statistics + * + * @opensearch.internal + */ static final class TopDocsStats { final int trackTotalHitsUpTo; long totalHits; @@ -778,6 +788,11 @@ void add(TopDocsAndMaxScore topDocs, boolean timedOut, Boolean terminatedEarly) } } + /** + * Top docs that have been sorted + * + * @opensearch.internal + */ static final class SortedTopDocs { static final SortedTopDocs EMPTY = new SortedTopDocs(EMPTY_DOCS, false, null, null, null); // the searches merged top docs diff --git a/server/src/main/java/org/opensearch/action/search/SearchResponse.java b/server/src/main/java/org/opensearch/action/search/SearchResponse.java index a99de14d2a9e3..06ac642a0547f 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchResponse.java +++ b/server/src/main/java/org/opensearch/action/search/SearchResponse.java @@ -475,6 +475,8 @@ public String toString() { /** * Holds info about the clusters that the search was executed on: how many in total, how many of them were successful * and how many of them were skipped. + * + * @opensearch.internal */ public static class Clusters implements ToXContentFragment, Writeable { diff --git a/server/src/main/java/org/opensearch/action/search/SearchResponseMerger.java b/server/src/main/java/org/opensearch/action/search/SearchResponseMerger.java index 9c32da2d122e0..20a7f576071b2 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchResponseMerger.java +++ b/server/src/main/java/org/opensearch/action/search/SearchResponseMerger.java @@ -410,6 +410,11 @@ private static SearchHits topDocsToSearchHits(TopDocs topDocs, SearchPhaseContro ); } + /** + * Holds a field search hit and doc + * + * @opensearch.internal + */ private static final class FieldDocAndSearchHit extends FieldDoc { private final SearchHit searchHit; @@ -426,6 +431,8 @@ private static final class FieldDocAndSearchHit extends FieldDoc { * (see TopDocs#tieBreakLessThan line 86). Generally, indices with same names on different clusters have different index uuids which * make their ShardIds different, which is not the case if the index is really the same one from the same cluster, in which case we * need to look at the cluster alias and make sure to assign a different shardIndex based on that. + * + * @opensearch.internal */ private static final class ShardIdAndClusterAlias implements Comparable { private final ShardId shardId; diff --git a/server/src/main/java/org/opensearch/action/search/SearchTransportService.java b/server/src/main/java/org/opensearch/action/search/SearchTransportService.java index 4a901ebef10ce..f91276960397a 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchTransportService.java +++ b/server/src/main/java/org/opensearch/action/search/SearchTransportService.java @@ -309,6 +309,11 @@ public Map getPendingSearchRequests() { return new HashMap<>(clientConnections); } + /** + * A scroll free context request + * + * @opensearch.internal + */ static class ScrollFreeContextRequest extends TransportRequest { private ShardSearchContextId contextId; @@ -333,6 +338,11 @@ public ShardSearchContextId id() { } + /** + * A search free context request + * + * @opensearch.internal + */ static class SearchFreeContextRequest extends ScrollFreeContextRequest implements IndicesRequest { private OriginalIndices originalIndices; @@ -370,6 +380,11 @@ public IndicesOptions indicesOptions() { } + /** + * A search free context response + * + * @opensearch.internal + */ public static class SearchFreeContextResponse extends TransportResponse { private boolean freed; @@ -564,6 +579,11 @@ public Transport.Connection getConnection(@Nullable String clusterAlias, Discove } } + /** + * A handler that counts connections + * + * @opensearch.internal + */ final class ConnectionCountingHandler extends ActionListenerResponseHandler { private final Map clientConnections; private final String nodeId; diff --git a/server/src/main/java/org/opensearch/action/search/TransportMultiSearchAction.java b/server/src/main/java/org/opensearch/action/search/TransportMultiSearchAction.java index 683b4b3eb2d19..58eb617a3d5fe 100644 --- a/server/src/main/java/org/opensearch/action/search/TransportMultiSearchAction.java +++ b/server/src/main/java/org/opensearch/action/search/TransportMultiSearchAction.java @@ -220,6 +220,11 @@ private long buildTookInMillis() { }); } + /** + * Slots a search request + * + * @opensearch.internal + */ static final class SearchRequestSlot { final SearchRequest request; diff --git a/server/src/main/java/org/opensearch/action/search/TransportSearchAction.java b/server/src/main/java/org/opensearch/action/search/TransportSearchAction.java index 6af56abba99cb..6ab49d975cddd 100644 --- a/server/src/main/java/org/opensearch/action/search/TransportSearchAction.java +++ b/server/src/main/java/org/opensearch/action/search/TransportSearchAction.java @@ -232,6 +232,8 @@ private Map resolveIndexBoosts(SearchRequest searchRequest, Clust * clock for measuring how long an operation took (they often lack precision, they are subject * to moving backwards due to NTP and other such complexities, etc.). There are also issues with * using a relative clock for reporting real time. Thus, we simply separate these two uses. + * + * @opensearch.internal */ static final class SearchTimeProvider { @@ -1222,6 +1224,11 @@ private static void failIfOverShardCountLimit(ClusterService clusterService, int } } + /** + * xcluster search listener + * + * @opensearch.internal + */ abstract static class CCSActionListener implements ActionListener { private final String clusterAlias; private final boolean skipUnavailable; diff --git a/server/src/main/java/org/opensearch/action/support/AutoCreateIndex.java b/server/src/main/java/org/opensearch/action/support/AutoCreateIndex.java index c986730aa74da..f0c8a9a7a11ba 100644 --- a/server/src/main/java/org/opensearch/action/support/AutoCreateIndex.java +++ b/server/src/main/java/org/opensearch/action/support/AutoCreateIndex.java @@ -144,6 +144,11 @@ void setAutoCreate(AutoCreate autoCreate) { this.autoCreate = autoCreate; } + /** + * An auto create object + * + * @opensearch.internal + */ static class AutoCreate { private final boolean autoCreateIndex; private final List> expressions; diff --git a/server/src/main/java/org/opensearch/action/support/HandledTransportAction.java b/server/src/main/java/org/opensearch/action/support/HandledTransportAction.java index e4c6addec40f3..0bc46b21be3b8 100644 --- a/server/src/main/java/org/opensearch/action/support/HandledTransportAction.java +++ b/server/src/main/java/org/opensearch/action/support/HandledTransportAction.java @@ -90,6 +90,11 @@ protected HandledTransportAction( transportService.registerRequestHandler(actionName, executor, false, canTripCircuitBreaker, requestReader, new TransportHandler()); } + /** + * Inner transport handler + * + * @opensearch.internal + */ class TransportHandler implements TransportRequestHandler { @Override public final void messageReceived(final Request request, final TransportChannel channel, Task task) { diff --git a/server/src/main/java/org/opensearch/action/support/ListenerTimeouts.java b/server/src/main/java/org/opensearch/action/support/ListenerTimeouts.java index ffe506905326f..b01320369af6a 100644 --- a/server/src/main/java/org/opensearch/action/support/ListenerTimeouts.java +++ b/server/src/main/java/org/opensearch/action/support/ListenerTimeouts.java @@ -96,6 +96,11 @@ public static ActionListener wrapWithTimeout( return wrappedListener; } + /** + * Listener that can time out + * + * @opensearch.internal + */ private static class TimeoutableListener implements ActionListener, Runnable { private final AtomicBoolean isDone = new AtomicBoolean(false); diff --git a/server/src/main/java/org/opensearch/action/support/TimeoutTaskCancellationUtility.java b/server/src/main/java/org/opensearch/action/support/TimeoutTaskCancellationUtility.java index 759819d803f0e..a98df5b832bf5 100644 --- a/server/src/main/java/org/opensearch/action/support/TimeoutTaskCancellationUtility.java +++ b/server/src/main/java/org/opensearch/action/support/TimeoutTaskCancellationUtility.java @@ -104,6 +104,8 @@ public static ActionListener wrapWithCancellationListener( * Timeout listener which executes the provided runnable after timeout is expired and if a response/failure is not yet received. * If either a response/failure is received before timeout then the scheduled task is cancelled and response/failure is sent back to * the original listener. + * + * @opensearch.internal */ private static class TimeoutRunnableListener implements ActionListener, Runnable { diff --git a/server/src/main/java/org/opensearch/action/support/TransportAction.java b/server/src/main/java/org/opensearch/action/support/TransportAction.java index edcef8ef0c5fd..a60648e50ff31 100644 --- a/server/src/main/java/org/opensearch/action/support/TransportAction.java +++ b/server/src/main/java/org/opensearch/action/support/TransportAction.java @@ -176,6 +176,11 @@ public final void execute(Task task, Request request, ActionListener l protected abstract void doExecute(Task task, Request request, ActionListener listener); + /** + * A request filter chain + * + * @opensearch.internal + */ private static class RequestFilterChain implements ActionFilterChain { @@ -210,6 +215,8 @@ public void proceed(Task task, String actionName, Request request, ActionListene /** * Wrapper for an action listener that stores the result at the end of the execution + * + * @opensearch.internal */ private static class TaskResultStoringActionListener implements ActionListener { private final ActionListener delegate; diff --git a/server/src/main/java/org/opensearch/action/support/broadcast/TransportBroadcastAction.java b/server/src/main/java/org/opensearch/action/support/broadcast/TransportBroadcastAction.java index 728497af8d0d5..a69853dc6a3c0 100644 --- a/server/src/main/java/org/opensearch/action/support/broadcast/TransportBroadcastAction.java +++ b/server/src/main/java/org/opensearch/action/support/broadcast/TransportBroadcastAction.java @@ -124,6 +124,11 @@ protected void doExecute(Task task, Request request, ActionListener li protected abstract ClusterBlockException checkRequestBlock(ClusterState state, Request request, String[] concreteIndices); + /** + * Asynchronous broadcast action + * + * @opensearch.internal + */ protected class AsyncBroadcastAction { private final Task task; @@ -320,6 +325,11 @@ void setFailure(ShardIterator shardIt, int shardIndex, Exception e) { } } + /** + * A shard transport handler + * + * @opensearch.internal + */ class ShardTransportHandler implements TransportRequestHandler { @Override diff --git a/server/src/main/java/org/opensearch/action/support/broadcast/node/TransportBroadcastByNodeAction.java b/server/src/main/java/org/opensearch/action/support/broadcast/node/TransportBroadcastByNodeAction.java index 1c5b71c5a1fb7..f849be4db4e2b 100644 --- a/server/src/main/java/org/opensearch/action/support/broadcast/node/TransportBroadcastByNodeAction.java +++ b/server/src/main/java/org/opensearch/action/support/broadcast/node/TransportBroadcastByNodeAction.java @@ -273,6 +273,11 @@ protected void doExecute(Task task, Request request, ActionListener li new AsyncAction(task, request, listener).start(); } + /** + * Asynchronous action + * + * @opensearch.internal + */ protected class AsyncAction { private final Task task; private final Request request; @@ -443,6 +448,11 @@ protected void onCompletion() { } } + /** + * Broadcast by a node's transport request handler + * + * @opensearch.internal + */ class BroadcastByNodeTransportRequestHandler implements TransportRequestHandler { @Override public void messageReceived(final NodeRequest request, TransportChannel channel, Task task) throws Exception { @@ -522,6 +532,11 @@ private void onShardOperation( } } + /** + * A node request + * + * @opensearch.internal + */ public class NodeRequest extends TransportRequest implements IndicesRequest { private String nodeId; @@ -569,6 +584,11 @@ public void writeTo(StreamOutput out) throws IOException { } } + /** + * A node response + * + * @opensearch.internal + */ class NodeResponse extends TransportResponse { protected String nodeId; protected int totalShards; @@ -633,6 +653,8 @@ public void writeTo(StreamOutput out) throws IOException { /** * Can be used for implementations of {@link #shardOperation(BroadcastRequest, ShardRouting) shardOperation} for * which there is no shard-level return value. + * + * @opensearch.internal */ public static final class EmptyResult implements Writeable { public static EmptyResult INSTANCE = new EmptyResult(); diff --git a/server/src/main/java/org/opensearch/action/support/master/TransportMasterNodeAction.java b/server/src/main/java/org/opensearch/action/support/master/TransportMasterNodeAction.java index 4ae490018e58f..4e0a180fe0cd4 100644 --- a/server/src/main/java/org/opensearch/action/support/master/TransportMasterNodeAction.java +++ b/server/src/main/java/org/opensearch/action/support/master/TransportMasterNodeAction.java @@ -142,6 +142,11 @@ protected void doExecute(Task task, final Request request, ActionListener listener; diff --git a/server/src/main/java/org/opensearch/action/support/nodes/TransportNodesAction.java b/server/src/main/java/org/opensearch/action/support/nodes/TransportNodesAction.java index 614740e6bc8a1..18fcdfad0bcc4 100644 --- a/server/src/main/java/org/opensearch/action/support/nodes/TransportNodesAction.java +++ b/server/src/main/java/org/opensearch/action/support/nodes/TransportNodesAction.java @@ -216,6 +216,11 @@ protected String getTransportNodeAction(DiscoveryNode node) { return transportNodeAction; } + /** + * Asynchronous action + * + * @opensearch.internal + */ class AsyncAction { private final NodesRequest request; @@ -311,6 +316,11 @@ private void finishHim() { } } + /** + * A node transport handler + * + * @opensearch.internal + */ class NodeTransportHandler implements TransportRequestHandler { @Override diff --git a/server/src/main/java/org/opensearch/action/support/replication/ReplicationOperation.java b/server/src/main/java/org/opensearch/action/support/replication/ReplicationOperation.java index 6c6da7d9b5753..cf40e872fe9b8 100644 --- a/server/src/main/java/org/opensearch/action/support/replication/ReplicationOperation.java +++ b/server/src/main/java/org/opensearch/action/support/replication/ReplicationOperation.java @@ -596,6 +596,11 @@ public interface ReplicaResponse { } + /** + * Thrown if there are any errors retrying on primary + * + * @opensearch.internal + */ public static class RetryOnPrimaryException extends OpenSearchException { RetryOnPrimaryException(ShardId shardId, String msg) { this(shardId, msg, null); diff --git a/server/src/main/java/org/opensearch/action/support/replication/ReplicationResponse.java b/server/src/main/java/org/opensearch/action/support/replication/ReplicationResponse.java index 38fa7ac7520e5..1dfa9e53c5fee 100644 --- a/server/src/main/java/org/opensearch/action/support/replication/ReplicationResponse.java +++ b/server/src/main/java/org/opensearch/action/support/replication/ReplicationResponse.java @@ -85,6 +85,11 @@ public void setShardInfo(ShardInfo shardInfo) { this.shardInfo = shardInfo; } + /** + * Holds shard information + * + * @opensearch.internal + */ public static class ShardInfo implements Writeable, ToXContentObject { private static final String TOTAL = "total"; @@ -227,6 +232,11 @@ public String toString() { return "ShardInfo{" + "total=" + total + ", successful=" + successful + ", failures=" + Arrays.toString(failures) + '}'; } + /** + * Holds failure information + * + * @opensearch.internal + */ public static class Failure extends ShardOperationFailedException implements ToXContentObject { private static final String _INDEX = "_index"; diff --git a/server/src/main/java/org/opensearch/action/support/replication/ReplicationTask.java b/server/src/main/java/org/opensearch/action/support/replication/ReplicationTask.java index 6fe658d338fae..b599dc405b8ab 100644 --- a/server/src/main/java/org/opensearch/action/support/replication/ReplicationTask.java +++ b/server/src/main/java/org/opensearch/action/support/replication/ReplicationTask.java @@ -75,6 +75,11 @@ public Status getStatus() { return new Status(phase); } + /** + * Status of the replication task + * + * @opensearch.internal + */ public static class Status implements Task.Status { public static final String NAME = "replication"; diff --git a/server/src/main/java/org/opensearch/action/support/replication/TransportReplicationAction.java b/server/src/main/java/org/opensearch/action/support/replication/TransportReplicationAction.java index 476b679fedaf6..9d3ee8e49e8c2 100644 --- a/server/src/main/java/org/opensearch/action/support/replication/TransportReplicationAction.java +++ b/server/src/main/java/org/opensearch/action/support/replication/TransportReplicationAction.java @@ -386,6 +386,11 @@ protected Releasable checkPrimaryLimits(final Request request, boolean rerouteWa return () -> {}; } + /** + * Asynchronous primary action + * + * @opensearch.internal + */ class AsyncPrimaryAction extends AbstractRunnable { private final ActionListener onCompletionListener; private final ReplicationTask replicationTask; @@ -554,6 +559,11 @@ protected void adaptResponse(Response response, IndexShard indexShard) { } + /** + * The Primary Result + * + * @opensearch.internal + */ public static class PrimaryResult, Response extends ReplicationResponse> implements ReplicationOperation.PrimaryResult { @@ -603,6 +613,11 @@ public void runPostReplicationActions(ActionListener listener) { } } + /** + * The replica result + * + * @opensearch.internal + */ public static class ReplicaResult { final Exception finalFailure; @@ -645,6 +660,11 @@ protected Releasable checkReplicaLimits(final ReplicaRequest request) { return () -> {}; } + /** + * Thrown if there are any errors retrying on the replica + * + * @opensearch.internal + */ public static class RetryOnReplicaException extends OpenSearchException { public RetryOnReplicaException(ShardId shardId, String msg) { @@ -657,6 +677,11 @@ public RetryOnReplicaException(StreamInput in) throws IOException { } } + /** + * Asynchronous replica action + * + * @opensearch.internal + */ private final class AsyncReplicaAction extends AbstractRunnable implements ActionListener { private final ActionListener onCompletionListener; private final IndexShard replica; @@ -799,6 +824,8 @@ private IndexShard getIndexShard(final ShardId shardId) { * node with primary copy. * * Resolves index and shard id for the request before routing it to target node + * + * @opensearch.internal */ final class ReroutePhase extends AbstractRunnable { private final ActionListener listener; @@ -1133,6 +1160,11 @@ protected void acquireReplicaOperationPermit( replica.acquireReplicaOperationPermit(primaryTerm, globalCheckpoint, maxSeqNoOfUpdatesOrDeletes, onAcquired, executor, request); } + /** + * The primary shard reference + * + * @opensearch.internal + */ class PrimaryShardReference implements Releasable, @@ -1225,6 +1257,11 @@ public PendingReplicationActions getPendingReplicationActions() { } } + /** + * The replica response + * + * @opensearch.internal + */ public static class ReplicaResponse extends ActionResponse implements ReplicationOperation.ReplicaResponse { private long localCheckpoint; private long globalCheckpoint; @@ -1281,6 +1318,8 @@ public int hashCode() { * interface that performs the actual {@code ReplicaRequest} on the replica * shards. It also encapsulates the logic required for failing the replica * if deemed necessary as well as marking it as stale when needed. + * + * @opensearch.internal */ protected class ReplicasProxy implements ReplicationOperation.Replicas { @@ -1338,7 +1377,11 @@ public void markShardCopyAsStaleIfNeeded(ShardId shardId, String allocationId, l } } - /** a wrapper class to encapsulate a request when being sent to a specific allocation id **/ + /** + * a wrapper class to encapsulate a request when being sent to a specific allocation id + * + * @opensearch.internal + */ public static class ConcreteShardRequest extends TransportRequest { /** {@link AllocationId#getId()} of the shard this request is sent to **/ @@ -1442,6 +1485,11 @@ public String toString() { } } + /** + * Internal request for concrete replica + * + * @opensearch.internal + */ protected static final class ConcreteReplicaRequest extends ConcreteShardRequest { private final long globalCheckpoint; diff --git a/server/src/main/java/org/opensearch/action/support/replication/TransportWriteAction.java b/server/src/main/java/org/opensearch/action/support/replication/TransportWriteAction.java index 2104f60c2fd32..39fb89bc48568 100644 --- a/server/src/main/java/org/opensearch/action/support/replication/TransportWriteAction.java +++ b/server/src/main/java/org/opensearch/action/support/replication/TransportWriteAction.java @@ -267,6 +267,8 @@ protected abstract void dispatchedShardOperationOnReplica( * Result of taking the action on the primary. * * NOTE: public for testing + * + * @opensearch.internal */ public static class WritePrimaryResult< ReplicaRequest extends ReplicatedWriteRequest, @@ -322,6 +324,8 @@ public void onFailure(Exception ex) { /** * Result of taking the action on the replica. + * + * @opensearch.internal */ public static class WriteReplicaResult> extends ReplicaResult { public final Location location; @@ -394,6 +398,8 @@ interface RespondingWriteResult { * This class encapsulates post write actions like async waits for * translog syncs or waiting for a refresh to happen making the write operation * visible. + * + * @opensearch.internal */ static final class AsyncAfterWriteAction { private final Location location; @@ -492,6 +498,8 @@ void run() { * * This extends {@code TransportReplicationAction.ReplicasProxy} to do the * failing and stale-ing. + * + * @opensearch.internal */ class WriteActionReplicasProxy extends ReplicasProxy { diff --git a/server/src/main/java/org/opensearch/action/support/single/instance/TransportInstanceSingleOperationAction.java b/server/src/main/java/org/opensearch/action/support/single/instance/TransportInstanceSingleOperationAction.java index a6a16157ed264..bb9d685deedcd 100644 --- a/server/src/main/java/org/opensearch/action/support/single/instance/TransportInstanceSingleOperationAction.java +++ b/server/src/main/java/org/opensearch/action/support/single/instance/TransportInstanceSingleOperationAction.java @@ -140,6 +140,11 @@ protected TransportRequestOptions transportOptions() { */ protected abstract ShardIterator shards(ClusterState clusterState, Request request); + /** + * Asynchronous single action + * + * @opensearch.internal + */ class AsyncSingleAction { private final ActionListener listener; @@ -291,6 +296,11 @@ public void onTimeout(TimeValue timeout) { } } + /** + * Transport handler per shard + * + * @opensearch.internal + */ private class ShardTransportHandler implements TransportRequestHandler { @Override diff --git a/server/src/main/java/org/opensearch/action/support/single/shard/TransportSingleShardAction.java b/server/src/main/java/org/opensearch/action/support/single/shard/TransportSingleShardAction.java index 679360360eed4..df39bd29493dd 100644 --- a/server/src/main/java/org/opensearch/action/support/single/shard/TransportSingleShardAction.java +++ b/server/src/main/java/org/opensearch/action/support/single/shard/TransportSingleShardAction.java @@ -153,6 +153,11 @@ protected void resolveRequest(ClusterState state, InternalRequest request) { @Nullable protected abstract ShardsIterator shards(ClusterState state, InternalRequest request); + /** + * Asynchronous single action + * + * @opensearch.internal + */ class AsyncSingleAction { private final ActionListener listener; @@ -299,6 +304,11 @@ public void handleException(TransportException exp) { } } + /** + * Internal transport handler + * + * @opensearch.internal + */ private class TransportHandler implements TransportRequestHandler { @Override @@ -308,6 +318,11 @@ public void messageReceived(Request request, final TransportChannel channel, Tas } } + /** + * Shard level transport handler + * + * @opensearch.internal + */ private class ShardTransportHandler implements TransportRequestHandler { @Override @@ -321,6 +336,8 @@ public void messageReceived(final Request request, final TransportChannel channe /** * Internal request class that gets built on each node. Holds the original request plus additional info. + * + * @opensearch.internal */ protected class InternalRequest { final Request request; diff --git a/server/src/main/java/org/opensearch/action/support/tasks/TransportTasksAction.java b/server/src/main/java/org/opensearch/action/support/tasks/TransportTasksAction.java index 7a79d449538aa..460a0f7875558 100644 --- a/server/src/main/java/org/opensearch/action/support/tasks/TransportTasksAction.java +++ b/server/src/main/java/org/opensearch/action/support/tasks/TransportTasksAction.java @@ -237,6 +237,11 @@ protected TasksResponse newResponse(TasksRequest request, AtomicReferenceArray r */ protected abstract void taskOperation(TasksRequest request, OperationTask task, ActionListener listener); + /** + * Asynchronous single action + * + * @opensearch.internal + */ private class AsyncAction { private final TasksRequest request; @@ -353,6 +358,11 @@ private void finishHim() { } } + /** + * Node level transport handler + * + * @opensearch.internal + */ class NodeTransportHandler implements TransportRequestHandler { @Override @@ -368,6 +378,11 @@ public void messageReceived(final NodeTaskRequest request, final TransportChanne } } + /** + * Node level task request + * + * @opensearch.internal + */ private class NodeTaskRequest extends TransportRequest { private TasksRequest tasksRequest; @@ -389,6 +404,11 @@ protected NodeTaskRequest(TasksRequest tasksRequest) { } + /** + * Node level task response + * + * @opensearch.internal + */ private class NodeTasksResponse extends TransportResponse { protected String nodeId; protected List exceptions; diff --git a/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsResponse.java b/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsResponse.java index 1dd4f524f86a2..1a9ec0b63f46c 100644 --- a/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsResponse.java +++ b/server/src/main/java/org/opensearch/action/termvectors/MultiTermVectorsResponse.java @@ -54,6 +54,8 @@ public class MultiTermVectorsResponse extends ActionResponse implements Iterable /** * Represents a failure. + * + * @opensearch.internal */ public static class Failure implements Writeable { private final String index; @@ -151,6 +153,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Fields used for parsing and toXContent + * + * @opensearch.internal + */ static final class Fields { static final String DOCS = "docs"; static final String _INDEX = "_index"; diff --git a/server/src/main/java/org/opensearch/action/termvectors/TermVectorsFields.java b/server/src/main/java/org/opensearch/action/termvectors/TermVectorsFields.java index 2349abcd5cbdc..0b2cd3bb2509f 100644 --- a/server/src/main/java/org/opensearch/action/termvectors/TermVectorsFields.java +++ b/server/src/main/java/org/opensearch/action/termvectors/TermVectorsFields.java @@ -204,6 +204,11 @@ public int size() { return fieldMap.size(); } + /** + * Internal term vector + * + * @opensearch.internal + */ private final class TermVector extends Terms { private final StreamInput perFieldTermVectorInput; @@ -420,6 +425,11 @@ public boolean hasPayloads() { } } + /** + * Internal postings enumerator for term vectors + * + * @opensearch.internal + */ private final class TermVectorPostingsEnum extends PostingsEnum { private boolean hasPositions; private boolean hasOffsets; diff --git a/server/src/main/java/org/opensearch/action/termvectors/TermVectorsFilter.java b/server/src/main/java/org/opensearch/action/termvectors/TermVectorsFilter.java index ea54cea675900..0e0202777794b 100644 --- a/server/src/main/java/org/opensearch/action/termvectors/TermVectorsFilter.java +++ b/server/src/main/java/org/opensearch/action/termvectors/TermVectorsFilter.java @@ -176,6 +176,11 @@ public void setMaxWordLength(int maxWordLength) { this.maxWordLength = maxWordLength; } + /** + * Internal score term + * + * @opensearch.internal + */ public static final class ScoreTerm { public String field; public String word; @@ -295,6 +300,11 @@ private float computeScore(long docFreq, int freq, long numDocs) { return freq * similarity.idf(docFreq, numDocs); } + /** + * Internal queue of score terms + * + * @opensearch.internal + */ private static class ScoreTermsQueue extends org.apache.lucene.util.PriorityQueue { private final int limit; diff --git a/server/src/main/java/org/opensearch/action/termvectors/TermVectorsRequest.java b/server/src/main/java/org/opensearch/action/termvectors/TermVectorsRequest.java index 7da1df1dbe308..25f33934dbb80 100644 --- a/server/src/main/java/org/opensearch/action/termvectors/TermVectorsRequest.java +++ b/server/src/main/java/org/opensearch/action/termvectors/TermVectorsRequest.java @@ -115,6 +115,11 @@ public class TermVectorsRequest extends SingleShardRequest i private FilterSettings filterSettings; + /** + * Internal filter settings + * + * @opensearch.internal + */ public static final class FilterSettings { public Integer maxNumTerms; public Integer minTermFreq; diff --git a/server/src/main/java/org/opensearch/action/termvectors/TermVectorsResponse.java b/server/src/main/java/org/opensearch/action/termvectors/TermVectorsResponse.java index 80d80d01b9a93..9f4cd005f23b4 100644 --- a/server/src/main/java/org/opensearch/action/termvectors/TermVectorsResponse.java +++ b/server/src/main/java/org/opensearch/action/termvectors/TermVectorsResponse.java @@ -66,6 +66,11 @@ */ public class TermVectorsResponse extends ActionResponse implements ToXContentObject { + /** + * Fields used for parsing and toXContent + * + * @opensearch.internal + */ private static class FieldStrings { // term statistics strings public static final String TTF = "ttf"; diff --git a/server/src/main/java/org/opensearch/action/update/UpdateHelper.java b/server/src/main/java/org/opensearch/action/update/UpdateHelper.java index 7f4c9524d406d..09a0a6281b8fc 100644 --- a/server/src/main/java/org/opensearch/action/update/UpdateHelper.java +++ b/server/src/main/java/org/opensearch/action/update/UpdateHelper.java @@ -390,6 +390,11 @@ public static GetResult extractGetResult( ); } + /** + * Internal result + * + * @opensearch.internal + */ public static class Result { private final Writeable action; @@ -468,6 +473,8 @@ public String toString() { /** * Field names used to populate the script context + * + * @opensearch.internal */ public static class ContextFields { public static final String CTX = "ctx"; diff --git a/server/src/main/java/org/opensearch/action/update/UpdateResponse.java b/server/src/main/java/org/opensearch/action/update/UpdateResponse.java index b51210d2d202b..8fca544f2d53b 100644 --- a/server/src/main/java/org/opensearch/action/update/UpdateResponse.java +++ b/server/src/main/java/org/opensearch/action/update/UpdateResponse.java @@ -172,6 +172,8 @@ public static void parseXContentFields(XContentParser parser, Builder context) t * Builder class for {@link UpdateResponse}. This builder is usually used during xcontent parsing to * temporarily store the parsed values, then the {@link DocWriteResponse.Builder#build()} method is called to * instantiate the {@link UpdateResponse}. + * + * @opensearch.internal */ public static class Builder extends DocWriteResponse.Builder { diff --git a/server/src/main/java/org/opensearch/index/Index.java b/server/src/main/java/org/opensearch/index/Index.java index db620592d1ede..0dc0399d6bf80 100644 --- a/server/src/main/java/org/opensearch/index/Index.java +++ b/server/src/main/java/org/opensearch/index/Index.java @@ -136,6 +136,8 @@ public static Index fromXContent(final XContentParser parser) throws IOException /** * Builder for Index objects. Used by ObjectParser instances only. + * + * @opensearch.internal */ private static final class Builder { private String name; diff --git a/server/src/main/java/org/opensearch/index/IndexModule.java b/server/src/main/java/org/opensearch/index/IndexModule.java index acceee7562068..49daf8293656c 100644 --- a/server/src/main/java/org/opensearch/index/IndexModule.java +++ b/server/src/main/java/org/opensearch/index/IndexModule.java @@ -387,6 +387,11 @@ public static boolean isBuiltinType(String storeType) { return false; } + /** + * Type of file system + * + * @opensearch.internal + */ public enum Type { HYBRIDFS("hybridfs"), NIOFS("niofs"), diff --git a/server/src/main/java/org/opensearch/index/IndexService.java b/server/src/main/java/org/opensearch/index/IndexService.java index 54aa7f5097d61..0739e5afdffcd 100644 --- a/server/src/main/java/org/opensearch/index/IndexService.java +++ b/server/src/main/java/org/opensearch/index/IndexService.java @@ -279,6 +279,11 @@ static boolean needsMapperService(IndexSettings indexSettings, IndexCreationCont && indexCreationContext == IndexCreationContext.CREATE_INDEX); // metadata verification needs a mapper service } + /** + * Context for index creation + * + * @opensearch.internal + */ public enum IndexCreationContext { CREATE_INDEX, METADATA_VERIFICATION @@ -741,6 +746,11 @@ public void accept(ShardLock lock) { } } + /** + * Cache listener for bitsets + * + * @opensearch.internal + */ private static final class BitsetCacheListener implements BitsetFilterCache.Listener { final IndexService indexService; @@ -894,6 +904,11 @@ private void rescheduleRefreshTasks() { } } + /** + * Shard Store Deleter Interface + * + * @opensearch.internal + */ public interface ShardStoreDeleter { void deleteShardStore(String reason, ShardLock lock, IndexSettings indexSettings) throws IOException; @@ -1000,6 +1015,11 @@ private void sync(final Consumer sync, final String source) { } } + /** + * Base asynchronous task + * + * @opensearch.internal + */ abstract static class BaseAsyncTask extends AbstractAsyncTask { protected final IndexService indexService; @@ -1020,6 +1040,8 @@ protected boolean mustReschedule() { /** * FSyncs the translog for all shards of this index in a defined interval. + * + * @opensearch.internal */ static final class AsyncTranslogFSync extends BaseAsyncTask { diff --git a/server/src/main/java/org/opensearch/index/IndexSortConfig.java b/server/src/main/java/org/opensearch/index/IndexSortConfig.java index 3acc80e519785..179d79f90cc8c 100644 --- a/server/src/main/java/org/opensearch/index/IndexSortConfig.java +++ b/server/src/main/java/org/opensearch/index/IndexSortConfig.java @@ -244,6 +244,11 @@ private void validateIndexSortField(SortField sortField) { } } + /** + * Field sort specification + * + * @opensearch.internal + */ static class FieldSortSpec { final String field; SortOrder order; diff --git a/server/src/main/java/org/opensearch/index/IndexWarmer.java b/server/src/main/java/org/opensearch/index/IndexWarmer.java index 5251b49539ecb..4b49a6c92dd9f 100644 --- a/server/src/main/java/org/opensearch/index/IndexWarmer.java +++ b/server/src/main/java/org/opensearch/index/IndexWarmer.java @@ -108,7 +108,11 @@ void warm(OpenSearchDirectoryReader reader, IndexShard shard, IndexSettings sett } } - /** A handle on the execution of warm-up action. */ + /** + * A handle on the execution of warm-up action. + * + * @opensearch.internal + */ public interface TerminationHandle { TerminationHandle NO_WAIT = () -> {}; @@ -117,12 +121,22 @@ public interface TerminationHandle { void awaitTermination() throws InterruptedException; } + /** + * Listener for the index warmer + * + * @opensearch.internal + */ public interface Listener { /** Queue tasks to warm-up the given segments and return handles that allow to wait for termination of the * execution of those tasks. */ TerminationHandle warmReader(IndexShard indexShard, OpenSearchDirectoryReader reader); } + /** + * Warmer for field data + * + * @opensearch.internal + */ private static class FieldDataWarmer implements IndexWarmer.Listener { private final Executor executor; diff --git a/server/src/main/java/org/opensearch/index/IndexingSlowLog.java b/server/src/main/java/org/opensearch/index/IndexingSlowLog.java index c45d3f6b34d65..d6ec06d5a274c 100644 --- a/server/src/main/java/org/opensearch/index/IndexingSlowLog.java +++ b/server/src/main/java/org/opensearch/index/IndexingSlowLog.java @@ -211,6 +211,11 @@ public void postIndex(ShardId shardId, Engine.Index indexOperation, Engine.Index } } + /** + * Slow log message for indexing + * + * @opensearch.internal + */ static final class IndexingSlowLogMessage extends OpenSearchLogMessage { IndexingSlowLogMessage(Index index, ParsedDocument doc, long tookInNanos, boolean reformat, int maxSourceCharsToLog) { diff --git a/server/src/main/java/org/opensearch/index/SearchSlowLog.java b/server/src/main/java/org/opensearch/index/SearchSlowLog.java index c48c122580579..133fa6761c197 100644 --- a/server/src/main/java/org/opensearch/index/SearchSlowLog.java +++ b/server/src/main/java/org/opensearch/index/SearchSlowLog.java @@ -208,6 +208,11 @@ public void onFetchPhase(SearchContext context, long tookInNanos) { } } + /** + * Search slow log message + * + * @opensearch.internal + */ static final class SearchSlowLogMessage extends OpenSearchLogMessage { SearchSlowLogMessage(SearchContext context, long tookInNanos) { diff --git a/server/src/main/java/org/opensearch/index/ShardIndexingPressureTracker.java b/server/src/main/java/org/opensearch/index/ShardIndexingPressureTracker.java index c6031d80fa0a8..937424598bc24 100644 --- a/server/src/main/java/org/opensearch/index/ShardIndexingPressureTracker.java +++ b/server/src/main/java/org/opensearch/index/ShardIndexingPressureTracker.java @@ -92,6 +92,8 @@ public CommonOperationTracker getCommonOperationTracker() { * a. StatsTracker : To track request level aggregated statistics for a shard * b. RejectionTracker : To track the rejection statistics for a shard * c. Performance Tracker : To track the request performance statistics for a shard + * + * @opensearch.internal */ public static class OperationTracker { private final StatsTracker statsTracker = new StatsTracker(); @@ -116,6 +118,8 @@ public PerformanceTracker getPerformanceTracker() { * a. currentBytes - Bytes of data that is inflight/processing for a shard. * b. totalBytes - Total bytes that are processed/completed successfully for a shard. * c. requestCount - Total number of requests that are processed/completed successfully for a shard. + * + * @opensearch.internal */ public static class StatsTracker { private final AtomicLong currentBytes = new AtomicLong(); @@ -156,6 +160,8 @@ public long incrementRequestCount() { * last successful request limits breached for a shard i.e. complete path failure (black-hole). * d. throughputDegradationLimitsBreachedRejections - Total number of requests that were rejected due to the * throughput degradation in the request path for a shard i.e. partial failure. + * + * @opensearch.internal */ public static class RejectionTracker { private final AtomicLong totalRejections = new AtomicLong(); @@ -205,6 +211,8 @@ public long incrementThroughputDegradationLimitsBreachedRejections() { * e. ThroughputMovingQueue - Queue that holds the last N requests throughput such that there exists a sliding window * which keeps moving everytime a new request comes. At any given point it tracks last N requests only. * EWMA cannot be used here as it evaluate the historical average, while here it just needs the average of last N requests. + * + * @opensearch.internal */ public static class PerformanceTracker { private final AtomicLong latencyInMillis = new AtomicLong(); @@ -273,6 +281,8 @@ public long getThroughputMovingQueueSize() { * when primary is local to coordinator node. Hence common accounting for coordinator and primary operation. * b. totalCombinedCoordinatingAndPrimaryBytes - Total bytes that are processed/completed successfully for a shard * when primary is local to coordinator node. Hence common accounting for coordinator and primary operation. + * + * @opensearch.internal */ public static class CommonOperationTracker { private final AtomicLong currentCombinedCoordinatingAndPrimaryBytes = new AtomicLong(); diff --git a/server/src/main/java/org/opensearch/index/analysis/AnalysisRegistry.java b/server/src/main/java/org/opensearch/index/analysis/AnalysisRegistry.java index 07041978c812c..8ec2b70001fc9 100644 --- a/server/src/main/java/org/opensearch/index/analysis/AnalysisRegistry.java +++ b/server/src/main/java/org/opensearch/index/analysis/AnalysisRegistry.java @@ -570,6 +570,11 @@ private static AnalysisProvider getAnalysisProvider( return type; } + /** + * Internal prebuilt analysis class + * + * @opensearch.internal + */ private static class PrebuiltAnalysis implements Closeable { final Map>> analyzerProviderFactories; diff --git a/server/src/main/java/org/opensearch/index/analysis/PreBuiltAnalyzerProviderFactory.java b/server/src/main/java/org/opensearch/index/analysis/PreBuiltAnalyzerProviderFactory.java index ce1489d5de70c..6202f0a679c83 100644 --- a/server/src/main/java/org/opensearch/index/analysis/PreBuiltAnalyzerProviderFactory.java +++ b/server/src/main/java/org/opensearch/index/analysis/PreBuiltAnalyzerProviderFactory.java @@ -104,6 +104,8 @@ public void close() throws IOException { * * This can be removed when all analyzers have been moved away from PreBuiltAnalyzers to * PreBuiltAnalyzerProviderFactory either in server or analysis-common. + * + * @opensearch.internal */ static class PreBuiltAnalyzersDelegateCache implements PreBuiltCacheFactory.PreBuiltCache> { diff --git a/server/src/main/java/org/opensearch/index/analysis/ShingleTokenFilterFactory.java b/server/src/main/java/org/opensearch/index/analysis/ShingleTokenFilterFactory.java index 953479e3e0a19..701a9302fc164 100644 --- a/server/src/main/java/org/opensearch/index/analysis/ShingleTokenFilterFactory.java +++ b/server/src/main/java/org/opensearch/index/analysis/ShingleTokenFilterFactory.java @@ -121,6 +121,11 @@ public Factory getInnerFactory() { return this.factory; } + /** + * Factory for single token filter + * + * @opensearch.internal + */ public static final class Factory implements TokenFilterFactory { private final int maxShingleSize; diff --git a/server/src/main/java/org/opensearch/index/cache/bitset/BitsetFilterCache.java b/server/src/main/java/org/opensearch/index/cache/bitset/BitsetFilterCache.java index 12306f942d32f..cd3691ba66a17 100644 --- a/server/src/main/java/org/opensearch/index/cache/bitset/BitsetFilterCache.java +++ b/server/src/main/java/org/opensearch/index/cache/bitset/BitsetFilterCache.java @@ -192,6 +192,11 @@ public void onRemoval(RemovalNotification> getLoadedFilters() { /** * A listener interface that is executed for each onCache / onRemoval event + * + * @opensearch.internal */ public interface Listener { /** diff --git a/server/src/main/java/org/opensearch/index/cache/query/QueryCacheStats.java b/server/src/main/java/org/opensearch/index/cache/query/QueryCacheStats.java index e9cc26c378749..941899476e728 100644 --- a/server/src/main/java/org/opensearch/index/cache/query/QueryCacheStats.java +++ b/server/src/main/java/org/opensearch/index/cache/query/QueryCacheStats.java @@ -155,6 +155,11 @@ public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params par return builder; } + /** + * Fields used for parsing and toXContent + * + * @opensearch.internal + */ static final class Fields { static final String QUERY_CACHE = "query_cache"; static final String MEMORY_SIZE = "memory_size"; diff --git a/server/src/main/java/org/opensearch/index/cache/request/RequestCacheStats.java b/server/src/main/java/org/opensearch/index/cache/request/RequestCacheStats.java index d03bfdad24226..2d0a3b5af1645 100644 --- a/server/src/main/java/org/opensearch/index/cache/request/RequestCacheStats.java +++ b/server/src/main/java/org/opensearch/index/cache/request/RequestCacheStats.java @@ -115,6 +115,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Fields used for parsing and toXContent + * + * @opensearch.internal + */ static final class Fields { static final String REQUEST_CACHE_STATS = "request_cache"; static final String MEMORY_SIZE = "memory_size"; diff --git a/server/src/main/java/org/opensearch/index/engine/CombinedDeletionPolicy.java b/server/src/main/java/org/opensearch/index/engine/CombinedDeletionPolicy.java index 8772724c2353d..528bd556681cc 100644 --- a/server/src/main/java/org/opensearch/index/engine/CombinedDeletionPolicy.java +++ b/server/src/main/java/org/opensearch/index/engine/CombinedDeletionPolicy.java @@ -265,6 +265,8 @@ public static String commitDescription(IndexCommit commit) throws IOException { /** * A wrapper of an index commit that prevents it from being deleted. + * + * @opensearch.internal */ private static class SnapshotIndexCommit extends IndexCommit { private final IndexCommit delegate; diff --git a/server/src/main/java/org/opensearch/index/engine/CommitStats.java b/server/src/main/java/org/opensearch/index/engine/CommitStats.java index 1faed2cd16713..495ff2a5c2622 100644 --- a/server/src/main/java/org/opensearch/index/engine/CommitStats.java +++ b/server/src/main/java/org/opensearch/index/engine/CommitStats.java @@ -112,6 +112,11 @@ public void writeTo(StreamOutput out) throws IOException { out.writeInt(numDocs); } + /** + * Fields used for parsing and toXContent + * + * @opensearch.internal + */ static final class Fields { static final String GENERATION = "generation"; static final String USER_DATA = "user_data"; diff --git a/server/src/main/java/org/opensearch/index/engine/Engine.java b/server/src/main/java/org/opensearch/index/engine/Engine.java index 06ceb34ab2065..87803f280260f 100644 --- a/server/src/main/java/org/opensearch/index/engine/Engine.java +++ b/server/src/main/java/org/opensearch/index/engine/Engine.java @@ -243,6 +243,8 @@ public void verifyEngineBeforeIndexClosing() throws IllegalStateException { * A throttling class that can be activated, causing the * {@code acquireThrottle} method to block on a lock when throttling * is enabled + * + * @opensearch.internal */ protected static final class IndexThrottle { private final CounterMetric throttleTimeMillisMetric = new CounterMetric(); @@ -317,7 +319,11 @@ boolean throttleLockIsHeldByCurrentThread() { // to be used in assertions and te */ public abstract void trimOperationsFromTranslog(long belowTerm, long aboveSeqNo) throws EngineException; - /** A Lock implementation that always allows the lock to be acquired */ + /** + * A Lock implementation that always allows the lock to be acquired + * + * @opensearch.internal + */ protected static final class NoOpLock implements Lock { @Override @@ -371,6 +377,8 @@ public Condition newCondition() { * Base class for index and delete operation results * Holds result meta data (e.g. translog location, updated version) * for an executed write {@link Operation} + * + * @opensearch.internal **/ public abstract static class Result { private final Operation.TYPE operationType; @@ -484,6 +492,11 @@ void freeze() { freeze.set(true); } + /** + * Type of the result + * + * @opensearch.internal + */ public enum Type { SUCCESS, FAILURE, @@ -491,6 +504,11 @@ public enum Type { } } + /** + * Index result + * + * @opensearch.internal + */ public static class IndexResult extends Result { private final boolean created; @@ -523,6 +541,11 @@ public boolean isCreated() { } + /** + * The delete result + * + * @opensearch.internal + */ public static class DeleteResult extends Result { private final boolean found; @@ -555,6 +578,11 @@ public boolean isFound() { } + /** + * A noop result + * + * @opensearch.internal + */ public static class NoOpResult extends Result { NoOpResult(long term, long seqNo) { @@ -713,6 +741,11 @@ boolean assertSearcherIsWarmedUp(String source, SearcherScope scope) { return true; } + /** + * Scope of the searcher + * + * @opensearch.internal + */ public enum SearcherScope { EXTERNAL, INTERNAL @@ -1241,6 +1274,11 @@ protected boolean maybeFailEngine(String source, Exception e) { return false; } + /** + * Event listener for the engine + * + * @opensearch.internal + */ public interface EventListener { /** * Called when a fatal exception occurred @@ -1248,6 +1286,11 @@ public interface EventListener { default void onFailedEngine(String reason, @Nullable Exception e) {} } + /** + * Supplier for the searcher + * + * @opensearch.internal + */ public abstract static class SearcherSupplier implements Releasable { private final Function wrapper; private final AtomicBoolean released = new AtomicBoolean(false); @@ -1278,6 +1321,11 @@ public final void close() { protected abstract Searcher acquireSearcherInternal(String source); } + /** + * The engine searcher + * + * @opensearch.internal + */ public static final class Searcher extends IndexSearcher implements Releasable { private final String source; private final Closeable onClose; @@ -1325,9 +1373,18 @@ public void close() { } } + /** + * Base operation class + * + * @opensearch.internal + */ public abstract static class Operation { - /** type of operation (index, delete), subclasses use static types */ + /** + * type of operation (index, delete), subclasses use static types + * + * @opensearch.internal + */ public enum TYPE { INDEX, DELETE, @@ -1362,6 +1419,11 @@ public Operation(Term uid, long seqNo, long primaryTerm, long version, VersionTy this.startTime = startTime; } + /** + * Origin of the operation + * + * @opensearch.internal + */ public enum Origin { PRIMARY, REPLICA, @@ -1416,6 +1478,11 @@ public long startTime() { public abstract TYPE operationType(); } + /** + * Index operation + * + * @opensearch.internal + */ public static class Index extends Operation { private final ParsedDocument doc; @@ -1529,6 +1596,11 @@ public long getIfPrimaryTerm() { } } + /** + * Delete operation + * + * @opensearch.internal + */ public static class Delete extends Operation { private final String id; @@ -1612,6 +1684,11 @@ public long getIfPrimaryTerm() { } } + /** + * noop operation + * + * @opensearch.internal + */ public static class NoOp extends Operation { private final String reason; @@ -1657,6 +1734,11 @@ public int estimatedSizeInBytes() { } + /** + * Get operation + * + * @opensearch.internal + */ public static class Get { private final boolean realtime; private final Term uid; @@ -1728,6 +1810,11 @@ public long getIfPrimaryTerm() { } + /** + * The Get result + * + * @opensearch.internal + */ public static class GetResult implements Releasable { private final boolean exists; private final long version; @@ -1848,6 +1935,8 @@ public long getLastWriteNanos() { * Called for each new opened engine reader to warm new segments * * @see EngineConfig#getWarmer() + * + * @opensearch.internal */ public interface Warmer { /** @@ -1917,6 +2006,11 @@ public long getMaxSeenAutoIdTimestamp() { */ public abstract void updateMaxUnsafeAutoIdTimestamp(long newTimestamp); + /** + * The runner for translog recovery + * + * @opensearch.internal + */ @FunctionalInterface public interface TranslogRecoveryRunner { int run(Engine engine, Translog.Snapshot snapshot) throws IOException; diff --git a/server/src/main/java/org/opensearch/index/engine/EngineConfig.java b/server/src/main/java/org/opensearch/index/engine/EngineConfig.java index 52dff2826657b..0ea4a96a72362 100644 --- a/server/src/main/java/org/opensearch/index/engine/EngineConfig.java +++ b/server/src/main/java/org/opensearch/index/engine/EngineConfig.java @@ -463,6 +463,8 @@ public LongSupplier getPrimaryTermSupplier() { /** * A supplier supplies tombstone documents which will be used in soft-update methods. * The returned document consists only _uid, _seqno, _term and _version fields; other metadata fields are excluded. + * + * @opensearch.internal */ public interface TombstoneDocSupplier { /** diff --git a/server/src/main/java/org/opensearch/index/engine/InternalEngine.java b/server/src/main/java/org/opensearch/index/engine/InternalEngine.java index 70165adb6da60..23321db4f1a65 100644 --- a/server/src/main/java/org/opensearch/index/engine/InternalEngine.java +++ b/server/src/main/java/org/opensearch/index/engine/InternalEngine.java @@ -379,6 +379,8 @@ public CompletionStats completionStats(String... fieldNamePatterns) { * since no indexing is happening and refreshes are only happening to the external reader manager, while with * this specialized implementation an external refresh will immediately be reflected on the internal reader * and old segments can be released in the same way previous version did this (as a side-effect of _refresh) + * + * @opensearch.internal */ @SuppressForbidden(reason = "reference counting is required here") private static final class ExternalReaderManager extends ReferenceManager { @@ -1295,6 +1297,11 @@ private void addStaleDocs(final List docs, final IndexWri } } + /** + * The indexing strategy + * + * @opensearch.internal + */ protected static final class IndexingStrategy { final boolean currentNotFoundOrDeleted; final boolean useLuceneUpdateDocument; @@ -1644,6 +1651,11 @@ private DeleteResult deleteInLucene(Delete delete, DeletionStrategy plan) throws } } + /** + * The deletion strategy + * + * @opensearch.internal + */ protected static final class DeletionStrategy { // of a rare double delete final boolean deleteFromLucene; @@ -2457,7 +2469,11 @@ private IndexWriterConfig getIndexWriterConfig() { return iwc; } - /** A listener that warms the segments if needed when acquiring a new reader */ + /** + * A listener that warms the segments if needed when acquiring a new reader + * + * @opensearch.internal + */ static final class RefreshWarmerListener implements BiConsumer { private final Engine.Warmer warmer; private final Logger logger; @@ -2882,6 +2898,11 @@ private static Map commitDataAsMap(final IndexWriter indexWriter return commitData; } + /** + * Internal Asserting Index Writer + * + * @opensearch.internal + */ private static class AssertingIndexWriter extends IndexWriter { AssertingIndexWriter(Directory d, IndexWriterConfig conf) throws IOException { super(d, conf); diff --git a/server/src/main/java/org/opensearch/index/engine/LiveVersionMap.java b/server/src/main/java/org/opensearch/index/engine/LiveVersionMap.java index 943792171d2e5..87ff449ee74e0 100644 --- a/server/src/main/java/org/opensearch/index/engine/LiveVersionMap.java +++ b/server/src/main/java/org/opensearch/index/engine/LiveVersionMap.java @@ -55,6 +55,11 @@ final class LiveVersionMap implements ReferenceManager.RefreshListener, Accounta private final KeyedLock keyedLock = new KeyedLock<>(); + /** + * Looks up document version + * + * @opensearch.internal + */ private static final class VersionLookup { /** Tracks bytes used by current map, i.e. what is freed on refresh. For deletes, which are also added to tombstones, @@ -120,6 +125,11 @@ public void updateMinDeletedTimestamp(DeleteVersionValue delete) { } + /** + * Map of version lookups + * + * @opensearch.internal + */ private static final class Maps { // All writes (adds and deletes) go into here: diff --git a/server/src/main/java/org/opensearch/index/engine/LuceneChangesSnapshot.java b/server/src/main/java/org/opensearch/index/engine/LuceneChangesSnapshot.java index 6b3a8d76defb5..098115bf676a8 100644 --- a/server/src/main/java/org/opensearch/index/engine/LuceneChangesSnapshot.java +++ b/server/src/main/java/org/opensearch/index/engine/LuceneChangesSnapshot.java @@ -350,6 +350,11 @@ private boolean assertDocSoftDeleted(LeafReader leafReader, int segmentDocId) th return ndv.longValue() == 1; } + /** + * Parallel array to hold translog operations + * + * @opensearch.internal + */ private static final class ParallelArray { final LeafReaderContext[] leafReaderContexts; final long[] version; diff --git a/server/src/main/java/org/opensearch/index/engine/PrunePostingsMergePolicy.java b/server/src/main/java/org/opensearch/index/engine/PrunePostingsMergePolicy.java index 5b186b7a3d841..87ac032b7d81b 100644 --- a/server/src/main/java/org/opensearch/index/engine/PrunePostingsMergePolicy.java +++ b/server/src/main/java/org/opensearch/index/engine/PrunePostingsMergePolicy.java @@ -168,6 +168,11 @@ public CacheHelper getReaderCacheHelper() { }; } + /** + * Class holder for only live docs and the postings enumerator + * + * @opensearch.internal + */ private static final class OnlyLiveDocsPostingsEnum extends PostingsEnum { private final Bits liveDocs; diff --git a/server/src/main/java/org/opensearch/index/engine/RecoverySourcePruneMergePolicy.java b/server/src/main/java/org/opensearch/index/engine/RecoverySourcePruneMergePolicy.java index fb907b3acd2a3..0c064a8f188ad 100644 --- a/server/src/main/java/org/opensearch/index/engine/RecoverySourcePruneMergePolicy.java +++ b/server/src/main/java/org/opensearch/index/engine/RecoverySourcePruneMergePolicy.java @@ -100,6 +100,11 @@ private static CodecReader wrapReader(String recoverySourceField, CodecReader re } } + /** + * A codec reader that prunes the source using a filter + * + * @opensearch.internal + */ private static class SourcePruningFilterCodecReader extends FilterCodecReader { private final BitSet recoverySourceToKeep; private final String recoverySourceField; @@ -166,6 +171,11 @@ public CacheHelper getReaderCacheHelper() { return null; } + /** + * A producer of filtered doc vlaues + * + * @opensearch.internal + */ private static class FilterDocValuesProducer extends DocValuesProducer { private final DocValuesProducer in; @@ -209,6 +219,11 @@ public void close() throws IOException { } } + /** + * A fields reader that provides a filtered stored field + * + * @opensearch.internal + */ private abstract static class FilterStoredFieldsReader extends StoredFieldsReader { protected final StoredFieldsReader in; @@ -236,6 +251,11 @@ public void checkIntegrity() throws IOException { } } + /** + * A reader of pruned stored fields + * + * @opensearch.internal + */ private static class RecoverySourcePruningStoredFieldsReader extends FilterStoredFieldsReader { private final BitSet recoverySourceToKeep; @@ -276,6 +296,11 @@ public StoredFieldsReader clone() { } + /** + * A visitor pattern for filtered stored fields + * + * @opensearch.internal + */ private static class FilterStoredFieldVisitor extends StoredFieldVisitor { private final StoredFieldVisitor visitor; diff --git a/server/src/main/java/org/opensearch/index/engine/SegmentsStats.java b/server/src/main/java/org/opensearch/index/engine/SegmentsStats.java index af4a1dc6f4d6b..231b2da546d46 100644 --- a/server/src/main/java/org/opensearch/index/engine/SegmentsStats.java +++ b/server/src/main/java/org/opensearch/index/engine/SegmentsStats.java @@ -244,6 +244,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Fields for segment statistics + * + * @opensearch.internal + */ static final class Fields { static final String SEGMENTS = "segments"; static final String COUNT = "count"; diff --git a/server/src/main/java/org/opensearch/index/fielddata/FieldData.java b/server/src/main/java/org/opensearch/index/fielddata/FieldData.java index a45cd79f68126..0f18944c67ebb 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/FieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/FieldData.java @@ -446,6 +446,11 @@ private interface ToStringValues { } + /** + * Values casted as a double type + * + * @opensearch.internal + */ private static class DoubleCastedValues extends NumericDoubleValues { private final NumericDocValues values; @@ -466,6 +471,11 @@ public boolean advanceExact(int doc) throws IOException { } + /** + * Sorted values casted as a double type + * + * @opensearch.internal + */ private static class SortedDoubleCastedValues extends SortedNumericDoubleValues { private final SortedNumericDocValues values; @@ -491,6 +501,11 @@ public int docValueCount() { } + /** + * Values casted as a long type + * + * @opensearch.internal + */ private static class LongCastedValues extends AbstractNumericDocValues { private final NumericDoubleValues values; @@ -517,6 +532,11 @@ public int docID() { } } + /** + * Sorted values casted as a long type + * + * @opensearch.internal + */ private static class SortedLongCastedValues extends AbstractSortedNumericDocValues { private final SortedNumericDoubleValues values; diff --git a/server/src/main/java/org/opensearch/index/fielddata/IndexFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/IndexFieldData.java index 9b9258efb1cc3..25437fb001978 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/IndexFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/IndexFieldData.java @@ -108,9 +108,13 @@ BucketedSort newBucketedSort( BucketedSort.ExtraData extra ); - // we need this extended source we we have custom comparators to reuse our field data - // in this case, we need to reduce type that will be used when search results are reduced - // on another node (we don't have the custom source them...) + /** + * we need this extended source we we have custom comparators to reuse our field data + * in this case, we need to reduce type that will be used when search results are reduced + * on another node (we don't have the custom source them...) + * + * @opensearch.internal + */ abstract class XFieldComparatorSource extends FieldComparatorSource { protected final MultiValueMode sortMode; @@ -273,11 +277,21 @@ public abstract BucketedSort newBucketedSort( ); } + /** + * Base builder interface + * + * @opensearch.internal + */ interface Builder { IndexFieldData build(IndexFieldDataCache cache, CircuitBreakerService breakerService); } + /** + * Base Global field data class + * + * @opensearch.internal + */ interface Global extends IndexFieldData { IndexFieldData loadGlobal(DirectoryReader indexReader); diff --git a/server/src/main/java/org/opensearch/index/fielddata/IndexFieldDataCache.java b/server/src/main/java/org/opensearch/index/fielddata/IndexFieldDataCache.java index 08aaadcac0d60..ef816099c7c58 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/IndexFieldDataCache.java +++ b/server/src/main/java/org/opensearch/index/fielddata/IndexFieldDataCache.java @@ -59,6 +59,11 @@ > IFD load(Direc */ void clear(String fieldName); + /** + * The listener interface + * + * @opensearch.internal + */ interface Listener { /** @@ -72,6 +77,11 @@ default void onCache(ShardId shardId, String fieldName, Accountable ramUsage) {} default void onRemoval(ShardId shardId, String fieldName, boolean wasEvicted, long sizeInBytes) {} } + /** + * No index field data cache + * + * @opensearch.internal + */ class None implements IndexFieldDataCache { @Override diff --git a/server/src/main/java/org/opensearch/index/fielddata/IndexNumericFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/IndexNumericFieldData.java index e4beb46b451f2..02748edfb4f83 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/IndexNumericFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/IndexNumericFieldData.java @@ -61,6 +61,8 @@ public abstract class IndexNumericFieldData implements IndexFieldData { /** * The type of number. + * + * @opensearch.internal */ public enum NumericType { BOOLEAN(false, SortField.Type.LONG, CoreValuesSourceType.BOOLEAN), diff --git a/server/src/main/java/org/opensearch/index/fielddata/ScriptDocValues.java b/server/src/main/java/org/opensearch/index/fielddata/ScriptDocValues.java index 5f2d899b9d1e8..0b5ace1657fd3 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/ScriptDocValues.java +++ b/server/src/main/java/org/opensearch/index/fielddata/ScriptDocValues.java @@ -93,6 +93,11 @@ public final void sort(Comparator c) { throw new UnsupportedOperationException("doc values are unmodifiable"); } + /** + * Long values for scripted doc values + * + * @opensearch.internal + */ public static final class Longs extends ScriptDocValues { private final SortedNumericDocValues in; private long[] values = new long[0]; @@ -147,6 +152,11 @@ public int size() { } } + /** + * Date values for scripted doc values + * + * @opensearch.internal + */ public static final class Dates extends ScriptDocValues { private final SortedNumericDocValues in; @@ -223,6 +233,11 @@ void refreshArray() throws IOException { } } + /** + * Double values for scripted doc values + * + * @opensearch.internal + */ public static final class Doubles extends ScriptDocValues { private final SortedNumericDoubleValues in; @@ -279,6 +294,11 @@ public int size() { } } + /** + * Geo points for scripted doc values + * + * @opensearch.internal + */ public static final class GeoPoints extends ScriptDocValues { private final MultiGeoPointValues in; @@ -399,6 +419,11 @@ public double geohashDistanceWithDefault(String geohash, double defaultValue) { } } + /** + * Boolean values for scripted doc values + * + * @opensearch.internal + */ public static final class Booleans extends ScriptDocValues { private final SortedNumericDocValues in; @@ -459,6 +484,11 @@ private static boolean[] grow(boolean[] array, int minSize) { } + /** + * Base class for binary script doc values + * + * @opensearch.internal + */ abstract static class BinaryScriptDocValues extends ScriptDocValues { private final SortedBinaryDocValues in; @@ -505,6 +535,11 @@ public int size() { } } + /** + * String class for scripted doc values + * + * @opensearch.internal + */ public static class Strings extends BinaryScriptDocValues { public Strings(SortedBinaryDocValues in) { super(in); @@ -533,6 +568,11 @@ public final String getValue() { } } + /** + * BytesRef values for scripted doc values + * + * @opensearch.internal + */ public static final class BytesRefs extends BinaryScriptDocValues { public BytesRefs(SortedBinaryDocValues in) { diff --git a/server/src/main/java/org/opensearch/index/fielddata/fieldcomparator/BytesRefFieldComparatorSource.java b/server/src/main/java/org/opensearch/index/fielddata/fieldcomparator/BytesRefFieldComparatorSource.java index 51dde57563ec6..e816b366c3153 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/fieldcomparator/BytesRefFieldComparatorSource.java +++ b/server/src/main/java/org/opensearch/index/fielddata/fieldcomparator/BytesRefFieldComparatorSource.java @@ -169,6 +169,8 @@ public BucketedSort newBucketedSort( /** * A view of a SortedDocValues where missing values * are replaced with the specified term + * + * @opensearch.internal */ // TODO: move this out if we need it for other reasons static class ReplaceMissing extends AbstractSortedDocValues { diff --git a/server/src/main/java/org/opensearch/index/fielddata/ordinals/MultiOrdinals.java b/server/src/main/java/org/opensearch/index/fielddata/ordinals/MultiOrdinals.java index e6e51ed83a6ab..6131bc33841b6 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/ordinals/MultiOrdinals.java +++ b/server/src/main/java/org/opensearch/index/fielddata/ordinals/MultiOrdinals.java @@ -129,6 +129,11 @@ public SortedSetDocValues ordinals(ValuesHolder values) { } } + /** + * Single doc type + * + * @opensearch.internal + */ private static class SingleDocs extends AbstractSortedDocValues { private final int valueCount; @@ -177,6 +182,11 @@ public int getValueCount() { } + /** + * Multiple docs + * + * @opensearch.internal + */ private static class MultiDocs extends AbstractSortedSetDocValues { private final long valueCount; diff --git a/server/src/main/java/org/opensearch/index/fielddata/ordinals/Ordinals.java b/server/src/main/java/org/opensearch/index/fielddata/ordinals/Ordinals.java index 6ce0c06be02ea..85ac535319e55 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/ordinals/Ordinals.java +++ b/server/src/main/java/org/opensearch/index/fielddata/ordinals/Ordinals.java @@ -62,6 +62,11 @@ public final SortedSetDocValues ordinals() { return ordinals(NO_VALUES); } + /** + * Holder of values + * + * @opensearch.internal + */ public interface ValuesHolder { BytesRef lookupOrd(long ord); diff --git a/server/src/main/java/org/opensearch/index/fielddata/ordinals/OrdinalsBuilder.java b/server/src/main/java/org/opensearch/index/fielddata/ordinals/OrdinalsBuilder.java index 85a9ba5358c3f..ea6baa1f2c684 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/ordinals/OrdinalsBuilder.java +++ b/server/src/main/java/org/opensearch/index/fielddata/ordinals/OrdinalsBuilder.java @@ -84,6 +84,8 @@ public final class OrdinalsBuilder implements Closeable { *

    * In addition to these structures, there is another array which stores the current position (level + slice + offset in the slice) * in order to be able to append data in constant time. + * + * @opensearch.internal */ private static class OrdinalsStore { diff --git a/server/src/main/java/org/opensearch/index/fielddata/ordinals/SinglePackedOrdinals.java b/server/src/main/java/org/opensearch/index/fielddata/ordinals/SinglePackedOrdinals.java index 90582079d3f76..a3007cded317e 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/ordinals/SinglePackedOrdinals.java +++ b/server/src/main/java/org/opensearch/index/fielddata/ordinals/SinglePackedOrdinals.java @@ -84,6 +84,11 @@ public SortedSetDocValues ordinals(ValuesHolder values) { return (SortedSetDocValues) DocValues.singleton(new Docs(this, values)); } + /** + * Doc class + * + * @opensearch.internal + */ private static class Docs extends AbstractSortedDocValues { private final int maxOrd; diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/AbstractIndexOrdinalsFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/AbstractIndexOrdinalsFieldData.java index 7dab513372235..0b3a5e09064ab 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/AbstractIndexOrdinalsFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/AbstractIndexOrdinalsFieldData.java @@ -182,6 +182,8 @@ public boolean supportsGlobalOrdinalsMapping() { *

    * Note that the .beforeLoad(...) and .afterLoad(...) methods must be * manually called. + * + * @opensearch.internal */ public interface PerValueEstimator { diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/AbstractLatLonPointIndexFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/AbstractLatLonPointIndexFieldData.java index d094acf4ca79d..6e9a13074a445 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/AbstractLatLonPointIndexFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/AbstractLatLonPointIndexFieldData.java @@ -100,6 +100,11 @@ public BucketedSort newBucketedSort( throw new IllegalArgumentException("can't sort on geo_point field without using specific sorting feature, like geo_distance"); } + /** + * Lucene LatLonPoint as indexed field data type + * + * @opensearch.internal + */ public static class LatLonPointIndexFieldData extends AbstractLatLonPointIndexFieldData { public LatLonPointIndexFieldData(String fieldName, ValuesSourceType valuesSourceType) { super(fieldName, valuesSourceType); @@ -138,6 +143,11 @@ static void checkCompatible(FieldInfo fieldInfo) { } } + /** + * Builder for LatLonPoint based field data + * + * @opensearch.internal + */ public static class Builder implements IndexFieldData.Builder { private final String name; private final ValuesSourceType valuesSourceType; diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/BinaryIndexFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/BinaryIndexFieldData.java index 6d3c1b8c14430..3fbc605e35e1d 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/BinaryIndexFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/BinaryIndexFieldData.java @@ -54,6 +54,11 @@ */ public class BinaryIndexFieldData implements IndexFieldData { + /** + * Builder for binary index field data + * + * @opensearch.internal + */ public static class Builder implements IndexFieldData.Builder { private final String name; private final ValuesSourceType valuesSourceType; diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/BytesBinaryIndexFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/BytesBinaryIndexFieldData.java index dbcbb26c5287e..e1a08344e68c7 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/BytesBinaryIndexFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/BytesBinaryIndexFieldData.java @@ -107,6 +107,11 @@ public BytesBinaryDVLeafFieldData loadDirect(LeafReaderContext context) throws E return load(context); } + /** + * Builder for bytes binary index field data + * + * @opensearch.internal + */ public static class Builder implements IndexFieldData.Builder { private final String name; private final ValuesSourceType valuesSourceType; diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/ConstantIndexFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/ConstantIndexFieldData.java index 1092b5ecb847f..2b08498f2b58b 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/ConstantIndexFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/ConstantIndexFieldData.java @@ -66,6 +66,11 @@ */ public class ConstantIndexFieldData extends AbstractIndexOrdinalsFieldData { + /** + * Builder for Constant Index Field Data + * + * @opensearch.internal + */ public static class Builder implements IndexFieldData.Builder { private final String constantValue; @@ -84,6 +89,11 @@ public IndexFieldData build(IndexFieldDataCache cache, CircuitBreakerService } } + /** + * Field data for constant values + * + * @opensearch.internal + */ private static class ConstantLeafFieldData extends AbstractLeafOrdinalsFieldData { private final String value; diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/PagedBytesIndexFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/PagedBytesIndexFieldData.java index 4b6cb287a078f..8f6a1e46ef417 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/PagedBytesIndexFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/PagedBytesIndexFieldData.java @@ -74,6 +74,11 @@ public class PagedBytesIndexFieldData extends AbstractIndexOrdinalsFieldData { private final double minFrequency, maxFrequency; private final int minSegmentSize; + /** + * Builder for paged bytes index field data + * + * @opensearch.internal + */ public static class Builder implements IndexFieldData.Builder { private final String name; private final double minFrequency, maxFrequency; @@ -280,6 +285,11 @@ public void afterLoad(TermsEnum termsEnum, long actualUsed) { } } + /** + * A frequency filter + * + * @opensearch.internal + */ private static final class FrequencyFilter extends FilteredTermsEnum { private final int minFreq; private final int maxFreq; diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/PagedBytesLeafFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/PagedBytesLeafFieldData.java index b54dccfb82f8f..0dcdef19b1357 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/PagedBytesLeafFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/PagedBytesLeafFieldData.java @@ -89,6 +89,11 @@ public SortedSetDocValues getOrdinalsValues() { return ordinals.ordinals(new ValuesHolder(bytes, termOrdToBytesOffset)); } + /** + * Value holder for paged bytes leaf field data + * + * @opensearch.internal + */ private static class ValuesHolder implements Ordinals.ValuesHolder { private final BytesRef scratch = new BytesRef(); diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/SortedNumericIndexFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/SortedNumericIndexFieldData.java index 65a3b8563a4ce..3ba11e3071192 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/SortedNumericIndexFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/SortedNumericIndexFieldData.java @@ -69,6 +69,12 @@ * @opensearch.internal */ public class SortedNumericIndexFieldData extends IndexNumericFieldData { + + /** + * Builder for sorted numeric index field data + * + * @opensearch.internal + */ public static class Builder implements IndexFieldData.Builder { private final String name; private final NumericType numericType; @@ -229,6 +235,8 @@ public Object nextValue() throws IOException { * for the case where documents have at most one value. In this case * {@link DocValues#unwrapSingleton(SortedNumericDocValues)} will return * the underlying single-valued NumericDocValues representation. + * + * @opensearch.internal */ static final class SortedNumericLongFieldData extends LeafLongFieldData { final LeafReader reader; @@ -267,6 +275,8 @@ public Collection getChildResources() { * for the case where documents have at most one value. In this case * {@link FieldData#unwrapSingleton(SortedNumericDoubleValues)} will return * the underlying single-valued NumericDoubleValues representation. + * + * @opensearch.internal */ static final class SortedNumericHalfFloatFieldData extends LeafDoubleFieldData { final LeafReader reader; @@ -302,6 +312,8 @@ public Collection getChildResources() { /** * Wraps a NumericDocValues and exposes a single 16-bit float per document. + * + * @opensearch.internal */ static final class SingleHalfFloatValues extends NumericDoubleValues { final NumericDocValues in; @@ -323,6 +335,8 @@ public boolean advanceExact(int doc) throws IOException { /** * Wraps a SortedNumericDocValues and exposes multiple 16-bit floats per document. + * + * @opensearch.internal */ static final class MultiHalfFloatValues extends SortedNumericDoubleValues { final SortedNumericDocValues in; @@ -359,6 +373,8 @@ public int docValueCount() { * for the case where documents have at most one value. In this case * {@link FieldData#unwrapSingleton(SortedNumericDoubleValues)} will return * the underlying single-valued NumericDoubleValues representation. + * + * @opensearch.internal */ static final class SortedNumericFloatFieldData extends LeafDoubleFieldData { final LeafReader reader; @@ -394,6 +410,8 @@ public Collection getChildResources() { /** * Wraps a NumericDocValues and exposes a single 32-bit float per document. + * + * @opensearch.internal */ static final class SingleFloatValues extends NumericDoubleValues { final NumericDocValues in; @@ -415,6 +433,8 @@ public boolean advanceExact(int doc) throws IOException { /** * Wraps a SortedNumericDocValues and exposes multiple 32-bit floats per document. + * + * @opensearch.internal */ static final class MultiFloatValues extends SortedNumericDoubleValues { final SortedNumericDocValues in; @@ -451,6 +471,8 @@ public int docValueCount() { * for the case where documents have at most one value. In this case * {@link FieldData#unwrapSingleton(SortedNumericDoubleValues)} will return * the underlying single-valued NumericDoubleValues representation. + * + * @opensearch.internal */ static final class SortedNumericDoubleFieldData extends LeafDoubleFieldData { final LeafReader reader; diff --git a/server/src/main/java/org/opensearch/index/fielddata/plain/SortedSetOrdinalsIndexFieldData.java b/server/src/main/java/org/opensearch/index/fielddata/plain/SortedSetOrdinalsIndexFieldData.java index 682b3de27a04a..801186bbc4379 100644 --- a/server/src/main/java/org/opensearch/index/fielddata/plain/SortedSetOrdinalsIndexFieldData.java +++ b/server/src/main/java/org/opensearch/index/fielddata/plain/SortedSetOrdinalsIndexFieldData.java @@ -62,6 +62,11 @@ */ public class SortedSetOrdinalsIndexFieldData extends AbstractIndexOrdinalsFieldData { + /** + * Builder for sorted set ordinals + * + * @opensearch.internal + */ public static class Builder implements IndexFieldData.Builder { private final String name; private final Function> scriptFunction; diff --git a/server/src/main/java/org/opensearch/index/flush/FlushStats.java b/server/src/main/java/org/opensearch/index/flush/FlushStats.java index 2490f22416c83..94be2c02df51b 100644 --- a/server/src/main/java/org/opensearch/index/flush/FlushStats.java +++ b/server/src/main/java/org/opensearch/index/flush/FlushStats.java @@ -125,6 +125,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Fields for flush statistics + * + * @opensearch.internal + */ static final class Fields { static final String FLUSH = "flush"; static final String TOTAL = "total"; diff --git a/server/src/main/java/org/opensearch/index/get/GetStats.java b/server/src/main/java/org/opensearch/index/get/GetStats.java index 06dc19e6349c1..54f6dc679fadd 100644 --- a/server/src/main/java/org/opensearch/index/get/GetStats.java +++ b/server/src/main/java/org/opensearch/index/get/GetStats.java @@ -145,6 +145,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Fields for get statistics + * + * @opensearch.internal + */ static final class Fields { static final String GET = "get"; static final String TOTAL = "total"; diff --git a/server/src/main/java/org/opensearch/index/mapper/AbstractGeometryFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/AbstractGeometryFieldMapper.java index dd7a1fd3e027a..a4d8222896bc3 100644 --- a/server/src/main/java/org/opensearch/index/mapper/AbstractGeometryFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/AbstractGeometryFieldMapper.java @@ -67,11 +67,21 @@ */ public abstract class AbstractGeometryFieldMapper extends FieldMapper { + /** + * String parameter names for the base geometry field mapper + * + * @opensearch.internal + */ public static class Names { public static final ParseField IGNORE_MALFORMED = new ParseField("ignore_malformed"); public static final ParseField IGNORE_Z_VALUE = new ParseField("ignore_z_value"); } + /** + * Default parameters for the base geometry field mapper + * + * @opensearch.internal + */ public static class Defaults { public static final Explicit IGNORE_MALFORMED = new Explicit<>(false, false); public static final Explicit IGNORE_Z_VALUE = new Explicit<>(true, false); @@ -86,6 +96,8 @@ public static class Defaults { /** * Interface representing an preprocessor in geometry indexing pipeline + * + * @opensearch.internal */ public interface Indexer { Processed prepareForIndexing(Parsed geometry); @@ -97,6 +109,8 @@ public interface Indexer { /** * Interface representing parser in geometry indexing pipeline. + * + * @opensearch.internal */ public abstract static class Parser { /** @@ -143,6 +157,11 @@ public Object parseAndFormatObject(Object value, String format) { } } + /** + * Builder for the base geometry field mapper + * + * @opensearch.internal + */ public abstract static class Builder, FT extends AbstractGeometryFieldType> extends FieldMapper.Builder { protected Boolean ignoreMalformed; protected Boolean ignoreZValue; @@ -200,6 +219,11 @@ public Builder ignoreZValue(final boolean ignoreZValue) { } } + /** + * Base type parser for geometry field mappers + * + * @opensearch.internal + */ public abstract static class TypeParser implements Mapper.TypeParser { protected abstract T newBuilder(String name, Map params); @@ -243,6 +267,11 @@ public T parse(String name, Map node, ParserContext parserContex } } + /** + * Base field type for all geometry fields + * + * @opensearch.internal + */ public abstract static class AbstractGeometryFieldType extends MappedFieldType { protected Indexer geometryIndexer; diff --git a/server/src/main/java/org/opensearch/index/mapper/AbstractPointGeometryFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/AbstractPointGeometryFieldMapper.java index a5e8f4d1d10e4..b546eeca1ec0a 100644 --- a/server/src/main/java/org/opensearch/index/mapper/AbstractPointGeometryFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/AbstractPointGeometryFieldMapper.java @@ -63,6 +63,11 @@ */ public abstract class AbstractPointGeometryFieldMapper extends AbstractGeometryFieldMapper { + /** + * Common parameter names for the base point geometry field mapper + * + * @opensearch.internal + */ public static class Names extends AbstractGeometryFieldMapper.Names { public static final ParseField NULL_VALUE = new ParseField("null_value"); } @@ -74,6 +79,11 @@ public static class Names extends AbstractGeometryFieldMapper.Names { DEFAULT_FIELD_TYPE.freeze(); } + /** + * Base builder for the base point geometry field mapper + * + * @opensearch.internal + */ public abstract static class Builder, FT extends AbstractPointGeometryFieldType> extends AbstractGeometryFieldMapper.Builder { @@ -113,6 +123,11 @@ public AbstractPointGeometryFieldMapper build(BuilderContext context) { } } + /** + * Base type parser for the base point geometry field mapper + * + * @opensearch.internal + */ public abstract static class TypeParser extends AbstractGeometryFieldMapper.TypeParser { protected abstract ParsedPoint parseNullValue(Object nullValue, boolean ignoreZValue, boolean ignoreMalformed); @@ -144,6 +159,11 @@ public T parse(String name, Map node, Map params ParsedPoint nullValue; + /** + * Base field type for the base point geometry field mapper + * + * @opensearch.internal + */ public abstract static class AbstractPointGeometryFieldType extends AbstractGeometryFieldType { protected AbstractPointGeometryFieldType( String name, @@ -197,7 +217,11 @@ public ParsedPoint nullValue() { return nullValue; } - /** represents a Point that has been parsed by {@link PointParser} */ + /** + * represents a Point that has been parsed by {@link PointParser} + * + * @opensearch.internal + */ public interface ParsedPoint { void validate(String fieldName); @@ -212,7 +236,11 @@ default boolean isNormalizable(double coord) { } } - /** A parser implementation that can parse the various point formats */ + /** + * A parser implementation that can parse the various point formats + * + * @opensearch.internal + */ public static class PointParser

    extends Parser> { /** * Note that this parser is only used for formatting values. diff --git a/server/src/main/java/org/opensearch/index/mapper/AbstractShapeGeometryFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/AbstractShapeGeometryFieldMapper.java index 4586360f8ce82..8f3e76f7bc4dd 100644 --- a/server/src/main/java/org/opensearch/index/mapper/AbstractShapeGeometryFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/AbstractShapeGeometryFieldMapper.java @@ -53,16 +53,31 @@ */ public abstract class AbstractShapeGeometryFieldMapper extends AbstractGeometryFieldMapper { + /** + * Common parameters for the base shape geometry field mapper + * + * @opensearch.internal + */ public static class Names extends AbstractGeometryFieldMapper.Names { public static final ParseField ORIENTATION = new ParseField("orientation"); public static final ParseField COERCE = new ParseField("coerce"); } + /** + * Parameter defaults for the base shape geometry field mapper + * + * @opensearch.internal + */ public static class Defaults extends AbstractGeometryFieldMapper.Defaults { public static final Explicit ORIENTATION = new Explicit<>(Orientation.RIGHT, false); public static final Explicit COERCE = new Explicit<>(false, false); } + /** + * Base builder for the base shape geometry field mapper + * + * @opensearch.internal + */ public abstract static class Builder, FT extends AbstractShapeGeometryFieldType> extends AbstractGeometryFieldMapper.Builder { protected Boolean coerce; @@ -124,6 +139,11 @@ protected Explicit orientation() { protected static final String DEPRECATED_PARAMETERS_KEY = "deprecated_parameters"; + /** + * Base type parser for the base shape geometry field mapper + * + * @opensearch.internal + */ public abstract static class TypeParser extends AbstractGeometryFieldMapper.TypeParser { protected abstract Builder newBuilder(String name, Map params); @@ -180,6 +200,11 @@ public Builder parse(String name, Map node, Map } } + /** + * Base field type for the base shape geometry field mapper + * + * @opensearch.internal + */ public abstract static class AbstractShapeGeometryFieldType extends AbstractGeometryFieldType { protected Orientation orientation = Defaults.ORIENTATION.value(); diff --git a/server/src/main/java/org/opensearch/index/mapper/BinaryFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/BinaryFieldMapper.java index ccc532d0539be..fdcaaf6ba36c8 100644 --- a/server/src/main/java/org/opensearch/index/mapper/BinaryFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/BinaryFieldMapper.java @@ -72,6 +72,11 @@ private static BinaryFieldMapper toType(FieldMapper in) { return (BinaryFieldMapper) in; } + /** + * Builder for the binary field mapper + * + * @opensearch.internal + */ public static class Builder extends ParametrizedFieldMapper.Builder { private final Parameter stored = Parameter.storeParam(m -> toType(m).stored, false); @@ -106,6 +111,11 @@ public BinaryFieldMapper build(BuilderContext context) { public static final TypeParser PARSER = new TypeParser((n, c) -> new Builder(n)); + /** + * Binary field type + * + * @opensearch.internal + */ public static final class BinaryFieldType extends MappedFieldType { private BinaryFieldType(String name, boolean isStored, boolean hasDocValues, Map meta) { @@ -223,6 +233,11 @@ protected String contentType() { return CONTENT_TYPE; } + /** + * Custom binary doc values field for the binary field mapper + * + * @opensearch.internal + */ public static class CustomBinaryDocValuesField extends CustomDocValuesField { private final ObjectArrayList bytesList; diff --git a/server/src/main/java/org/opensearch/index/mapper/BooleanFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/BooleanFieldMapper.java index 5d22a0f097298..81584c4419753 100644 --- a/server/src/main/java/org/opensearch/index/mapper/BooleanFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/BooleanFieldMapper.java @@ -68,6 +68,11 @@ public class BooleanFieldMapper extends ParametrizedFieldMapper { public static final String CONTENT_TYPE = "boolean"; + /** + * Default parameters for the boolean field mapper + * + * @opensearch.internal + */ public static class Defaults { public static final FieldType FIELD_TYPE = new FieldType(); @@ -79,6 +84,11 @@ public static class Defaults { } } + /** + * Values that can be used for this field mapper + * + * @opensearch.internal + */ public static class Values { public static final BytesRef TRUE = new BytesRef("T"); public static final BytesRef FALSE = new BytesRef("F"); @@ -88,6 +98,11 @@ private static BooleanFieldMapper toType(FieldMapper in) { return (BooleanFieldMapper) in; } + /** + * Builder for this field mapper + * + * @opensearch.internal + */ public static class Builder extends ParametrizedFieldMapper.Builder { private final Parameter docValues = Parameter.docValuesParam(m -> toType(m).hasDocValues, true); @@ -131,6 +146,11 @@ public BooleanFieldMapper build(BuilderContext context) { public static final TypeParser PARSER = new TypeParser((n, c) -> new Builder(n)); + /** + * Field type for boolean field mapper + * + * @opensearch.internal + */ public static final class BooleanFieldType extends TermBasedFieldType { private final Boolean nullValue; diff --git a/server/src/main/java/org/opensearch/index/mapper/CompletionFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/CompletionFieldMapper.java index 73b2603f16221..143ee9a96a00c 100644 --- a/server/src/main/java/org/opensearch/index/mapper/CompletionFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/CompletionFieldMapper.java @@ -106,6 +106,11 @@ public ParametrizedFieldMapper.Builder getMergeBuilder() { return new Builder(simpleName(), defaultAnalyzer, indexVersionCreated).init(this); } + /** + * Default parameters + * + * @opensearch.internal + */ public static class Defaults { public static final FieldType FIELD_TYPE = new FieldType(); static { @@ -121,6 +126,11 @@ public static class Defaults { public static final int DEFAULT_MAX_INPUT_LENGTH = 50; } + /** + * Parameter fields + * + * @opensearch.internal + */ public static class Fields { // Content field names public static final String CONTENT_FIELD_NAME_INPUT = "input"; @@ -134,6 +144,8 @@ private static CompletionFieldMapper toType(FieldMapper in) { /** * Builder for {@link CompletionFieldMapper} + * + * @opensearch.internal */ public static class Builder extends ParametrizedFieldMapper.Builder { @@ -255,6 +267,11 @@ private void checkCompletionContextsLimit(BuilderContext context) { (n, c) -> new Builder(n, c.getIndexAnalyzers().get("simple"), c.indexVersionCreated()) ); + /** + * Field type for Completion Field Mapper + * + * @opensearch.internal + */ public static final class CompletionFieldType extends TermBasedFieldType { private static PostingsFormat postingsFormat; @@ -608,6 +625,11 @@ private void parse(ParseContext parseContext, Token token, XContentParser parser } } + /** + * Metadata for completion input + * + * @opensearch.internal + */ static class CompletionInputMetadata { public final String input; public final Map> contexts; diff --git a/server/src/main/java/org/opensearch/index/mapper/DataStreamFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/DataStreamFieldMapper.java index a94d85916338a..4d03d5f67e7d5 100644 --- a/server/src/main/java/org/opensearch/index/mapper/DataStreamFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/DataStreamFieldMapper.java @@ -32,11 +32,21 @@ public class DataStreamFieldMapper extends MetadataFieldMapper { public static final String NAME = "_data_stream_timestamp"; public static final String CONTENT_TYPE = "_data_stream_timestamp"; + /** + * Default parameters + * + * @opensearch.internal + */ public static final class Defaults { public static final boolean ENABLED = false; public static final TimestampField TIMESTAMP_FIELD = new TimestampField("@timestamp"); } + /** + * Builder for the field mapper + * + * @opensearch.internal + */ public static final class Builder extends MetadataFieldMapper.Builder { final Parameter enabledParam = Parameter.boolParam("enabled", false, mapper -> toType(mapper).enabled, Defaults.ENABLED); @@ -63,6 +73,11 @@ public MetadataFieldMapper build(BuilderContext context) { } } + /** + * Field type for data stream field mapper + * + * @opensearch.internal + */ public static final class DataStreamFieldType extends MappedFieldType { public static final DataStreamFieldType INSTANCE = new DataStreamFieldType(); diff --git a/server/src/main/java/org/opensearch/index/mapper/DateFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/DateFieldMapper.java index 0aef814f3dedb..8e01c1f41f078 100644 --- a/server/src/main/java/org/opensearch/index/mapper/DateFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/DateFieldMapper.java @@ -94,6 +94,11 @@ public final class DateFieldMapper extends ParametrizedFieldMapper { public static final String DATE_NANOS_CONTENT_TYPE = "date_nanos"; public static final DateFormatter DEFAULT_DATE_TIME_FORMATTER = DateFormatter.forPattern("strict_date_optional_time||epoch_millis"); + /** + * Resolution of the date time + * + * @opensearch.internal + */ public enum Resolution { MILLISECONDS(CONTENT_TYPE, NumericType.DATE) { @Override @@ -201,6 +206,11 @@ private static DateFieldMapper toType(FieldMapper in) { return (DateFieldMapper) in; } + /** + * Builder for the date field mapper + * + * @opensearch.internal + */ public static class Builder extends ParametrizedFieldMapper.Builder { private final Parameter index = Parameter.indexParam(m -> toType(m).indexed, true); @@ -312,6 +322,11 @@ public DateFieldMapper build(BuilderContext context) { return new Builder(n, Resolution.NANOSECONDS, c.getDateFormatter(), ignoreMalformedByDefault, c.indexVersionCreated()); }); + /** + * Field type for date field mapper + * + * @opensearch.internal + */ public static final class DateFieldType extends MappedFieldType { protected final DateFormatter dateTimeFormatter; protected final DateMathParser dateMathParser; diff --git a/server/src/main/java/org/opensearch/index/mapper/DocValueFetcher.java b/server/src/main/java/org/opensearch/index/mapper/DocValueFetcher.java index dd15f72bbd45e..bf14af809fbfd 100644 --- a/server/src/main/java/org/opensearch/index/mapper/DocValueFetcher.java +++ b/server/src/main/java/org/opensearch/index/mapper/DocValueFetcher.java @@ -74,6 +74,11 @@ public List fetchValues(SourceLookup lookup) throws IOException { return result; } + /** + * Leaf interface + * + * @opensearch.internal + */ public interface Leaf { /** * Advance the doc values reader to the provided doc. diff --git a/server/src/main/java/org/opensearch/index/mapper/DocumentMapper.java b/server/src/main/java/org/opensearch/index/mapper/DocumentMapper.java index 6c3851315fc60..1e5b3b4a9c93e 100644 --- a/server/src/main/java/org/opensearch/index/mapper/DocumentMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/DocumentMapper.java @@ -70,6 +70,11 @@ */ public class DocumentMapper implements ToXContentFragment { + /** + * Builder for the Document Field Mapper + * + * @opensearch.internal + */ public static class Builder { private final Map, MetadataFieldMapper> metadataMappers = new LinkedHashMap<>(); diff --git a/server/src/main/java/org/opensearch/index/mapper/DynamicTemplate.java b/server/src/main/java/org/opensearch/index/mapper/DynamicTemplate.java index 8a418a7272b0a..c91373860213d 100644 --- a/server/src/main/java/org/opensearch/index/mapper/DynamicTemplate.java +++ b/server/src/main/java/org/opensearch/index/mapper/DynamicTemplate.java @@ -51,6 +51,11 @@ */ public class DynamicTemplate implements ToXContentObject { + /** + * Match type of the template + * + * @opensearch.internal + */ public enum MatchType { SIMPLE { @Override @@ -88,7 +93,11 @@ public static MatchType fromString(String value) { public abstract boolean matches(String regex, String value); } - /** The type of a field as detected while parsing a json document. */ + /** + * The type of a field as detected while parsing a json document. + * + * @opensearch.internal + */ public enum XContentFieldType { OBJECT { @Override diff --git a/server/src/main/java/org/opensearch/index/mapper/FieldAliasMapper.java b/server/src/main/java/org/opensearch/index/mapper/FieldAliasMapper.java index 30f7de09e6304..7c0280a7272a0 100644 --- a/server/src/main/java/org/opensearch/index/mapper/FieldAliasMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/FieldAliasMapper.java @@ -52,6 +52,11 @@ public final class FieldAliasMapper extends Mapper { public static final String CONTENT_TYPE = "alias"; + /** + * Parameter names + * + * @opensearch.internal + */ public static class Names { public static final String PATH = "path"; } @@ -138,6 +143,11 @@ public void validate(MappingLookup mappers) { } } + /** + * The type parser + * + * @opensearch.internal + */ public static class TypeParser implements Mapper.TypeParser { @Override public Mapper.Builder parse(String name, Map node, ParserContext parserContext) throws MapperParsingException { @@ -151,6 +161,11 @@ public Mapper.Builder parse(String name, Map node, ParserContext } } + /** + * The bulider for the field alias field mapper + * + * @opensearch.internal + */ public static class Builder extends Mapper.Builder { private String name; private String path; diff --git a/server/src/main/java/org/opensearch/index/mapper/FieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/FieldMapper.java index bd5a671887ef2..137ca4be1ca87 100644 --- a/server/src/main/java/org/opensearch/index/mapper/FieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/FieldMapper.java @@ -73,6 +73,11 @@ public abstract class FieldMapper extends Mapper implements Cloneable { ); public static final Setting COERCE_SETTING = Setting.boolSetting("index.mapping.coerce", false, Property.IndexScope); + /** + * Base builder for all field mappers + * + * @opensearch.internal + */ public abstract static class Builder> extends Mapper.Builder { protected final FieldType fieldType; @@ -560,12 +565,22 @@ protected static String indexOptionToString(IndexOptions indexOption) { protected abstract String contentType(); + /** + * Multi field implementation used across field mappers + * + * @opensearch.internal + */ public static class MultiFields implements Iterable { public static MultiFields empty() { return new MultiFields(ImmutableOpenMap.of()); } + /** + * Concrete builder for field mappers + * + * @opensearch.internal + */ public static class Builder { private final ImmutableOpenMap.Builder mapperBuilders = ImmutableOpenMap.builder(); @@ -689,6 +704,8 @@ public int compare(Mapper o1, Mapper o2) { /** * Represents a list of fields with optional boost factor where the current field should be copied to + * + * @opensearch.internal */ public static class CopyTo { @@ -715,6 +732,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Builder for the copyTo field + * + * @opensearch.internal + */ public static class Builder { private final List copyToBuilders = new ArrayList<>(); diff --git a/server/src/main/java/org/opensearch/index/mapper/FieldNamesFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/FieldNamesFieldMapper.java index 24793e916047b..dc2ea1f35f8b8 100644 --- a/server/src/main/java/org/opensearch/index/mapper/FieldNamesFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/FieldNamesFieldMapper.java @@ -64,6 +64,11 @@ public ParametrizedFieldMapper.Builder getMergeBuilder() { return new Builder(indexVersionCreated).init(this); } + /** + * Parameter defaults + * + * @opensearch.internal + */ public static class Defaults { public static final String NAME = FieldNamesFieldMapper.NAME; @@ -87,6 +92,11 @@ private static FieldNamesFieldMapper toType(FieldMapper in) { "Disabling _field_names is not necessary because it no longer carries a large index overhead. Support for the `enabled` " + "setting will be removed in a future major version. Please remove it from your mappings and templates."; + /** + * Builder for the FieldNames field mapper + * + * @opensearch.internal + */ static class Builder extends MetadataFieldMapper.Builder { private final Parameter> enabled = updateableBoolParam( @@ -122,6 +132,11 @@ public FieldNamesFieldMapper build(BuilderContext context) { c -> new Builder(c.indexVersionCreated()) ); + /** + * Field type for FieldNames field mapper + * + * @opensearch.internal + */ public static final class FieldNamesFieldType extends TermBasedFieldType { private final boolean enabled; diff --git a/server/src/main/java/org/opensearch/index/mapper/GeoPointFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/GeoPointFieldMapper.java index 3dfdfdb87f8b9..e3dab3f892949 100644 --- a/server/src/main/java/org/opensearch/index/mapper/GeoPointFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/GeoPointFieldMapper.java @@ -78,6 +78,11 @@ public class GeoPointFieldMapper extends AbstractPointGeometryFieldMapper { public Builder(String name) { @@ -107,6 +112,11 @@ public GeoPointFieldMapper build( } } + /** + * Concrete parser for geo_point types + * + * @opensearch.internal + */ public static class TypeParser extends AbstractPointGeometryFieldMapper.TypeParser { @Override protected Builder newBuilder(String name, Map params) { @@ -189,6 +199,11 @@ public GeoPointFieldType fieldType() { return (GeoPointFieldType) mappedFieldType; } + /** + * Concrete field type for geo_point + * + * @opensearch.internal + */ public static class GeoPointFieldType extends AbstractPointGeometryFieldType, List> implements GeoShapeQueryable { @@ -242,6 +257,11 @@ public Query distanceFeatureQuery(Object origin, String pivot, float boost, Quer // Eclipse requires the AbstractPointGeometryFieldMapper prefix or it can't find ParsedPoint // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=565255 + /** + * A geo point parsed from geojson + * + * @opensearch.internal + */ protected static class ParsedGeoPoint extends GeoPoint implements AbstractPointGeometryFieldMapper.ParsedPoint { @Override public void validate(String fieldName) { @@ -299,6 +319,11 @@ public int hashCode() { } } + /** + * The indexer for geo_point + * + * @opensearch.internal + */ protected static class GeoPointIndexer implements Indexer, List> { protected final GeoPointFieldType fieldType; diff --git a/server/src/main/java/org/opensearch/index/mapper/GeoShapeFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/GeoShapeFieldMapper.java index aeda2a2d93f12..f0cc6839d6e7c 100644 --- a/server/src/main/java/org/opensearch/index/mapper/GeoShapeFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/GeoShapeFieldMapper.java @@ -78,6 +78,11 @@ public class GeoShapeFieldMapper extends AbstractShapeGeometryFieldMapper { public Builder(String name) { @@ -110,6 +115,11 @@ public GeoShapeFieldMapper build(BuilderContext context) { } } + /** + * Concrete field type for geo_shape fields + * + * @opensearch.internal + */ public static class GeoShapeFieldType extends AbstractShapeGeometryFieldType implements GeoShapeQueryable { private final VectorGeoShapeQueryProcessor queryProcessor; @@ -130,6 +140,11 @@ public Query geoShapeQuery(Geometry shape, String fieldName, ShapeRelation relat } } + /** + * The type parser + * + * @opensearch.internal + */ public static final class TypeParser extends AbstractShapeGeometryFieldMapper.TypeParser { @Override diff --git a/server/src/main/java/org/opensearch/index/mapper/GeoShapeIndexer.java b/server/src/main/java/org/opensearch/index/mapper/GeoShapeIndexer.java index 8a1712c0f9645..758798dc514c2 100644 --- a/server/src/main/java/org/opensearch/index/mapper/GeoShapeIndexer.java +++ b/server/src/main/java/org/opensearch/index/mapper/GeoShapeIndexer.java @@ -202,6 +202,11 @@ public List indexShape(ParseContext context, Geometry shape) { return visitor.fields(); } + /** + * The shape indexer + * + * @opensearch.internal + */ private static class LuceneGeometryIndexer implements GeometryVisitor { private List fields = new ArrayList<>(); private final String name; diff --git a/server/src/main/java/org/opensearch/index/mapper/IdFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/IdFieldMapper.java index a3c4153ec5373..4b1395ac02bf1 100644 --- a/server/src/main/java/org/opensearch/index/mapper/IdFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/IdFieldMapper.java @@ -87,6 +87,11 @@ public class IdFieldMapper extends MetadataFieldMapper { public static final String CONTENT_TYPE = "_id"; + /** + * Default parameters + * + * @opensearch.internal + */ public static class Defaults { public static final String NAME = IdFieldMapper.NAME; @@ -112,6 +117,11 @@ public static class Defaults { public static final TypeParser PARSER = new FixedTypeParser(c -> new IdFieldMapper(() -> c.mapperService().isIdFieldDataEnabled())); + /** + * Field type for ID field + * + * @opensearch.internal + */ static final class IdFieldType extends TermBasedFieldType { private final Supplier fieldDataEnabled; diff --git a/server/src/main/java/org/opensearch/index/mapper/IgnoredFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/IgnoredFieldMapper.java index 69e0c414bbcde..0db795d99c7e0 100644 --- a/server/src/main/java/org/opensearch/index/mapper/IgnoredFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/IgnoredFieldMapper.java @@ -53,6 +53,11 @@ public final class IgnoredFieldMapper extends MetadataFieldMapper { public static final String CONTENT_TYPE = "_ignored"; + /** + * Default parameters + * + * @opensearch.internal + */ public static class Defaults { public static final String NAME = IgnoredFieldMapper.NAME; @@ -69,6 +74,11 @@ public static class Defaults { public static final TypeParser PARSER = new FixedTypeParser(c -> new IgnoredFieldMapper()); + /** + * Field type for Ignored fields + * + * @opensearch.internal + */ public static final class IgnoredFieldType extends StringFieldType { public static final IgnoredFieldType INSTANCE = new IgnoredFieldType(); diff --git a/server/src/main/java/org/opensearch/index/mapper/IndexFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/IndexFieldMapper.java index 22feeed3fe675..8cc307f7697c6 100644 --- a/server/src/main/java/org/opensearch/index/mapper/IndexFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/IndexFieldMapper.java @@ -57,6 +57,11 @@ public class IndexFieldMapper extends MetadataFieldMapper { public static final TypeParser PARSER = new FixedTypeParser(c -> new IndexFieldMapper()); + /** + * Field type for Index field mapper + * + * @opensearch.internal + */ static final class IndexFieldType extends ConstantFieldType { static final IndexFieldType INSTANCE = new IndexFieldType(); diff --git a/server/src/main/java/org/opensearch/index/mapper/IpFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/IpFieldMapper.java index aa5a5638776cf..2a677d8bc1352 100644 --- a/server/src/main/java/org/opensearch/index/mapper/IpFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/IpFieldMapper.java @@ -78,6 +78,11 @@ private static IpFieldMapper toType(FieldMapper in) { return (IpFieldMapper) in; } + /** + * Builder + * + * @opensearch.internal + */ public static class Builder extends ParametrizedFieldMapper.Builder { private final Parameter indexed = Parameter.indexParam(m -> toType(m).indexed, true); @@ -155,6 +160,11 @@ public IpFieldMapper build(BuilderContext context) { return new Builder(n, ignoreMalformedByDefault, c.indexVersionCreated()); }); + /** + * Field type for IP fields + * + * @opensearch.internal + */ public static final class IpFieldType extends SimpleMappedFieldType { private final InetAddress nullValue; @@ -305,6 +315,11 @@ public static Query rangeQuery( return builder.apply(lower, upper); } + /** + * Field type for IP Scripted doc values + * + * @opensearch.internal + */ public static final class IpScriptDocValues extends ScriptDocValues { private final SortedSetDocValues in; diff --git a/server/src/main/java/org/opensearch/index/mapper/KeywordFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/KeywordFieldMapper.java index cde2fb1b93668..0b85ba0d2ccd8 100644 --- a/server/src/main/java/org/opensearch/index/mapper/KeywordFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/KeywordFieldMapper.java @@ -68,6 +68,11 @@ public final class KeywordFieldMapper extends ParametrizedFieldMapper { public static final String CONTENT_TYPE = "keyword"; + /** + * Default parameters + * + * @opensearch.internal + */ public static class Defaults { public static final FieldType FIELD_TYPE = new FieldType(); @@ -79,6 +84,11 @@ public static class Defaults { } } + /** + * The keyword field for the field mapper + * + * @opensearch.internal + */ public static class KeywordField extends Field { public KeywordField(String field, BytesRef term, FieldType ft) { @@ -91,6 +101,11 @@ private static KeywordFieldMapper toType(FieldMapper in) { return (KeywordFieldMapper) in; } + /** + * The builder for the field mapper + * + * @opensearch.internal + */ public static class Builder extends ParametrizedFieldMapper.Builder { private final Parameter indexed = Parameter.indexParam(m -> toType(m).indexed, true); @@ -225,6 +240,11 @@ public KeywordFieldMapper build(BuilderContext context) { public static final TypeParser PARSER = new TypeParser((n, c) -> new Builder(n, c.getIndexAnalyzers())); + /** + * Field type for keyword fields + * + * @opensearch.internal + */ public static final class KeywordFieldType extends StringFieldType { private final int ignoreAbove; diff --git a/server/src/main/java/org/opensearch/index/mapper/LegacyGeoShapeFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/LegacyGeoShapeFieldMapper.java index fc64d173d75f2..71d76c6a835c2 100644 --- a/server/src/main/java/org/opensearch/index/mapper/LegacyGeoShapeFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/LegacyGeoShapeFieldMapper.java @@ -101,8 +101,18 @@ public class LegacyGeoShapeFieldMapper extends AbstractShapeGeometryFieldMapper< public static final String CONTENT_TYPE = "geo_shape"; + /** + * Legacy prefix tree parameters that are now deprecated + * + * @opensearch.internal + */ @Deprecated public static class DeprecatedParameters { + /** + * Deprecated parameter names for Prefix trees + * + * @opensearch.internal + */ public static class Names { public static final ParseField STRATEGY = new ParseField("strategy"); public static final ParseField TREE = new ParseField("tree"); @@ -112,12 +122,22 @@ public static class Names { public static final ParseField POINTS_ONLY = new ParseField("points_only"); } + /** + * Deprecated prefix tree types + * + * @opensearch.internal + */ public static class PrefixTrees { public static final String LEGACY_QUADTREE = "legacyquadtree"; public static final String QUADTREE = "quadtree"; public static final String GEOHASH = "geohash"; } + /** + * Deprecated defaults for legacy prefix trees + * + * @opensearch.internal + */ public static class Defaults { public static final SpatialStrategy STRATEGY = SpatialStrategy.RECURSIVE; public static final String TREE = "quadtree"; @@ -203,6 +223,11 @@ private static void checkPrefixTreeSupport(String fieldName) { private static final DeprecationLogger DEPRECATION_LOGGER = DeprecationLogger.getLogger(LegacyGeoShapeFieldMapper.class); + /** + * The builder for the deprecated prefix tree implementation + * + * @opensearch.internal + */ public static class Builder extends AbstractShapeGeometryFieldMapper.Builder { DeprecatedParameters deprecatedParameters; @@ -325,6 +350,11 @@ public LegacyGeoShapeFieldMapper build(BuilderContext context) { } } + /** + * A legacy parser for prefix trees + * + * @opensearch.internal + */ private static class LegacyGeoShapeParser extends Parser> { /** * Note that this parser is only used for formatting values. @@ -347,6 +377,11 @@ public Object format(ShapeBuilder value, String format) { } } + /** + * Field type for GeoShape fields + * + * @opensearch.internal + */ public static final class GeoShapeFieldType extends AbstractShapeGeometryFieldType, Shape> implements GeoShapeQueryable { diff --git a/server/src/main/java/org/opensearch/index/mapper/MappedFieldType.java b/server/src/main/java/org/opensearch/index/mapper/MappedFieldType.java index e37325b246727..ead901a25e6fd 100644 --- a/server/src/main/java/org/opensearch/index/mapper/MappedFieldType.java +++ b/server/src/main/java/org/opensearch/index/mapper/MappedFieldType.java @@ -378,6 +378,8 @@ public IntervalsSource intervals(String query, int max_gaps, IntervalMode mode, /** * An enum used to describe the relation between the range of terms in a * shard when compared with a query range + * + * @opensearch.internal */ public enum Relation { WITHIN, diff --git a/server/src/main/java/org/opensearch/index/mapper/Mapper.java b/server/src/main/java/org/opensearch/index/mapper/Mapper.java index 2f763ec0e35c1..0a0f32597a2d1 100644 --- a/server/src/main/java/org/opensearch/index/mapper/Mapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/Mapper.java @@ -55,6 +55,11 @@ */ public abstract class Mapper implements ToXContentFragment, Iterable { + /** + * The builder context used in field mappings + * + * @opensearch.internal + */ public static class BuilderContext { private final Settings indexSettings; private final ContentPath contentPath; @@ -86,6 +91,11 @@ public Version indexCreatedVersionOrDefault(@Nullable Version defaultValue) { } } + /** + * Base mapper builder + * + * @opensearch.internal + */ public abstract static class Builder { public String name; @@ -104,8 +114,18 @@ public String name() { public abstract Mapper build(BuilderContext context); } + /** + * Type parser for the mapper + * + * @opensearch.internal + */ public interface TypeParser { + /** + * Parser context for the type parser + * + * @opensearch.internal + */ class ParserContext { private final Function similarityLookupService; @@ -200,6 +220,11 @@ public ParserContext createMultiFieldContext(ParserContext in) { return new MultiFieldParserContext(in); } + /** + * Base mutiple field parser context + * + * @opensearch.internal + */ static class MultiFieldParserContext extends ParserContext { MultiFieldParserContext(ParserContext in) { super( diff --git a/server/src/main/java/org/opensearch/index/mapper/MapperService.java b/server/src/main/java/org/opensearch/index/mapper/MapperService.java index 980259fec7e44..f0d0b77396b0e 100644 --- a/server/src/main/java/org/opensearch/index/mapper/MapperService.java +++ b/server/src/main/java/org/opensearch/index/mapper/MapperService.java @@ -96,6 +96,8 @@ public class MapperService extends AbstractIndexComponent implements Closeable { /** * The reason why a mapping is being merged. + * + * @opensearch.internal */ public enum MergeReason { /** diff --git a/server/src/main/java/org/opensearch/index/mapper/MetadataFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/MetadataFieldMapper.java index b4142de9b097c..17a2451bf4dd1 100644 --- a/server/src/main/java/org/opensearch/index/mapper/MetadataFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/MetadataFieldMapper.java @@ -47,6 +47,11 @@ */ public abstract class MetadataFieldMapper extends ParametrizedFieldMapper { + /** + * Type parser for the field mapper + * + * @opensearch.internal + */ public interface TypeParser extends Mapper.TypeParser { @Override @@ -91,6 +96,8 @@ public static Parameter> updateableBoolParam( /** * A type parser for an unconfigurable metadata field. + * + * @opensearch.internal */ public static class FixedTypeParser implements TypeParser { @@ -111,6 +118,11 @@ public MetadataFieldMapper getDefault(MappedFieldType defaultFieldType, ParserCo } } + /** + * Type parser that is configurable + * + * @opensearch.internal + */ public static class ConfigurableTypeParser implements TypeParser { final Function defaultMapperParser; @@ -137,6 +149,11 @@ public MetadataFieldMapper getDefault(MappedFieldType defaultFieldType, ParserCo } } + /** + * Base builder for internal metadata fields + * + * @opensearch.internal + */ public abstract static class Builder extends ParametrizedFieldMapper.Builder { protected Builder(String name) { diff --git a/server/src/main/java/org/opensearch/index/mapper/NestedPathFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/NestedPathFieldMapper.java index 6b441df47b9fd..06db3fd38c062 100644 --- a/server/src/main/java/org/opensearch/index/mapper/NestedPathFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/NestedPathFieldMapper.java @@ -31,6 +31,11 @@ public class NestedPathFieldMapper extends MetadataFieldMapper { public static final String LEGACY_NAME = "_type"; public static final String NAME = "_nested_path"; + /** + * Default parameters for the field mapper + * + * @opensearch.internal + */ public static class Defaults { public static final FieldType FIELD_TYPE = new FieldType(); static { @@ -77,7 +82,11 @@ public static Query filter(Version version, String path) { return new TermQuery(new Term(name(version), new BytesRef(path))); } - /** field type for the NestPath field */ + /** + * field type for the NestPath field + * + * @opensearch.internal + */ public static final class NestedPathFieldType extends StringFieldType { private NestedPathFieldType(String name) { super(name, true, false, false, TextSearchInfo.SIMPLE_MATCH_ONLY, Collections.emptyMap()); diff --git a/server/src/main/java/org/opensearch/index/mapper/NumberFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/NumberFieldMapper.java index 343a1235ba8e6..92b970895837f 100644 --- a/server/src/main/java/org/opensearch/index/mapper/NumberFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/NumberFieldMapper.java @@ -90,6 +90,11 @@ private static NumberFieldMapper toType(FieldMapper in) { return (NumberFieldMapper) in; } + /** + * Builder for the number field mappers + * + * @opensearch.internal + */ public static class Builder extends ParametrizedFieldMapper.Builder { private final Parameter indexed = Parameter.indexParam(m -> toType(m).indexed, true); @@ -156,6 +161,11 @@ public NumberFieldMapper build(BuilderContext context) { } } + /** + * Type of number + * + * @opensearch.internal + */ public enum NumberType { HALF_FLOAT("half_float", NumericType.HALF_FLOAT) { @Override @@ -964,6 +974,11 @@ public static Query longRangeQuery( } } + /** + * Field type for numeric fields + * + * @opensearch.internal + */ public static class NumberFieldType extends SimpleMappedFieldType { private final NumberType type; diff --git a/server/src/main/java/org/opensearch/index/mapper/ObjectMapper.java b/server/src/main/java/org/opensearch/index/mapper/ObjectMapper.java index 5fbebc0206270..fcbca6049ec0b 100644 --- a/server/src/main/java/org/opensearch/index/mapper/ObjectMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/ObjectMapper.java @@ -67,18 +67,33 @@ public class ObjectMapper extends Mapper implements Cloneable { public static final String CONTENT_TYPE = "object"; public static final String NESTED_CONTENT_TYPE = "nested"; + /** + * Parameter defaults + * + * @opensearch.internal + */ public static class Defaults { public static final boolean ENABLED = true; public static final Nested NESTED = Nested.NO; public static final Dynamic DYNAMIC = null; // not set, inherited from root } + /** + * Dynamic field mapping specification + * + * @opensearch.internal + */ public enum Dynamic { TRUE, FALSE, STRICT } + /** + * Nested objects + * + * @opensearch.internal + */ public static class Nested { public static final Nested NO = new Nested(false, new Explicit<>(false, false), new Explicit<>(false, false)); @@ -150,6 +165,11 @@ public void setIncludeInRoot(boolean value) { } } + /** + * Builder for object field mapper + * + * @opensearch.internal + */ @SuppressWarnings("rawtypes") public static class Builder extends Mapper.Builder { @@ -227,6 +247,11 @@ protected ObjectMapper createMapper( } } + /** + * Type parser for object field mapper + * + * @opensearch.internal + */ public static class TypeParser implements Mapper.TypeParser { @Override public Mapper.Builder parse(String name, Map node, ParserContext parserContext) throws MapperParsingException { diff --git a/server/src/main/java/org/opensearch/index/mapper/ParametrizedFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/ParametrizedFieldMapper.java index 5697d2fffcf3b..26af9b7faeae9 100644 --- a/server/src/main/java/org/opensearch/index/mapper/ParametrizedFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/ParametrizedFieldMapper.java @@ -173,6 +173,8 @@ protected interface SerializerCheck { /** * A configurable parameter for a field mapper * @param the type of the value the parameter holds + * + * @opensearch.internal */ public static final class Parameter implements Supplier { @@ -544,6 +546,11 @@ public static Parameter boostParam() { } + /** + * Conflicts in the field mapper + * + * @opensearch.internal + */ private static final class Conflicts { private final String mapperName; @@ -569,6 +576,8 @@ void check() { /** * A Builder for a ParametrizedFieldMapper + * + * @opensearch.internal */ public abstract static class Builder extends Mapper.Builder { @@ -725,6 +734,8 @@ private static boolean isDeprecatedParameter(String propName, Version indexCreat /** * TypeParser implementation that automatically handles parsing + * + * @opensearch.internal */ public static final class TypeParser implements Mapper.TypeParser { diff --git a/server/src/main/java/org/opensearch/index/mapper/ParseContext.java b/server/src/main/java/org/opensearch/index/mapper/ParseContext.java index 3dd68bb6d7c58..24f27139f6f4c 100644 --- a/server/src/main/java/org/opensearch/index/mapper/ParseContext.java +++ b/server/src/main/java/org/opensearch/index/mapper/ParseContext.java @@ -56,7 +56,11 @@ */ public abstract class ParseContext implements Iterable { - /** Fork of {@link org.apache.lucene.document.Document} with additional functionality. */ + /** + * Fork of {@link org.apache.lucene.document.Document} with additional functionality. + * + * @opensearch.internal + */ public static class Document implements Iterable { private final Document parent; @@ -171,6 +175,11 @@ public BytesRef getBinaryValue(String name) { } + /** + * Filter parse context. + * + * @opensearch.internal + */ private static class FilterParseContext extends ParseContext { private final ParseContext in; @@ -305,6 +314,11 @@ public Collection getIgnoredFields() { } } + /** + * An internal parse context + * + * @opensearch.internal + */ public static class InternalParseContext extends ParseContext { private final DocumentMapper docMapper; diff --git a/server/src/main/java/org/opensearch/index/mapper/RangeFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/RangeFieldMapper.java index adc0cbaae7d1c..5257609e0cba9 100644 --- a/server/src/main/java/org/opensearch/index/mapper/RangeFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/RangeFieldMapper.java @@ -86,6 +86,11 @@ public class RangeFieldMapper extends ParametrizedFieldMapper { public static final boolean DEFAULT_INCLUDE_UPPER = true; public static final boolean DEFAULT_INCLUDE_LOWER = true; + /** + * Default parameters for range fields + * + * @opensearch.internal + */ public static class Defaults { public static final Explicit COERCE = new Explicit<>(true, false); public static final DateFormatter DATE_FORMATTER = DateFieldMapper.DEFAULT_DATE_TIME_FORMATTER; @@ -98,6 +103,11 @@ private static RangeFieldMapper toType(FieldMapper in) { return (RangeFieldMapper) in; } + /** + * Builder for range fields + * + * @opensearch.internal + */ public static class Builder extends ParametrizedFieldMapper.Builder { private final Parameter index = Parameter.indexParam(m -> toType(m).index, true); @@ -233,6 +243,11 @@ public RangeFieldMapper build(BuilderContext context) { } } + /** + * Field type for range fields + * + * @opensearch.internal + */ public static final class RangeFieldType extends MappedFieldType { protected final RangeType rangeType; protected final DateFormatter dateTimeFormatter; @@ -559,7 +574,11 @@ private static Range parseIpRangeFromCidr(final XContentParser parser) throws IO } } - /** Class defining a range */ + /** + * Class defining a range + * + * @opensearch.internal + */ public static class Range { RangeType type; Object from; @@ -618,6 +637,11 @@ public Object getTo() { } } + /** + * Doc values field for binary ranges + * + * @opensearch.internal + */ static class BinaryRangesDocValuesField extends CustomDocValuesField { private final Set ranges; diff --git a/server/src/main/java/org/opensearch/index/mapper/RangeType.java b/server/src/main/java/org/opensearch/index/mapper/RangeType.java index ce31b5e6ac5df..a9e2a638843ea 100644 --- a/server/src/main/java/org/opensearch/index/mapper/RangeType.java +++ b/server/src/main/java/org/opensearch/index/mapper/RangeType.java @@ -982,6 +982,11 @@ public final Mapper.TypeParser parser() { private final NumberFieldMapper.NumberType numberType; public final LengthType lengthType; + /** + * Type of length + * + * @opensearch.internal + */ public enum LengthType { FIXED_4 { @Override diff --git a/server/src/main/java/org/opensearch/index/mapper/RootObjectMapper.java b/server/src/main/java/org/opensearch/index/mapper/RootObjectMapper.java index cee9ba9f7507c..7a76a9b4c18a9 100644 --- a/server/src/main/java/org/opensearch/index/mapper/RootObjectMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/RootObjectMapper.java @@ -65,6 +65,11 @@ public class RootObjectMapper extends ObjectMapper { private static final DeprecationLogger DEPRECATION_LOGGER = DeprecationLogger.getLogger(RootObjectMapper.class); + /** + * Default parameters for root object + * + * @opensearch.internal + */ public static class Defaults { public static final DateFormatter[] DYNAMIC_DATE_TIME_FORMATTERS = new DateFormatter[] { DateFieldMapper.DEFAULT_DATE_TIME_FORMATTER, @@ -73,6 +78,11 @@ public static class Defaults { public static final boolean NUMERIC_DETECTION = false; } + /** + * Builder for the root object + * + * @opensearch.internal + */ public static class Builder extends ObjectMapper.Builder { protected Explicit dynamicTemplates = new Explicit<>(new DynamicTemplate[0], false); @@ -153,6 +163,11 @@ private static void fixRedundantIncludes(ObjectMapper objectMapper, boolean pare } } + /** + * Type parser for the root object + * + * @opensearch.internal + */ public static class TypeParser extends ObjectMapper.TypeParser { @Override diff --git a/server/src/main/java/org/opensearch/index/mapper/RoutingFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/RoutingFieldMapper.java index f8bc833983391..222ba70a5ce0c 100644 --- a/server/src/main/java/org/opensearch/index/mapper/RoutingFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/RoutingFieldMapper.java @@ -57,6 +57,11 @@ public ParametrizedFieldMapper.Builder getMergeBuilder() { return new Builder().init(this); } + /** + * Default parameters for routing fields + * + * @opensearch.internal + */ public static class Defaults { public static final FieldType FIELD_TYPE = new FieldType(); @@ -75,6 +80,11 @@ private static RoutingFieldMapper toType(FieldMapper in) { return (RoutingFieldMapper) in; } + /** + * Builder for routing fields + * + * @opensearch.internal + */ public static class Builder extends MetadataFieldMapper.Builder { final Parameter required = Parameter.boolParam("required", false, m -> toType(m).required, Defaults.REQUIRED); @@ -96,6 +106,11 @@ public RoutingFieldMapper build(BuilderContext context) { public static final TypeParser PARSER = new ConfigurableTypeParser(c -> new RoutingFieldMapper(Defaults.REQUIRED), c -> new Builder()); + /** + * Field type for routing fields + * + * @opensearch.internal + */ static final class RoutingFieldType extends StringFieldType { static RoutingFieldType INSTANCE = new RoutingFieldType(); diff --git a/server/src/main/java/org/opensearch/index/mapper/SeqNoFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/SeqNoFieldMapper.java index 9b2e561acc841..16f76f087e403 100644 --- a/server/src/main/java/org/opensearch/index/mapper/SeqNoFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/SeqNoFieldMapper.java @@ -73,6 +73,8 @@ public class SeqNoFieldMapper extends MetadataFieldMapper { /** * A sequence ID, which is made up of a sequence number (both the searchable * and doc_value version of the field) and the primary term. + * + * @opensearch.internal */ public static class SequenceIDFields { @@ -108,6 +110,11 @@ public static SequenceIDFields emptySeqID() { public static final TypeParser PARSER = new FixedTypeParser(c -> new SeqNoFieldMapper()); + /** + * Field type for internal sequence numbers + * + * @opensearch.internal + */ static final class SeqNoFieldType extends SimpleMappedFieldType { private static final SeqNoFieldType INSTANCE = new SeqNoFieldType(); diff --git a/server/src/main/java/org/opensearch/index/mapper/SourceFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/SourceFieldMapper.java index 4a5778db590dc..6a9db10de6266 100644 --- a/server/src/main/java/org/opensearch/index/mapper/SourceFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/SourceFieldMapper.java @@ -73,6 +73,11 @@ public class SourceFieldMapper extends MetadataFieldMapper { public static final String CONTENT_TYPE = "_source"; private final Function, Map> filter; + /** + * Default parameters for source fields + * + * @opensearch.internal + */ public static class Defaults { public static final String NAME = SourceFieldMapper.NAME; public static final boolean ENABLED = true; @@ -91,6 +96,11 @@ private static SourceFieldMapper toType(FieldMapper in) { return (SourceFieldMapper) in; } + /** + * Builder for source fields + * + * @opensearch.internal + */ public static class Builder extends MetadataFieldMapper.Builder { private final Parameter enabled = Parameter.boolParam("enabled", false, m -> toType(m).enabled, Defaults.ENABLED); @@ -128,6 +138,11 @@ public SourceFieldMapper build(BuilderContext context) { public static final TypeParser PARSER = new ConfigurableTypeParser(c -> new SourceFieldMapper(), c -> new Builder()); + /** + * Field type for source field mapper + * + * @opensearch.internal + */ static final class SourceFieldType extends MappedFieldType { private SourceFieldType(boolean enabled) { diff --git a/server/src/main/java/org/opensearch/index/mapper/SourceToParse.java b/server/src/main/java/org/opensearch/index/mapper/SourceToParse.java index 7993c3f0a3b36..8afc0e25b079d 100644 --- a/server/src/main/java/org/opensearch/index/mapper/SourceToParse.java +++ b/server/src/main/java/org/opensearch/index/mapper/SourceToParse.java @@ -90,6 +90,11 @@ public XContentType getXContentType() { return this.xContentType; } + /** + * Origin of the source + * + * @opensearch.internal + */ public enum Origin { PRIMARY, REPLICA diff --git a/server/src/main/java/org/opensearch/index/mapper/TextFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/TextFieldMapper.java index bad09e76ecab6..82bd8ebb4d362 100644 --- a/server/src/main/java/org/opensearch/index/mapper/TextFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/TextFieldMapper.java @@ -113,6 +113,11 @@ public class TextFieldMapper extends ParametrizedFieldMapper { private static final int POSITION_INCREMENT_GAP_USE_ANALYZER = -1; private static final String FAST_PHRASE_SUFFIX = "._index_phrase"; + /** + * Default paramters for text fields + * + * @opensearch.internal + */ public static class Defaults { public static final double FIELDDATA_MIN_FREQUENCY = 0; public static final double FIELDDATA_MAX_FREQUENCY = Integer.MAX_VALUE; @@ -142,6 +147,11 @@ private static Builder builder(FieldMapper in) { return ((TextFieldMapper) in).builder; } + /** + * Prefix configuration + * + * @opensearch.internal + */ private static final class PrefixConfig implements ToXContent { final int minChars; final int maxChars; @@ -199,6 +209,11 @@ private static PrefixConfig parsePrefixConfig(String propName, ParserContext par return new PrefixConfig(minChars, maxChars); } + /** + * Frequency filter for field data + * + * @opensearch.internal + */ private static final class FielddataFrequencyFilter implements ToXContent { final double minFreq; final double maxFreq; @@ -256,6 +271,11 @@ private static FielddataFrequencyFilter parseFrequencyFilter(String name, Parser return new FielddataFrequencyFilter(minFrequency, maxFrequency, minSegmentSize); } + /** + * Builder for text fields + * + * @opensearch.internal + */ public static class Builder extends ParametrizedFieldMapper.Builder { private final Version indexCreatedVersion; @@ -456,6 +476,11 @@ public TextFieldMapper build(BuilderContext context) { public static final TypeParser PARSER = new TypeParser((n, c) -> new Builder(n, c.indexVersionCreated(), c.getIndexAnalyzers())); + /** + * A phrase wrapped field analyzer + * + * @opensearch.internal + */ private static class PhraseWrappedAnalyzer extends AnalyzerWrapper { private final Analyzer delegate; @@ -476,6 +501,11 @@ protected TokenStreamComponents wrapComponents(String fieldName, TokenStreamComp } } + /** + * A prefix wrapped analyzer + * + * @opensearch.internal + */ private static class PrefixWrappedAnalyzer extends AnalyzerWrapper { private final int minChars; @@ -501,6 +531,11 @@ protected TokenStreamComponents wrapComponents(String fieldName, TokenStreamComp } } + /** + * Field type for phrase fields + * + * @opensearch.internal + */ static final class PhraseFieldType extends StringFieldType { final TextFieldType parent; @@ -533,6 +568,11 @@ public Query existsQuery(QueryShardContext context) { } } + /** + * Field type for prefix fields + * + * @opensearch.internal + */ static final class PrefixFieldType extends StringFieldType { final int minChars; @@ -626,6 +666,11 @@ public Query existsQuery(QueryShardContext context) { } } + /** + * Field mapper for phrase fields + * + * @opensearch.internal + */ private static final class PhraseFieldMapper extends FieldMapper { PhraseFieldMapper(FieldType fieldType, PhraseFieldType mappedFieldType) { @@ -648,6 +693,11 @@ protected String contentType() { } } + /** + * Field mapper for prefix fields + * + * @opensearch.internal + */ private static final class PrefixFieldMapper extends FieldMapper { protected PrefixFieldMapper(FieldType fieldType, PrefixFieldType mappedFieldType) { @@ -679,6 +729,11 @@ public String toString() { } } + /** + * Field type for text fields + * + * @opensearch.internal + */ public static class TextFieldType extends StringFieldType { private boolean fielddata; diff --git a/server/src/main/java/org/opensearch/index/mapper/TextParams.java b/server/src/main/java/org/opensearch/index/mapper/TextParams.java index f8fd02edafb11..0f46ddb021aad 100644 --- a/server/src/main/java/org/opensearch/index/mapper/TextParams.java +++ b/server/src/main/java/org/opensearch/index/mapper/TextParams.java @@ -54,6 +54,11 @@ public final class TextParams { private TextParams() {} + /** + * Analyzers for text + * + * @opensearch.internal + */ public static final class Analyzers { public final Parameter indexAnalyzer; public final Parameter searchAnalyzer; diff --git a/server/src/main/java/org/opensearch/index/mapper/TextSearchInfo.java b/server/src/main/java/org/opensearch/index/mapper/TextSearchInfo.java index 79cb5f1ab2a54..535fba6c39371 100644 --- a/server/src/main/java/org/opensearch/index/mapper/TextSearchInfo.java +++ b/server/src/main/java/org/opensearch/index/mapper/TextSearchInfo.java @@ -144,6 +144,8 @@ public boolean isTokenized() { /** * What sort of term vectors are available + * + * @opensearch.internal */ public enum TermVector { NONE, diff --git a/server/src/main/java/org/opensearch/index/mapper/VersionFieldMapper.java b/server/src/main/java/org/opensearch/index/mapper/VersionFieldMapper.java index f5c36a3d30495..6cef46be86a6a 100644 --- a/server/src/main/java/org/opensearch/index/mapper/VersionFieldMapper.java +++ b/server/src/main/java/org/opensearch/index/mapper/VersionFieldMapper.java @@ -54,6 +54,11 @@ public class VersionFieldMapper extends MetadataFieldMapper { public static final TypeParser PARSER = new FixedTypeParser(c -> new VersionFieldMapper()); + /** + * Field type for internal version field + * + * @opensearch.internal + */ static final class VersionFieldType extends MappedFieldType { public static final VersionFieldType INSTANCE = new VersionFieldType(); diff --git a/server/src/main/java/org/opensearch/index/merge/MergeStats.java b/server/src/main/java/org/opensearch/index/merge/MergeStats.java index 2bd6bc88b8659..6c872514f402e 100644 --- a/server/src/main/java/org/opensearch/index/merge/MergeStats.java +++ b/server/src/main/java/org/opensearch/index/merge/MergeStats.java @@ -244,6 +244,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Fields used for merge statistics + * + * @opensearch.internal + */ static final class Fields { static final String MERGES = "merges"; static final String CURRENT = "current"; diff --git a/server/src/main/java/org/opensearch/index/query/AbstractGeometryQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/AbstractGeometryQueryBuilder.java index a72447402d3c5..4f0a873ac7bdb 100644 --- a/server/src/main/java/org/opensearch/index/query/AbstractGeometryQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/AbstractGeometryQueryBuilder.java @@ -524,7 +524,11 @@ protected QueryBuilder doRewrite(QueryRewriteContext queryRewriteContext) throws return this; } - /** local class that encapsulates xcontent parsed shape parameters */ + /** + * local class that encapsulates xcontent parsed shape parameters + * + * @opensearch.internal + */ protected abstract static class ParsedGeometryQueryParams { public String fieldName; public ShapeRelation relation; diff --git a/server/src/main/java/org/opensearch/index/query/DistanceFeatureQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/DistanceFeatureQueryBuilder.java index dee6e3f8a762f..697e1579fb88f 100644 --- a/server/src/main/java/org/opensearch/index/query/DistanceFeatureQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/DistanceFeatureQueryBuilder.java @@ -158,6 +158,11 @@ protected boolean doEquals(DistanceFeatureQueryBuilder other) { return this.field.equals(other.field) && Objects.equals(this.origin, other.origin) && this.pivot.equals(other.pivot); } + /** + * Origin of a distance feature query + * + * @opensearch.internal + */ public static class Origin { private final Object origin; diff --git a/server/src/main/java/org/opensearch/index/query/GeoShapeQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/GeoShapeQueryBuilder.java index 589c733eafe00..cedc142a2f0eb 100644 --- a/server/src/main/java/org/opensearch/index/query/GeoShapeQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/GeoShapeQueryBuilder.java @@ -231,6 +231,11 @@ protected GeoShapeQueryBuilder doRewrite(QueryRewriteContext queryRewriteContext return builder; } + /** + * Geoshape query parameters that have been parsed from xcontent + * + * @opensearch.internal + */ private static class ParsedGeoShapeQueryParams extends ParsedGeometryQueryParams { SpatialStrategy strategy; diff --git a/server/src/main/java/org/opensearch/index/query/IntervalFilterScript.java b/server/src/main/java/org/opensearch/index/query/IntervalFilterScript.java index a5513e560d15f..f94a8bf0f310c 100644 --- a/server/src/main/java/org/opensearch/index/query/IntervalFilterScript.java +++ b/server/src/main/java/org/opensearch/index/query/IntervalFilterScript.java @@ -43,6 +43,11 @@ */ public abstract class IntervalFilterScript { + /** + * Internal interval + * + * @opensearch.internal + */ public static class Interval { private IntervalIterator iterator; @@ -66,6 +71,11 @@ public int getGaps() { public abstract boolean execute(Interval interval); + /** + * Factory to create a script + * + * @opensearch.internal + */ public interface Factory extends ScriptFactory { IntervalFilterScript newInstance(); } diff --git a/server/src/main/java/org/opensearch/index/query/IntervalsSourceProvider.java b/server/src/main/java/org/opensearch/index/query/IntervalsSourceProvider.java index 9409a264fa8a0..cc69a44c9c80c 100644 --- a/server/src/main/java/org/opensearch/index/query/IntervalsSourceProvider.java +++ b/server/src/main/java/org/opensearch/index/query/IntervalsSourceProvider.java @@ -127,6 +127,11 @@ private static IntervalsSourceProvider parseInnerIntervals(XContentParser parser return isp; } + /** + * Match interval + * + * @opensearch.internal + */ public static class Match extends IntervalsSourceProvider { public static final String NAME = "match"; @@ -312,6 +317,11 @@ String getUseField() { } } + /** + * Disjunction interval + * + * @opensearch.internal + */ public static class Disjunction extends IntervalsSourceProvider { public static final String NAME = "any_of"; @@ -417,6 +427,11 @@ IntervalFilter getFilter() { } } + /** + * Combine interval + * + * @opensearch.internal + */ public static class Combine extends IntervalsSourceProvider { public static final String NAME = "all_of"; @@ -567,6 +582,11 @@ IntervalFilter getFilter() { } } + /** + * Prefix interval + * + * @opensearch.internal + */ public static class Prefix extends IntervalsSourceProvider { public static final String NAME = "prefix"; @@ -681,6 +701,11 @@ String getUseField() { } } + /** + * Regular expression interval + * + * @opensearch.internal + */ public static class Regexp extends IntervalsSourceProvider { public static final String NAME = "regexp"; @@ -860,6 +885,11 @@ boolean isCaseInsensitive() { } } + /** + * Wildcard interval + * + * @opensearch.internal + */ public static class Wildcard extends IntervalsSourceProvider { public static final String NAME = "wildcard"; @@ -1010,6 +1040,11 @@ Integer getMaxExpansions() { } } + /** + * Fuzzy interval + * + * @opensearch.internal + */ public static class Fuzzy extends IntervalsSourceProvider { public static final String NAME = "fuzzy"; @@ -1180,6 +1215,11 @@ String getUseField() { } } + /** + * Script filter source + * + * @opensearch.internal + */ static class ScriptFilterSource extends FilteredIntervalsSource { final IntervalFilterScript script; @@ -1197,6 +1237,11 @@ protected boolean accept(IntervalIterator it) { } } + /** + * An interval filter + * + * @opensearch.internal + */ public static class IntervalFilter implements ToXContentObject, Writeable { public static final String NAME = "filter"; diff --git a/server/src/main/java/org/opensearch/index/query/MoreLikeThisQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/MoreLikeThisQueryBuilder.java index fe13aef627f7b..71275e53fce95 100644 --- a/server/src/main/java/org/opensearch/index/query/MoreLikeThisQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/MoreLikeThisQueryBuilder.java @@ -161,6 +161,8 @@ public class MoreLikeThisQueryBuilder extends AbstractQueryBuilder innerHit } } + /** + * Context builder for nested inner hits + * + * @opensearch.internal + */ static class NestedInnerHitContextBuilder extends InnerHitContextBuilder { private final String path; @@ -396,6 +401,11 @@ protected void doBuild(SearchContext parentSearchContext, InnerHitsContext inner } } + /** + * Inner hits sub context + * + * @opensearch.internal + */ static final class NestedInnerHitSubContext extends InnerHitsContext.InnerHitSubContext { private final ObjectMapper parentObjectMapper; diff --git a/server/src/main/java/org/opensearch/index/query/ScriptQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/ScriptQueryBuilder.java index b4e6a6d9a9cdd..a477237816d9b 100644 --- a/server/src/main/java/org/opensearch/index/query/ScriptQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/ScriptQueryBuilder.java @@ -164,6 +164,11 @@ protected Query doToQuery(QueryShardContext context) throws IOException { return new ScriptQuery(script, filterScript, queryName); } + /** + * Internal script query + * + * @opensearch.internal + */ static class ScriptQuery extends Query { final Script script; diff --git a/server/src/main/java/org/opensearch/index/query/SpanNearQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/SpanNearQueryBuilder.java index ccc0b8f9dbde7..d7fd41435fab7 100644 --- a/server/src/main/java/org/opensearch/index/query/SpanNearQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/SpanNearQueryBuilder.java @@ -306,6 +306,8 @@ public String getWriteableName() { * can be invoked for it. * This QueryBuilder is only applicable as a clause in SpanGapQueryBuilder but * yet to enforce this restriction. + * + * @opensearch.internal */ public static class SpanGapQueryBuilder implements SpanQueryBuilder { public static final String NAME = "span_gap"; diff --git a/server/src/main/java/org/opensearch/index/query/SpanQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/SpanQueryBuilder.java index 29aa4cfbcc6ce..9ff8bad4adc36 100644 --- a/server/src/main/java/org/opensearch/index/query/SpanQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/SpanQueryBuilder.java @@ -42,6 +42,11 @@ */ public interface SpanQueryBuilder extends QueryBuilder { + /** + * Utility for span query builders + * + * @opensearch.internal + */ class SpanQueryBuilderUtil { private SpanQueryBuilderUtil() { // utility class diff --git a/server/src/main/java/org/opensearch/index/query/TermsSetQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/TermsSetQueryBuilder.java index 6bb42f8ff5d39..fa432216b67e8 100644 --- a/server/src/main/java/org/opensearch/index/query/TermsSetQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/TermsSetQueryBuilder.java @@ -298,6 +298,11 @@ private LongValuesSource createValuesSource(QueryShardContext context) { return longValuesSource; } + /** + * Values Source for scripted long values + * + * @opensearch.internal + */ static final class ScriptLongValueSource extends LongValuesSource { private final Script script; @@ -366,8 +371,12 @@ public LongValuesSource rewrite(IndexSearcher searcher) throws IOException { } - // Forked from LongValuesSource.FieldValuesSource and changed getValues() method to always use sorted numeric - // doc values, because that is what is being used in NumberFieldMapper. + /** + * Forked from LongValuesSource.FieldValuesSource and changed getValues() method to always use sorted numeric + * doc values, because that is what is being used in NumberFieldMapper. + * + * @opensearch.internal + */ static class FieldValuesSource extends LongValuesSource { private final String fieldName; diff --git a/server/src/main/java/org/opensearch/index/query/VectorGeoShapeQueryProcessor.java b/server/src/main/java/org/opensearch/index/query/VectorGeoShapeQueryProcessor.java index 47766c6c8521e..e11b22e9296cf 100644 --- a/server/src/main/java/org/opensearch/index/query/VectorGeoShapeQueryProcessor.java +++ b/server/src/main/java/org/opensearch/index/query/VectorGeoShapeQueryProcessor.java @@ -88,6 +88,11 @@ private Query getVectorQueryFromShape(Geometry queryShape, String fieldName, Sha ); } + /** + * Geometry collector for LatLonShape indexing types + * + * @opensearch.internal + */ private static class LuceneGeometryCollector implements GeometryVisitor { private final List geometries = new ArrayList<>(); private final String name; diff --git a/server/src/main/java/org/opensearch/index/query/functionscore/DecayFunctionBuilder.java b/server/src/main/java/org/opensearch/index/query/functionscore/DecayFunctionBuilder.java index b90462baed612..be3ca83f54a0f 100644 --- a/server/src/main/java/org/opensearch/index/query/functionscore/DecayFunctionBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/functionscore/DecayFunctionBuilder.java @@ -424,6 +424,11 @@ private AbstractDistanceScoreFunction parseDateVariable( ); } + /** + * Score function for geo field data + * + * @opensearch.internal + */ static class GeoFieldDataScoreFunction extends AbstractDistanceScoreFunction { private final GeoPoint origin; @@ -520,6 +525,11 @@ protected int doHashCode() { } } + /** + * Score function for numeric data + * + * @opensearch.internal + */ static class NumericFieldDataScoreFunction extends AbstractDistanceScoreFunction { private final IndexNumericFieldData fieldData; @@ -610,7 +620,8 @@ protected boolean doEquals(ScoreFunction other) { /** * This is the base class for scoring a single field. * - * */ + * @opensearch.internal + */ public abstract static class AbstractDistanceScoreFunction extends ScoreFunction { private final double scale; diff --git a/server/src/main/java/org/opensearch/index/query/functionscore/ExponentialDecayFunctionBuilder.java b/server/src/main/java/org/opensearch/index/query/functionscore/ExponentialDecayFunctionBuilder.java index 96754466bb0e1..c541ab84c8141 100644 --- a/server/src/main/java/org/opensearch/index/query/functionscore/ExponentialDecayFunctionBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/functionscore/ExponentialDecayFunctionBuilder.java @@ -96,6 +96,11 @@ public DecayFunction getDecayFunction() { return EXP_DECAY_FUNCTION; } + /** + * Exponential decay + * + * @opensearch.internal + */ private static final class ExponentialDecayScoreFunction implements DecayFunction { @Override diff --git a/server/src/main/java/org/opensearch/index/query/functionscore/FunctionScoreQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/functionscore/FunctionScoreQueryBuilder.java index 9f39b8f74d819..19edcfc2b0b48 100644 --- a/server/src/main/java/org/opensearch/index/query/functionscore/FunctionScoreQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/functionscore/FunctionScoreQueryBuilder.java @@ -371,6 +371,8 @@ protected Query doToQuery(QueryShardContext context) throws IOException { /** * Function to be associated with an optional filter, meaning it will be executed only for the documents * that match the given filter. + * + * @opensearch.internal */ public static class FilterFunctionBuilder implements ToXContentObject, Writeable { private final QueryBuilder filter; diff --git a/server/src/main/java/org/opensearch/index/query/functionscore/GaussDecayFunctionBuilder.java b/server/src/main/java/org/opensearch/index/query/functionscore/GaussDecayFunctionBuilder.java index b3e42292addeb..e7906eb65c738 100644 --- a/server/src/main/java/org/opensearch/index/query/functionscore/GaussDecayFunctionBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/functionscore/GaussDecayFunctionBuilder.java @@ -96,6 +96,11 @@ public DecayFunction getDecayFunction() { return GAUSS_DECAY_FUNCTION; } + /** + * Gaussian scoring + * + * @opensearch.internal + */ private static final class GaussScoreFunction implements DecayFunction { @Override public double evaluate(double value, double scale) { diff --git a/server/src/main/java/org/opensearch/index/query/functionscore/LinearDecayFunctionBuilder.java b/server/src/main/java/org/opensearch/index/query/functionscore/LinearDecayFunctionBuilder.java index b3b948677756a..0b4e84393af1c 100644 --- a/server/src/main/java/org/opensearch/index/query/functionscore/LinearDecayFunctionBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/functionscore/LinearDecayFunctionBuilder.java @@ -94,6 +94,11 @@ public DecayFunction getDecayFunction() { return LINEAR_DECAY_FUNCTION; } + /** + * Linear decay + * + * @opensearch.internal + */ private static final class LinearDecayScoreFunction implements DecayFunction { @Override diff --git a/server/src/main/java/org/opensearch/index/recovery/RecoveryStats.java b/server/src/main/java/org/opensearch/index/recovery/RecoveryStats.java index 14d8fa6f70939..9490e51d36ab4 100644 --- a/server/src/main/java/org/opensearch/index/recovery/RecoveryStats.java +++ b/server/src/main/java/org/opensearch/index/recovery/RecoveryStats.java @@ -127,6 +127,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Fields for recovery statistics + * + * @opensearch.internal + */ static final class Fields { static final String RECOVERY = "recovery"; static final String CURRENT_AS_SOURCE = "current_as_source"; diff --git a/server/src/main/java/org/opensearch/index/reindex/BulkByScrollTask.java b/server/src/main/java/org/opensearch/index/reindex/BulkByScrollTask.java index 7751b2d848535..5d8adf03040ee 100644 --- a/server/src/main/java/org/opensearch/index/reindex/BulkByScrollTask.java +++ b/server/src/main/java/org/opensearch/index/reindex/BulkByScrollTask.java @@ -222,6 +222,8 @@ public boolean shouldCancelChildrenOnCancellation() { * This class acts as a builder for {@link Status}. Once the {@link Status} object is built by calling * {@link #buildStatus()} it is immutable. Used by an instance of {@link ObjectParser} when parsing from * XContent. + * + * @opensearch.internal */ public static class StatusBuilder { private Integer sliceId = null; @@ -355,6 +357,8 @@ public Status buildStatus() { * implementations, this one has become defacto standardized because Kibana * parses it. As such, we should be very careful about removing things from * this. + * + * @opensearch.internal */ public static class Status implements Task.Status, SuccessfullyProcessed { public static final String NAME = "bulk-by-scroll"; @@ -927,6 +931,8 @@ private long checkPositive(long value, String name) { /** * The status of a slice of the request. Successful requests store the {@link StatusOrException#status} while failing requests store a * {@link StatusOrException#exception}. + * + * @opensearch.internal */ public static class StatusOrException implements Writeable, ToXContentObject { private final Status status; diff --git a/server/src/main/java/org/opensearch/index/reindex/ClientScrollableHitSource.java b/server/src/main/java/org/opensearch/index/reindex/ClientScrollableHitSource.java index 82008746f06f8..f01f90ef68bcd 100644 --- a/server/src/main/java/org/opensearch/index/reindex/ClientScrollableHitSource.java +++ b/server/src/main/java/org/opensearch/index/reindex/ClientScrollableHitSource.java @@ -179,6 +179,11 @@ private Response wrapSearchResponse(SearchResponse response) { return new Response(response.isTimedOut(), failures, total, hits, response.getScrollId()); } + /** + * A Client hit + * + * @opensearch.internal + */ private static class ClientHit implements Hit { private final SearchHit delegate; private final BytesReference source; diff --git a/server/src/main/java/org/opensearch/index/reindex/LeaderBulkByScrollTaskState.java b/server/src/main/java/org/opensearch/index/reindex/LeaderBulkByScrollTaskState.java index bef696fe18ed4..973ceeefe43b7 100644 --- a/server/src/main/java/org/opensearch/index/reindex/LeaderBulkByScrollTaskState.java +++ b/server/src/main/java/org/opensearch/index/reindex/LeaderBulkByScrollTaskState.java @@ -156,6 +156,11 @@ private void recordSliceCompletionAndRespondIfAllDone(ActionListener { private Request(StreamInput in) throws IOException { diff --git a/server/src/main/java/org/opensearch/index/seqno/ReplicationTracker.java b/server/src/main/java/org/opensearch/index/seqno/ReplicationTracker.java index ac611a4af4318..d63a178b4213a 100644 --- a/server/src/main/java/org/opensearch/index/seqno/ReplicationTracker.java +++ b/server/src/main/java/org/opensearch/index/seqno/ReplicationTracker.java @@ -662,6 +662,11 @@ public synchronized void renewPeerRecoveryRetentionLeases() { assert invariant(); } + /** + * The state of the lucene checkpoint + * + * @opensearch.internal + */ public static class CheckpointState implements Writeable { /** @@ -1594,6 +1599,8 @@ private synchronized void waitForLocalCheckpointToAdvance() throws InterruptedEx /** * Represents the sequence number component of the primary context. This is the knowledge on the primary of the in-sync and initializing * shards and their local checkpoints. + * + * @opensearch.internal */ public static class PrimaryContext implements Writeable { diff --git a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseActions.java b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseActions.java index 3827666a5678c..2ce0f1f524a43 100644 --- a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseActions.java +++ b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseActions.java @@ -71,6 +71,11 @@ public class RetentionLeaseActions { public static final long RETAIN_ALL = -1; + /** + * Base class for transport retention lease actions + * + * @opensearch.internal + */ abstract static class TransportRetentionLeaseAction> extends TransportSingleShardAction { private final IndicesService indicesService; @@ -134,6 +139,11 @@ protected boolean resolveIndex(final T request) { } + /** + * Add retention lease action + * + * @opensearch.internal + */ public static class Add extends ActionType { public static final Add INSTANCE = new Add(); @@ -143,6 +153,11 @@ private Add() { super(ACTION_NAME, Response::new); } + /** + * Internal transport action + * + * @opensearch.internal + */ public static class TransportAction extends TransportRetentionLeaseAction { @Inject @@ -184,6 +199,11 @@ protected Writeable.Reader getResponseReader() { } } + /** + * Renew the retention lease + * + * @opensearch.internal + */ public static class Renew extends ActionType { public static final Renew INSTANCE = new Renew(); @@ -193,6 +213,11 @@ private Renew() { super(ACTION_NAME, Response::new); } + /** + * Internal transport action for renew + * + * @opensearch.internal + */ public static class TransportAction extends TransportRetentionLeaseAction { @Inject @@ -225,6 +250,11 @@ void doRetentionLeaseAction(final IndexShard indexShard, final RenewRequest requ } } + /** + * Remove retention lease action + * + * @opensearch.internal + */ public static class Remove extends ActionType { public static final Remove INSTANCE = new Remove(); @@ -234,6 +264,11 @@ private Remove() { super(ACTION_NAME, Response::new); } + /** + * Internal transport action for remove + * + * @opensearch.internal + */ public static class TransportAction extends TransportRetentionLeaseAction { @Inject @@ -265,6 +300,11 @@ void doRetentionLeaseAction(final IndexShard indexShard, final RemoveRequest req } } + /** + * Base request + * + * @opensearch.internal + */ private abstract static class Request> extends SingleShardRequest { private final ShardId shardId; @@ -305,6 +345,11 @@ public void writeTo(final StreamOutput out) throws IOException { } + /** + * Base add or renew request + * + * @opensearch.internal + */ private abstract static class AddOrRenewRequest> extends Request { private final long retainingSequenceNumber; @@ -343,6 +388,11 @@ public void writeTo(final StreamOutput out) throws IOException { } + /** + * Add retention lease request + * + * @opensearch.internal + */ public static class AddRequest extends AddOrRenewRequest { AddRequest(StreamInput in) throws IOException { @@ -355,6 +405,11 @@ public AddRequest(final ShardId shardId, final String id, final long retainingSe } + /** + * Renew Request action + * + * @opensearch.internal + */ public static class RenewRequest extends AddOrRenewRequest { RenewRequest(StreamInput in) throws IOException { @@ -367,6 +422,11 @@ public RenewRequest(final ShardId shardId, final String id, final long retaining } + /** + * Remove request + * + * @opensearch.internal + */ public static class RemoveRequest extends Request { RemoveRequest(StreamInput in) throws IOException { @@ -379,6 +439,11 @@ public RemoveRequest(final ShardId shardId, final String id) { } + /** + * The response + * + * @opensearch.internal + */ public static class Response extends ActionResponse { public Response() {} diff --git a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseBackgroundSyncAction.java b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseBackgroundSyncAction.java index 891b55f0e8391..6de6aeaef5018 100644 --- a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseBackgroundSyncAction.java +++ b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseBackgroundSyncAction.java @@ -198,6 +198,11 @@ protected void shardOperationOnReplica(Request request, IndexShard replica, Acti }); } + /** + * Request for retention lease bground sync action + * + * @opensearch.internal + */ public static final class Request extends ReplicationRequest { private RetentionLeases retentionLeases; diff --git a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseSyncAction.java b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseSyncAction.java index a6aebeb21a76a..afcf5c6766194 100644 --- a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseSyncAction.java +++ b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseSyncAction.java @@ -211,6 +211,11 @@ public ClusterBlockLevel indexBlockLevel() { return null; } + /** + * Request for retention lease sync action + * + * @opensearch.internal + */ public static final class Request extends ReplicatedWriteRequest { private RetentionLeases retentionLeases; @@ -260,6 +265,11 @@ public String toString() { } + /** + * Response for retention lease sync action + * + * @opensearch.internal + */ public static final class Response extends ReplicationResponse implements WriteResponse { public Response() {} diff --git a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseSyncer.java b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseSyncer.java index 25a768868f5d5..bfe5fc75a0991 100644 --- a/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseSyncer.java +++ b/server/src/main/java/org/opensearch/index/seqno/RetentionLeaseSyncer.java @@ -80,6 +80,8 @@ public void backgroundSync(ShardId shardId, String primaryAllocationId, long pri /** * Represents an action that is invoked to sync retention leases to replica shards after a retention lease is added * or removed on the primary. The specified listener is invoked when the syncing completes with success or failure. + * + * @opensearch.internal */ public interface SyncAction { void sync( @@ -94,6 +96,8 @@ void sync( /** * Represents an action that is invoked periodically to sync retention leases to replica shards after some retention * lease has been renewed or expired. + * + * @opensearch.internal */ public interface BackgroundSyncAction { void backgroundSync(ShardId shardId, String primaryAllocationId, long primaryTerm, RetentionLeases retentionLeases); diff --git a/server/src/main/java/org/opensearch/index/seqno/SequenceNumbers.java b/server/src/main/java/org/opensearch/index/seqno/SequenceNumbers.java index f8639595d9195..210976ffba58a 100644 --- a/server/src/main/java/org/opensearch/index/seqno/SequenceNumbers.java +++ b/server/src/main/java/org/opensearch/index/seqno/SequenceNumbers.java @@ -129,6 +129,11 @@ public static long max(final long maxSeqNo, final long seqNo) { } } + /** + * Commit information + * + * @opensearch.internal + */ public static final class CommitInfo { public final long maxSeqNo; public final long localCheckpoint; diff --git a/server/src/main/java/org/opensearch/index/shard/DocsStats.java b/server/src/main/java/org/opensearch/index/shard/DocsStats.java index 952f94d26e1ef..ebb7091c4acd6 100644 --- a/server/src/main/java/org/opensearch/index/shard/DocsStats.java +++ b/server/src/main/java/org/opensearch/index/shard/DocsStats.java @@ -121,6 +121,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Fields for document statistics + * + * @opensearch.internal + */ static final class Fields { static final String DOCS = "docs"; static final String COUNT = "count"; diff --git a/server/src/main/java/org/opensearch/index/shard/GlobalCheckpointListeners.java b/server/src/main/java/org/opensearch/index/shard/GlobalCheckpointListeners.java index e26f2ccca4fd1..6dbbb62e231af 100644 --- a/server/src/main/java/org/opensearch/index/shard/GlobalCheckpointListeners.java +++ b/server/src/main/java/org/opensearch/index/shard/GlobalCheckpointListeners.java @@ -65,6 +65,8 @@ public class GlobalCheckpointListeners implements Closeable { /** * A global checkpoint listener consisting of a callback that is notified when the global checkpoint is updated or the shard is closed. + * + * @opensearch.internal */ public interface GlobalCheckpointListener { diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShard.java b/server/src/main/java/org/opensearch/index/shard/IndexShard.java index b11148a9a2ef1..e54c08d4cbad3 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShard.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShard.java @@ -1503,6 +1503,11 @@ static Engine.Searcher wrapSearcher( } } + /** + * Wrapper for a non-closing reader + * + * @opensearch.internal + */ private static final class NonClosingReaderWrapper extends FilterDirectoryReader { private NonClosingReaderWrapper(DirectoryReader in) throws IOException { @@ -3620,6 +3625,8 @@ private RefreshListeners buildRefreshListeners() { * Simple struct encapsulating a shard failure * * @see IndexShard#addShardFailureCallback(Consumer) + * + * @opensearch.internal */ public static final class ShardFailure { public final ShardRouting routing; @@ -3785,6 +3792,11 @@ public void addRefreshListener(Translog.Location location, Consumer lis } } + /** + * Metrics updater for a refresh + * + * @opensearch.internal + */ private static class RefreshMetricUpdater implements ReferenceManager.RefreshListener { private final MeanMetric refreshMetric; diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShardOperationPermits.java b/server/src/main/java/org/opensearch/index/shard/IndexShardOperationPermits.java index 3e788b55c6f32..9d500db1d8036 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShardOperationPermits.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShardOperationPermits.java @@ -361,6 +361,11 @@ List getActiveOperations() { .collect(Collectors.toList()); } + /** + * Represents a delayed operation + * + * @opensearch.internal + */ private static class DelayedOperation { private final ActionListener listener; private final String debugInfo; diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShardState.java b/server/src/main/java/org/opensearch/index/shard/IndexShardState.java index 5a0808ece96d5..dc6f2fc3a86d9 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShardState.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShardState.java @@ -34,6 +34,8 @@ /** * Index Shard States + * + * @opensearch.internal */ public enum IndexShardState { CREATED((byte) 0), diff --git a/server/src/main/java/org/opensearch/index/shard/IndexingStats.java b/server/src/main/java/org/opensearch/index/shard/IndexingStats.java index c57be2b2b689c..11004fa3e52c3 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexingStats.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexingStats.java @@ -52,6 +52,11 @@ */ public class IndexingStats implements Writeable, ToXContentFragment { + /** + * Internal statistics for indexing + * + * @opensearch.internal + */ public static class Stats implements Writeable, ToXContentFragment { private long indexCount; @@ -269,6 +274,11 @@ public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params par return builder; } + /** + * Fields for indexing statistics + * + * @opensearch.internal + */ static final class Fields { static final String INDEXING = "indexing"; static final String INDEX_TOTAL = "index_total"; diff --git a/server/src/main/java/org/opensearch/index/shard/InternalIndexingStats.java b/server/src/main/java/org/opensearch/index/shard/InternalIndexingStats.java index 25500ceafb2ef..f0b87ee3c2b41 100644 --- a/server/src/main/java/org/opensearch/index/shard/InternalIndexingStats.java +++ b/server/src/main/java/org/opensearch/index/shard/InternalIndexingStats.java @@ -129,6 +129,11 @@ void noopUpdate() { totalStats.noopUpdates.inc(); } + /** + * Holder for base indexing statistics + * + * @opensearch.internal + */ static class StatsHolder { private final MeanMetric indexMetric = new MeanMetric(); private final MeanMetric deleteMetric = new MeanMetric(); diff --git a/server/src/main/java/org/opensearch/index/shard/PrimaryReplicaSyncer.java b/server/src/main/java/org/opensearch/index/shard/PrimaryReplicaSyncer.java index 463c9b7ca4af2..bff556c498c67 100644 --- a/server/src/main/java/org/opensearch/index/shard/PrimaryReplicaSyncer.java +++ b/server/src/main/java/org/opensearch/index/shard/PrimaryReplicaSyncer.java @@ -225,6 +225,11 @@ public void onFailure(Exception e) { } } + /** + * Synchronous action + * + * @opensearch.internal + */ public interface SyncAction { void sync( ResyncReplicationRequest request, @@ -235,6 +240,11 @@ void sync( ); } + /** + * Sends a snapshot + * + * @opensearch.internal + */ static class SnapshotSender extends AbstractRunnable implements ActionListener { private final Logger logger; private final SyncAction syncAction; @@ -348,6 +358,11 @@ protected void doRun() throws Exception { } } + /** + * Request to resync primary and replica + * + * @opensearch.internal + */ public static class ResyncRequest extends ActionRequest { private final ShardId shardId; @@ -379,6 +394,11 @@ public ActionRequestValidationException validate() { } } + /** + * Task to resync primary and replica + * + * @opensearch.internal + */ public static class ResyncTask extends Task { private volatile String phase = "starting"; private volatile int totalOperations; @@ -441,6 +461,11 @@ public ResyncTask.Status getStatus() { return new ResyncTask.Status(phase, totalOperations, resyncedOperations, skippedOperations); } + /** + * Status for primary replica syncer + * + * @opensearch.internal + */ public static class Status implements Task.Status { public static final String NAME = "resync"; diff --git a/server/src/main/java/org/opensearch/index/shard/RemoveCorruptedShardDataCommand.java b/server/src/main/java/org/opensearch/index/shard/RemoveCorruptedShardDataCommand.java index feceb017a3663..ccc620fc8cf64 100644 --- a/server/src/main/java/org/opensearch/index/shard/RemoveCorruptedShardDataCommand.java +++ b/server/src/main/java/org/opensearch/index/shard/RemoveCorruptedShardDataCommand.java @@ -528,6 +528,11 @@ private Path getNodePath(ShardPath shardPath) { return nodePath; } + /** + * Status of the shard cleaning operation + * + * @opensearch.internal + */ public enum CleanStatus { CLEAN("clean"), CLEAN_WITH_CORRUPTED_MARKER("marked corrupted, but no corruption detected"), diff --git a/server/src/main/java/org/opensearch/index/shard/ShardSplittingQuery.java b/server/src/main/java/org/opensearch/index/shard/ShardSplittingQuery.java index 5f3297fa08b08..6d559a6cc0673 100644 --- a/server/src/main/java/org/opensearch/index/shard/ShardSplittingQuery.java +++ b/server/src/main/java/org/opensearch/index/shard/ShardSplittingQuery.java @@ -296,6 +296,8 @@ boolean matches(int doc) throws IOException { /** * This two phase iterator visits every live doc and selects all docs that don't belong into this * shard based on their id and routing value. This is only used in a routing partitioned index. + * + * @opensearch.internal */ private static final class RoutingPartitionedDocIdSetIterator extends TwoPhaseIterator { private final Visitor visitor; @@ -318,6 +320,8 @@ public float matchCost() { /** * This TwoPhaseIterator marks all nested docs of matching parents as matches as well. + * + * @opensearch.internal */ private static final class NestedRoutingPartitionedDocIdSetIterator extends TwoPhaseIterator { private final Visitor visitor; diff --git a/server/src/main/java/org/opensearch/index/shard/StoreRecovery.java b/server/src/main/java/org/opensearch/index/shard/StoreRecovery.java index 7ed424e9623eb..df501d24265c3 100644 --- a/server/src/main/java/org/opensearch/index/shard/StoreRecovery.java +++ b/server/src/main/java/org/opensearch/index/shard/StoreRecovery.java @@ -231,6 +231,8 @@ void addIndices( /** * Directory wrapper that records copy process for recovery statistics + * + * @opensearch.internal */ static final class StatsDirectoryWrapper extends FilterDirectory { private final RecoveryState.Index index; diff --git a/server/src/main/java/org/opensearch/index/similarity/ScriptedSimilarity.java b/server/src/main/java/org/opensearch/index/similarity/ScriptedSimilarity.java index 53604606887eb..5b39c03b7276a 100644 --- a/server/src/main/java/org/opensearch/index/similarity/ScriptedSimilarity.java +++ b/server/src/main/java/org/opensearch/index/similarity/ScriptedSimilarity.java @@ -163,7 +163,11 @@ public Explanation explain(Explanation freq, long norm) { } } - /** Scoring factors that come from the query. */ + /** + * Scoring factors that come from the query. + * + * @opensearch.internal + */ public static class Query { private final float boost; @@ -177,7 +181,11 @@ public float getBoost() { } } - /** Statistics that are specific to a given field. */ + /** + * Statistics that are specific to a given field. + * + * @opensearch.internal + */ public static class Field { private final long docCount; private final long sumDocFreq; @@ -207,7 +215,11 @@ public long getSumTotalTermFreq() { } } - /** Statistics that are specific to a given term. */ + /** + * Statistics that are specific to a given term. + * + * @opensearch.internal + */ public static class Term { private final long docFreq; private final long totalTermFreq; @@ -228,7 +240,11 @@ public long getTotalTermFreq() { } } - /** Statistics that are specific to a document. */ + /** + * Statistics that are specific to a document. + * + * @opensearch.internal + */ public static class Doc { private float freq; private long norm; diff --git a/server/src/main/java/org/opensearch/index/similarity/SimilarityService.java b/server/src/main/java/org/opensearch/index/similarity/SimilarityService.java index 1bfcc302c3bfc..d575ec508acb6 100644 --- a/server/src/main/java/org/opensearch/index/similarity/SimilarityService.java +++ b/server/src/main/java/org/opensearch/index/similarity/SimilarityService.java @@ -208,6 +208,11 @@ Similarity getDefaultSimilarity() { return defaultSimilarity; } + /** + * Similarity per field + * + * @opensearch.internal + */ static class PerFieldSimilarity extends PerFieldSimilarityWrapper { private final Similarity defaultSimilarity; diff --git a/server/src/main/java/org/opensearch/index/snapshots/IndexShardSnapshotStatus.java b/server/src/main/java/org/opensearch/index/snapshots/IndexShardSnapshotStatus.java index f0ce45e290c16..d48da6f462502 100644 --- a/server/src/main/java/org/opensearch/index/snapshots/IndexShardSnapshotStatus.java +++ b/server/src/main/java/org/opensearch/index/snapshots/IndexShardSnapshotStatus.java @@ -44,6 +44,8 @@ public class IndexShardSnapshotStatus { /** * Snapshot stage + * + * @opensearch.internal */ public enum Stage { /** @@ -245,6 +247,8 @@ public static IndexShardSnapshotStatus newDone( /** * Returns an immutable state of {@link IndexShardSnapshotStatus} at a given point in time. + * + * @opensearch.internal */ public static class Copy { diff --git a/server/src/main/java/org/opensearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshot.java b/server/src/main/java/org/opensearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshot.java index f3b6e91a79535..a0e783727ee27 100644 --- a/server/src/main/java/org/opensearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshot.java +++ b/server/src/main/java/org/opensearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshot.java @@ -61,6 +61,8 @@ public class BlobStoreIndexShardSnapshot implements ToXContentFragment { /** * Information about snapshotted file + * + * @opensearch.internal */ public static class FileInfo { diff --git a/server/src/main/java/org/opensearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshots.java b/server/src/main/java/org/opensearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshots.java index 4f59f65e25553..c5e48890cb392 100644 --- a/server/src/main/java/org/opensearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshots.java +++ b/server/src/main/java/org/opensearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshots.java @@ -178,11 +178,21 @@ public Iterator iterator() { return shardSnapshots.iterator(); } + /** + * Fields for blob store index shard snapshot + * + * @opensearch.internal + */ static final class Fields { static final String FILES = "files"; static final String SNAPSHOTS = "snapshots"; } + /** + * Parse fields for blob store index shard snapshots + * + * @opensearch.internal + */ static final class ParseFields { static final ParseField FILES = new ParseField("files"); static final ParseField SHARD_STATE_ID = new ParseField("shard_state_id"); diff --git a/server/src/main/java/org/opensearch/index/snapshots/blobstore/RateLimitingInputStream.java b/server/src/main/java/org/opensearch/index/snapshots/blobstore/RateLimitingInputStream.java index b95814f92624c..86ecef1173e48 100644 --- a/server/src/main/java/org/opensearch/index/snapshots/blobstore/RateLimitingInputStream.java +++ b/server/src/main/java/org/opensearch/index/snapshots/blobstore/RateLimitingInputStream.java @@ -52,6 +52,11 @@ public class RateLimitingInputStream extends FilterInputStream { private long bytesSinceLastRateLimit; + /** + * Internal listener + * + * @opensearch.internal + */ public interface Listener { void onPause(long nanos); } diff --git a/server/src/main/java/org/opensearch/index/store/ByteSizeCachingDirectory.java b/server/src/main/java/org/opensearch/index/store/ByteSizeCachingDirectory.java index 76836391cb9d6..9fe72c0da1062 100644 --- a/server/src/main/java/org/opensearch/index/store/ByteSizeCachingDirectory.java +++ b/server/src/main/java/org/opensearch/index/store/ByteSizeCachingDirectory.java @@ -54,6 +54,11 @@ */ final class ByteSizeCachingDirectory extends FilterDirectory { + /** + * Internal caching size and modulo count + * + * @opensearch.internal + */ private static class SizeAndModCount { final long size; final long modCount; diff --git a/server/src/main/java/org/opensearch/index/store/FsDirectoryFactory.java b/server/src/main/java/org/opensearch/index/store/FsDirectoryFactory.java index 02e9eb50e7309..57cc9f09ac37d 100644 --- a/server/src/main/java/org/opensearch/index/store/FsDirectoryFactory.java +++ b/server/src/main/java/org/opensearch/index/store/FsDirectoryFactory.java @@ -135,6 +135,11 @@ public static boolean isHybridFs(Directory directory) { return unwrap instanceof HybridDirectory; } + /** + * A hybrid directory implementation + * + * @opensearch.internal + */ static final class HybridDirectory extends NIOFSDirectory { private final MMapDirectory delegate; @@ -201,6 +206,11 @@ MMapDirectory getDelegate() { } } + /** + * Pre loaded mmap directory + * + * @opensearch.internal + */ // TODO it would be nice to share code between PreLoadMMapDirectory and HybridDirectory but due to the nesting aspect of // directories here makes it tricky. It would be nice to allow MMAPDirectory to pre-load on a per IndexInput basis. static final class PreLoadMMapDirectory extends MMapDirectory { diff --git a/server/src/main/java/org/opensearch/index/store/Store.java b/server/src/main/java/org/opensearch/index/store/Store.java index e21cf8e3e5b58..65c47f66b7654 100644 --- a/server/src/main/java/org/opensearch/index/store/Store.java +++ b/server/src/main/java/org/opensearch/index/store/Store.java @@ -736,6 +736,11 @@ public void beforeClose() { shardLock.setDetails("closing shard"); } + /** + * A store directory + * + * @opensearch.internal + */ static final class StoreDirectory extends FilterDirectory { private final Logger deletesLogger; @@ -792,6 +797,8 @@ public Set getPendingDeletions() throws IOException { * change concurrently for safety reasons. * * @see StoreFileMetadata + * + * @opensearch.internal */ public static final class MetadataSnapshot implements Iterable, Writeable { private final Map metadata; @@ -865,6 +872,11 @@ public long getNumDocs() { return numDocs; } + /** + * Metadata that is currently loaded + * + * @opensearch.internal + */ static class LoadedMetadata { final Map fileMetadata; final Map userData; @@ -1162,6 +1174,8 @@ public String getSyncId() { * A class representing the diff between a recovery source and recovery target * * @see MetadataSnapshot#recoveryDiff(org.opensearch.index.store.Store.MetadataSnapshot) + * + * @opensearch.internal */ public static final class RecoveryDiff { /** @@ -1211,6 +1225,11 @@ public static String digestToString(long digest) { return Long.toString(digest, Character.MAX_RADIX); } + /** + * Class to verify the lucene index output + * + * @opensearch.internal + */ static class LuceneVerifyingIndexOutput extends VerifyingIndexOutput { private final StoreFileMetadata metadata; @@ -1309,6 +1328,8 @@ public void writeBytes(byte[] b, int offset, int length) throws IOException { * This class supports random access (it is possible to seek backward and forward) in order to accommodate retry * mechanism that is used in some repository plugins (S3 for example). However, the checksum is only calculated on * the first read. All consecutive reads of the same data are not used to calculate the checksum. + * + * @opensearch.internal */ static class VerifyingIndexInput extends ChecksumIndexInput { private final IndexInput input; @@ -1481,6 +1502,8 @@ public void markStoreCorrupted(IOException exception) throws IOException { /** * A listener that is executed once the store is closed and all references to it are released + * + * @opensearch.internal */ public interface OnClose extends Consumer { OnClose EMPTY = new OnClose() { diff --git a/server/src/main/java/org/opensearch/index/store/StoreStats.java b/server/src/main/java/org/opensearch/index/store/StoreStats.java index fdda71aaaeebb..8a8af673713e9 100644 --- a/server/src/main/java/org/opensearch/index/store/StoreStats.java +++ b/server/src/main/java/org/opensearch/index/store/StoreStats.java @@ -138,6 +138,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Fields for store statistics + * + * @opensearch.internal + */ static final class Fields { static final String STORE = "store"; static final String SIZE = "size"; diff --git a/server/src/main/java/org/opensearch/index/termvectors/TermVectorsService.java b/server/src/main/java/org/opensearch/index/termvectors/TermVectorsService.java index 7648f151851c0..ff75c6e3ddc45 100644 --- a/server/src/main/java/org/opensearch/index/termvectors/TermVectorsService.java +++ b/server/src/main/java/org/opensearch/index/termvectors/TermVectorsService.java @@ -423,7 +423,11 @@ private static Fields mergeFields(Fields fields1, Fields fields2) throws IOExcep return parallelFields; } - // Poached from Lucene ParallelLeafReader + /** + * Poached from Lucene ParallelLeafReader + * + * @opensearch.internal + */ private static final class ParallelFields extends Fields { final Map fields = new TreeMap<>(); diff --git a/server/src/main/java/org/opensearch/index/translog/MultiSnapshot.java b/server/src/main/java/org/opensearch/index/translog/MultiSnapshot.java index f1de0ddab97c4..bda8bbecb81f0 100644 --- a/server/src/main/java/org/opensearch/index/translog/MultiSnapshot.java +++ b/server/src/main/java/org/opensearch/index/translog/MultiSnapshot.java @@ -98,6 +98,11 @@ public void close() throws IOException { onClose.close(); } + /** + * Sequence number set + * + * @opensearch.internal + */ static final class SeqNoSet { static final short BIT_SET_SIZE = 1024; private final LongObjectHashMap bitSets = new LongObjectHashMap<>(); diff --git a/server/src/main/java/org/opensearch/index/translog/Translog.java b/server/src/main/java/org/opensearch/index/translog/Translog.java index 4a11db2bc6a1d..7f22ad1bf320d 100644 --- a/server/src/main/java/org/opensearch/index/translog/Translog.java +++ b/server/src/main/java/org/opensearch/index/translog/Translog.java @@ -952,6 +952,11 @@ public TranslogDeletionPolicy getDeletionPolicy() { return deletionPolicy; } + /** + * Location in the translot + * + * @opensearch.internal + */ public static class Location implements Comparable { public final long generation; @@ -1008,6 +1013,8 @@ public int hashCode() { /** * A snapshot of the transaction log, allows to iterate over all the transaction log operations. + * + * @opensearch.internal */ public interface Snapshot extends Closeable { @@ -1035,6 +1042,8 @@ default int skippedOperations() { * between {@code fromSeqNo} (inclusive) and {@code toSeqNo} (inclusive). This filtered snapshot * shares the same underlying resources with the {@code delegate} snapshot, therefore we should not * use the {@code delegate} after passing it to this filtered snapshot. + * + * @opensearch.internal */ private static final class SeqNoFilterSnapshot implements Snapshot { private final Snapshot delegate; @@ -1090,8 +1099,15 @@ public void close() throws IOException { /** * A generic interface representing an operation performed on the transaction log. * Each is associated with a type. + * + * @opensearch.internal */ public interface Operation { + /** + * The type of operation + * + * @opensearch.internal + */ enum Type { @Deprecated CREATE((byte) 1), @@ -1179,6 +1195,11 @@ static void writeOperation(final StreamOutput output, final Operation operation) } + /** + * The source in the translog + * + * @opensearch.internal + */ public static class Source { public final BytesReference source; @@ -1191,6 +1212,11 @@ public Source(BytesReference source, String routing) { } + /** + * Indexing operation + * + * @opensearch.internal + */ public static class Index implements Operation { public static final int FORMAT_6_0 = 8; // since 6.0.0 @@ -1378,6 +1404,11 @@ public long getAutoGeneratedIdTimestamp() { } + /** + * Delete operation + * + * @opensearch.internal + */ public static class Delete implements Operation { private static final int FORMAT_6_0 = 4; // 6.0 - * @@ -1509,6 +1540,11 @@ public String toString() { } } + /** + * Translog no op + * + * @opensearch.internal + */ public static class NoOp implements Operation { private final long seqNo; @@ -1588,6 +1624,11 @@ public String toString() { } } + /** + * How to sync the translog + * + * @opensearch.internal + */ public enum Durability { /** @@ -1844,6 +1885,8 @@ void closeFilesIfNoPendingRetentionLocks() throws IOException { /** * References a transaction log generation + * + * @opensearch.internal */ public static final class TranslogGeneration { public final String translogUUID; diff --git a/server/src/main/java/org/opensearch/index/warmer/WarmerStats.java b/server/src/main/java/org/opensearch/index/warmer/WarmerStats.java index 79fba31d015d3..ca2c3f4d27328 100644 --- a/server/src/main/java/org/opensearch/index/warmer/WarmerStats.java +++ b/server/src/main/java/org/opensearch/index/warmer/WarmerStats.java @@ -120,6 +120,11 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws return builder; } + /** + * Fields for warmer statistics + * + * @opensearch.internal + */ static final class Fields { static final String WARMER = "warmer"; static final String CURRENT = "current"; diff --git a/server/src/main/java/org/opensearch/transport/ConnectionManager.java b/server/src/main/java/org/opensearch/transport/ConnectionManager.java index 3fcd05029a4c9..d48f2eb4e0bb1 100644 --- a/server/src/main/java/org/opensearch/transport/ConnectionManager.java +++ b/server/src/main/java/org/opensearch/transport/ConnectionManager.java @@ -76,11 +76,21 @@ void connectToNode( ConnectionProfile getConnectionProfile(); + /** + * Validates a connection + * + * @opensearch.internal + */ @FunctionalInterface interface ConnectionValidator { void validate(Transport.Connection connection, ConnectionProfile profile, ActionListener listener); } + /** + * Connection listener for a delegating node + * + * @opensearch.internal + */ final class DelegatingNodeConnectionListener implements TransportConnectionListener { private final CopyOnWriteArrayList listeners = new CopyOnWriteArrayList<>(); diff --git a/server/src/main/java/org/opensearch/transport/ConnectionProfile.java b/server/src/main/java/org/opensearch/transport/ConnectionProfile.java index 5b657efcabd3e..708d1a3a0e4c1 100644 --- a/server/src/main/java/org/opensearch/transport/ConnectionProfile.java +++ b/server/src/main/java/org/opensearch/transport/ConnectionProfile.java @@ -174,6 +174,8 @@ private ConnectionProfile( /** * A builder to build a new {@link ConnectionProfile} + * + * @opensearch.internal */ public static class Builder { private final List handles = new ArrayList<>(); diff --git a/server/src/main/java/org/opensearch/transport/InboundAggregator.java b/server/src/main/java/org/opensearch/transport/InboundAggregator.java index 321db13751906..c8cfaa8339e33 100644 --- a/server/src/main/java/org/opensearch/transport/InboundAggregator.java +++ b/server/src/main/java/org/opensearch/transport/InboundAggregator.java @@ -239,6 +239,11 @@ private void checkBreaker(final Header header, final int contentLength, final Br } } + /** + * Internal circuit breaker control + * + * @opensearch.internal + */ private static class BreakerControl implements Releasable { private static final int CLOSED = -1; diff --git a/server/src/main/java/org/opensearch/transport/InboundHandler.java b/server/src/main/java/org/opensearch/transport/InboundHandler.java index 21a23461c1b8a..37604151603d0 100644 --- a/server/src/main/java/org/opensearch/transport/InboundHandler.java +++ b/server/src/main/java/org/opensearch/transport/InboundHandler.java @@ -432,6 +432,11 @@ static void assertRemoteVersion(StreamInput in, Version version) { assert version.equals(in.getVersion()) : "Stream version [" + in.getVersion() + "] does not match version [" + version + "]"; } + /** + * Internal request handler + * + * @opensearch.internal + */ private static class RequestHandler extends AbstractRunnable { private final RequestHandlerRegistry reg; private final T request; diff --git a/server/src/main/java/org/opensearch/transport/OutboundHandler.java b/server/src/main/java/org/opensearch/transport/OutboundHandler.java index 726fb940ee3e0..e890929cfc29f 100644 --- a/server/src/main/java/org/opensearch/transport/OutboundHandler.java +++ b/server/src/main/java/org/opensearch/transport/OutboundHandler.java @@ -212,6 +212,11 @@ void setMessageListener(TransportMessageListener listener) { } } + /** + * Internal message serializer + * + * @opensearch.internal + */ private static class MessageSerializer implements CheckedSupplier, Releasable { private final OutboundMessage message; diff --git a/server/src/main/java/org/opensearch/transport/OutboundMessage.java b/server/src/main/java/org/opensearch/transport/OutboundMessage.java index 2747a93420282..8d51f58bbe53e 100644 --- a/server/src/main/java/org/opensearch/transport/OutboundMessage.java +++ b/server/src/main/java/org/opensearch/transport/OutboundMessage.java @@ -117,6 +117,11 @@ protected BytesReference writeMessage(CompressibleBytesOutputStream stream) thro } } + /** + * Internal outbound message request + * + * @opensearch.internal + */ static class Request extends OutboundMessage { private final String[] features; @@ -158,6 +163,11 @@ private static byte setStatus(boolean compress, boolean isHandshake, Writeable m } } + /** + * Internal message response + * + * @opensearch.internal + */ static class Response extends OutboundMessage { private final Set features; diff --git a/server/src/main/java/org/opensearch/transport/ProxyConnectionStrategy.java b/server/src/main/java/org/opensearch/transport/ProxyConnectionStrategy.java index c1b35ca00a92b..dfb317fd76212 100644 --- a/server/src/main/java/org/opensearch/transport/ProxyConnectionStrategy.java +++ b/server/src/main/java/org/opensearch/transport/ProxyConnectionStrategy.java @@ -344,6 +344,11 @@ private static TransportAddress resolveAddress(String address) { return new TransportAddress(parseConfiguredAddress(address)); } + /** + * Contains information about the proxy mode + * + * @opensearch.internal + */ public static class ProxyModeInfo implements RemoteConnectionInfo.ModeInfo { private final String address; diff --git a/server/src/main/java/org/opensearch/transport/RemoteClusterService.java b/server/src/main/java/org/opensearch/transport/RemoteClusterService.java index fcdeec36f865c..d39f80ea6b383 100644 --- a/server/src/main/java/org/opensearch/transport/RemoteClusterService.java +++ b/server/src/main/java/org/opensearch/transport/RemoteClusterService.java @@ -436,6 +436,11 @@ Collection getConnections() { return remoteClusters.values(); } + /** + * Internal class to hold cluster alias and key and track a remote connection + * + * @opensearch.internal + */ private static class RemoteConnectionEnabled implements Setting.Validator { private final String clusterAlias; diff --git a/server/src/main/java/org/opensearch/transport/RemoteConnectionInfo.java b/server/src/main/java/org/opensearch/transport/RemoteConnectionInfo.java index 7ca1d646a9507..ac88eae624813 100644 --- a/server/src/main/java/org/opensearch/transport/RemoteConnectionInfo.java +++ b/server/src/main/java/org/opensearch/transport/RemoteConnectionInfo.java @@ -222,6 +222,11 @@ public int hashCode() { return Objects.hash(modeInfo, initialConnectionTimeout, clusterAlias, skipUnavailable); } + /** + * Mode information + * + * @opensearch.internal + */ public interface ModeInfo extends ToXContentFragment, Writeable { boolean isConnected(); diff --git a/server/src/main/java/org/opensearch/transport/RemoteConnectionStrategy.java b/server/src/main/java/org/opensearch/transport/RemoteConnectionStrategy.java index 8d5727858ec6f..6a3063a835d5e 100644 --- a/server/src/main/java/org/opensearch/transport/RemoteConnectionStrategy.java +++ b/server/src/main/java/org/opensearch/transport/RemoteConnectionStrategy.java @@ -422,6 +422,11 @@ private boolean connectionProfileChanged(ConnectionProfile oldProfile, Connectio || Objects.equals(oldProfile.getPingInterval(), newProfile.getPingInterval()) == false; } + /** + * Internal strategy validation object + * + * @opensearch.internal + */ static class StrategyValidator implements Setting.Validator { private final String key; diff --git a/server/src/main/java/org/opensearch/transport/SniffConnectionStrategy.java b/server/src/main/java/org/opensearch/transport/SniffConnectionStrategy.java index c84c5599bb746..3e95c937a296f 100644 --- a/server/src/main/java/org/opensearch/transport/SniffConnectionStrategy.java +++ b/server/src/main/java/org/opensearch/transport/SniffConnectionStrategy.java @@ -561,6 +561,11 @@ private boolean proxyChanged(String oldProxy, String newProxy) { return Objects.equals(oldProxy, newProxy) == false; } + /** + * Information about the sniff mode + * + * @opensearch.internal + */ public static class SniffModeInfo implements RemoteConnectionInfo.ModeInfo { final List seedNodes; diff --git a/server/src/main/java/org/opensearch/transport/TcpChannel.java b/server/src/main/java/org/opensearch/transport/TcpChannel.java index 4202b906ce161..14012ec5dd43c 100644 --- a/server/src/main/java/org/opensearch/transport/TcpChannel.java +++ b/server/src/main/java/org/opensearch/transport/TcpChannel.java @@ -96,6 +96,11 @@ public interface TcpChannel extends CloseableChannel { */ ChannelStats getChannelStats(); + /** + * Channel statistics + * + * @opensearch.internal + */ class ChannelStats { private volatile long lastAccessedTime; diff --git a/server/src/main/java/org/opensearch/transport/TcpTransport.java b/server/src/main/java/org/opensearch/transport/TcpTransport.java index 76a0671a40c3e..7aedebb946e58 100644 --- a/server/src/main/java/org/opensearch/transport/TcpTransport.java +++ b/server/src/main/java/org/opensearch/transport/TcpTransport.java @@ -244,6 +244,11 @@ public void setSlowLogThreshold(TimeValue slowLogThreshold) { inboundHandler.setSlowLogThreshold(slowLogThreshold); } + /** + * List of node connection channels + * + * @opensearch.internal + */ public final class NodeChannels extends CloseableConnection { private final Map typeMapping; private final List channels; @@ -872,6 +877,8 @@ private static boolean bufferStartsWith(BytesReference buffer, String method) { /** * A helper exception to mark an incoming connection as potentially being HTTP * so an appropriate error code can be returned + * + * @opensearch.internal */ public static class HttpRequestOnTransportException extends OpenSearchException { diff --git a/server/src/main/java/org/opensearch/transport/Transport.java b/server/src/main/java/org/opensearch/transport/Transport.java index cf917d2a532dc..fbf6b3ef350d8 100644 --- a/server/src/main/java/org/opensearch/transport/Transport.java +++ b/server/src/main/java/org/opensearch/transport/Transport.java @@ -268,6 +268,11 @@ public TransportResponseHandler onResponseReceived( } } + /** + * Request handler implementations + * + * @opensearch.internal + */ final class RequestHandlers { private volatile Map> requestHandlers = Collections.emptyMap(); diff --git a/server/src/main/java/org/opensearch/transport/TransportActionProxy.java b/server/src/main/java/org/opensearch/transport/TransportActionProxy.java index b7cf18e88d924..6ab4a86071746 100644 --- a/server/src/main/java/org/opensearch/transport/TransportActionProxy.java +++ b/server/src/main/java/org/opensearch/transport/TransportActionProxy.java @@ -53,6 +53,11 @@ public final class TransportActionProxy { private TransportActionProxy() {} // no instance + /** + * Handler for proxy requests + * + * @opensearch.internal + */ private static class ProxyRequestHandler implements TransportRequestHandler { private final TransportService service; @@ -82,6 +87,11 @@ public void messageReceived(T request, TransportChannel channel, Task task) thro } } + /** + * Handler for the proxy response + * + * @opensearch.internal + */ private static class ProxyResponseHandler implements TransportResponseHandler { private final Writeable.Reader reader; @@ -121,6 +131,11 @@ public String executor() { } } + /** + * The proxy request + * + * @opensearch.internal + */ static class ProxyRequest extends TransportRequest { final T wrapped; final DiscoveryNode targetNode; diff --git a/server/src/main/java/org/opensearch/transport/TransportRequest.java b/server/src/main/java/org/opensearch/transport/TransportRequest.java index 6d599f9faf927..b089ed538e041 100644 --- a/server/src/main/java/org/opensearch/transport/TransportRequest.java +++ b/server/src/main/java/org/opensearch/transport/TransportRequest.java @@ -45,6 +45,11 @@ * @opensearch.internal */ public abstract class TransportRequest extends TransportMessage implements TaskAwareRequest { + /** + * Empty transport request + * + * @opensearch.internal + */ public static class Empty extends TransportRequest { public static final Empty INSTANCE = new Empty(); diff --git a/server/src/main/java/org/opensearch/transport/TransportRequestOptions.java b/server/src/main/java/org/opensearch/transport/TransportRequestOptions.java index 082d4dc3dd8a5..fe54d8185ea5f 100644 --- a/server/src/main/java/org/opensearch/transport/TransportRequestOptions.java +++ b/server/src/main/java/org/opensearch/transport/TransportRequestOptions.java @@ -59,6 +59,11 @@ public Type type() { public static final TransportRequestOptions EMPTY = new TransportRequestOptions.Builder().build(); + /** + * Type of transport request + * + * @opensearch.internal + */ public enum Type { RECOVERY, BULK, @@ -71,6 +76,11 @@ public static Builder builder() { return new Builder(); } + /** + * Builder for transport request options + * + * @opensearch.internal + */ public static class Builder { private TimeValue timeout; private Type type = Type.REG; diff --git a/server/src/main/java/org/opensearch/transport/TransportResponse.java b/server/src/main/java/org/opensearch/transport/TransportResponse.java index aeef9c71499fb..59cbcc8c25dc0 100644 --- a/server/src/main/java/org/opensearch/transport/TransportResponse.java +++ b/server/src/main/java/org/opensearch/transport/TransportResponse.java @@ -58,6 +58,11 @@ public TransportResponse(StreamInput in) throws IOException { super(in); } + /** + * Empty transport response + * + * @opensearch.internal + */ public static class Empty extends TransportResponse { public static final Empty INSTANCE = new Empty(); diff --git a/server/src/main/java/org/opensearch/transport/TransportService.java b/server/src/main/java/org/opensearch/transport/TransportService.java index 4d8773dcfbf9f..1a280f2475e5d 100644 --- a/server/src/main/java/org/opensearch/transport/TransportService.java +++ b/server/src/main/java/org/opensearch/transport/TransportService.java @@ -566,6 +566,11 @@ public ConnectionManager getConnectionManager() { return connectionManager; } + /** + * Internal Handshake request + * + * @opensearch.internal + */ static class HandshakeRequest extends TransportRequest { public static final HandshakeRequest INSTANCE = new HandshakeRequest(); @@ -578,6 +583,11 @@ private HandshakeRequest() {} } + /** + * Internal handshake response + * + * @opensearch.internal + */ public static class HandshakeResponse extends TransportResponse { private final DiscoveryNode discoveryNode; private final ClusterName clusterName; @@ -1285,6 +1295,11 @@ private void scheduleTimeout(TimeValue timeout) { } } + /** + * Holder for timeout information + * + * @opensearch.internal + */ static class TimeoutInfoHolder { private final DiscoveryNode node; @@ -1372,6 +1387,11 @@ void setTimeoutHandler(TimeoutHandler handler) { } + /** + * A channel for a direct response + * + * @opensearch.internal + */ static class DirectResponseChannel implements TransportChannel { final DiscoveryNode localNode; private final String action; From bdefab0873cde3badedb41a91564555d06297791 Mon Sep 17 00:00:00 2001 From: Tianli Feng Date: Wed, 11 May 2022 16:36:37 -0700 Subject: [PATCH 149/514] Replace internal usages of 'master' term in 'client' directory (#3088) (#3284) * Replace internal usages of 'master' term in 'client' directory Signed-off-by: Tianli Feng * Add a uni test for NodeSelector to test deprecated master role Signed-off-by: Tianli Feng --- .../org/opensearch/client/TimedRequest.java | 14 ++--- .../indices/GetComponentTemplatesRequest.java | 16 +++--- .../GetComposableIndexTemplateRequest.java | 16 +++--- .../client/indices/GetIndexRequest.java | 4 +- .../indices/GetIndexTemplatesRequest.java | 16 +++--- .../client/ClusterRequestConvertersTests.java | 6 +-- .../opensearch/client/TimedRequestTests.java | 6 +-- .../indices/CloseIndexRequestTests.java | 6 +-- .../main/java/org/opensearch/client/Node.java | 2 +- .../org/opensearch/client/NodeSelector.java | 6 +-- .../opensearch/client/NodeSelectorTests.java | 53 ++++++++++++++----- .../client/RestClientMultipleHostsTests.java | 2 +- .../RestClientDocumentation.java | 2 +- .../section/ClientYamlTestSuiteTests.java | 6 +-- 14 files changed, 92 insertions(+), 63 deletions(-) diff --git a/client/rest-high-level/src/main/java/org/opensearch/client/TimedRequest.java b/client/rest-high-level/src/main/java/org/opensearch/client/TimedRequest.java index 3310425df4662..b5e7209a5212b 100644 --- a/client/rest-high-level/src/main/java/org/opensearch/client/TimedRequest.java +++ b/client/rest-high-level/src/main/java/org/opensearch/client/TimedRequest.java @@ -47,7 +47,7 @@ public abstract class TimedRequest implements Validatable { public static final TimeValue DEFAULT_MASTER_NODE_TIMEOUT = TimeValue.timeValueSeconds(30); private TimeValue timeout = DEFAULT_ACK_TIMEOUT; - private TimeValue masterTimeout = DEFAULT_MASTER_NODE_TIMEOUT; + private TimeValue clusterManagerTimeout = DEFAULT_MASTER_NODE_TIMEOUT; /** * Sets the timeout to wait for the all the nodes to acknowledge @@ -58,11 +58,11 @@ public void setTimeout(TimeValue timeout) { } /** - * Sets the timeout to connect to the master node - * @param masterTimeout timeout as a {@link TimeValue} + * Sets the timeout to connect to the cluster-manager node + * @param clusterManagerTimeout timeout as a {@link TimeValue} */ - public void setMasterTimeout(TimeValue masterTimeout) { - this.masterTimeout = masterTimeout; + public void setMasterTimeout(TimeValue clusterManagerTimeout) { + this.clusterManagerTimeout = clusterManagerTimeout; } /** @@ -73,9 +73,9 @@ public TimeValue timeout() { } /** - * Returns the timeout for the request to be completed on the master node + * Returns the timeout for the request to be completed on the cluster-manager node */ public TimeValue masterNodeTimeout() { - return masterTimeout; + return clusterManagerTimeout; } } diff --git a/client/rest-high-level/src/main/java/org/opensearch/client/indices/GetComponentTemplatesRequest.java b/client/rest-high-level/src/main/java/org/opensearch/client/indices/GetComponentTemplatesRequest.java index f70682fee3763..ba9702fd6f2f2 100644 --- a/client/rest-high-level/src/main/java/org/opensearch/client/indices/GetComponentTemplatesRequest.java +++ b/client/rest-high-level/src/main/java/org/opensearch/client/indices/GetComponentTemplatesRequest.java @@ -44,7 +44,7 @@ public class GetComponentTemplatesRequest implements Validatable { private final String name; - private TimeValue masterNodeTimeout = TimedRequest.DEFAULT_MASTER_NODE_TIMEOUT; + private TimeValue clusterManagerNodeTimeout = TimedRequest.DEFAULT_MASTER_NODE_TIMEOUT; private boolean local = false; /** @@ -65,23 +65,23 @@ public String name() { } /** - * @return the timeout for waiting for the master node to respond + * @return the timeout for waiting for the cluster-manager node to respond */ public TimeValue getMasterNodeTimeout() { - return masterNodeTimeout; + return clusterManagerNodeTimeout; } - public void setMasterNodeTimeout(@Nullable TimeValue masterNodeTimeout) { - this.masterNodeTimeout = masterNodeTimeout; + public void setMasterNodeTimeout(@Nullable TimeValue clusterManagerNodeTimeout) { + this.clusterManagerNodeTimeout = clusterManagerNodeTimeout; } - public void setMasterNodeTimeout(String masterNodeTimeout) { - final TimeValue timeValue = TimeValue.parseTimeValue(masterNodeTimeout, getClass().getSimpleName() + ".masterNodeTimeout"); + public void setMasterNodeTimeout(String clusterManagerNodeTimeout) { + final TimeValue timeValue = TimeValue.parseTimeValue(clusterManagerNodeTimeout, getClass().getSimpleName() + ".masterNodeTimeout"); setMasterNodeTimeout(timeValue); } /** - * @return true if this request is to read from the local cluster state, rather than the master node - false otherwise + * @return true if this request is to read from the local cluster state, rather than the cluster-manager node - false otherwise */ public boolean isLocal() { return local; diff --git a/client/rest-high-level/src/main/java/org/opensearch/client/indices/GetComposableIndexTemplateRequest.java b/client/rest-high-level/src/main/java/org/opensearch/client/indices/GetComposableIndexTemplateRequest.java index 572a5eeec2d23..cc8e820d5929f 100644 --- a/client/rest-high-level/src/main/java/org/opensearch/client/indices/GetComposableIndexTemplateRequest.java +++ b/client/rest-high-level/src/main/java/org/opensearch/client/indices/GetComposableIndexTemplateRequest.java @@ -44,7 +44,7 @@ public class GetComposableIndexTemplateRequest implements Validatable { private final String name; - private TimeValue masterNodeTimeout = TimedRequest.DEFAULT_MASTER_NODE_TIMEOUT; + private TimeValue clusterManagerNodeTimeout = TimedRequest.DEFAULT_MASTER_NODE_TIMEOUT; private boolean local = false; /** @@ -65,23 +65,23 @@ public String name() { } /** - * @return the timeout for waiting for the master node to respond + * @return the timeout for waiting for the cluster-manager node to respond */ public TimeValue getMasterNodeTimeout() { - return masterNodeTimeout; + return clusterManagerNodeTimeout; } - public void setMasterNodeTimeout(@Nullable TimeValue masterNodeTimeout) { - this.masterNodeTimeout = masterNodeTimeout; + public void setMasterNodeTimeout(@Nullable TimeValue clusterManagerNodeTimeout) { + this.clusterManagerNodeTimeout = clusterManagerNodeTimeout; } - public void setMasterNodeTimeout(String masterNodeTimeout) { - final TimeValue timeValue = TimeValue.parseTimeValue(masterNodeTimeout, getClass().getSimpleName() + ".masterNodeTimeout"); + public void setMasterNodeTimeout(String clusterManagerNodeTimeout) { + final TimeValue timeValue = TimeValue.parseTimeValue(clusterManagerNodeTimeout, getClass().getSimpleName() + ".masterNodeTimeout"); setMasterNodeTimeout(timeValue); } /** - * @return true if this request is to read from the local cluster state, rather than the master node - false otherwise + * @return true if this request is to read from the local cluster state, rather than the cluster-manager node - false otherwise */ public boolean isLocal() { return local; diff --git a/client/rest-high-level/src/main/java/org/opensearch/client/indices/GetIndexRequest.java b/client/rest-high-level/src/main/java/org/opensearch/client/indices/GetIndexRequest.java index 5e5ab6aeae305..c5ef5cb9c1795 100644 --- a/client/rest-high-level/src/main/java/org/opensearch/client/indices/GetIndexRequest.java +++ b/client/rest-high-level/src/main/java/org/opensearch/client/indices/GetIndexRequest.java @@ -82,9 +82,9 @@ public final GetIndexRequest local(boolean local) { } /** - * Return local information, do not retrieve the state from master node (default: false). + * Return local information, do not retrieve the state from cluster-manager node (default: false). * @return true if local information is to be returned; - * false if information is to be retrieved from master node (default). + * false if information is to be retrieved from cluster-manager node (default). */ public final boolean local() { return local; diff --git a/client/rest-high-level/src/main/java/org/opensearch/client/indices/GetIndexTemplatesRequest.java b/client/rest-high-level/src/main/java/org/opensearch/client/indices/GetIndexTemplatesRequest.java index 071bcc7a75a71..f46af130cc9b0 100644 --- a/client/rest-high-level/src/main/java/org/opensearch/client/indices/GetIndexTemplatesRequest.java +++ b/client/rest-high-level/src/main/java/org/opensearch/client/indices/GetIndexTemplatesRequest.java @@ -51,7 +51,7 @@ public class GetIndexTemplatesRequest implements Validatable { private final List names; - private TimeValue masterNodeTimeout = TimedRequest.DEFAULT_MASTER_NODE_TIMEOUT; + private TimeValue clusterManagerNodeTimeout = TimedRequest.DEFAULT_MASTER_NODE_TIMEOUT; private boolean local = false; /** @@ -84,23 +84,23 @@ public List names() { } /** - * @return the timeout for waiting for the master node to respond + * @return the timeout for waiting for the cluster-manager node to respond */ public TimeValue getMasterNodeTimeout() { - return masterNodeTimeout; + return clusterManagerNodeTimeout; } - public void setMasterNodeTimeout(@Nullable TimeValue masterNodeTimeout) { - this.masterNodeTimeout = masterNodeTimeout; + public void setMasterNodeTimeout(@Nullable TimeValue clusterManagerNodeTimeout) { + this.clusterManagerNodeTimeout = clusterManagerNodeTimeout; } - public void setMasterNodeTimeout(String masterNodeTimeout) { - final TimeValue timeValue = TimeValue.parseTimeValue(masterNodeTimeout, getClass().getSimpleName() + ".masterNodeTimeout"); + public void setMasterNodeTimeout(String clusterManagerNodeTimeout) { + final TimeValue timeValue = TimeValue.parseTimeValue(clusterManagerNodeTimeout, getClass().getSimpleName() + ".masterNodeTimeout"); setMasterNodeTimeout(timeValue); } /** - * @return true if this request is to read from the local cluster state, rather than the master node - false otherwise + * @return true if this request is to read from the local cluster state, rather than the cluster-manager node - false otherwise */ public boolean isLocal() { return local; diff --git a/client/rest-high-level/src/test/java/org/opensearch/client/ClusterRequestConvertersTests.java b/client/rest-high-level/src/test/java/org/opensearch/client/ClusterRequestConvertersTests.java index 2af164a51dbab..dcc8443656b10 100644 --- a/client/rest-high-level/src/test/java/org/opensearch/client/ClusterRequestConvertersTests.java +++ b/client/rest-high-level/src/test/java/org/opensearch/client/ClusterRequestConvertersTests.java @@ -91,7 +91,7 @@ public void testClusterHealth() { RequestConvertersTests.setRandomLocal(healthRequest::local, expectedParams); String timeoutType = OpenSearchTestCase.randomFrom("timeout", "masterTimeout", "both", "none"); String timeout = OpenSearchTestCase.randomTimeValue(); - String masterTimeout = OpenSearchTestCase.randomTimeValue(); + String clusterManagerTimeout = OpenSearchTestCase.randomTimeValue(); switch (timeoutType) { case "timeout": healthRequest.timeout(timeout); @@ -101,8 +101,8 @@ public void testClusterHealth() { break; case "masterTimeout": expectedParams.put("timeout", "30s"); - healthRequest.masterNodeTimeout(masterTimeout); - expectedParams.put("master_timeout", masterTimeout); + healthRequest.masterNodeTimeout(clusterManagerTimeout); + expectedParams.put("master_timeout", clusterManagerTimeout); break; case "both": healthRequest.timeout(timeout); diff --git a/client/rest-high-level/src/test/java/org/opensearch/client/TimedRequestTests.java b/client/rest-high-level/src/test/java/org/opensearch/client/TimedRequestTests.java index 3026472bb8e53..659238debccad 100644 --- a/client/rest-high-level/src/test/java/org/opensearch/client/TimedRequestTests.java +++ b/client/rest-high-level/src/test/java/org/opensearch/client/TimedRequestTests.java @@ -48,10 +48,10 @@ public void testNonDefaults() { TimedRequest timedRequest = new TimedRequest() { }; TimeValue timeout = TimeValue.timeValueSeconds(randomIntBetween(0, 1000)); - TimeValue masterTimeout = TimeValue.timeValueSeconds(randomIntBetween(0, 1000)); + TimeValue clusterManagerTimeout = TimeValue.timeValueSeconds(randomIntBetween(0, 1000)); timedRequest.setTimeout(timeout); - timedRequest.setMasterTimeout(masterTimeout); + timedRequest.setMasterTimeout(clusterManagerTimeout); assertEquals(timedRequest.timeout(), timeout); - assertEquals(timedRequest.masterNodeTimeout(), masterTimeout); + assertEquals(timedRequest.masterNodeTimeout(), clusterManagerTimeout); } } diff --git a/client/rest-high-level/src/test/java/org/opensearch/client/indices/CloseIndexRequestTests.java b/client/rest-high-level/src/test/java/org/opensearch/client/indices/CloseIndexRequestTests.java index c96e296891fb9..5bfb0abab9f37 100644 --- a/client/rest-high-level/src/test/java/org/opensearch/client/indices/CloseIndexRequestTests.java +++ b/client/rest-high-level/src/test/java/org/opensearch/client/indices/CloseIndexRequestTests.java @@ -80,10 +80,10 @@ public void testTimeout() { final TimeValue timeout = TimeValue.timeValueSeconds(randomIntBetween(0, 1000)); request.setTimeout(timeout); - final TimeValue masterTimeout = TimeValue.timeValueSeconds(randomIntBetween(0, 1000)); - request.setMasterTimeout(masterTimeout); + final TimeValue clusterManagerTimeout = TimeValue.timeValueSeconds(randomIntBetween(0, 1000)); + request.setMasterTimeout(clusterManagerTimeout); assertEquals(request.timeout(), timeout); - assertEquals(request.masterNodeTimeout(), masterTimeout); + assertEquals(request.masterNodeTimeout(), clusterManagerTimeout); } } diff --git a/client/rest/src/main/java/org/opensearch/client/Node.java b/client/rest/src/main/java/org/opensearch/client/Node.java index c982ae8eb931f..952823cf29d6c 100644 --- a/client/rest/src/main/java/org/opensearch/client/Node.java +++ b/client/rest/src/main/java/org/opensearch/client/Node.java @@ -210,7 +210,7 @@ public Roles(final Set roles) { } /** - * Returns whether or not the node could be elected master. + * Returns whether or not the node could be elected cluster-manager. */ public boolean isMasterEligible() { return roles.contains("master") || roles.contains("cluster_manager"); diff --git a/client/rest/src/main/java/org/opensearch/client/NodeSelector.java b/client/rest/src/main/java/org/opensearch/client/NodeSelector.java index 09d5a2c1fe576..1d1c09f33fef7 100644 --- a/client/rest/src/main/java/org/opensearch/client/NodeSelector.java +++ b/client/rest/src/main/java/org/opensearch/client/NodeSelector.java @@ -36,7 +36,7 @@ /** * Selects nodes that can receive requests. Used to keep requests away - * from master nodes or to send them to nodes with a particular attribute. + * from cluster-manager nodes or to send them to nodes with a particular attribute. * Use with {@link RestClientBuilder#setNodeSelector(NodeSelector)}. */ public interface NodeSelector { @@ -80,10 +80,10 @@ public String toString() { /** * Selector that matches any node that has metadata and doesn't - * have the {@code master} role OR it has the data {@code data} + * have the {@code cluster_manager} role OR it has the data {@code data} * role. */ - NodeSelector SKIP_DEDICATED_MASTERS = new NodeSelector() { + NodeSelector SKIP_DEDICATED_CLUSTER_MANAGERS = new NodeSelector() { @Override public void select(Iterable nodes) { for (Iterator itr = nodes.iterator(); itr.hasNext();) { diff --git a/client/rest/src/test/java/org/opensearch/client/NodeSelectorTests.java b/client/rest/src/test/java/org/opensearch/client/NodeSelectorTests.java index f7cb0733bb8c5..65a831e59bfb0 100644 --- a/client/rest/src/test/java/org/opensearch/client/NodeSelectorTests.java +++ b/client/rest/src/test/java/org/opensearch/client/NodeSelectorTests.java @@ -55,33 +55,33 @@ public void testAny() { assertEquals(expected, nodes); } - public void testNotMasterOnly() { - Node masterOnly = dummyNode(true, false, false); + public void testNotClusterManagerOnly() { + Node clusterManagerOnly = dummyNode(true, false, false); Node all = dummyNode(true, true, true); - Node masterAndData = dummyNode(true, true, false); - Node masterAndIngest = dummyNode(true, false, true); + Node clusterManagerAndData = dummyNode(true, true, false); + Node clusterManagerAndIngest = dummyNode(true, false, true); Node coordinatingOnly = dummyNode(false, false, false); Node ingestOnly = dummyNode(false, false, true); Node data = dummyNode(false, true, randomBoolean()); List nodes = new ArrayList<>(); - nodes.add(masterOnly); + nodes.add(clusterManagerOnly); nodes.add(all); - nodes.add(masterAndData); - nodes.add(masterAndIngest); + nodes.add(clusterManagerAndData); + nodes.add(clusterManagerAndIngest); nodes.add(coordinatingOnly); nodes.add(ingestOnly); nodes.add(data); Collections.shuffle(nodes, getRandom()); List expected = new ArrayList<>(nodes); - expected.remove(masterOnly); - NodeSelector.SKIP_DEDICATED_MASTERS.select(nodes); + expected.remove(clusterManagerOnly); + NodeSelector.SKIP_DEDICATED_CLUSTER_MANAGERS.select(nodes); assertEquals(expected, nodes); } - private static Node dummyNode(boolean master, boolean data, boolean ingest) { + private static Node dummyNode(boolean clusterManager, boolean data, boolean ingest) { final Set roles = new TreeSet<>(); - if (master) { - roles.add("master"); + if (clusterManager) { + roles.add("cluster_manager"); } if (data) { roles.add("data"); @@ -98,4 +98,33 @@ private static Node dummyNode(boolean master, boolean data, boolean ingest) { Collections.>emptyMap() ); } + + /* + * Validate SKIP_DEDICATED_CLUSTER_MANAGERS can filter both the deprecated "master" role and the new "cluster_manager" role. + * The test is a modified copy of the above testNotClusterManagerOnly(). + */ + public void testDeprecatedNotMasterOnly() { + Node clusterManagerOnly = dummyNode(true, false, false); + Node all = dummyNode(true, true, true); + Node data = dummyNode(false, true, randomBoolean()); + Node deprecatedMasterOnly = new Node( + new HttpHost("dummy"), + Collections.emptySet(), + randomAsciiAlphanumOfLength(5), + randomAsciiAlphanumOfLength(5), + new Roles(Collections.singleton("master")), + Collections.emptyMap() + ); + List nodes = new ArrayList<>(); + nodes.add(clusterManagerOnly); + nodes.add(all); + nodes.add(data); + nodes.add(deprecatedMasterOnly); + Collections.shuffle(nodes, getRandom()); + List expected = new ArrayList<>(nodes); + expected.remove(clusterManagerOnly); + expected.remove(deprecatedMasterOnly); + NodeSelector.SKIP_DEDICATED_CLUSTER_MANAGERS.select(nodes); + assertEquals(expected, nodes); + } } diff --git a/client/rest/src/test/java/org/opensearch/client/RestClientMultipleHostsTests.java b/client/rest/src/test/java/org/opensearch/client/RestClientMultipleHostsTests.java index 0b7d2881ccb54..d88d4f4afd9b1 100644 --- a/client/rest/src/test/java/org/opensearch/client/RestClientMultipleHostsTests.java +++ b/client/rest/src/test/java/org/opensearch/client/RestClientMultipleHostsTests.java @@ -297,7 +297,7 @@ public void testNodeSelector() throws Exception { } public void testSetNodes() throws Exception { - RestClient restClient = createRestClient(NodeSelector.SKIP_DEDICATED_MASTERS); + RestClient restClient = createRestClient(NodeSelector.SKIP_DEDICATED_CLUSTER_MANAGERS); List newNodes = new ArrayList<>(nodes.size()); for (int i = 0; i < nodes.size(); i++) { Node.Roles roles = i == 0 diff --git a/client/rest/src/test/java/org/opensearch/client/documentation/RestClientDocumentation.java b/client/rest/src/test/java/org/opensearch/client/documentation/RestClientDocumentation.java index 82c4fc2896213..066419844f048 100644 --- a/client/rest/src/test/java/org/opensearch/client/documentation/RestClientDocumentation.java +++ b/client/rest/src/test/java/org/opensearch/client/documentation/RestClientDocumentation.java @@ -133,7 +133,7 @@ public void usage() throws IOException, InterruptedException { //tag::rest-client-init-node-selector RestClientBuilder builder = RestClient.builder( new HttpHost("localhost", 9200, "http")); - builder.setNodeSelector(NodeSelector.SKIP_DEDICATED_MASTERS); // <1> + builder.setNodeSelector(NodeSelector.SKIP_DEDICATED_CLUSTER_MANAGERS); // <1> //end::rest-client-init-node-selector } { diff --git a/test/framework/src/test/java/org/opensearch/test/rest/yaml/section/ClientYamlTestSuiteTests.java b/test/framework/src/test/java/org/opensearch/test/rest/yaml/section/ClientYamlTestSuiteTests.java index fc4564ce55df7..f995e18d0f2df 100644 --- a/test/framework/src/test/java/org/opensearch/test/rest/yaml/section/ClientYamlTestSuiteTests.java +++ b/test/framework/src/test/java/org/opensearch/test/rest/yaml/section/ClientYamlTestSuiteTests.java @@ -486,7 +486,7 @@ public void testAddingDoWithNodeSelectorWithoutSkipNodeSelector() { int lineNumber = between(1, 10000); DoSection doSection = new DoSection(new XContentLocation(lineNumber, 0)); ApiCallSection apiCall = new ApiCallSection("test"); - apiCall.setNodeSelector(NodeSelector.SKIP_DEDICATED_MASTERS); + apiCall.setNodeSelector(NodeSelector.SKIP_DEDICATED_CLUSTER_MANAGERS); doSection.setApiCallSection(apiCall); ClientYamlTestSuite testSuite = createTestSuite(SkipSection.EMPTY, doSection); Exception e = expectThrows(IllegalArgumentException.class, testSuite::validate); @@ -553,7 +553,7 @@ public void testMultipleValidationErrors() { { DoSection doSection = new DoSection(new XContentLocation(thirdLineNumber, 0)); ApiCallSection apiCall = new ApiCallSection("test"); - apiCall.setNodeSelector(NodeSelector.SKIP_DEDICATED_MASTERS); + apiCall.setNodeSelector(NodeSelector.SKIP_DEDICATED_CLUSTER_MANAGERS); doSection.setApiCallSection(apiCall); doSections.add(doSection); } @@ -593,7 +593,7 @@ public void testAddingDoWithNodeSelectorWithSkip() { SkipSection skipSection = new SkipSection(null, singletonList("node_selector"), null); DoSection doSection = new DoSection(new XContentLocation(lineNumber, 0)); ApiCallSection apiCall = new ApiCallSection("test"); - apiCall.setNodeSelector(NodeSelector.SKIP_DEDICATED_MASTERS); + apiCall.setNodeSelector(NodeSelector.SKIP_DEDICATED_CLUSTER_MANAGERS); doSection.setApiCallSection(apiCall); createTestSuite(skipSection, doSection).validate(); } From ccd7c5b1b244b803adfd9359ead2e807693f048e Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 11 May 2022 20:29:25 -0400 Subject: [PATCH 150/514] Replace internal usages of 'master' term in 'test' directory (#3283) (#3293) * Replace internal usages of 'master' terminology in server/src/internalClusterTest directory Signed-off-by: Tianli Feng * Replace 'master' terminology with 'cluster manager' in test directory Signed-off-by: Tianli Feng * Replace 'master' terminology with 'cluster manager' in server/src/internalClusterTest directory Signed-off-by: Tianli Feng * Adjust format by spotlessApply task Signed-off-by: Tianli Feng * Replace 'master' terminology with 'cluster manager' in test directory Signed-off-by: Tianli Feng * Adjust format by spotlessApply task Signed-off-by: Tianli Feng (cherry picked from commit 10bff0c9f5b9ca78b3dc50f5c704dabf41b9d535) Co-authored-by: Tianli Feng --- .../ingest/common/IngestRestartIT.java | 2 +- .../rest/discovery/Zen2RestApiIT.java | 10 +- .../discovery/gce/GceDiscoverTests.java | 2 +- .../http/DanglingIndicesRestIT.java | 6 +- .../action/admin/ClientTimeoutIT.java | 14 +- .../ClusterAllocationExplainIT.java | 6 +- .../admin/cluster/node/tasks/TasksIT.java | 8 +- ...ansportClusterStateActionDisruptionIT.java | 46 +-- .../admin/cluster/stats/ClusterStatsIT.java | 12 +- .../admin/indices/exists/IndicesExistsIT.java | 2 +- .../master/IndexingMasterFailoverIT.java | 2 +- .../cluster/ClusterStateDiffIT.java | 8 +- .../cluster/MinimumMasterNodesIT.java | 18 +- .../cluster/SpecificMasterNodesIT.java | 14 +- .../coordination/RareClusterStateIT.java | 2 +- .../coordination/RemoveCustomsCommandIT.java | 6 +- .../coordination/RemoveSettingsCommandIT.java | 6 +- .../UnsafeBootstrapAndDetachCommandIT.java | 58 ++-- .../coordination/VotingConfigurationIT.java | 4 +- .../cluster/coordination/ZenDiscoveryIT.java | 8 +- .../cluster/routing/AllocationIdIT.java | 2 +- .../cluster/routing/PrimaryAllocationIT.java | 28 +- .../decider/DiskThresholdDeciderIT.java | 4 +- .../ClusterDisruptionCleanSettingsIT.java | 2 +- .../discovery/ClusterDisruptionIT.java | 28 +- .../discovery/DiscoveryDisruptionIT.java | 50 +-- .../discovery/MasterDisruptionIT.java | 29 +- .../discovery/StableMasterDisruptionIT.java | 8 +- .../env/NodeRepurposeCommandIT.java | 24 +- .../gateway/GatewayIndexStateIT.java | 2 +- .../opensearch/gateway/MetadataNodesIT.java | 6 +- .../gateway/RecoverAfterNodesIT.java | 16 +- .../gateway/RecoveryFromGatewayIT.java | 2 +- .../gateway/ReplicaShardAllocatorIT.java | 6 +- .../PeerRecoveryRetentionLeaseCreationIT.java | 2 +- .../RemoveCorruptedShardDataCommandIT.java | 2 +- .../DedicatedMasterGetFieldMappingIT.java | 2 +- .../indices/recovery/IndexRecoveryIT.java | 6 +- .../store/IndicesStoreIntegrationIT.java | 20 +- .../org/opensearch/ingest/IngestClientIT.java | 6 +- .../recovery/FullRollingRestartIT.java | 2 +- .../snapshots/AbortedRestoreIT.java | 2 +- .../snapshots/BlobStoreIncrementalityIT.java | 4 +- .../opensearch/snapshots/CloneSnapshotIT.java | 44 +-- .../snapshots/ConcurrentSnapshotsIT.java | 90 +++--- .../DedicatedClusterSnapshotRestoreIT.java | 16 +- .../snapshots/MultiClusterRepoAccessIT.java | 4 +- .../snapshots/SnapshotShardsServiceIT.java | 2 +- .../DelayedAllocationServiceTests.java | 2 +- .../allocation/AllocationCommandsTests.java | 4 +- .../NodeVersionAllocationDeciderTests.java | 12 +- .../allocation/SameShardRoutingTests.java | 6 +- .../decider/DiskThresholdDeciderTests.java | 4 +- .../IncrementalClusterStateWriterTests.java | 4 +- .../transport/RemoteClusterServiceTests.java | 4 +- .../ClusterStateCreationUtils.java | 18 +- .../cluster/OpenSearchAllocationTestCase.java | 8 +- .../AbstractCoordinatorTestCase.java | 66 ++-- .../CoordinationStateTestCluster.java | 14 +- .../service/FakeThreadPoolMasterService.java | 4 +- .../opensearch/common/util/MockBigArrays.java | 19 +- .../common/util/MockPageCacheRecycler.java | 22 +- .../blobstore/BlobStoreTestUtil.java | 2 +- .../AbstractSnapshotIntegTestCase.java | 26 +- .../snapshots/mockstore/MockRepository.java | 4 +- .../test/AbstractBuilderTestCase.java | 6 +- .../opensearch/test/ClusterServiceUtils.java | 12 +- .../opensearch/test/ExternalTestCluster.java | 12 +- .../opensearch/test/InternalTestCluster.java | 296 +++++++++--------- .../java/org/opensearch/test/NodeRoles.java | 6 +- .../test/OpenSearchIntegTestCase.java | 86 ++--- .../test/OpenSearchSingleNodeTestCase.java | 2 +- .../java/org/opensearch/test/TestCluster.java | 2 +- .../org/opensearch/test/VersionUtils.java | 4 +- .../BlockMasterServiceOnMaster.java | 2 +- .../BusyMasterServiceDisruption.java | 2 +- .../test/disruption/NetworkDisruption.java | 2 +- .../rest/yaml/ClientYamlDocsTestClient.java | 4 +- .../test/rest/yaml/ClientYamlTestClient.java | 10 +- .../yaml/ClientYamlTestExecutionContext.java | 2 +- .../OpenSearchClientYamlSuiteTestCase.java | 43 +-- .../test/rest/yaml/section/DoSection.java | 6 +- .../FakeThreadPoolMasterServiceTests.java | 16 +- .../test/disruption/NetworkDisruptionIT.java | 6 +- .../test/test/InternalTestClusterIT.java | 2 +- .../test/test/InternalTestClusterTests.java | 52 +-- 86 files changed, 743 insertions(+), 692 deletions(-) diff --git a/modules/ingest-common/src/internalClusterTest/java/org/opensearch/ingest/common/IngestRestartIT.java b/modules/ingest-common/src/internalClusterTest/java/org/opensearch/ingest/common/IngestRestartIT.java index aeaa7246f33b8..c662843b91ebb 100644 --- a/modules/ingest-common/src/internalClusterTest/java/org/opensearch/ingest/common/IngestRestartIT.java +++ b/modules/ingest-common/src/internalClusterTest/java/org/opensearch/ingest/common/IngestRestartIT.java @@ -86,7 +86,7 @@ protected Map, Object>> pluginScripts() { public void testFailureInConditionalProcessor() { internalCluster().ensureAtLeastNumDataNodes(1); - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String pipelineId = "foo"; client().admin() .cluster() diff --git a/modules/transport-netty4/src/internalClusterTest/java/org/opensearch/rest/discovery/Zen2RestApiIT.java b/modules/transport-netty4/src/internalClusterTest/java/org/opensearch/rest/discovery/Zen2RestApiIT.java index f7899d91e0cb9..96e21e0e05ff7 100644 --- a/modules/transport-netty4/src/internalClusterTest/java/org/opensearch/rest/discovery/Zen2RestApiIT.java +++ b/modules/transport-netty4/src/internalClusterTest/java/org/opensearch/rest/discovery/Zen2RestApiIT.java @@ -69,7 +69,7 @@ protected boolean addMockHttpTransport() { } public void testRollingRestartOfTwoNodeCluster() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(1); + internalCluster().setBootstrapClusterManagerNodeIndex(1); final List nodes = internalCluster().startNodes(2); createIndex( "test", @@ -135,7 +135,7 @@ public Settings onNodeStopped(String nodeName) throws IOException { } public void testClearVotingTombstonesNotWaitingForRemoval() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(2); + internalCluster().setBootstrapClusterManagerNodeIndex(2); List nodes = internalCluster().startNodes(3); ensureStableCluster(3); RestClient restClient = getRestClient(); @@ -150,7 +150,7 @@ public void testClearVotingTombstonesNotWaitingForRemoval() throws Exception { } public void testClearVotingTombstonesWaitingForRemoval() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(2); + internalCluster().setBootstrapClusterManagerNodeIndex(2); List nodes = internalCluster().startNodes(3); ensureStableCluster(3); RestClient restClient = getRestClient(); @@ -165,7 +165,7 @@ public void testClearVotingTombstonesWaitingForRemoval() throws Exception { } public void testFailsOnUnknownNode() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(2); + internalCluster().setBootstrapClusterManagerNodeIndex(2); internalCluster().startNodes(3); ensureStableCluster(3); RestClient restClient = getRestClient(); @@ -182,7 +182,7 @@ public void testFailsOnUnknownNode() throws Exception { } public void testRemoveTwoNodesAtOnce() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(2); + internalCluster().setBootstrapClusterManagerNodeIndex(2); List nodes = internalCluster().startNodes(3); ensureStableCluster(3); RestClient restClient = getRestClient(); diff --git a/plugins/discovery-gce/src/internalClusterTest/java/org/opensearch/discovery/gce/GceDiscoverTests.java b/plugins/discovery-gce/src/internalClusterTest/java/org/opensearch/discovery/gce/GceDiscoverTests.java index 815537b534586..60293614254c5 100644 --- a/plugins/discovery-gce/src/internalClusterTest/java/org/opensearch/discovery/gce/GceDiscoverTests.java +++ b/plugins/discovery-gce/src/internalClusterTest/java/org/opensearch/discovery/gce/GceDiscoverTests.java @@ -86,7 +86,7 @@ protected Settings nodeSettings(int nodeOrdinal) { public void testJoin() { // start master node - final String masterNode = internalCluster().startMasterOnlyNode(); + final String masterNode = internalCluster().startClusterManagerOnlyNode(); registerGceNode(masterNode); ClusterStateResponse clusterStateResponse = client(masterNode).admin() diff --git a/qa/smoke-test-http/src/test/java/org/opensearch/http/DanglingIndicesRestIT.java b/qa/smoke-test-http/src/test/java/org/opensearch/http/DanglingIndicesRestIT.java index 3b32ac40917e4..8ce546e327c31 100644 --- a/qa/smoke-test-http/src/test/java/org/opensearch/http/DanglingIndicesRestIT.java +++ b/qa/smoke-test-http/src/test/java/org/opensearch/http/DanglingIndicesRestIT.java @@ -91,7 +91,7 @@ private Settings buildSettings(int maxTombstones) { * Check that when dangling indices are discovered, then they can be listed via the REST API. */ public void testDanglingIndicesCanBeListed() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(1); + internalCluster().setBootstrapClusterManagerNodeIndex(1); internalCluster().startNodes(3, buildSettings(0)); final DanglingIndexDetails danglingIndexDetails = createDanglingIndices(INDEX_NAME); @@ -121,7 +121,7 @@ public void testDanglingIndicesCanBeListed() throws Exception { * Check that dangling indices can be imported. */ public void testDanglingIndicesCanBeImported() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(1); + internalCluster().setBootstrapClusterManagerNodeIndex(1); internalCluster().startNodes(3, buildSettings(0)); createDanglingIndices(INDEX_NAME); @@ -157,7 +157,7 @@ public void testDanglingIndicesCanBeImported() throws Exception { * deleted through the API */ public void testDanglingIndicesCanBeDeleted() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(1); + internalCluster().setBootstrapClusterManagerNodeIndex(1); internalCluster().startNodes(3, buildSettings(1)); createDanglingIndices(INDEX_NAME, OTHER_INDEX_NAME); diff --git a/server/src/internalClusterTest/java/org/opensearch/action/admin/ClientTimeoutIT.java b/server/src/internalClusterTest/java/org/opensearch/action/admin/ClientTimeoutIT.java index d83e8112569ee..3b56c07cb10c8 100644 --- a/server/src/internalClusterTest/java/org/opensearch/action/admin/ClientTimeoutIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/action/admin/ClientTimeoutIT.java @@ -47,7 +47,7 @@ protected Collection> nodePlugins() { } public void testNodesInfoTimeout() { - String masterNode = internalCluster().startMasterOnlyNode(); + String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); String dataNode = internalCluster().startDataOnlyNode(); String anotherDataNode = internalCluster().startDataOnlyNode(); @@ -65,11 +65,11 @@ public void testNodesInfoTimeout() { nodes.add(node.getNode().getName()); } assertThat(response.getNodes().size(), equalTo(2)); - assertThat(nodes.contains(masterNode), is(true)); + assertThat(nodes.contains(clusterManagerNode), is(true)); } public void testNodesStatsTimeout() { - String masterNode = internalCluster().startMasterOnlyNode(); + String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); String dataNode = internalCluster().startDataOnlyNode(); String anotherDataNode = internalCluster().startDataOnlyNode(); TimeValue timeout = TimeValue.timeValueMillis(1000); @@ -87,11 +87,11 @@ public void testNodesStatsTimeout() { nodes.add(node.getNode().getName()); } assertThat(response.getNodes().size(), equalTo(2)); - assertThat(nodes.contains(masterNode), is(true)); + assertThat(nodes.contains(clusterManagerNode), is(true)); } public void testListTasksTimeout() { - String masterNode = internalCluster().startMasterOnlyNode(); + String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); String dataNode = internalCluster().startDataOnlyNode(); String anotherDataNode = internalCluster().startDataOnlyNode(); TimeValue timeout = TimeValue.timeValueMillis(1000); @@ -108,7 +108,7 @@ public void testListTasksTimeout() { } public void testRecoveriesWithTimeout() { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); String dataNode = internalCluster().startDataOnlyNode(); String anotherDataNode = internalCluster().startDataOnlyNode(); @@ -148,7 +148,7 @@ public void testRecoveriesWithTimeout() { } public void testStatsWithTimeout() { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); String dataNode = internalCluster().startDataOnlyNode(); String anotherDataNode = internalCluster().startDataOnlyNode(); diff --git a/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainIT.java b/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainIT.java index 8c7e5378516bf..542d2069a21ce 100644 --- a/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainIT.java @@ -1110,7 +1110,7 @@ public void testAssignedReplicaOnSpecificNode() throws Exception { public void testCannotAllocateStaleReplicaExplanation() throws Exception { logger.info("--> starting 3 nodes"); - final String masterNode = internalCluster().startNode(); + final String clusterManagerNode = internalCluster().startNode(); // start replica node first, so it's path will be used first when we start a node after // stopping all of them at end of test. final String replicaNode = internalCluster().startNode(); @@ -1123,7 +1123,7 @@ public void testCannotAllocateStaleReplicaExplanation() throws Exception { 1, Settings.builder() .put("index.routing.allocation.include._name", primaryNode) - .put("index.routing.allocation.exclude._name", masterNode) + .put("index.routing.allocation.exclude._name", clusterManagerNode) .build(), ActiveShardCount.ONE ); @@ -1165,7 +1165,7 @@ public void testCannotAllocateStaleReplicaExplanation() throws Exception { logger.info("--> restart the node with the stale replica"); String restartedNode = internalCluster().startDataOnlyNode(replicaDataPathSettings); - ensureClusterSizeConsistency(); // wait for the master to finish processing join. + ensureClusterSizeConsistency(); // wait for the cluster-manager to finish processing join. // wait until the system has fetched shard data and we know there is no valid shard copy assertBusy(() -> { diff --git a/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/node/tasks/TasksIT.java b/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/node/tasks/TasksIT.java index ac0ae44eb732e..9c6c67116ef8a 100644 --- a/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/node/tasks/TasksIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/node/tasks/TasksIT.java @@ -117,7 +117,7 @@ /** * Integration tests for task management API *

    - * We need at least 2 nodes so we have a master node a non-master node + * We need at least 2 nodes so we have a cluster-manager node a non-cluster-manager node */ @OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.SUITE, minNumDataNodes = 2) public class TasksIT extends OpenSearchIntegTestCase { @@ -154,17 +154,17 @@ public void testTaskCounts() { assertThat(response.getTasks().size(), greaterThanOrEqualTo(cluster().numDataNodes())); } - public void testMasterNodeOperationTasks() { + public void testClusterManagerNodeOperationTasks() { registerTaskManagerListeners(ClusterHealthAction.NAME); - // First run the health on the master node - should produce only one task on the master node + // First run the health on the cluster-manager node - should produce only one task on the cluster-manager node internalCluster().masterClient().admin().cluster().prepareHealth().get(); assertEquals(1, numberOfEvents(ClusterHealthAction.NAME, Tuple::v1)); // counting only registration events assertEquals(1, numberOfEvents(ClusterHealthAction.NAME, event -> event.v1() == false)); // counting only unregistration events resetTaskManagerListeners(ClusterHealthAction.NAME); - // Now run the health on a non-master node - should produce one task on master and one task on another node + // Now run the health on a non-cluster-manager node - should produce one task on cluster-manager and one task on another node internalCluster().nonMasterClient().admin().cluster().prepareHealth().get(); assertEquals(2, numberOfEvents(ClusterHealthAction.NAME, Tuple::v1)); // counting only registration events assertEquals(2, numberOfEvents(ClusterHealthAction.NAME, event -> event.v1() == false)); // counting only unregistration events diff --git a/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/state/TransportClusterStateActionDisruptionIT.java b/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/state/TransportClusterStateActionDisruptionIT.java index c6f47a01ed2d2..b7538f6752ec4 100644 --- a/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/state/TransportClusterStateActionDisruptionIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/state/TransportClusterStateActionDisruptionIT.java @@ -68,8 +68,8 @@ protected Collection> nodePlugins() { return Collections.singletonList(MockTransportService.TestPlugin.class); } - public void testNonLocalRequestAlwaysFindsMaster() throws Exception { - runRepeatedlyWhileChangingMaster(() -> { + public void testNonLocalRequestAlwaysFindsClusterManager() throws Exception { + runRepeatedlyWhileChangingClusterManager(() -> { final ClusterStateRequestBuilder clusterStateRequestBuilder = client().admin() .cluster() .prepareState() @@ -82,12 +82,12 @@ public void testNonLocalRequestAlwaysFindsMaster() throws Exception { } catch (MasterNotDiscoveredException e) { return; // ok, we hit the disconnected node } - assertNotNull("should always contain a master node", clusterStateResponse.getState().nodes().getMasterNodeId()); + assertNotNull("should always contain a cluster-manager node", clusterStateResponse.getState().nodes().getMasterNodeId()); }); } public void testLocalRequestAlwaysSucceeds() throws Exception { - runRepeatedlyWhileChangingMaster(() -> { + runRepeatedlyWhileChangingClusterManager(() -> { final String node = randomFrom(internalCluster().getNodeNames()); final DiscoveryNodes discoveryNodes = client(node).admin() .cluster() @@ -108,8 +108,8 @@ public void testLocalRequestAlwaysSucceeds() throws Exception { }); } - public void testNonLocalRequestAlwaysFindsMasterAndWaitsForMetadata() throws Exception { - runRepeatedlyWhileChangingMaster(() -> { + public void testNonLocalRequestAlwaysFindsClusterManagerAndWaitsForMetadata() throws Exception { + runRepeatedlyWhileChangingClusterManager(() -> { final String node = randomFrom(internalCluster().getNodeNames()); final long metadataVersion = internalCluster().getInstance(ClusterService.class, node) .getClusterApplierService() @@ -134,14 +134,14 @@ public void testNonLocalRequestAlwaysFindsMasterAndWaitsForMetadata() throws Exc } if (clusterStateResponse.isWaitForTimedOut() == false) { final ClusterState state = clusterStateResponse.getState(); - assertNotNull("should always contain a master node", state.nodes().getMasterNodeId()); + assertNotNull("should always contain a cluster-manager node", state.nodes().getMasterNodeId()); assertThat("waited for metadata version", state.metadata().version(), greaterThanOrEqualTo(waitForMetadataVersion)); } }); } public void testLocalRequestWaitsForMetadata() throws Exception { - runRepeatedlyWhileChangingMaster(() -> { + runRepeatedlyWhileChangingClusterManager(() -> { final String node = randomFrom(internalCluster().getNodeNames()); final long metadataVersion = internalCluster().getInstance(ClusterService.class, node) .getClusterApplierService() @@ -170,7 +170,7 @@ public void testLocalRequestWaitsForMetadata() throws Exception { }); } - public void runRepeatedlyWhileChangingMaster(Runnable runnable) throws Exception { + public void runRepeatedlyWhileChangingClusterManager(Runnable runnable) throws Exception { internalCluster().startNodes(3); assertBusy( @@ -191,7 +191,7 @@ public void runRepeatedlyWhileChangingMaster(Runnable runnable) throws Exception ) ); - final String masterName = internalCluster().getMasterName(); + final String clusterManagerName = internalCluster().getMasterName(); final AtomicBoolean shutdown = new AtomicBoolean(); final Thread assertingThread = new Thread(() -> { @@ -204,9 +204,12 @@ public void runRepeatedlyWhileChangingMaster(Runnable runnable) throws Exception String value = "none"; while (shutdown.get() == false) { value = "none".equals(value) ? "all" : "none"; - final String nonMasterNode = randomValueOtherThan(masterName, () -> randomFrom(internalCluster().getNodeNames())); + final String nonClusterManagerNode = randomValueOtherThan( + clusterManagerName, + () -> randomFrom(internalCluster().getNodeNames()) + ); assertAcked( - client(nonMasterNode).admin() + client(nonClusterManagerNode).admin() .cluster() .prepareUpdateSettings() .setPersistentSettings(Settings.builder().put(CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING.getKey(), value)) @@ -222,22 +225,25 @@ public void runRepeatedlyWhileChangingMaster(Runnable runnable) throws Exception assertingThread.start(); updatingThread.start(); - final MockTransportService masterTransportService = (MockTransportService) internalCluster().getInstance( + final MockTransportService clusterManagerTransportService = (MockTransportService) internalCluster().getInstance( TransportService.class, - masterName + clusterManagerName ); for (MockTransportService mockTransportService : mockTransportServices) { - if (masterTransportService != mockTransportService) { - masterTransportService.addFailToSendNoConnectRule(mockTransportService); - mockTransportService.addFailToSendNoConnectRule(masterTransportService); + if (clusterManagerTransportService != mockTransportService) { + clusterManagerTransportService.addFailToSendNoConnectRule(mockTransportService); + mockTransportService.addFailToSendNoConnectRule(clusterManagerTransportService); } } assertBusy(() -> { - final String nonMasterNode = randomValueOtherThan(masterName, () -> randomFrom(internalCluster().getNodeNames())); - final String claimedMasterName = internalCluster().getMasterName(nonMasterNode); - assertThat(claimedMasterName, not(equalTo(masterName))); + final String nonClusterManagerNode = randomValueOtherThan( + clusterManagerName, + () -> randomFrom(internalCluster().getNodeNames()) + ); + final String claimedClusterManagerName = internalCluster().getMasterName(nonClusterManagerNode); + assertThat(claimedClusterManagerName, not(equalTo(clusterManagerName))); }); shutdown.set(true); diff --git a/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/stats/ClusterStatsIT.java b/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/stats/ClusterStatsIT.java index 5b48268dfa89f..48e9f49ece629 100644 --- a/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/stats/ClusterStatsIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/action/admin/cluster/stats/ClusterStatsIT.java @@ -97,7 +97,7 @@ public void testNodeCounts() { for (int i = 0; i < numNodes; i++) { boolean isDataNode = randomBoolean(); boolean isIngestNode = randomBoolean(); - boolean isMasterNode = randomBoolean(); + boolean isClusterManagerNode = randomBoolean(); boolean isRemoteClusterClientNode = false; final Set roles = new HashSet<>(); if (isDataNode) { @@ -106,7 +106,7 @@ public void testNodeCounts() { if (isIngestNode) { roles.add(DiscoveryNodeRole.INGEST_ROLE); } - if (isMasterNode) { + if (isClusterManagerNode) { roles.add(DiscoveryNodeRole.CLUSTER_MANAGER_ROLE); } if (isRemoteClusterClientNode) { @@ -128,14 +128,14 @@ public void testNodeCounts() { if (isIngestNode) { incrementCountForRole(DiscoveryNodeRole.INGEST_ROLE.roleName(), expectedCounts); } - if (isMasterNode) { + if (isClusterManagerNode) { incrementCountForRole(DiscoveryNodeRole.MASTER_ROLE.roleName(), expectedCounts); incrementCountForRole(DiscoveryNodeRole.CLUSTER_MANAGER_ROLE.roleName(), expectedCounts); } if (isRemoteClusterClientNode) { incrementCountForRole(DiscoveryNodeRole.REMOTE_CLUSTER_CLIENT_ROLE.roleName(), expectedCounts); } - if (!isDataNode && !isMasterNode && !isIngestNode && !isRemoteClusterClientNode) { + if (!isDataNode && !isClusterManagerNode && !isIngestNode && !isRemoteClusterClientNode) { incrementCountForRole(ClusterStatsNodes.Counts.COORDINATING_ONLY, expectedCounts); } @@ -254,12 +254,12 @@ public void testAllocatedProcessors() throws Exception { } public void testClusterStatusWhenStateNotRecovered() throws Exception { - internalCluster().startMasterOnlyNode(Settings.builder().put("gateway.recover_after_nodes", 2).build()); + internalCluster().startClusterManagerOnlyNode(Settings.builder().put("gateway.recover_after_nodes", 2).build()); ClusterStatsResponse response = client().admin().cluster().prepareClusterStats().get(); assertThat(response.getStatus(), equalTo(ClusterHealthStatus.RED)); if (randomBoolean()) { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); } else { internalCluster().startDataOnlyNode(); } diff --git a/server/src/internalClusterTest/java/org/opensearch/action/admin/indices/exists/IndicesExistsIT.java b/server/src/internalClusterTest/java/org/opensearch/action/admin/indices/exists/IndicesExistsIT.java index f8be80948f8cf..810d8b9f2d226 100644 --- a/server/src/internalClusterTest/java/org/opensearch/action/admin/indices/exists/IndicesExistsIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/action/admin/indices/exists/IndicesExistsIT.java @@ -48,7 +48,7 @@ public class IndicesExistsIT extends OpenSearchIntegTestCase { public void testIndexExistsWithBlocksInPlace() throws IOException { - internalCluster().setBootstrapMasterNodeIndex(0); + internalCluster().setBootstrapClusterManagerNodeIndex(0); Settings settings = Settings.builder().put(GatewayService.RECOVER_AFTER_NODES_SETTING.getKey(), 99).build(); String node = internalCluster().startNode(settings); diff --git a/server/src/internalClusterTest/java/org/opensearch/action/support/master/IndexingMasterFailoverIT.java b/server/src/internalClusterTest/java/org/opensearch/action/support/master/IndexingMasterFailoverIT.java index f8db63bc8b61d..b4e4c058be198 100644 --- a/server/src/internalClusterTest/java/org/opensearch/action/support/master/IndexingMasterFailoverIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/action/support/master/IndexingMasterFailoverIT.java @@ -65,7 +65,7 @@ protected Collection> nodePlugins() { public void testMasterFailoverDuringIndexingWithMappingChanges() throws Throwable { logger.info("--> start 4 nodes, 3 master, 1 data"); - internalCluster().setBootstrapMasterNodeIndex(2); + internalCluster().setBootstrapClusterManagerNodeIndex(2); internalCluster().startMasterOnlyNodes(3, Settings.EMPTY); diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/ClusterStateDiffIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/ClusterStateDiffIT.java index ea1daffaf770d..7654a937c8dc0 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/ClusterStateDiffIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/ClusterStateDiffIT.java @@ -93,9 +93,13 @@ public class ClusterStateDiffIT extends OpenSearchIntegTestCase { public void testClusterStateDiffSerialization() throws Exception { NamedWriteableRegistry namedWriteableRegistry = new NamedWriteableRegistry(ClusterModule.getNamedWriteables()); - DiscoveryNode masterNode = randomNode("master"); + DiscoveryNode clusterManagerNode = randomNode("master"); DiscoveryNode otherNode = randomNode("other"); - DiscoveryNodes discoveryNodes = DiscoveryNodes.builder().add(masterNode).add(otherNode).localNodeId(masterNode.getId()).build(); + DiscoveryNodes discoveryNodes = DiscoveryNodes.builder() + .add(clusterManagerNode) + .add(otherNode) + .localNodeId(clusterManagerNode.getId()) + .build(); ClusterState clusterState = ClusterState.builder(new ClusterName("test")).nodes(discoveryNodes).build(); ClusterState clusterStateFromDiffs = ClusterState.Builder.fromBytes( ClusterState.Builder.toBytes(clusterState), diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/MinimumMasterNodesIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/MinimumMasterNodesIT.java index 32899690799d3..4981da39197c3 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/MinimumMasterNodesIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/MinimumMasterNodesIT.java @@ -84,7 +84,7 @@ protected Collection> nodePlugins() { } public void testTwoNodesNoMasterBlock() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(1); + internalCluster().setBootstrapClusterManagerNodeIndex(1); Settings settings = Settings.builder().put("discovery.initial_state_timeout", "500ms").build(); @@ -250,7 +250,7 @@ public void testTwoNodesNoMasterBlock() throws Exception { } public void testThreeNodesNoMasterBlock() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(2); + internalCluster().setBootstrapClusterManagerNodeIndex(2); Settings settings = Settings.builder().put("discovery.initial_state_timeout", "500ms").build(); @@ -309,11 +309,11 @@ public void testThreeNodesNoMasterBlock() throws Exception { assertHitCount(client().prepareSearch().setSize(0).setQuery(QueryBuilders.matchAllQuery()).execute().actionGet(), 100); } - List nonMasterNodes = new ArrayList<>( + List nonClusterManagerNodes = new ArrayList<>( Sets.difference(Sets.newHashSet(internalCluster().getNodeNames()), Collections.singleton(internalCluster().getMasterName())) ); - Settings nonMasterDataPathSettings1 = internalCluster().dataPathSettings(nonMasterNodes.get(0)); - Settings nonMasterDataPathSettings2 = internalCluster().dataPathSettings(nonMasterNodes.get(1)); + Settings nonMasterDataPathSettings1 = internalCluster().dataPathSettings(nonClusterManagerNodes.get(0)); + Settings nonMasterDataPathSettings2 = internalCluster().dataPathSettings(nonClusterManagerNodes.get(1)); internalCluster().stopRandomNonMasterNode(); internalCluster().stopRandomNonMasterNode(); @@ -340,7 +340,7 @@ public void testThreeNodesNoMasterBlock() throws Exception { } public void testCannotCommitStateThreeNodes() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(2); + internalCluster().setBootstrapClusterManagerNodeIndex(2); Settings settings = Settings.builder().put("discovery.initial_state_timeout", "500ms").build(); @@ -393,7 +393,7 @@ public void onFailure(String source, Exception e) { // otherwise persistent setting (which is a part of accepted state on old master) will be propagated to other nodes logger.debug("--> wait for master to be elected in major partition"); assertBusy(() -> { - DiscoveryNode masterNode = internalCluster().client(randomFrom(otherNodes)) + DiscoveryNode clusterManagerNode = internalCluster().client(randomFrom(otherNodes)) .admin() .cluster() .prepareState() @@ -402,8 +402,8 @@ public void onFailure(String source, Exception e) { .getState() .nodes() .getMasterNode(); - assertThat(masterNode, notNullValue()); - assertThat(masterNode.getName(), not(equalTo(master))); + assertThat(clusterManagerNode, notNullValue()); + assertThat(clusterManagerNode.getName(), not(equalTo(master))); }); partition.stopDisrupting(); diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/SpecificMasterNodesIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/SpecificMasterNodesIT.java index 5380b61c446d4..e72ce5d85303d 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/SpecificMasterNodesIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/SpecificMasterNodesIT.java @@ -56,7 +56,7 @@ public class SpecificMasterNodesIT extends OpenSearchIntegTestCase { public void testSimpleOnlyMasterNodeElection() throws IOException { - internalCluster().setBootstrapMasterNodeIndex(0); + internalCluster().setBootstrapClusterManagerNodeIndex(0); logger.info("--> start data node / non master node"); internalCluster().startNode(Settings.builder().put(dataOnlyNode()).put("discovery.initial_state_timeout", "1s")); try { @@ -77,7 +77,7 @@ public void testSimpleOnlyMasterNodeElection() throws IOException { // all is well, no cluster-manager elected } logger.info("--> start master node"); - final String masterNodeName = internalCluster().startMasterOnlyNode(); + final String masterNodeName = internalCluster().startClusterManagerOnlyNode(); assertThat( internalCluster().nonMasterClient() .admin() @@ -160,7 +160,7 @@ public void testSimpleOnlyMasterNodeElection() throws IOException { } public void testElectOnlyBetweenMasterNodes() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(0); + internalCluster().setBootstrapClusterManagerNodeIndex(0); logger.info("--> start data node / non master node"); internalCluster().startNode(Settings.builder().put(dataOnlyNode()).put("discovery.initial_state_timeout", "1s")); try { @@ -181,7 +181,7 @@ public void testElectOnlyBetweenMasterNodes() throws Exception { // all is well, no cluster-manager elected } logger.info("--> start master node (1)"); - final String masterNodeName = internalCluster().startMasterOnlyNode(); + final String masterNodeName = internalCluster().startClusterManagerOnlyNode(); assertThat( internalCluster().nonMasterClient() .admin() @@ -210,7 +210,7 @@ public void testElectOnlyBetweenMasterNodes() throws Exception { ); logger.info("--> start master node (2)"); - final String nextMasterEligableNodeName = internalCluster().startMasterOnlyNode(); + final String nextMasterEligableNodeName = internalCluster().startClusterManagerOnlyNode(); assertThat( internalCluster().nonMasterClient() .admin() @@ -312,9 +312,9 @@ public void testElectOnlyBetweenMasterNodes() throws Exception { } public void testAliasFilterValidation() { - internalCluster().setBootstrapMasterNodeIndex(0); + internalCluster().setBootstrapClusterManagerNodeIndex(0); logger.info("--> start master node / non data"); - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); logger.info("--> start data node / non master node"); internalCluster().startDataOnlyNode(); diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/RareClusterStateIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/RareClusterStateIT.java index 6f4c6fca77196..2e0ff9aeb5956 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/RareClusterStateIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/RareClusterStateIT.java @@ -173,7 +173,7 @@ private ActionFuture masterNodes = new ArrayList<>(); logger.info("--> start 1st cluster-manager-eligible node"); masterNodes.add( - internalCluster().startMasterOnlyNode( + internalCluster().startClusterManagerOnlyNode( Settings.builder().put(DiscoverySettings.INITIAL_STATE_TIMEOUT_SETTING.getKey(), "0s").build() ) ); // node ordinal 0 @@ -364,7 +364,7 @@ public void test3MasterNodes2Failed() throws Exception { ); logger.info("--> start 1st cluster-manager-eligible node"); - String masterNode2 = internalCluster().startMasterOnlyNode(master1DataPathSettings); + String masterNode2 = internalCluster().startClusterManagerOnlyNode(master1DataPathSettings); logger.info("--> detach-cluster on data-only node"); Environment environmentData = TestEnvironment.newEnvironment( @@ -410,15 +410,15 @@ public void test3MasterNodes2Failed() throws Exception { detachCluster(environmentMaster3, false); logger.info("--> start 2nd and 3rd cluster-manager-eligible nodes and ensure 4 nodes stable cluster"); - bootstrappedNodes.add(internalCluster().startMasterOnlyNode(master2DataPathSettings)); - bootstrappedNodes.add(internalCluster().startMasterOnlyNode(master3DataPathSettings)); + bootstrappedNodes.add(internalCluster().startClusterManagerOnlyNode(master2DataPathSettings)); + bootstrappedNodes.add(internalCluster().startClusterManagerOnlyNode(master3DataPathSettings)); ensureStableCluster(4); bootstrappedNodes.forEach(node -> ensureReadOnlyBlock(true, node)); removeBlock(); } public void testAllMasterEligibleNodesFailedDanglingIndexImport() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(0); + internalCluster().setBootstrapClusterManagerNodeIndex(0); Settings settings = Settings.builder().put(AUTO_IMPORT_DANGLING_INDICES_SETTING.getKey(), true).build(); @@ -478,21 +478,21 @@ public boolean clearData(String nodeName) { } public void testNoInitialBootstrapAfterDetach() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(0); - String masterNode = internalCluster().startMasterOnlyNode(); - Settings masterNodeDataPathSettings = internalCluster().dataPathSettings(masterNode); + internalCluster().setBootstrapClusterManagerNodeIndex(0); + String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); + Settings clusterManagerNodeDataPathSettings = internalCluster().dataPathSettings(clusterManagerNode); internalCluster().stopCurrentMasterNode(); final Environment environment = TestEnvironment.newEnvironment( - Settings.builder().put(internalCluster().getDefaultSettings()).put(masterNodeDataPathSettings).build() + Settings.builder().put(internalCluster().getDefaultSettings()).put(clusterManagerNodeDataPathSettings).build() ); detachCluster(environment); - String node = internalCluster().startMasterOnlyNode( + String node = internalCluster().startClusterManagerOnlyNode( Settings.builder() // give the cluster 2 seconds to elect the master (it should not) .put(DiscoverySettings.INITIAL_STATE_TIMEOUT_SETTING.getKey(), "2s") - .put(masterNodeDataPathSettings) + .put(clusterManagerNodeDataPathSettings) .build() ); @@ -503,9 +503,9 @@ public void testNoInitialBootstrapAfterDetach() throws Exception { } public void testCanRunUnsafeBootstrapAfterErroneousDetachWithoutLoosingMetadata() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(0); - String masterNode = internalCluster().startMasterOnlyNode(); - Settings masterNodeDataPathSettings = internalCluster().dataPathSettings(masterNode); + internalCluster().setBootstrapClusterManagerNodeIndex(0); + String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); + Settings clusterManagerNodeDataPathSettings = internalCluster().dataPathSettings(clusterManagerNode); ClusterUpdateSettingsRequest req = new ClusterUpdateSettingsRequest().persistentSettings( Settings.builder().put(INDICES_RECOVERY_MAX_BYTES_PER_SEC_SETTING.getKey(), "1234kb") ); @@ -514,17 +514,17 @@ public void testCanRunUnsafeBootstrapAfterErroneousDetachWithoutLoosingMetadata( ClusterState state = internalCluster().client().admin().cluster().prepareState().execute().actionGet().getState(); assertThat(state.metadata().persistentSettings().get(INDICES_RECOVERY_MAX_BYTES_PER_SEC_SETTING.getKey()), equalTo("1234kb")); - ensureReadOnlyBlock(false, masterNode); + ensureReadOnlyBlock(false, clusterManagerNode); internalCluster().stopCurrentMasterNode(); final Environment environment = TestEnvironment.newEnvironment( - Settings.builder().put(internalCluster().getDefaultSettings()).put(masterNodeDataPathSettings).build() + Settings.builder().put(internalCluster().getDefaultSettings()).put(clusterManagerNodeDataPathSettings).build() ); detachCluster(environment); unsafeBootstrap(environment); // read-only block will remain same as one before bootstrap, in this case it is false - String masterNode2 = internalCluster().startMasterOnlyNode(masterNodeDataPathSettings); + String masterNode2 = internalCluster().startClusterManagerOnlyNode(clusterManagerNodeDataPathSettings); ensureGreen(); ensureReadOnlyBlock(false, masterNode2); @@ -533,9 +533,9 @@ public void testCanRunUnsafeBootstrapAfterErroneousDetachWithoutLoosingMetadata( } public void testUnsafeBootstrapWithApplyClusterReadOnlyBlockAsFalse() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(0); - String masterNode = internalCluster().startMasterOnlyNode(); - Settings masterNodeDataPathSettings = internalCluster().dataPathSettings(masterNode); + internalCluster().setBootstrapClusterManagerNodeIndex(0); + String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); + Settings clusterManagerNodeDataPathSettings = internalCluster().dataPathSettings(clusterManagerNode); ClusterUpdateSettingsRequest req = new ClusterUpdateSettingsRequest().persistentSettings( Settings.builder().put(INDICES_RECOVERY_MAX_BYTES_PER_SEC_SETTING.getKey(), "1234kb") ); @@ -544,18 +544,18 @@ public void testUnsafeBootstrapWithApplyClusterReadOnlyBlockAsFalse() throws Exc ClusterState state = internalCluster().client().admin().cluster().prepareState().execute().actionGet().getState(); assertThat(state.metadata().persistentSettings().get(INDICES_RECOVERY_MAX_BYTES_PER_SEC_SETTING.getKey()), equalTo("1234kb")); - ensureReadOnlyBlock(false, masterNode); + ensureReadOnlyBlock(false, clusterManagerNode); internalCluster().stopCurrentMasterNode(); final Environment environment = TestEnvironment.newEnvironment( - Settings.builder().put(internalCluster().getDefaultSettings()).put(masterNodeDataPathSettings).build() + Settings.builder().put(internalCluster().getDefaultSettings()).put(clusterManagerNodeDataPathSettings).build() ); unsafeBootstrap(environment, false, false); - String masterNode2 = internalCluster().startMasterOnlyNode(masterNodeDataPathSettings); + String clusterManagerNode2 = internalCluster().startClusterManagerOnlyNode(clusterManagerNodeDataPathSettings); ensureGreen(); - ensureReadOnlyBlock(false, masterNode2); + ensureReadOnlyBlock(false, clusterManagerNode2); state = internalCluster().client().admin().cluster().prepareState().execute().actionGet().getState(); assertThat(state.metadata().settings().get(INDICES_RECOVERY_MAX_BYTES_PER_SEC_SETTING.getKey()), equalTo("1234kb")); diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/VotingConfigurationIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/VotingConfigurationIT.java index f73ec8dc4bcd0..ef2d52e2de7b9 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/VotingConfigurationIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/VotingConfigurationIT.java @@ -62,7 +62,7 @@ protected Collection> nodePlugins() { } public void testAbdicateAfterVotingConfigExclusionAdded() throws ExecutionException, InterruptedException { - internalCluster().setBootstrapMasterNodeIndex(0); + internalCluster().setBootstrapClusterManagerNodeIndex(0); internalCluster().startNodes(2); final String originalMaster = internalCluster().getMasterName(); @@ -73,7 +73,7 @@ public void testAbdicateAfterVotingConfigExclusionAdded() throws ExecutionExcept } public void testElectsNodeNotInVotingConfiguration() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(0); + internalCluster().setBootstrapClusterManagerNodeIndex(0); final List nodeNames = internalCluster().startNodes(4); // a 4-node cluster settles on a 3-node configuration; we then prevent the nodes in the configuration from winning an election diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/ZenDiscoveryIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/ZenDiscoveryIT.java index 1baac9071110a..d70da69853f17 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/ZenDiscoveryIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/coordination/ZenDiscoveryIT.java @@ -60,7 +60,7 @@ import static org.opensearch.action.admin.cluster.node.stats.NodesStatsRequest.Metric.DISCOVERY; import static org.opensearch.test.NodeRoles.dataNode; -import static org.opensearch.test.NodeRoles.masterOnlyNode; +import static org.opensearch.test.NodeRoles.clusterManagerOnlyNode; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.greaterThanOrEqualTo; @@ -73,7 +73,7 @@ public class ZenDiscoveryIT extends OpenSearchIntegTestCase { public void testNoShardRelocationsOccurWhenElectedMasterNodeFails() throws Exception { - Settings masterNodeSettings = masterOnlyNode(); + Settings masterNodeSettings = clusterManagerOnlyNode(); internalCluster().startNodes(2, masterNodeSettings); Settings dateNodeSettings = dataNode(); internalCluster().startNodes(2, dateNodeSettings); @@ -106,10 +106,10 @@ public void testNoShardRelocationsOccurWhenElectedMasterNodeFails() throws Excep } public void testHandleNodeJoin_incompatibleClusterState() throws InterruptedException, ExecutionException, TimeoutException { - String masterNode = internalCluster().startMasterOnlyNode(); + String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); String node1 = internalCluster().startNode(); ClusterService clusterService = internalCluster().getInstance(ClusterService.class, node1); - Coordinator coordinator = (Coordinator) internalCluster().getInstance(Discovery.class, masterNode); + Coordinator coordinator = (Coordinator) internalCluster().getInstance(Discovery.class, clusterManagerNode); final ClusterState state = clusterService.state(); Metadata.Builder mdBuilder = Metadata.builder(state.metadata()); mdBuilder.putCustom(CustomMetadata.TYPE, new CustomMetadata("data")); diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/routing/AllocationIdIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/routing/AllocationIdIT.java index a20e944caebb2..7b0ffa0ceea32 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/routing/AllocationIdIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/routing/AllocationIdIT.java @@ -100,7 +100,7 @@ public void testFailedRecoveryOnAllocateStalePrimaryRequiresAnotherAllocateStale // initial set up final String indexName = "index42"; - final String master = internalCluster().startMasterOnlyNode(); + final String clusterManager = internalCluster().startClusterManagerOnlyNode(); String node1 = internalCluster().startNode(); createIndex( indexName, diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/routing/PrimaryAllocationIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/routing/PrimaryAllocationIT.java index 55bdc2a4ac3c4..00e603e196a0c 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/routing/PrimaryAllocationIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/routing/PrimaryAllocationIT.java @@ -110,7 +110,7 @@ protected boolean addMockInternalEngine() { } public void testBulkWeirdScenario() throws Exception { - String master = internalCluster().startMasterOnlyNode(Settings.EMPTY); + String master = internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); internalCluster().startDataOnlyNodes(2); assertAcked( @@ -203,7 +203,7 @@ private Settings createStaleReplicaScenario(String master) throws Exception { public void testDoNotAllowStaleReplicasToBePromotedToPrimary() throws Exception { logger.info("--> starting 3 nodes, 1 master, 2 data"); - String master = internalCluster().startMasterOnlyNode(Settings.EMPTY); + String master = internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); internalCluster().startDataOnlyNodes(2); assertAcked( client().admin() @@ -292,7 +292,7 @@ public void testFailedAllocationOfStalePrimaryToDataNodeWithNoData() throws Exce public void testForceStaleReplicaToBePromotedToPrimary() throws Exception { logger.info("--> starting 3 nodes, 1 master, 2 data"); - String master = internalCluster().startMasterOnlyNode(Settings.EMPTY); + String clusterManager = internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); internalCluster().startDataOnlyNodes(2); assertAcked( client().admin() @@ -305,7 +305,7 @@ public void testForceStaleReplicaToBePromotedToPrimary() throws Exception { Set historyUUIDs = Arrays.stream(client().admin().indices().prepareStats("test").clear().get().getShards()) .map(shard -> shard.getCommitStats().getUserData().get(Engine.HISTORY_UUID_KEY)) .collect(Collectors.toSet()); - createStaleReplicaScenario(master); + createStaleReplicaScenario(clusterManager); if (randomBoolean()) { assertAcked(client().admin().indices().prepareClose("test").setWaitForActiveShards(0)); } @@ -343,7 +343,7 @@ public void testForceStaleReplicaToBePromotedToPrimary() throws Exception { } logger.info("expected allocation ids: {} actual allocation ids: {}", expectedAllocationIds, allocationIds); }; - final ClusterService clusterService = internalCluster().getInstance(ClusterService.class, master); + final ClusterService clusterService = internalCluster().getInstance(ClusterService.class, clusterManager); clusterService.addListener(clusterStateListener); rerouteBuilder.get(); @@ -390,7 +390,7 @@ public void testForceStaleReplicaToBePromotedToPrimary() throws Exception { } public void testForceStaleReplicaToBePromotedToPrimaryOnWrongNode() throws Exception { - String master = internalCluster().startMasterOnlyNode(Settings.EMPTY); + String clusterManager = internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); internalCluster().startDataOnlyNodes(2); final String idxName = "test"; assertAcked( @@ -401,14 +401,14 @@ public void testForceStaleReplicaToBePromotedToPrimaryOnWrongNode() throws Excep .get() ); ensureGreen(); - createStaleReplicaScenario(master); + createStaleReplicaScenario(clusterManager); // Ensure the stopped primary's data is deleted so that it doesn't get picked up by the next datanode we start internalCluster().wipePendingDataDirectories(); internalCluster().startDataOnlyNodes(1); - ensureStableCluster(3, master); + ensureStableCluster(3, clusterManager); final int shardId = 0; final List nodeNames = new ArrayList<>(Arrays.asList(internalCluster().getNodeNames())); - nodeNames.remove(master); + nodeNames.remove(clusterManager); client().admin() .indices() .prepareShardStores(idxName) @@ -434,7 +434,7 @@ public void testForceStaleReplicaToBePromotedToPrimaryOnWrongNode() throws Excep } public void testForceStaleReplicaToBePromotedForGreenIndex() { - internalCluster().startMasterOnlyNode(Settings.EMPTY); + internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); final List dataNodes = internalCluster().startDataOnlyNodes(2); final String idxName = "test"; assertAcked( @@ -459,7 +459,7 @@ public void testForceStaleReplicaToBePromotedForGreenIndex() { } public void testForceStaleReplicaToBePromotedForMissingIndex() { - internalCluster().startMasterOnlyNode(Settings.EMPTY); + internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); final String dataNode = internalCluster().startDataOnlyNode(); final String idxName = "test"; IndexNotFoundException ex = expectThrows( @@ -497,7 +497,7 @@ public void testForcePrimaryShardIfAllocationDecidersSayNoAfterIndexCreation() t } public void testDoNotRemoveAllocationIdOnNodeLeave() throws Exception { - internalCluster().startMasterOnlyNode(Settings.EMPTY); + internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); internalCluster().startDataOnlyNode(Settings.EMPTY); assertAcked( client().admin() @@ -537,7 +537,7 @@ public boolean clearData(String nodeName) { } public void testRemoveAllocationIdOnWriteAfterNodeLeave() throws Exception { - internalCluster().startMasterOnlyNode(Settings.EMPTY); + internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); internalCluster().startDataOnlyNode(Settings.EMPTY); assertAcked( client().admin() @@ -657,7 +657,7 @@ public void testForceAllocatePrimaryOnNoDecision() throws Exception { * This test asserts that replicas failed to execute resync operations will be failed but not marked as stale. */ public void testPrimaryReplicaResyncFailed() throws Exception { - String master = internalCluster().startMasterOnlyNode(Settings.EMPTY); + String master = internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); final int numberOfReplicas = between(2, 3); final String oldPrimary = internalCluster().startDataOnlyNode(); assertAcked( diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/routing/allocation/decider/DiskThresholdDeciderIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/routing/allocation/decider/DiskThresholdDeciderIT.java index eb3e61d83a948..2fe7efdf8fc3a 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/routing/allocation/decider/DiskThresholdDeciderIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/routing/allocation/decider/DiskThresholdDeciderIT.java @@ -154,7 +154,7 @@ protected Collection> nodePlugins() { } public void testHighWatermarkNotExceeded() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String dataNodeName = internalCluster().startDataOnlyNode(); ensureStableCluster(3); @@ -189,7 +189,7 @@ public void testHighWatermarkNotExceeded() throws Exception { } public void testRestoreSnapshotAllocationDoesNotExceedWatermark() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String dataNodeName = internalCluster().startDataOnlyNode(); ensureStableCluster(3); diff --git a/server/src/internalClusterTest/java/org/opensearch/discovery/ClusterDisruptionCleanSettingsIT.java b/server/src/internalClusterTest/java/org/opensearch/discovery/ClusterDisruptionCleanSettingsIT.java index 61a47d2bb0237..7040bfb950663 100644 --- a/server/src/internalClusterTest/java/org/opensearch/discovery/ClusterDisruptionCleanSettingsIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/discovery/ClusterDisruptionCleanSettingsIT.java @@ -63,7 +63,7 @@ protected Collection> nodePlugins() { public void testSearchWithRelocationAndSlowClusterStateProcessing() throws Exception { // Don't use AbstractDisruptionTestCase.DEFAULT_SETTINGS as settings // (which can cause node disconnects on a slow CI machine) - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String node_1 = internalCluster().startDataOnlyNode(); logger.info("--> creating index [test] with one shard and on replica"); diff --git a/server/src/internalClusterTest/java/org/opensearch/discovery/ClusterDisruptionIT.java b/server/src/internalClusterTest/java/org/opensearch/discovery/ClusterDisruptionIT.java index ceec1315a9d59..c52918ee80fe0 100644 --- a/server/src/internalClusterTest/java/org/opensearch/discovery/ClusterDisruptionIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/discovery/ClusterDisruptionIT.java @@ -338,26 +338,26 @@ public void testRejoinDocumentExistsInAllShardCopies() throws Exception { // simulate handling of sending shard failure during an isolation public void testSendingShardFailure() throws Exception { List nodes = startCluster(3); - String masterNode = internalCluster().getMasterName(); - List nonMasterNodes = nodes.stream().filter(node -> !node.equals(masterNode)).collect(Collectors.toList()); - String nonMasterNode = randomFrom(nonMasterNodes); + String clusterManagerNode = internalCluster().getMasterName(); + List nonClusterManagerNodes = nodes.stream().filter(node -> !node.equals(clusterManagerNode)).collect(Collectors.toList()); + String nonClusterManagerNode = randomFrom(nonClusterManagerNodes); assertAcked( prepareCreate("test").setSettings( Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 3).put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 2) ) ); ensureGreen(); - String nonMasterNodeId = internalCluster().clusterService(nonMasterNode).localNode().getId(); + String nonClusterManagerNodeId = internalCluster().clusterService(nonClusterManagerNode).localNode().getId(); // fail a random shard ShardRouting failedShard = randomFrom( - clusterService().state().getRoutingNodes().node(nonMasterNodeId).shardsWithState(ShardRoutingState.STARTED) + clusterService().state().getRoutingNodes().node(nonClusterManagerNodeId).shardsWithState(ShardRoutingState.STARTED) ); - ShardStateAction service = internalCluster().getInstance(ShardStateAction.class, nonMasterNode); + ShardStateAction service = internalCluster().getInstance(ShardStateAction.class, nonClusterManagerNode); CountDownLatch latch = new CountDownLatch(1); AtomicBoolean success = new AtomicBoolean(); - String isolatedNode = randomBoolean() ? masterNode : nonMasterNode; + String isolatedNode = randomBoolean() ? clusterManagerNode : nonClusterManagerNode; TwoPartitions partitions = isolateNode(isolatedNode); // we cannot use the NetworkUnresponsive disruption type here as it will swallow the "shard failed" request, calling neither // onSuccess nor onFailure on the provided listener. @@ -385,10 +385,10 @@ public void onFailure(Exception e) { } ); - if (isolatedNode.equals(nonMasterNode)) { - assertNoMaster(nonMasterNode); + if (isolatedNode.equals(nonClusterManagerNode)) { + assertNoMaster(nonClusterManagerNode); } else { - ensureStableCluster(2, nonMasterNode); + ensureStableCluster(2, nonClusterManagerNode); } // heal the partition @@ -410,10 +410,10 @@ public void onFailure(Exception e) { } public void testCannotJoinIfMasterLostDataFolder() throws Exception { - String masterNode = internalCluster().startMasterOnlyNode(); + String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); String dataNode = internalCluster().startDataOnlyNode(); - internalCluster().restartNode(masterNode, new InternalTestCluster.RestartCallback() { + internalCluster().restartNode(clusterManagerNode, new InternalTestCluster.RestartCallback() { @Override public boolean clearData(String nodeName) { return true; @@ -442,9 +442,9 @@ public boolean validateClusterForming() { }); assertBusy(() -> { - assertFalse(internalCluster().client(masterNode).admin().cluster().prepareHealth().get().isTimedOut()); + assertFalse(internalCluster().client(clusterManagerNode).admin().cluster().prepareHealth().get().isTimedOut()); assertTrue( - internalCluster().client(masterNode) + internalCluster().client(clusterManagerNode) .admin() .cluster() .prepareHealth() diff --git a/server/src/internalClusterTest/java/org/opensearch/discovery/DiscoveryDisruptionIT.java b/server/src/internalClusterTest/java/org/opensearch/discovery/DiscoveryDisruptionIT.java index bea70bd0f5919..6fb311ba9a7b2 100644 --- a/server/src/internalClusterTest/java/org/opensearch/discovery/DiscoveryDisruptionIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/discovery/DiscoveryDisruptionIT.java @@ -64,29 +64,29 @@ public class DiscoveryDisruptionIT extends AbstractDisruptionTestCase { * Test cluster join with issues in cluster state publishing * */ public void testClusterJoinDespiteOfPublishingIssues() throws Exception { - String masterNode = internalCluster().startMasterOnlyNode(); - String nonMasterNode = internalCluster().startDataOnlyNode(); + String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); + String nonClusterManagerNode = internalCluster().startDataOnlyNode(); - DiscoveryNodes discoveryNodes = internalCluster().getInstance(ClusterService.class, nonMasterNode).state().nodes(); + DiscoveryNodes discoveryNodes = internalCluster().getInstance(ClusterService.class, nonClusterManagerNode).state().nodes(); TransportService masterTranspotService = internalCluster().getInstance( TransportService.class, discoveryNodes.getMasterNode().getName() ); - logger.info("blocking requests from non master [{}] to master [{}]", nonMasterNode, masterNode); + logger.info("blocking requests from non master [{}] to master [{}]", nonClusterManagerNode, clusterManagerNode); MockTransportService nonMasterTransportService = (MockTransportService) internalCluster().getInstance( TransportService.class, - nonMasterNode + nonClusterManagerNode ); nonMasterTransportService.addFailToSendNoConnectRule(masterTranspotService); - assertNoMaster(nonMasterNode); + assertNoMaster(nonClusterManagerNode); - logger.info("blocking cluster state publishing from master [{}] to non master [{}]", masterNode, nonMasterNode); + logger.info("blocking cluster state publishing from master [{}] to non master [{}]", clusterManagerNode, nonClusterManagerNode); MockTransportService masterTransportService = (MockTransportService) internalCluster().getInstance( TransportService.class, - masterNode + clusterManagerNode ); TransportService localTransportService = internalCluster().getInstance( TransportService.class, @@ -98,7 +98,11 @@ public void testClusterJoinDespiteOfPublishingIssues() throws Exception { masterTransportService.addFailToSendNoConnectRule(localTransportService, PublicationTransportHandler.COMMIT_STATE_ACTION_NAME); } - logger.info("allowing requests from non master [{}] to master [{}], waiting for two join request", nonMasterNode, masterNode); + logger.info( + "allowing requests from non master [{}] to master [{}], waiting for two join request", + nonClusterManagerNode, + clusterManagerNode + ); final CountDownLatch countDownLatch = new CountDownLatch(2); nonMasterTransportService.addSendBehavior(masterTransportService, (connection, requestId, action, request, options) -> { if (action.equals(JoinHelper.JOIN_ACTION_NAME)) { @@ -197,31 +201,31 @@ public void testElectMasterWithLatestVersion() throws Exception { public void testNodeNotReachableFromMaster() throws Exception { startCluster(3); - String masterNode = internalCluster().getMasterName(); - String nonMasterNode = null; - while (nonMasterNode == null) { - nonMasterNode = randomFrom(internalCluster().getNodeNames()); - if (nonMasterNode.equals(masterNode)) { - nonMasterNode = null; + String clusterManagerNode = internalCluster().getMasterName(); + String nonClusterManagerNode = null; + while (nonClusterManagerNode == null) { + nonClusterManagerNode = randomFrom(internalCluster().getNodeNames()); + if (nonClusterManagerNode.equals(clusterManagerNode)) { + nonClusterManagerNode = null; } } - logger.info("blocking request from master [{}] to [{}]", masterNode, nonMasterNode); + logger.info("blocking request from master [{}] to [{}]", clusterManagerNode, nonClusterManagerNode); MockTransportService masterTransportService = (MockTransportService) internalCluster().getInstance( TransportService.class, - masterNode + clusterManagerNode ); if (randomBoolean()) { - masterTransportService.addUnresponsiveRule(internalCluster().getInstance(TransportService.class, nonMasterNode)); + masterTransportService.addUnresponsiveRule(internalCluster().getInstance(TransportService.class, nonClusterManagerNode)); } else { - masterTransportService.addFailToSendNoConnectRule(internalCluster().getInstance(TransportService.class, nonMasterNode)); + masterTransportService.addFailToSendNoConnectRule(internalCluster().getInstance(TransportService.class, nonClusterManagerNode)); } - logger.info("waiting for [{}] to be removed from cluster", nonMasterNode); - ensureStableCluster(2, masterNode); + logger.info("waiting for [{}] to be removed from cluster", nonClusterManagerNode); + ensureStableCluster(2, clusterManagerNode); - logger.info("waiting for [{}] to have no cluster-manager", nonMasterNode); - assertNoMaster(nonMasterNode); + logger.info("waiting for [{}] to have no cluster-manager", nonClusterManagerNode); + assertNoMaster(nonClusterManagerNode); logger.info("healing partition and checking cluster reforms"); masterTransportService.clearAllRules(); diff --git a/server/src/internalClusterTest/java/org/opensearch/discovery/MasterDisruptionIT.java b/server/src/internalClusterTest/java/org/opensearch/discovery/MasterDisruptionIT.java index 2434537d7a424..090423b380bf7 100644 --- a/server/src/internalClusterTest/java/org/opensearch/discovery/MasterDisruptionIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/discovery/MasterDisruptionIT.java @@ -71,33 +71,40 @@ public class MasterDisruptionIT extends AbstractDisruptionTestCase { public void testMasterNodeGCs() throws Exception { List nodes = startCluster(3); - String oldMasterNode = internalCluster().getMasterName(); + String oldClusterManagerNode = internalCluster().getMasterName(); // a very long GC, but it's OK as we remove the disruption when it has had an effect - SingleNodeDisruption masterNodeDisruption = new IntermittentLongGCDisruption(random(), oldMasterNode, 100, 200, 30000, 60000); + SingleNodeDisruption masterNodeDisruption = new IntermittentLongGCDisruption( + random(), + oldClusterManagerNode, + 100, + 200, + 30000, + 60000 + ); internalCluster().setDisruptionScheme(masterNodeDisruption); masterNodeDisruption.startDisrupting(); - Set oldNonMasterNodesSet = new HashSet<>(nodes); - oldNonMasterNodesSet.remove(oldMasterNode); + Set oldNonClusterManagerNodesSet = new HashSet<>(nodes); + oldNonClusterManagerNodesSet.remove(oldClusterManagerNode); - List oldNonMasterNodes = new ArrayList<>(oldNonMasterNodesSet); + List oldNonClusterManagerNodes = new ArrayList<>(oldNonClusterManagerNodesSet); - logger.info("waiting for nodes to de-elect master [{}]", oldMasterNode); - for (String node : oldNonMasterNodesSet) { - assertDifferentMaster(node, oldMasterNode); + logger.info("waiting for nodes to de-elect master [{}]", oldClusterManagerNode); + for (String node : oldNonClusterManagerNodesSet) { + assertDifferentMaster(node, oldClusterManagerNode); } logger.info("waiting for nodes to elect a new master"); - ensureStableCluster(2, oldNonMasterNodes.get(0)); + ensureStableCluster(2, oldNonClusterManagerNodes.get(0)); // restore GC masterNodeDisruption.stopDisrupting(); final TimeValue waitTime = new TimeValue(DISRUPTION_HEALING_OVERHEAD.millis() + masterNodeDisruption.expectedTimeToHeal().millis()); - ensureStableCluster(3, waitTime, false, oldNonMasterNodes.get(0)); + ensureStableCluster(3, waitTime, false, oldNonClusterManagerNodes.get(0)); // make sure all nodes agree on master String newMaster = internalCluster().getMasterName(); - assertThat(newMaster, not(equalTo(oldMasterNode))); + assertThat(newMaster, not(equalTo(oldClusterManagerNode))); assertMaster(newMaster, nodes); } diff --git a/server/src/internalClusterTest/java/org/opensearch/discovery/StableMasterDisruptionIT.java b/server/src/internalClusterTest/java/org/opensearch/discovery/StableMasterDisruptionIT.java index 77553ba713540..614c5a13c3253 100644 --- a/server/src/internalClusterTest/java/org/opensearch/discovery/StableMasterDisruptionIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/discovery/StableMasterDisruptionIT.java @@ -73,8 +73,8 @@ import static org.hamcrest.Matchers.equalTo; /** - * Tests relating to the loss of the master, but which work with the default fault detection settings which are rather lenient and will - * not detect a master failure too quickly. + * Tests relating to the loss of the cluster-manager, but which work with the default fault detection settings which are rather lenient and will + * not detect a cluster-manager failure too quickly. */ @OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.TEST, numDataNodes = 0) public class StableMasterDisruptionIT extends OpenSearchIntegTestCase { @@ -228,9 +228,9 @@ public void testStaleMasterNotHijackingMajority() throws Exception { event.state(), event.previousState() ); - String previousMasterNodeName = previousMaster != null ? previousMaster.getName() : null; + String previousClusterManagerNodeName = previousMaster != null ? previousMaster.getName() : null; String currentMasterNodeName = currentMaster != null ? currentMaster.getName() : null; - masters.get(node).add(new Tuple<>(previousMasterNodeName, currentMasterNodeName)); + masters.get(node).add(new Tuple<>(previousClusterManagerNodeName, currentMasterNodeName)); } }); } diff --git a/server/src/internalClusterTest/java/org/opensearch/env/NodeRepurposeCommandIT.java b/server/src/internalClusterTest/java/org/opensearch/env/NodeRepurposeCommandIT.java index e2bbd0ee13db3..11ece43ea90d7 100644 --- a/server/src/internalClusterTest/java/org/opensearch/env/NodeRepurposeCommandIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/env/NodeRepurposeCommandIT.java @@ -56,7 +56,7 @@ public void testRepurpose() throws Exception { final String indexName = "test-repurpose"; logger.info("--> starting two nodes"); - final String masterNode = internalCluster().startMasterOnlyNode(); + final String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode( Settings.builder().put(IndicesService.WRITE_DANGLING_INDICES_INFO_SETTING.getKey(), false).build() ); @@ -71,20 +71,20 @@ public void testRepurpose() throws Exception { assertTrue(client().prepareGet(indexName, "1").get().isExists()); - final Settings masterNodeDataPathSettings = internalCluster().dataPathSettings(masterNode); + final Settings clusterManagerNodeDataPathSettings = internalCluster().dataPathSettings(clusterManagerNode); final Settings dataNodeDataPathSettings = internalCluster().dataPathSettings(dataNode); - final Settings noMasterNoDataSettings = NodeRoles.removeRoles( + final Settings noClusterManagerNoDataSettings = NodeRoles.removeRoles( Collections.unmodifiableSet(new HashSet<>(Arrays.asList(DiscoveryNodeRole.DATA_ROLE, DiscoveryNodeRole.MASTER_ROLE))) ); - final Settings noMasterNoDataSettingsForMasterNode = Settings.builder() - .put(noMasterNoDataSettings) - .put(masterNodeDataPathSettings) + final Settings noClusterManagerNoDataSettingsForClusterManagerNode = Settings.builder() + .put(noClusterManagerNoDataSettings) + .put(clusterManagerNodeDataPathSettings) .build(); - final Settings noMasterNoDataSettingsForDataNode = Settings.builder() - .put(noMasterNoDataSettings) + final Settings noClusterManagerNoDataSettingsForDataNode = Settings.builder() + .put(noClusterManagerNoDataSettings) .put(dataNodeDataPathSettings) .build(); @@ -99,11 +99,11 @@ public void testRepurpose() throws Exception { ); logger.info("--> Repurposing node 1"); - executeRepurposeCommand(noMasterNoDataSettingsForDataNode, 1, 1); + executeRepurposeCommand(noClusterManagerNoDataSettingsForDataNode, 1, 1); OpenSearchException lockedException = expectThrows( OpenSearchException.class, - () -> executeRepurposeCommand(noMasterNoDataSettingsForMasterNode, 1, 1) + () -> executeRepurposeCommand(noClusterManagerNoDataSettingsForClusterManagerNode, 1, 1) ); assertThat(lockedException.getMessage(), containsString(NodeRepurposeCommand.FAILED_TO_OBTAIN_NODE_LOCK_MSG)); @@ -119,11 +119,11 @@ public void testRepurpose() throws Exception { internalCluster().stopRandomNode(s -> true); internalCluster().stopRandomNode(s -> true); - executeRepurposeCommand(noMasterNoDataSettingsForMasterNode, 1, 0); + executeRepurposeCommand(noClusterManagerNoDataSettingsForClusterManagerNode, 1, 0); // by restarting as master and data node, we can check that the index definition was really deleted and also that the tool // does not mess things up so much that the nodes cannot boot as master or data node any longer. - internalCluster().startMasterOnlyNode(masterNodeDataPathSettings); + internalCluster().startClusterManagerOnlyNode(clusterManagerNodeDataPathSettings); internalCluster().startDataOnlyNode(dataNodeDataPathSettings); ensureGreen(); diff --git a/server/src/internalClusterTest/java/org/opensearch/gateway/GatewayIndexStateIT.java b/server/src/internalClusterTest/java/org/opensearch/gateway/GatewayIndexStateIT.java index a8828c7ad38b5..1542d6800eaa1 100644 --- a/server/src/internalClusterTest/java/org/opensearch/gateway/GatewayIndexStateIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/gateway/GatewayIndexStateIT.java @@ -277,7 +277,7 @@ public void testJustMasterNodeAndJustDataNode() { logger.info("--> cleaning nodes"); logger.info("--> starting 1 master node non data"); - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); logger.info("--> create an index"); diff --git a/server/src/internalClusterTest/java/org/opensearch/gateway/MetadataNodesIT.java b/server/src/internalClusterTest/java/org/opensearch/gateway/MetadataNodesIT.java index c9807aa24e259..c96a71d5b2617 100644 --- a/server/src/internalClusterTest/java/org/opensearch/gateway/MetadataNodesIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/gateway/MetadataNodesIT.java @@ -60,7 +60,7 @@ public class MetadataNodesIT extends OpenSearchIntegTestCase { public void testMetaWrittenAlsoOnDataNode() throws Exception { // this test checks that index state is written on data only nodes if they have a shard allocated - String masterNode = internalCluster().startMasterOnlyNode(Settings.EMPTY); + String masterNode = internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); String dataNode = internalCluster().startDataOnlyNode(Settings.EMPTY); assertAcked(prepareCreate("test").setSettings(Settings.builder().put("index.number_of_replicas", 0))); index("test", "_doc", "1", jsonBuilder().startObject().field("text", "some text").endObject()); @@ -71,7 +71,7 @@ public void testMetaWrittenAlsoOnDataNode() throws Exception { public void testIndexFilesAreRemovedIfAllShardsFromIndexRemoved() throws Exception { // this test checks that the index data is removed from a data only node once all shards have been allocated away from it - String masterNode = internalCluster().startMasterOnlyNode(Settings.EMPTY); + String masterNode = internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); List nodeNames = internalCluster().startDataOnlyNodes(2); String node1 = nodeNames.get(0); String node2 = nodeNames.get(1); @@ -114,7 +114,7 @@ public void testIndexFilesAreRemovedIfAllShardsFromIndexRemoved() throws Excepti @SuppressWarnings("unchecked") public void testMetaWrittenWhenIndexIsClosedAndMetaUpdated() throws Exception { - String masterNode = internalCluster().startMasterOnlyNode(Settings.EMPTY); + String masterNode = internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); final String dataNode = internalCluster().startDataOnlyNode(Settings.EMPTY); final String index = "index"; diff --git a/server/src/internalClusterTest/java/org/opensearch/gateway/RecoverAfterNodesIT.java b/server/src/internalClusterTest/java/org/opensearch/gateway/RecoverAfterNodesIT.java index 7365ef1c8847d..77a9d37063c83 100644 --- a/server/src/internalClusterTest/java/org/opensearch/gateway/RecoverAfterNodesIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/gateway/RecoverAfterNodesIT.java @@ -44,7 +44,7 @@ import java.util.Set; import static org.opensearch.test.NodeRoles.dataOnlyNode; -import static org.opensearch.test.NodeRoles.masterOnlyNode; +import static org.opensearch.test.NodeRoles.clusterManagerOnlyNode; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasItem; @@ -75,7 +75,7 @@ public Client startNode(Settings.Builder settings) { } public void testRecoverAfterNodes() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(0); + internalCluster().setBootstrapClusterManagerNodeIndex(0); logger.info("--> start node (1)"); Client clientNode1 = startNode(Settings.builder().put("gateway.recover_after_nodes", 3)); assertThat( @@ -128,9 +128,9 @@ public void testRecoverAfterNodes() throws Exception { } public void testRecoverAfterMasterNodes() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(0); + internalCluster().setBootstrapClusterManagerNodeIndex(0); logger.info("--> start master_node (1)"); - Client master1 = startNode(Settings.builder().put("gateway.recover_after_master_nodes", 2).put(masterOnlyNode())); + Client master1 = startNode(Settings.builder().put("gateway.recover_after_master_nodes", 2).put(clusterManagerOnlyNode())); assertThat( master1.admin() .cluster() @@ -211,7 +211,7 @@ public void testRecoverAfterMasterNodes() throws Exception { ); logger.info("--> start master_node (2)"); - Client master2 = startNode(Settings.builder().put("gateway.recover_after_master_nodes", 2).put(masterOnlyNode())); + Client master2 = startNode(Settings.builder().put("gateway.recover_after_master_nodes", 2).put(clusterManagerOnlyNode())); assertThat(waitForNoBlocksOnNode(BLOCK_WAIT_TIMEOUT, master1).isEmpty(), equalTo(true)); assertThat(waitForNoBlocksOnNode(BLOCK_WAIT_TIMEOUT, master2).isEmpty(), equalTo(true)); assertThat(waitForNoBlocksOnNode(BLOCK_WAIT_TIMEOUT, data1).isEmpty(), equalTo(true)); @@ -219,9 +219,9 @@ public void testRecoverAfterMasterNodes() throws Exception { } public void testRecoverAfterDataNodes() throws Exception { - internalCluster().setBootstrapMasterNodeIndex(0); + internalCluster().setBootstrapClusterManagerNodeIndex(0); logger.info("--> start master_node (1)"); - Client master1 = startNode(Settings.builder().put("gateway.recover_after_data_nodes", 2).put(masterOnlyNode())); + Client master1 = startNode(Settings.builder().put("gateway.recover_after_data_nodes", 2).put(clusterManagerOnlyNode())); assertThat( master1.admin() .cluster() @@ -263,7 +263,7 @@ public void testRecoverAfterDataNodes() throws Exception { ); logger.info("--> start master_node (2)"); - Client master2 = startNode(Settings.builder().put("gateway.recover_after_data_nodes", 2).put(masterOnlyNode())); + Client master2 = startNode(Settings.builder().put("gateway.recover_after_data_nodes", 2).put(clusterManagerOnlyNode())); assertThat( master2.admin() .cluster() diff --git a/server/src/internalClusterTest/java/org/opensearch/gateway/RecoveryFromGatewayIT.java b/server/src/internalClusterTest/java/org/opensearch/gateway/RecoveryFromGatewayIT.java index 92d8dc6a0bb5e..c0093d2f0910b 100644 --- a/server/src/internalClusterTest/java/org/opensearch/gateway/RecoveryFromGatewayIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/gateway/RecoveryFromGatewayIT.java @@ -511,7 +511,7 @@ public void testLatestVersionLoaded() throws Exception { } public void testReuseInFileBasedPeerRecovery() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String primaryNode = internalCluster().startDataOnlyNode(nodeSettings(0)); // create the index with our mapping diff --git a/server/src/internalClusterTest/java/org/opensearch/gateway/ReplicaShardAllocatorIT.java b/server/src/internalClusterTest/java/org/opensearch/gateway/ReplicaShardAllocatorIT.java index 345ed668a3bf4..db46fb4424848 100644 --- a/server/src/internalClusterTest/java/org/opensearch/gateway/ReplicaShardAllocatorIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/gateway/ReplicaShardAllocatorIT.java @@ -327,7 +327,7 @@ public void testFullClusterRestartPerformNoopRecovery() throws Exception { public void testPreferCopyWithHighestMatchingOperations() throws Exception { String indexName = "test"; - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNodes(3); assertAcked( client().admin() @@ -402,7 +402,7 @@ public void testPreferCopyWithHighestMatchingOperations() throws Exception { * Make sure that we do not repeatedly cancel an ongoing recovery for a noop copy on a broken node. */ public void testDoNotCancelRecoveryForBrokenNode() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); String nodeWithPrimary = internalCluster().startDataOnlyNode(); String indexName = "test"; assertAcked( @@ -518,7 +518,7 @@ public void testPeerRecoveryForClosedIndices() throws Exception { * this behavior by changing the global checkpoint in phase1 to unassigned. */ public void testSimulateRecoverySourceOnOldNode() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); String source = internalCluster().startDataOnlyNode(); String indexName = "test"; assertAcked( diff --git a/server/src/internalClusterTest/java/org/opensearch/index/seqno/PeerRecoveryRetentionLeaseCreationIT.java b/server/src/internalClusterTest/java/org/opensearch/index/seqno/PeerRecoveryRetentionLeaseCreationIT.java index e1e969345d5ed..686911f8d4741 100644 --- a/server/src/internalClusterTest/java/org/opensearch/index/seqno/PeerRecoveryRetentionLeaseCreationIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/index/seqno/PeerRecoveryRetentionLeaseCreationIT.java @@ -63,7 +63,7 @@ public void testCanRecoverFromStoreWithoutPeerRecoveryRetentionLease() throws Ex * primary that is recovering from store creates a lease for itself. */ - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode(); final Path[] nodeDataPaths = internalCluster().getInstance(NodeEnvironment.class, dataNode).nodeDataPaths(); diff --git a/server/src/internalClusterTest/java/org/opensearch/index/shard/RemoveCorruptedShardDataCommandIT.java b/server/src/internalClusterTest/java/org/opensearch/index/shard/RemoveCorruptedShardDataCommandIT.java index 2dc241e278768..7f7914b1ead87 100644 --- a/server/src/internalClusterTest/java/org/opensearch/index/shard/RemoveCorruptedShardDataCommandIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/index/shard/RemoveCorruptedShardDataCommandIT.java @@ -497,7 +497,7 @@ public Settings onNodeStopped(String nodeName) throws Exception { } public void testCorruptTranslogTruncationOfReplica() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String node1 = internalCluster().startDataOnlyNode(); final String node2 = internalCluster().startDataOnlyNode(); diff --git a/server/src/internalClusterTest/java/org/opensearch/indices/mapping/DedicatedMasterGetFieldMappingIT.java b/server/src/internalClusterTest/java/org/opensearch/indices/mapping/DedicatedMasterGetFieldMappingIT.java index 98134531d4f31..a4123ccc46ab6 100644 --- a/server/src/internalClusterTest/java/org/opensearch/indices/mapping/DedicatedMasterGetFieldMappingIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/indices/mapping/DedicatedMasterGetFieldMappingIT.java @@ -42,7 +42,7 @@ public class DedicatedMasterGetFieldMappingIT extends SimpleGetFieldMappingsIT { @Before public void before1() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startNode(); } diff --git a/server/src/internalClusterTest/java/org/opensearch/indices/recovery/IndexRecoveryIT.java b/server/src/internalClusterTest/java/org/opensearch/indices/recovery/IndexRecoveryIT.java index a7dc77e024d5c..98386f1f3af93 100644 --- a/server/src/internalClusterTest/java/org/opensearch/indices/recovery/IndexRecoveryIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/indices/recovery/IndexRecoveryIT.java @@ -1211,7 +1211,7 @@ public void testDisconnectsDuringRecovery() throws Exception { .build(); TimeValue disconnectAfterDelay = TimeValue.timeValueMillis(randomIntBetween(0, 100)); // start a master node - String masterNodeName = internalCluster().startMasterOnlyNode(nodeSettings); + String masterNodeName = internalCluster().startClusterManagerOnlyNode(nodeSettings); final String blueNodeName = internalCluster().startNode( Settings.builder().put("node.attr.color", "blue").put(nodeSettings).build() @@ -2084,7 +2084,7 @@ public void testRepeatedRecovery() throws Exception { } public void testAllocateEmptyPrimaryResetsGlobalCheckpoint() throws Exception { - internalCluster().startMasterOnlyNode(Settings.EMPTY); + internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); final List dataNodes = internalCluster().startDataOnlyNodes(2); final Settings randomNodeDataPathSettings = internalCluster().dataPathSettings(randomFrom(dataNodes)); final String indexName = "test"; @@ -2184,7 +2184,7 @@ public void testPeerRecoveryTrimsLocalTranslog() throws Exception { } public void testCancelRecoveryWithAutoExpandReplicas() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); assertAcked( client().admin() .indices() diff --git a/server/src/internalClusterTest/java/org/opensearch/indices/store/IndicesStoreIntegrationIT.java b/server/src/internalClusterTest/java/org/opensearch/indices/store/IndicesStoreIntegrationIT.java index b85afa80496d0..2e35b7159b6aa 100644 --- a/server/src/internalClusterTest/java/org/opensearch/indices/store/IndicesStoreIntegrationIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/indices/store/IndicesStoreIntegrationIT.java @@ -345,7 +345,7 @@ public void testShardsCleanup() throws Exception { } public void testShardActiveElsewhereDoesNotDeleteAnother() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final List nodes = internalCluster().startDataOnlyNodes(4); final String node1 = nodes.get(0); @@ -459,11 +459,11 @@ public void testShardActiveElsewhereDoesNotDeleteAnother() throws Exception { public void testShardActiveElseWhere() throws Exception { List nodes = internalCluster().startNodes(2); - final String masterNode = internalCluster().getMasterName(); - final String nonMasterNode = nodes.get(0).equals(masterNode) ? nodes.get(1) : nodes.get(0); + final String clusterManagerNode = internalCluster().getMasterName(); + final String nonClusterManagerNode = nodes.get(0).equals(clusterManagerNode) ? nodes.get(1) : nodes.get(0); - final String masterId = internalCluster().clusterService(masterNode).localNode().getId(); - final String nonMasterId = internalCluster().clusterService(nonMasterNode).localNode().getId(); + final String clusterManagerId = internalCluster().clusterService(clusterManagerNode).localNode().getId(); + final String nonClusterManagerId = internalCluster().clusterService(nonClusterManagerNode).localNode().getId(); final int numShards = scaledRandomIntBetween(2, 10); assertAcked( @@ -476,14 +476,14 @@ public void testShardActiveElseWhere() throws Exception { waitNoPendingTasksOnAll(); ClusterStateResponse stateResponse = client().admin().cluster().prepareState().get(); final Index index = stateResponse.getState().metadata().index("test").getIndex(); - RoutingNode routingNode = stateResponse.getState().getRoutingNodes().node(nonMasterId); + RoutingNode routingNode = stateResponse.getState().getRoutingNodes().node(nonClusterManagerId); final int[] node2Shards = new int[routingNode.numberOfOwningShards()]; int i = 0; for (ShardRouting shardRouting : routingNode) { node2Shards[i] = shardRouting.shardId().id(); i++; } - logger.info("Node [{}] has shards: {}", nonMasterNode, Arrays.toString(node2Shards)); + logger.info("Node [{}] has shards: {}", nonClusterManagerNode, Arrays.toString(node2Shards)); // disable relocations when we do this, to make sure the shards are not relocated from node2 // due to rebalancing, and delete its content @@ -496,14 +496,14 @@ public void testShardActiveElseWhere() throws Exception { ) .get(); - ClusterApplierService clusterApplierService = internalCluster().getInstance(ClusterService.class, nonMasterNode) + ClusterApplierService clusterApplierService = internalCluster().getInstance(ClusterService.class, nonClusterManagerNode) .getClusterApplierService(); ClusterState currentState = clusterApplierService.state(); IndexRoutingTable.Builder indexRoutingTableBuilder = IndexRoutingTable.builder(index); for (int j = 0; j < numShards; j++) { indexRoutingTableBuilder.addIndexShard( new IndexShardRoutingTable.Builder(new ShardId(index, j)).addShard( - TestShardRouting.newShardRouting("test", j, masterId, true, ShardRoutingState.STARTED) + TestShardRouting.newShardRouting("test", j, clusterManagerId, true, ShardRoutingState.STARTED) ).build() ); } @@ -528,7 +528,7 @@ public void onFailure(String source, Exception e) { waitNoPendingTasksOnAll(); logger.info("Checking if shards aren't removed"); for (int shard : node2Shards) { - assertShardExists(nonMasterNode, index, shard); + assertShardExists(nonClusterManagerNode, index, shard); } } diff --git a/server/src/internalClusterTest/java/org/opensearch/ingest/IngestClientIT.java b/server/src/internalClusterTest/java/org/opensearch/ingest/IngestClientIT.java index 2f666bbd65d4d..d577019590019 100644 --- a/server/src/internalClusterTest/java/org/opensearch/ingest/IngestClientIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/ingest/IngestClientIT.java @@ -302,8 +302,8 @@ public void testPutWithPipelineFactoryError() throws Exception { assertFalse(response.isFound()); } - public void testWithDedicatedMaster() throws Exception { - String masterOnlyNode = internalCluster().startMasterOnlyNode(); + public void testWithDedicatedClusterManager() throws Exception { + String clusterManagerOnlyNode = internalCluster().startClusterManagerOnlyNode(); BytesReference source = BytesReference.bytes( jsonBuilder().startObject() .field("description", "my_pipeline") @@ -318,7 +318,7 @@ public void testWithDedicatedMaster() throws Exception { PutPipelineRequest putPipelineRequest = new PutPipelineRequest("_id", source, XContentType.JSON); client().admin().cluster().putPipeline(putPipelineRequest).get(); - BulkItemResponse item = client(masterOnlyNode).prepareBulk() + BulkItemResponse item = client(clusterManagerOnlyNode).prepareBulk() .add(client().prepareIndex("test").setSource("field", "value2", "drop", true).setPipeline("_id")) .get() .getItems()[0]; diff --git a/server/src/internalClusterTest/java/org/opensearch/recovery/FullRollingRestartIT.java b/server/src/internalClusterTest/java/org/opensearch/recovery/FullRollingRestartIT.java index 15d1f3a0559a8..a8423312de271 100644 --- a/server/src/internalClusterTest/java/org/opensearch/recovery/FullRollingRestartIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/recovery/FullRollingRestartIT.java @@ -196,7 +196,7 @@ public void testFullRollingRestart() throws Exception { public void testNoRebalanceOnRollingRestart() throws Exception { // see https://github.com/elastic/elasticsearch/issues/14387 - internalCluster().startMasterOnlyNode(Settings.EMPTY); + internalCluster().startClusterManagerOnlyNode(Settings.EMPTY); internalCluster().startDataOnlyNodes(3); /** * We start 3 nodes and a dedicated master. Restart on of the data-nodes and ensure that we got no relocations. diff --git a/server/src/internalClusterTest/java/org/opensearch/snapshots/AbortedRestoreIT.java b/server/src/internalClusterTest/java/org/opensearch/snapshots/AbortedRestoreIT.java index 6a8e45920e806..97faacb38bc50 100644 --- a/server/src/internalClusterTest/java/org/opensearch/snapshots/AbortedRestoreIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/snapshots/AbortedRestoreIT.java @@ -59,7 +59,7 @@ public class AbortedRestoreIT extends AbstractSnapshotIntegTestCase { public void testAbortedRestoreAlsoAbortFileRestores() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode(); final String indexName = "test-abort-restore"; diff --git a/server/src/internalClusterTest/java/org/opensearch/snapshots/BlobStoreIncrementalityIT.java b/server/src/internalClusterTest/java/org/opensearch/snapshots/BlobStoreIncrementalityIT.java index 5a3d2c6c4bafd..9a40ea2c95b28 100644 --- a/server/src/internalClusterTest/java/org/opensearch/snapshots/BlobStoreIncrementalityIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/snapshots/BlobStoreIncrementalityIT.java @@ -59,7 +59,7 @@ public class BlobStoreIncrementalityIT extends AbstractSnapshotIntegTestCase { public void testIncrementalBehaviorOnPrimaryFailover() throws InterruptedException, ExecutionException, IOException { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String primaryNode = internalCluster().startDataOnlyNode(); final String indexName = "test-index"; createIndex( @@ -148,7 +148,7 @@ public void testIncrementalBehaviorOnPrimaryFailover() throws InterruptedExcepti } public void testForceMergeCausesFullSnapshot() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().ensureAtLeastNumDataNodes(2); final String indexName = "test-index"; createIndex(indexName, Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1).build()); diff --git a/server/src/internalClusterTest/java/org/opensearch/snapshots/CloneSnapshotIT.java b/server/src/internalClusterTest/java/org/opensearch/snapshots/CloneSnapshotIT.java index 137be2187fe57..7dc33294ce783 100644 --- a/server/src/internalClusterTest/java/org/opensearch/snapshots/CloneSnapshotIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/snapshots/CloneSnapshotIT.java @@ -72,7 +72,7 @@ public class CloneSnapshotIT extends AbstractSnapshotIntegTestCase { public void testShardClone() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "repo-name"; final Path repoPath = randomRepoPath(); @@ -143,7 +143,7 @@ public void testShardClone() throws Exception { } public void testCloneSnapshotIndex() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "repo-name"; createRepository(repoName, "fs"); @@ -172,7 +172,7 @@ public void testCloneSnapshotIndex() throws Exception { } public void testClonePreventsSnapshotDelete() throws Exception { - final String masterName = internalCluster().startMasterOnlyNode(); + final String clusterManagerName = internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "repo-name"; createRepository(repoName, "mock"); @@ -185,9 +185,9 @@ public void testClonePreventsSnapshotDelete() throws Exception { indexRandomDocs(indexName, randomIntBetween(20, 100)); final String targetSnapshot = "target-snapshot"; - blockNodeOnAnyFiles(repoName, masterName); + blockNodeOnAnyFiles(repoName, clusterManagerName); final ActionFuture cloneFuture = startClone(repoName, sourceSnapshot, targetSnapshot, indexName); - waitForBlock(masterName, repoName, TimeValue.timeValueSeconds(30L)); + waitForBlock(clusterManagerName, repoName, TimeValue.timeValueSeconds(30L)); assertFalse(cloneFuture.isDone()); ConcurrentSnapshotExecutionException ex = expectThrows( @@ -196,7 +196,7 @@ public void testClonePreventsSnapshotDelete() throws Exception { ); assertThat(ex.getMessage(), containsString("cannot delete snapshot while it is being cloned")); - unblockNode(repoName, masterName); + unblockNode(repoName, clusterManagerName); assertAcked(cloneFuture.get()); final List status = clusterAdmin().prepareSnapshotStatus(repoName) .setSnapshots(sourceSnapshot, targetSnapshot) @@ -210,7 +210,7 @@ public void testClonePreventsSnapshotDelete() throws Exception { } public void testConcurrentCloneAndSnapshot() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode(); final String repoName = "repo-name"; createRepository(repoName, "mock"); @@ -234,7 +234,7 @@ public void testConcurrentCloneAndSnapshot() throws Exception { public void testLongRunningCloneAllowsConcurrentSnapshot() throws Exception { // large snapshot pool so blocked snapshot threads from cloning don't prevent concurrent snapshot finalizations - final String masterNode = internalCluster().startMasterOnlyNode(LARGE_SNAPSHOT_POOL_SETTINGS); + final String masterNode = internalCluster().startClusterManagerOnlyNode(LARGE_SNAPSHOT_POOL_SETTINGS); internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -263,7 +263,7 @@ public void testLongRunningCloneAllowsConcurrentSnapshot() throws Exception { } public void testLongRunningSnapshotAllowsConcurrentClone() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -293,7 +293,7 @@ public void testLongRunningSnapshotAllowsConcurrentClone() throws Exception { } public void testDeletePreventsClone() throws Exception { - final String masterName = internalCluster().startMasterOnlyNode(); + final String clusterManagerName = internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "repo-name"; createRepository(repoName, "mock"); @@ -306,9 +306,9 @@ public void testDeletePreventsClone() throws Exception { indexRandomDocs(indexName, randomIntBetween(20, 100)); final String targetSnapshot = "target-snapshot"; - blockNodeOnAnyFiles(repoName, masterName); + blockNodeOnAnyFiles(repoName, clusterManagerName); final ActionFuture deleteFuture = startDeleteSnapshot(repoName, sourceSnapshot); - waitForBlock(masterName, repoName, TimeValue.timeValueSeconds(30L)); + waitForBlock(clusterManagerName, repoName, TimeValue.timeValueSeconds(30L)); assertFalse(deleteFuture.isDone()); ConcurrentSnapshotExecutionException ex = expectThrows( @@ -317,13 +317,13 @@ public void testDeletePreventsClone() throws Exception { ); assertThat(ex.getMessage(), containsString("cannot clone from snapshot that is being deleted")); - unblockNode(repoName, masterName); + unblockNode(repoName, clusterManagerName); assertAcked(deleteFuture.get()); } public void testBackToBackClonesForIndexNotInCluster() throws Exception { // large snapshot pool so blocked snapshot threads from cloning don't prevent concurrent snapshot finalizations - final String masterNode = internalCluster().startMasterOnlyNode(LARGE_SNAPSHOT_POOL_SETTINGS); + final String masterNode = internalCluster().startClusterManagerOnlyNode(LARGE_SNAPSHOT_POOL_SETTINGS); internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -413,7 +413,7 @@ public void testMasterFailoverDuringCloneStep1() throws Exception { } public void testFailsOnCloneMissingIndices() { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "repo-name"; final Path repoPath = randomRepoPath(); @@ -481,7 +481,7 @@ public void testExceptionDuringShardClone() throws Exception { } public void testDoesNotStartOnBrokenSourceSnapshot() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -516,7 +516,7 @@ public void testDoesNotStartOnBrokenSourceSnapshot() throws Exception { } public void testStartSnapshotWithSuccessfulShardClonePendingFinalization() throws Exception { - final String masterName = internalCluster().startMasterOnlyNode(LARGE_SNAPSHOT_POOL_SETTINGS); + final String masterName = internalCluster().startClusterManagerOnlyNode(LARGE_SNAPSHOT_POOL_SETTINGS); final String dataNode = internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -546,7 +546,7 @@ public void testStartSnapshotWithSuccessfulShardClonePendingFinalization() throw } public void testStartCloneWithSuccessfulShardClonePendingFinalization() throws Exception { - final String masterName = internalCluster().startMasterOnlyNode(); + final String clusterManagerName = internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -560,14 +560,14 @@ public void testStartCloneWithSuccessfulShardClonePendingFinalization() throws E blockMasterOnWriteIndexFile(repoName); final String cloneName = "clone-blocked"; final ActionFuture blockedClone = startClone(repoName, sourceSnapshot, cloneName, indexName); - waitForBlock(masterName, repoName, TimeValue.timeValueSeconds(30L)); + waitForBlock(clusterManagerName, repoName, TimeValue.timeValueSeconds(30L)); awaitNumberOfSnapshotsInProgress(1); final String otherCloneName = "other-clone"; final ActionFuture otherClone = startClone(repoName, sourceSnapshot, otherCloneName, indexName); awaitNumberOfSnapshotsInProgress(2); assertFalse(blockedClone.isDone()); - unblockNode(repoName, masterName); - awaitNoMoreRunningOperations(masterName); + unblockNode(repoName, clusterManagerName); + awaitNoMoreRunningOperations(clusterManagerName); awaitMasterFinishRepoOperations(); assertAcked(blockedClone.get()); assertAcked(otherClone.get()); @@ -576,7 +576,7 @@ public void testStartCloneWithSuccessfulShardClonePendingFinalization() throws E } public void testStartCloneWithSuccessfulShardSnapshotPendingFinalization() throws Exception { - final String masterName = internalCluster().startMasterOnlyNode(LARGE_SNAPSHOT_POOL_SETTINGS); + final String masterName = internalCluster().startClusterManagerOnlyNode(LARGE_SNAPSHOT_POOL_SETTINGS); internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); diff --git a/server/src/internalClusterTest/java/org/opensearch/snapshots/ConcurrentSnapshotsIT.java b/server/src/internalClusterTest/java/org/opensearch/snapshots/ConcurrentSnapshotsIT.java index 9adb0ff6260e8..edae4fa4a6b5e 100644 --- a/server/src/internalClusterTest/java/org/opensearch/snapshots/ConcurrentSnapshotsIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/snapshots/ConcurrentSnapshotsIT.java @@ -106,7 +106,7 @@ protected Settings nodeSettings(int nodeOrdinal) { } public void testLongRunningSnapshotAllowsConcurrentSnapshot() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -139,7 +139,7 @@ public void testLongRunningSnapshotAllowsConcurrentSnapshot() throws Exception { } public void testDeletesAreBatched() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -205,7 +205,7 @@ public void testDeletesAreBatched() throws Exception { } public void testBlockedRepoDoesNotBlockOtherRepos() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String blockedRepoName = "test-repo-blocked"; final String otherRepoName = "test-repo"; @@ -231,7 +231,7 @@ public void testBlockedRepoDoesNotBlockOtherRepos() throws Exception { } public void testMultipleReposAreIndependent() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); // We're blocking a some of the snapshot threads when we block the first repo below so we have to make sure we have enough threads // left for the second concurrent snapshot. final String dataNode = startDataNodeWithLargeSnapshotPool(); @@ -255,7 +255,7 @@ public void testMultipleReposAreIndependent() throws Exception { } public void testMultipleReposAreIndependent2() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); // We're blocking a some of the snapshot threads when we block the first repo below so we have to make sure we have enough threads // left for the second repository's concurrent operations. final String dataNode = startDataNodeWithLargeSnapshotPool(); @@ -280,7 +280,7 @@ public void testMultipleReposAreIndependent2() throws Exception { } public void testMultipleReposAreIndependent3() throws Exception { - final String masterNode = internalCluster().startMasterOnlyNode(LARGE_SNAPSHOT_POOL_SETTINGS); + final String masterNode = internalCluster().startClusterManagerOnlyNode(LARGE_SNAPSHOT_POOL_SETTINGS); internalCluster().startDataOnlyNode(); final String blockedRepoName = "test-repo-blocked"; final String otherRepoName = "test-repo"; @@ -301,7 +301,7 @@ public void testMultipleReposAreIndependent3() throws Exception { } public void testSnapshotRunsAfterInProgressDelete() throws Exception { - final String masterNode = internalCluster().startMasterOnlyNode(); + final String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -314,11 +314,11 @@ public void testSnapshotRunsAfterInProgressDelete() throws Exception { blockMasterFromFinalizingSnapshotOnIndexFile(repoName); final ActionFuture deleteFuture = startDeleteSnapshot(repoName, firstSnapshot); - waitForBlock(masterNode, repoName, TimeValue.timeValueSeconds(30L)); + waitForBlock(clusterManagerNode, repoName, TimeValue.timeValueSeconds(30L)); final ActionFuture snapshotFuture = startFullSnapshot(repoName, "second-snapshot"); - unblockNode(repoName, masterNode); + unblockNode(repoName, clusterManagerNode); final UncategorizedExecutionException ex = expectThrows(UncategorizedExecutionException.class, deleteFuture::actionGet); assertThat(ex.getRootCause(), instanceOf(IOException.class)); @@ -326,7 +326,7 @@ public void testSnapshotRunsAfterInProgressDelete() throws Exception { } public void testAbortOneOfMultipleSnapshots() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -386,7 +386,7 @@ public void testAbortOneOfMultipleSnapshots() throws Exception { } public void testCascadedAborts() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -540,7 +540,7 @@ public void testMasterFailOverWithQueuedDeletes() throws Exception { } public void testAssertMultipleSnapshotsAndPrimaryFailOver() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -571,7 +571,7 @@ public void testAssertMultipleSnapshotsAndPrimaryFailOver() throws Exception { } public void testQueuedDeletesWithFailures() throws Exception { - final String masterNode = internalCluster().startMasterOnlyNode(); + final String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -580,7 +580,7 @@ public void testQueuedDeletesWithFailures() throws Exception { blockMasterFromFinalizingSnapshotOnIndexFile(repoName); final ActionFuture firstDeleteFuture = startDeleteSnapshot(repoName, "*"); - waitForBlock(masterNode, repoName, TimeValue.timeValueSeconds(30L)); + waitForBlock(clusterManagerNode, repoName, TimeValue.timeValueSeconds(30L)); final ActionFuture snapshotFuture = startFullSnapshot(repoName, "snapshot-queued"); awaitNumberOfSnapshotsInProgress(1); @@ -588,7 +588,7 @@ public void testQueuedDeletesWithFailures() throws Exception { final ActionFuture secondDeleteFuture = startDeleteSnapshot(repoName, "*"); awaitNDeletionsInProgress(2); - unblockNode(repoName, masterNode); + unblockNode(repoName, clusterManagerNode); expectThrows(UncategorizedExecutionException.class, firstDeleteFuture::actionGet); // Second delete works out cleanly since the repo is unblocked now @@ -601,7 +601,7 @@ public void testQueuedDeletesWithFailures() throws Exception { } public void testQueuedDeletesWithOverlap() throws Exception { - final String masterNode = internalCluster().startMasterOnlyNode(); + final String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -615,7 +615,7 @@ public void testQueuedDeletesWithOverlap() throws Exception { final ActionFuture secondDeleteFuture = startDeleteSnapshot(repoName, "*"); awaitNDeletionsInProgress(2); - unblockNode(repoName, masterNode); + unblockNode(repoName, clusterManagerNode); assertThat(firstDeleteFuture.get().isAcknowledged(), is(true)); // Second delete works out cleanly since the repo is unblocked now @@ -878,7 +878,7 @@ public void testQueuedSnapshotOperationsAndBrokenRepoOnMasterFailOverMultipleRep } public void testMultipleSnapshotsQueuedAfterDelete() throws Exception { - final String masterNode = internalCluster().startMasterOnlyNode(); + final String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -889,7 +889,7 @@ public void testMultipleSnapshotsQueuedAfterDelete() throws Exception { final ActionFuture snapshotThree = startFullSnapshot(repoName, "snapshot-three"); final ActionFuture snapshotFour = startFullSnapshot(repoName, "snapshot-four"); - unblockNode(repoName, masterNode); + unblockNode(repoName, clusterManagerNode); assertSuccessful(snapshotThree); assertSuccessful(snapshotFour); @@ -897,7 +897,7 @@ public void testMultipleSnapshotsQueuedAfterDelete() throws Exception { } public void testMultiplePartialSnapshotsQueuedAfterDelete() throws Exception { - final String masterNode = internalCluster().startMasterOnlyNode(); + final String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -911,7 +911,7 @@ public void testMultiplePartialSnapshotsQueuedAfterDelete() throws Exception { awaitNumberOfSnapshotsInProgress(2); assertAcked(client().admin().indices().prepareDelete("index-two")); - unblockNode(repoName, masterNode); + unblockNode(repoName, clusterManagerNode); assertThat(snapshotThree.get().getSnapshotInfo().state(), is(SnapshotState.PARTIAL)); assertThat(snapshotFour.get().getSnapshotInfo().state(), is(SnapshotState.PARTIAL)); @@ -919,7 +919,7 @@ public void testMultiplePartialSnapshotsQueuedAfterDelete() throws Exception { } public void testQueuedSnapshotsWaitingForShardReady() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNodes(2); final String repoName = "test-repo"; createRepository(repoName, "fs"); @@ -977,7 +977,7 @@ public void testQueuedSnapshotsWaitingForShardReady() throws Exception { } public void testBackToBackQueuedDeletes() throws Exception { - final String masterName = internalCluster().startMasterOnlyNode(); + final String clusterManagerName = internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -990,7 +990,7 @@ public void testBackToBackQueuedDeletes() throws Exception { final ActionFuture deleteSnapshotTwo = startDeleteSnapshot(repoName, snapshotTwo); awaitNDeletionsInProgress(2); - unblockNode(repoName, masterName); + unblockNode(repoName, clusterManagerName); assertAcked(deleteSnapshotOne.get()); assertAcked(deleteSnapshotTwo.get()); @@ -1024,7 +1024,7 @@ public void testQueuedOperationsAfterFinalizationFailure() throws Exception { } public void testStartDeleteDuringFinalizationCleanup() throws Exception { - final String masterName = internalCluster().startMasterOnlyNode(); + final String clusterManagerName = internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -1033,35 +1033,35 @@ public void testStartDeleteDuringFinalizationCleanup() throws Exception { final String snapshotName = "snap-name"; blockMasterFromDeletingIndexNFile(repoName); final ActionFuture snapshotFuture = startFullSnapshot(repoName, snapshotName); - waitForBlock(masterName, repoName, TimeValue.timeValueSeconds(30L)); + waitForBlock(clusterManagerName, repoName, TimeValue.timeValueSeconds(30L)); final ActionFuture deleteFuture = startDeleteSnapshot(repoName, snapshotName); awaitNDeletionsInProgress(1); - unblockNode(repoName, masterName); + unblockNode(repoName, clusterManagerName); assertSuccessful(snapshotFuture); assertAcked(deleteFuture.get(30L, TimeUnit.SECONDS)); } public void testEquivalentDeletesAreDeduplicated() throws Exception { - final String masterName = internalCluster().startMasterOnlyNode(); + final String clusterManagerName = internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); createIndexWithContent("index-test"); createNSnapshots(repoName, randomIntBetween(1, 5)); - blockNodeOnAnyFiles(repoName, masterName); + blockNodeOnAnyFiles(repoName, clusterManagerName); final int deletes = randomIntBetween(2, 10); final List> deleteResponses = new ArrayList<>(deletes); for (int i = 0; i < deletes; ++i) { deleteResponses.add(client().admin().cluster().prepareDeleteSnapshot(repoName, "*").execute()); } - waitForBlock(masterName, repoName, TimeValue.timeValueSeconds(30L)); + waitForBlock(clusterManagerName, repoName, TimeValue.timeValueSeconds(30L)); awaitNDeletionsInProgress(1); for (ActionFuture deleteResponse : deleteResponses) { assertFalse(deleteResponse.isDone()); } awaitNDeletionsInProgress(1); - unblockNode(repoName, masterName); + unblockNode(repoName, clusterManagerName); for (ActionFuture deleteResponse : deleteResponses) { assertAcked(deleteResponse.get()); } @@ -1102,7 +1102,7 @@ public void testMasterFailoverOnFinalizationLoop() throws Exception { } public void testStatusMultipleSnapshotsMultipleRepos() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); // We're blocking a some of the snapshot threads when we block the first repo below so we have to make sure we have enough threads // left for the second concurrent snapshot. final String dataNode = startDataNodeWithLargeSnapshotPool(); @@ -1146,7 +1146,7 @@ public void testStatusMultipleSnapshotsMultipleRepos() throws Exception { } public void testInterleavedAcrossMultipleRepos() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); // We're blocking a some of the snapshot threads when we block the first repo below so we have to make sure we have enough threads // left for the second concurrent snapshot. final String dataNode = startDataNodeWithLargeSnapshotPool(); @@ -1219,7 +1219,7 @@ public void testMasterFailoverAndMultipleQueuedUpSnapshotsAcrossTwoRepos() throw } public void testConcurrentOperationsLimit() throws Exception { - final String masterName = internalCluster().startMasterOnlyNode(); + final String clusterManagerName = internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -1237,7 +1237,7 @@ public void testConcurrentOperationsLimit() throws Exception { ); final List snapshotNames = createNSnapshots(repoName, limitToTest + 1); - blockNodeOnAnyFiles(repoName, masterName); + blockNodeOnAnyFiles(repoName, clusterManagerName); int blockedSnapshots = 0; boolean blockedDelete = false; final List> snapshotFutures = new ArrayList<>(); @@ -1255,7 +1255,7 @@ public void testConcurrentOperationsLimit() throws Exception { if (blockedDelete) { awaitNDeletionsInProgress(1); } - waitForBlock(masterName, repoName, TimeValue.timeValueSeconds(30L)); + waitForBlock(clusterManagerName, repoName, TimeValue.timeValueSeconds(30L)); final String expectedFailureMessage = "Cannot start another operation, already running [" + limitToTest @@ -1275,7 +1275,7 @@ public void testConcurrentOperationsLimit() throws Exception { assertThat(csen2.getMessage(), containsString(expectedFailureMessage)); } - unblockNode(repoName, masterName); + unblockNode(repoName, clusterManagerName); if (deleteFuture != null) { assertAcked(deleteFuture.get()); } @@ -1285,7 +1285,7 @@ public void testConcurrentOperationsLimit() throws Exception { } public void testConcurrentSnapshotWorksWithOldVersionRepo() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; final Path repoPath = randomRepoPath(); @@ -1322,23 +1322,23 @@ public void testConcurrentSnapshotWorksWithOldVersionRepo() throws Exception { } public void testQueuedDeleteAfterFinalizationFailure() throws Exception { - final String masterNode = internalCluster().startMasterOnlyNode(); + final String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); blockMasterFromFinalizingSnapshotOnIndexFile(repoName); final String snapshotName = "snap-1"; final ActionFuture snapshotFuture = startFullSnapshot(repoName, snapshotName); - waitForBlock(masterNode, repoName, TimeValue.timeValueSeconds(30L)); + waitForBlock(clusterManagerNode, repoName, TimeValue.timeValueSeconds(30L)); final ActionFuture deleteFuture = startDeleteSnapshot(repoName, snapshotName); awaitNDeletionsInProgress(1); - unblockNode(repoName, masterNode); + unblockNode(repoName, clusterManagerNode); assertAcked(deleteFuture.get()); final SnapshotException sne = expectThrows(SnapshotException.class, snapshotFuture::actionGet); assertThat(sne.getCause().getMessage(), containsString("exception after block")); } public void testAbortNotStartedSnapshotWithoutIO() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -1365,7 +1365,7 @@ public void testAbortNotStartedSnapshotWithoutIO() throws Exception { } public void testStartWithSuccessfulShardSnapshotPendingFinalization() throws Exception { - final String masterName = internalCluster().startMasterOnlyNode(); + final String clusterManagerName = internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "mock"); @@ -1375,13 +1375,13 @@ public void testStartWithSuccessfulShardSnapshotPendingFinalization() throws Exc blockMasterOnWriteIndexFile(repoName); final ActionFuture blockedSnapshot = startFullSnapshot(repoName, "snap-blocked"); - waitForBlock(masterName, repoName, TimeValue.timeValueSeconds(30L)); + waitForBlock(clusterManagerName, repoName, TimeValue.timeValueSeconds(30L)); awaitNumberOfSnapshotsInProgress(1); blockNodeOnAnyFiles(repoName, dataNode); final ActionFuture otherSnapshot = startFullSnapshot(repoName, "other-snapshot"); awaitNumberOfSnapshotsInProgress(2); assertFalse(blockedSnapshot.isDone()); - unblockNode(repoName, masterName); + unblockNode(repoName, clusterManagerName); awaitNumberOfSnapshotsInProgress(1); awaitMasterFinishRepoOperations(); diff --git a/server/src/internalClusterTest/java/org/opensearch/snapshots/DedicatedClusterSnapshotRestoreIT.java b/server/src/internalClusterTest/java/org/opensearch/snapshots/DedicatedClusterSnapshotRestoreIT.java index 0c392dbe8bbe6..46638f31b6cca 100644 --- a/server/src/internalClusterTest/java/org/opensearch/snapshots/DedicatedClusterSnapshotRestoreIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/snapshots/DedicatedClusterSnapshotRestoreIT.java @@ -926,7 +926,7 @@ public void testMasterAndDataShutdownDuringSnapshot() throws Exception { */ public void testRestoreShrinkIndex() throws Exception { logger.info("--> starting a cluster-manager node and a data node"); - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repo = "test-repo"; @@ -1145,7 +1145,7 @@ public void testDeduplicateIndexMetadata() throws Exception { public void testDataNodeRestartWithBusyMasterDuringSnapshot() throws Exception { logger.info("--> starting a cluster-manager node and two data nodes"); - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNodes(2); final Path repoPath = randomRepoPath(); createRepository("test-repo", "mock", repoPath); @@ -1201,7 +1201,7 @@ public void testDataNodeRestartWithBusyMasterDuringSnapshot() throws Exception { public void testDataNodeRestartAfterShardSnapshotFailure() throws Exception { logger.info("--> starting a cluster-manager node and two data nodes"); - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final List dataNodes = internalCluster().startDataOnlyNodes(2); final Path repoPath = randomRepoPath(); createRepository("test-repo", "mock", repoPath); @@ -1323,7 +1323,7 @@ public void testRetentionLeasesClearedOnRestore() throws Exception { } public void testAbortWaitsOnDataNode() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String dataNodeName = internalCluster().startDataOnlyNode(); final String indexName = "test-index"; createIndex(indexName); @@ -1375,7 +1375,7 @@ public void onRequestSent( } public void testPartialSnapshotAllShardsMissing() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final String dataNode = internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "fs"); @@ -1393,7 +1393,7 @@ public void testPartialSnapshotAllShardsMissing() throws Exception { * correctly by testing a snapshot name collision. */ public void testCreateSnapshotLegacyPath() throws Exception { - final String masterNode = internalCluster().startMasterOnlyNode(); + final String clusterManagerNode = internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoName = "test-repo"; createRepository(repoName, "fs"); @@ -1403,7 +1403,7 @@ public void testCreateSnapshotLegacyPath() throws Exception { final Snapshot snapshot1 = PlainActionFuture.get( f -> snapshotsService.createSnapshotLegacy(new CreateSnapshotRequest(repoName, "snap-1"), f) ); - awaitNoMoreRunningOperations(masterNode); + awaitNoMoreRunningOperations(clusterManagerNode); final InvalidSnapshotNameException sne = expectThrows( InvalidSnapshotNameException.class, @@ -1425,7 +1425,7 @@ public void testCreateSnapshotLegacyPath() throws Exception { } public void testSnapshotDeleteRelocatingPrimaryIndex() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); final List dataNodes = internalCluster().startDataOnlyNodes(2); final String repoName = "test-repo"; createRepository(repoName, "fs"); diff --git a/server/src/internalClusterTest/java/org/opensearch/snapshots/MultiClusterRepoAccessIT.java b/server/src/internalClusterTest/java/org/opensearch/snapshots/MultiClusterRepoAccessIT.java index 2b2b656d5dd0e..13aee8b8e18a6 100644 --- a/server/src/internalClusterTest/java/org/opensearch/snapshots/MultiClusterRepoAccessIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/snapshots/MultiClusterRepoAccessIT.java @@ -107,13 +107,13 @@ public void stopSecondCluster() throws IOException { } public void testConcurrentDeleteFromOtherCluster() throws InterruptedException { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); final String repoNameOnFirstCluster = "test-repo"; final String repoNameOnSecondCluster = randomBoolean() ? "test-repo" : "other-repo"; createRepository(repoNameOnFirstCluster, "fs", repoPath); - secondCluster.startMasterOnlyNode(); + secondCluster.startClusterManagerOnlyNode(); secondCluster.startDataOnlyNode(); secondCluster.client() .admin() diff --git a/server/src/internalClusterTest/java/org/opensearch/snapshots/SnapshotShardsServiceIT.java b/server/src/internalClusterTest/java/org/opensearch/snapshots/SnapshotShardsServiceIT.java index 762656e251659..4543a3e0a1b6d 100644 --- a/server/src/internalClusterTest/java/org/opensearch/snapshots/SnapshotShardsServiceIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/snapshots/SnapshotShardsServiceIT.java @@ -60,7 +60,7 @@ protected Collection> nodePlugins() { } public void testRetryPostingSnapshotStatusMessages() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNode(); createRepository("test-repo", "mock"); diff --git a/server/src/test/java/org/opensearch/cluster/routing/DelayedAllocationServiceTests.java b/server/src/test/java/org/opensearch/cluster/routing/DelayedAllocationServiceTests.java index 1f45c5c1dfce4..635dfe409058a 100644 --- a/server/src/test/java/org/opensearch/cluster/routing/DelayedAllocationServiceTests.java +++ b/server/src/test/java/org/opensearch/cluster/routing/DelayedAllocationServiceTests.java @@ -83,7 +83,7 @@ public void createDelayedAllocationService() { threadPool = new TestThreadPool(getTestName()); clusterService = mock(ClusterService.class); allocationService = createAllocationService(Settings.EMPTY, new DelayedShardsMockGatewayAllocator()); - when(clusterService.getSettings()).thenReturn(NodeRoles.masterOnlyNode()); + when(clusterService.getSettings()).thenReturn(NodeRoles.clusterManagerOnlyNode()); delayedAllocationService = new TestDelayAllocationService(threadPool, clusterService, allocationService); verify(clusterService).addListener(delayedAllocationService); verify(clusterService).getSettings(); diff --git a/server/src/test/java/org/opensearch/cluster/routing/allocation/AllocationCommandsTests.java b/server/src/test/java/org/opensearch/cluster/routing/allocation/AllocationCommandsTests.java index cda0f1afaf62c..4db9c0cf49b73 100644 --- a/server/src/test/java/org/opensearch/cluster/routing/allocation/AllocationCommandsTests.java +++ b/server/src/test/java/org/opensearch/cluster/routing/allocation/AllocationCommandsTests.java @@ -737,7 +737,7 @@ public void testMoveShardToNonDataNode() { "test1", buildNewFakeTransportAddress(), emptyMap(), - MASTER_DATA_ROLES, + CLUSTER_MANAGER_DATA_ROLES, Version.CURRENT ); DiscoveryNode node2 = new DiscoveryNode( @@ -808,7 +808,7 @@ public void testMoveShardFromNonDataNode() { "test1", buildNewFakeTransportAddress(), emptyMap(), - MASTER_DATA_ROLES, + CLUSTER_MANAGER_DATA_ROLES, Version.CURRENT ); DiscoveryNode node2 = new DiscoveryNode( diff --git a/server/src/test/java/org/opensearch/cluster/routing/allocation/NodeVersionAllocationDeciderTests.java b/server/src/test/java/org/opensearch/cluster/routing/allocation/NodeVersionAllocationDeciderTests.java index 5972cc9981254..38e24af421475 100644 --- a/server/src/test/java/org/opensearch/cluster/routing/allocation/NodeVersionAllocationDeciderTests.java +++ b/server/src/test/java/org/opensearch/cluster/routing/allocation/NodeVersionAllocationDeciderTests.java @@ -338,21 +338,21 @@ public void testRebalanceDoesNotAllocatePrimaryAndReplicasOnDifferentVersionNode "newNode", buildNewFakeTransportAddress(), emptyMap(), - MASTER_DATA_ROLES, + CLUSTER_MANAGER_DATA_ROLES, Version.CURRENT ); final DiscoveryNode oldNode1 = new DiscoveryNode( "oldNode1", buildNewFakeTransportAddress(), emptyMap(), - MASTER_DATA_ROLES, + CLUSTER_MANAGER_DATA_ROLES, VersionUtils.getPreviousVersion() ); final DiscoveryNode oldNode2 = new DiscoveryNode( "oldNode2", buildNewFakeTransportAddress(), emptyMap(), - MASTER_DATA_ROLES, + CLUSTER_MANAGER_DATA_ROLES, VersionUtils.getPreviousVersion() ); AllocationId allocationId1P = AllocationId.newInitializing(); @@ -457,21 +457,21 @@ public void testRestoreDoesNotAllocateSnapshotOnOlderNodes() { "newNode", buildNewFakeTransportAddress(), emptyMap(), - MASTER_DATA_ROLES, + CLUSTER_MANAGER_DATA_ROLES, Version.CURRENT ); final DiscoveryNode oldNode1 = new DiscoveryNode( "oldNode1", buildNewFakeTransportAddress(), emptyMap(), - MASTER_DATA_ROLES, + CLUSTER_MANAGER_DATA_ROLES, VersionUtils.getPreviousVersion() ); final DiscoveryNode oldNode2 = new DiscoveryNode( "oldNode2", buildNewFakeTransportAddress(), emptyMap(), - MASTER_DATA_ROLES, + CLUSTER_MANAGER_DATA_ROLES, VersionUtils.getPreviousVersion() ); diff --git a/server/src/test/java/org/opensearch/cluster/routing/allocation/SameShardRoutingTests.java b/server/src/test/java/org/opensearch/cluster/routing/allocation/SameShardRoutingTests.java index 36cb68e460418..cd19f78d54be5 100644 --- a/server/src/test/java/org/opensearch/cluster/routing/allocation/SameShardRoutingTests.java +++ b/server/src/test/java/org/opensearch/cluster/routing/allocation/SameShardRoutingTests.java @@ -96,7 +96,7 @@ public void testSameHost() { "test1", buildNewFakeTransportAddress(), emptyMap(), - MASTER_DATA_ROLES, + CLUSTER_MANAGER_DATA_ROLES, Version.CURRENT ) ) @@ -109,7 +109,7 @@ public void testSameHost() { "test1", buildNewFakeTransportAddress(), emptyMap(), - MASTER_DATA_ROLES, + CLUSTER_MANAGER_DATA_ROLES, Version.CURRENT ) ) @@ -138,7 +138,7 @@ public void testSameHost() { "test2", buildNewFakeTransportAddress(), emptyMap(), - MASTER_DATA_ROLES, + CLUSTER_MANAGER_DATA_ROLES, Version.CURRENT ) ) diff --git a/server/src/test/java/org/opensearch/cluster/routing/allocation/decider/DiskThresholdDeciderTests.java b/server/src/test/java/org/opensearch/cluster/routing/allocation/decider/DiskThresholdDeciderTests.java index a2fcf14638d45..cbf624cdad2ca 100644 --- a/server/src/test/java/org/opensearch/cluster/routing/allocation/decider/DiskThresholdDeciderTests.java +++ b/server/src/test/java/org/opensearch/cluster/routing/allocation/decider/DiskThresholdDeciderTests.java @@ -921,14 +921,14 @@ public void testCanRemainWithShardRelocatingAway() { "node1", buildNewFakeTransportAddress(), emptyMap(), - MASTER_DATA_ROLES, + CLUSTER_MANAGER_DATA_ROLES, Version.CURRENT ); DiscoveryNode discoveryNode2 = new DiscoveryNode( "node2", buildNewFakeTransportAddress(), emptyMap(), - MASTER_DATA_ROLES, + CLUSTER_MANAGER_DATA_ROLES, Version.CURRENT ); DiscoveryNodes discoveryNodes = DiscoveryNodes.builder().add(discoveryNode1).add(discoveryNode2).build(); diff --git a/server/src/test/java/org/opensearch/gateway/IncrementalClusterStateWriterTests.java b/server/src/test/java/org/opensearch/gateway/IncrementalClusterStateWriterTests.java index 21d5c897c4a7d..1907abbfcaabd 100644 --- a/server/src/test/java/org/opensearch/gateway/IncrementalClusterStateWriterTests.java +++ b/server/src/test/java/org/opensearch/gateway/IncrementalClusterStateWriterTests.java @@ -181,8 +181,8 @@ private ClusterState clusterStateWithReplicatedClosedIndex(IndexMetadata indexMe private DiscoveryNodes.Builder generateDiscoveryNodes(boolean masterEligible) { Set dataOnlyRoles = Collections.singleton(DiscoveryNodeRole.DATA_ROLE); return DiscoveryNodes.builder() - .add(newNode("node1", masterEligible ? MASTER_DATA_ROLES : dataOnlyRoles)) - .add(newNode("master_node", MASTER_DATA_ROLES)) + .add(newNode("node1", masterEligible ? CLUSTER_MANAGER_DATA_ROLES : dataOnlyRoles)) + .add(newNode("master_node", CLUSTER_MANAGER_DATA_ROLES)) .localNodeId("node1") .masterNodeId(masterEligible ? "node1" : "master_node"); } diff --git a/server/src/test/java/org/opensearch/transport/RemoteClusterServiceTests.java b/server/src/test/java/org/opensearch/transport/RemoteClusterServiceTests.java index 75ba1fb56aa1d..0092763b4ba20 100644 --- a/server/src/test/java/org/opensearch/transport/RemoteClusterServiceTests.java +++ b/server/src/test/java/org/opensearch/transport/RemoteClusterServiceTests.java @@ -62,7 +62,7 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.function.BiFunction; -import static org.opensearch.test.NodeRoles.masterOnlyNode; +import static org.opensearch.test.NodeRoles.clusterManagerOnlyNode; import static org.opensearch.test.NodeRoles.nonMasterNode; import static org.opensearch.test.NodeRoles.removeRoles; import static org.hamcrest.Matchers.either; @@ -553,7 +553,7 @@ public void testRemoteNodeRoles() throws IOException, InterruptedException { final Settings settings = Settings.EMPTY; final List knownNodes = new CopyOnWriteArrayList<>(); final Settings data = nonMasterNode(); - final Settings dedicatedMaster = masterOnlyNode(); + final Settings dedicatedMaster = clusterManagerOnlyNode(); try ( MockTransportService c1N1 = startTransport("cluster_1_node_1", knownNodes, Version.CURRENT, dedicatedMaster); MockTransportService c1N2 = startTransport("cluster_1_node_2", knownNodes, Version.CURRENT, data); diff --git a/test/framework/src/main/java/org/opensearch/action/support/replication/ClusterStateCreationUtils.java b/test/framework/src/main/java/org/opensearch/action/support/replication/ClusterStateCreationUtils.java index 72ca3617c40a3..18f8f4e584748 100644 --- a/test/framework/src/main/java/org/opensearch/action/support/replication/ClusterStateCreationUtils.java +++ b/test/framework/src/main/java/org/opensearch/action/support/replication/ClusterStateCreationUtils.java @@ -97,7 +97,7 @@ public static ClusterState state( numberOfNodes++; } } - numberOfNodes = Math.max(2, numberOfNodes); // we need a non-local master to test shard failures + numberOfNodes = Math.max(2, numberOfNodes); // we need a non-local cluster-manager to test shard failures final ShardId shardId = new ShardId(index, "_na_", 0); DiscoveryNodes.Builder discoBuilder = DiscoveryNodes.builder(); Set unassignedNodes = new HashSet<>(); @@ -107,7 +107,7 @@ public static ClusterState state( unassignedNodes.add(node.getId()); } discoBuilder.localNodeId(newNode(0).getId()); - discoBuilder.masterNodeId(newNode(1).getId()); // we need a non-local master to test shard failures + discoBuilder.masterNodeId(newNode(1).getId()); // we need a non-local cluster-manager to test shard failures final int primaryTerm = 1 + randomInt(200); IndexMetadata indexMetadata = IndexMetadata.builder(index) .settings( @@ -284,14 +284,14 @@ public static ClusterState state(final int numberOfNodes, final String[] indices */ public static ClusterState stateWithAssignedPrimariesAndOneReplica(String index, int numberOfShards) { - int numberOfNodes = 2; // we need a non-local master to test shard failures + int numberOfNodes = 2; // we need a non-local cluster-manager to test shard failures DiscoveryNodes.Builder discoBuilder = DiscoveryNodes.builder(); for (int i = 0; i < numberOfNodes + 1; i++) { final DiscoveryNode node = newNode(i); discoBuilder = discoBuilder.add(node); } discoBuilder.localNodeId(newNode(0).getId()); - discoBuilder.masterNodeId(newNode(1).getId()); // we need a non-local master to test shard failures + discoBuilder.masterNodeId(newNode(1).getId()); // we need a non-local cluster-manager to test shard failures IndexMetadata indexMetadata = IndexMetadata.builder(index) .settings( Settings.builder() @@ -426,20 +426,20 @@ public static ClusterState stateWithNoShard() { } /** - * Creates a cluster state where local node and master node can be specified + * Creates a cluster state where local node and cluster-manager node can be specified * * @param localNode node in allNodes that is the local node - * @param masterNode node in allNodes that is the master node. Can be null if no cluster-manager exists + * @param clusterManagerNode node in allNodes that is the cluster-manager node. Can be null if no cluster-manager exists * @param allNodes all nodes in the cluster * @return cluster state */ - public static ClusterState state(DiscoveryNode localNode, DiscoveryNode masterNode, DiscoveryNode... allNodes) { + public static ClusterState state(DiscoveryNode localNode, DiscoveryNode clusterManagerNode, DiscoveryNode... allNodes) { DiscoveryNodes.Builder discoBuilder = DiscoveryNodes.builder(); for (DiscoveryNode node : allNodes) { discoBuilder.add(node); } - if (masterNode != null) { - discoBuilder.masterNodeId(masterNode.getId()); + if (clusterManagerNode != null) { + discoBuilder.masterNodeId(clusterManagerNode.getId()); } discoBuilder.localNodeId(localNode.getId()); diff --git a/test/framework/src/main/java/org/opensearch/cluster/OpenSearchAllocationTestCase.java b/test/framework/src/main/java/org/opensearch/cluster/OpenSearchAllocationTestCase.java index e42dd42b18da5..a13d337fa4d26 100644 --- a/test/framework/src/main/java/org/opensearch/cluster/OpenSearchAllocationTestCase.java +++ b/test/framework/src/main/java/org/opensearch/cluster/OpenSearchAllocationTestCase.java @@ -148,7 +148,7 @@ public static AllocationDeciders randomAllocationDeciders(Settings settings, Clu return new AllocationDeciders(deciders); } - protected static Set MASTER_DATA_ROLES = Collections.unmodifiableSet( + protected static Set CLUSTER_MANAGER_DATA_ROLES = Collections.unmodifiableSet( new HashSet<>(Arrays.asList(DiscoveryNodeRole.CLUSTER_MANAGER_ROLE, DiscoveryNodeRole.DATA_ROLE)) ); @@ -157,11 +157,11 @@ protected static DiscoveryNode newNode(String nodeId) { } protected static DiscoveryNode newNode(String nodeName, String nodeId, Map attributes) { - return new DiscoveryNode(nodeName, nodeId, buildNewFakeTransportAddress(), attributes, MASTER_DATA_ROLES, Version.CURRENT); + return new DiscoveryNode(nodeName, nodeId, buildNewFakeTransportAddress(), attributes, CLUSTER_MANAGER_DATA_ROLES, Version.CURRENT); } protected static DiscoveryNode newNode(String nodeId, Map attributes) { - return new DiscoveryNode(nodeId, buildNewFakeTransportAddress(), attributes, MASTER_DATA_ROLES, Version.CURRENT); + return new DiscoveryNode(nodeId, buildNewFakeTransportAddress(), attributes, CLUSTER_MANAGER_DATA_ROLES, Version.CURRENT); } protected static DiscoveryNode newNode(String nodeId, Set roles) { @@ -169,7 +169,7 @@ protected static DiscoveryNode newNode(String nodeId, Set rol } protected static DiscoveryNode newNode(String nodeId, Version version) { - return new DiscoveryNode(nodeId, buildNewFakeTransportAddress(), emptyMap(), MASTER_DATA_ROLES, version); + return new DiscoveryNode(nodeId, buildNewFakeTransportAddress(), emptyMap(), CLUSTER_MANAGER_DATA_ROLES, version); } protected static ClusterState startRandomInitializingShard(ClusterState clusterState, AllocationService strategy) { diff --git a/test/framework/src/main/java/org/opensearch/cluster/coordination/AbstractCoordinatorTestCase.java b/test/framework/src/main/java/org/opensearch/cluster/coordination/AbstractCoordinatorTestCase.java index 6178ead662870..e341a330e2c4c 100644 --- a/test/framework/src/main/java/org/opensearch/cluster/coordination/AbstractCoordinatorTestCase.java +++ b/test/framework/src/main/java/org/opensearch/cluster/coordination/AbstractCoordinatorTestCase.java @@ -217,13 +217,13 @@ protected static int defaultInt(Setting setting) { } // Updating the cluster state involves up to 7 delays: - // 1. submit the task to the master service + // 1. submit the task to the cluster-manager service // 2. send PublishRequest // 3. receive PublishResponse // 4. send ApplyCommitRequest // 5. apply committed cluster state // 6. receive ApplyCommitResponse - // 7. apply committed state on master (last one to apply cluster state) + // 7. apply committed state on cluster-manager (last one to apply cluster state) public static final long DEFAULT_CLUSTER_STATE_UPDATE_DELAY = 7 * DEFAULT_DELAY_VARIABILITY; private static final int ELECTION_RETRIES = 10; @@ -288,11 +288,11 @@ class Cluster implements Releasable { this(initialNodeCount, true, Settings.EMPTY); } - Cluster(int initialNodeCount, boolean allNodesMasterEligible, Settings nodeSettings) { - this(initialNodeCount, allNodesMasterEligible, nodeSettings, () -> new StatusInfo(HEALTHY, "healthy-info")); + Cluster(int initialNodeCount, boolean allNodesclusterManagerEligible, Settings nodeSettings) { + this(initialNodeCount, allNodesclusterManagerEligible, nodeSettings, () -> new StatusInfo(HEALTHY, "healthy-info")); } - Cluster(int initialNodeCount, boolean allNodesMasterEligible, Settings nodeSettings, NodeHealthService nodeHealthService) { + Cluster(int initialNodeCount, boolean allNodesClusterManagerEligible, Settings nodeSettings, NodeHealthService nodeHealthService) { this.nodeHealthService = nodeHealthService; bigArrays = usually() ? BigArrays.NON_RECYCLING_INSTANCE @@ -301,29 +301,29 @@ class Cluster implements Releasable { assertThat(initialNodeCount, greaterThan(0)); - final Set masterEligibleNodeIds = new HashSet<>(initialNodeCount); + final Set clusterManagerEligibleNodeIds = new HashSet<>(initialNodeCount); clusterNodes = new ArrayList<>(initialNodeCount); for (int i = 0; i < initialNodeCount; i++) { final ClusterNode clusterNode = new ClusterNode( nextNodeIndex.getAndIncrement(), - allNodesMasterEligible || i == 0 || randomBoolean(), + allNodesClusterManagerEligible || i == 0 || randomBoolean(), nodeSettings, nodeHealthService ); clusterNodes.add(clusterNode); if (clusterNode.getLocalNode().isMasterNode()) { - masterEligibleNodeIds.add(clusterNode.getId()); + clusterManagerEligibleNodeIds.add(clusterNode.getId()); } } initialConfiguration = new VotingConfiguration( - new HashSet<>(randomSubsetOf(randomIntBetween(1, masterEligibleNodeIds.size()), masterEligibleNodeIds)) + new HashSet<>(randomSubsetOf(randomIntBetween(1, clusterManagerEligibleNodeIds.size()), clusterManagerEligibleNodeIds)) ); logger.info( "--> creating cluster of {} nodes (cluster-manager-eligible nodes: {}) with initial configuration {}", initialNodeCount, - masterEligibleNodeIds, + clusterManagerEligibleNodeIds, initialConfiguration ); } @@ -336,7 +336,7 @@ void addNodesAndStabilise(int newNodesCount) { addNodes(newNodesCount); stabilise( - // The first pinging discovers the master + // The first pinging discovers the cluster-manager defaultMillis(DISCOVERY_FIND_PEERS_INTERVAL_SETTING) // One message delay to send a join + DEFAULT_DELAY_VARIABILITY @@ -557,7 +557,7 @@ void stabilise(long stabilisationDurationMillis) { final ClusterNode leader = getAnyLeader(); final long leaderTerm = leader.coordinator.getCurrentTerm(); - final int pendingTaskCount = leader.masterService.getFakeMasterServicePendingTaskCount(); + final int pendingTaskCount = leader.clusterManagerService.getFakeMasterServicePendingTaskCount(); runFor((pendingTaskCount + 1) * DEFAULT_CLUSTER_STATE_UPDATE_DELAY, "draining task queue"); final Matcher isEqualToLeaderVersion = equalTo(leader.coordinator.getLastAcceptedState().getVersion()); @@ -566,7 +566,7 @@ void stabilise(long stabilisationDurationMillis) { assertTrue(leaderId + " has been bootstrapped", leader.coordinator.isInitialConfigurationSet()); assertTrue(leaderId + " exists in its last-applied state", leader.getLastAppliedClusterState().getNodes().nodeExists(leaderId)); assertThat( - leaderId + " has no NO_MASTER_BLOCK", + leaderId + " has no NO_CLUSTER_MANAGER_BLOCK", leader.getLastAppliedClusterState().blocks().hasGlobalBlockWithId(NO_MASTER_BLOCK_ID), equalTo(false) ); @@ -616,12 +616,12 @@ void stabilise(long stabilisationDurationMillis) { ); assertTrue(nodeId + " has been bootstrapped", clusterNode.coordinator.isInitialConfigurationSet()); assertThat( - nodeId + " has correct master", + nodeId + " has correct cluster-manager", clusterNode.getLastAppliedClusterState().nodes().getMasterNode(), equalTo(leader.getLocalNode()) ); assertThat( - nodeId + " has no NO_MASTER_BLOCK", + nodeId + " has no NO_CLUSTER_MANAGER_BLOCK", clusterNode.getLastAppliedClusterState().blocks().hasGlobalBlockWithId(NO_MASTER_BLOCK_ID), equalTo(false) ); @@ -638,7 +638,7 @@ void stabilise(long stabilisationDurationMillis) { nullValue() ); assertThat( - nodeId + " has NO_MASTER_BLOCK", + nodeId + " has NO_CLUSTER_MANAGER_BLOCK", clusterNode.getLastAppliedClusterState().blocks().hasGlobalBlockWithId(NO_MASTER_BLOCK_ID), equalTo(true) ); @@ -898,7 +898,7 @@ class MockPersistedState implements CoordinationState.PersistedState { final long persistedCurrentTerm; - if ( // node is master-ineligible either before or after the restart ... + if ( // node is cluster-manager-ineligible either before or after the restart ... (oldState.getLastAcceptedState().nodes().getLocalNode().isMasterNode() && newLocalNode.isMasterNode()) == false // ... and it's accepted some non-initial state so we can roll back ... && (oldState.getLastAcceptedState().term() > 0L || oldState.getLastAcceptedState().version() > 0L) @@ -930,7 +930,7 @@ && randomBoolean()) { final long newValue = randomLong(); logger.trace( - "rolling back persisted cluster state on master-ineligible node [{}]: " + "rolling back persisted cluster state on cluster-manager-ineligible node [{}]: " + "previously currentTerm={}, lastAcceptedTerm={}, lastAcceptedVersion={} " + "but now currentTerm={}, lastAcceptedTerm={}, lastAcceptedVersion={}", newLocalNode, @@ -1025,7 +1025,7 @@ class ClusterNode { private final DiscoveryNode localNode; final MockPersistedState persistedState; final Settings nodeSettings; - private AckedFakeThreadPoolMasterService masterService; + private AckedFakeThreadPoolClusterManagerService clusterManagerService; private DisruptableClusterApplierService clusterApplierService; private ClusterService clusterService; TransportService transportService; @@ -1033,10 +1033,10 @@ class ClusterNode { private NodeHealthService nodeHealthService; List> extraJoinValidators = new ArrayList<>(); - ClusterNode(int nodeIndex, boolean masterEligible, Settings nodeSettings, NodeHealthService nodeHealthService) { + ClusterNode(int nodeIndex, boolean clusterManagerEligible, Settings nodeSettings, NodeHealthService nodeHealthService) { this( nodeIndex, - createDiscoveryNode(nodeIndex, masterEligible), + createDiscoveryNode(nodeIndex, clusterManagerEligible), defaultPersistedStateSupplier, nodeSettings, nodeHealthService @@ -1105,7 +1105,7 @@ protected Optional getDisruptableMockTransport(Transpo null, emptySet() ); - masterService = new AckedFakeThreadPoolMasterService( + clusterManagerService = new AckedFakeThreadPoolClusterManagerService( localNode.getId(), "test", threadPool, @@ -1119,7 +1119,7 @@ protected Optional getDisruptableMockTransport(Transpo deterministicTaskQueue, threadPool ); - clusterService = new ClusterService(settings, clusterSettings, masterService, clusterApplierService); + clusterService = new ClusterService(settings, clusterSettings, clusterManagerService, clusterApplierService); clusterService.setNodeConnectionsService( new NodeConnectionsService(clusterService.getSettings(), threadPool, transportService) ); @@ -1134,7 +1134,7 @@ protected Optional getDisruptableMockTransport(Transpo transportService, writableRegistry(), allocationService, - masterService, + clusterManagerService, this::getPersistedState, Cluster.this::provideSeedHosts, clusterApplierService, @@ -1144,7 +1144,7 @@ protected Optional getDisruptableMockTransport(Transpo getElectionStrategy(), nodeHealthService ); - masterService.setClusterStatePublisher(coordinator); + clusterManagerService.setClusterStatePublisher(coordinator); final GatewayService gatewayService = new GatewayService( settings, allocationService, @@ -1261,7 +1261,7 @@ public String toString() { void submitSetAutoShrinkVotingConfiguration(final boolean autoShrinkVotingConfiguration) { submitUpdateTask( - "set master nodes failure tolerance [" + autoShrinkVotingConfiguration + "]", + "set cluster-manager nodes failure tolerance [" + autoShrinkVotingConfiguration + "]", cs -> ClusterState.builder(cs) .metadata( Metadata.builder(cs.metadata()) @@ -1331,11 +1331,11 @@ AckCollector submitUpdateTask( onNode(() -> { logger.trace("[{}] submitUpdateTask: enqueueing [{}]", localNode.getId(), source); final long submittedTerm = coordinator.getCurrentTerm(); - masterService.submitStateUpdateTask(source, new ClusterStateUpdateTask() { + clusterManagerService.submitStateUpdateTask(source, new ClusterStateUpdateTask() { @Override public ClusterState execute(ClusterState currentState) { assertThat(currentState.term(), greaterThanOrEqualTo(submittedTerm)); - masterService.nextAckCollector = ackCollector; + clusterManagerService.nextAckCollector = ackCollector; return clusterStateUpdate.apply(currentState); } @@ -1347,7 +1347,7 @@ public void onFailure(String source, Exception e) { @Override public void onNoLongerMaster(String source) { - logger.trace("no longer master: [{}]", source); + logger.trace("no longer cluster-manager: [{}]", source); taskListener.onNoLongerMaster(source); } @@ -1510,11 +1510,11 @@ int getSuccessfulAckIndex(ClusterNode clusterNode) { } } - static class AckedFakeThreadPoolMasterService extends FakeThreadPoolMasterService { + static class AckedFakeThreadPoolClusterManagerService extends FakeThreadPoolMasterService { AckCollector nextAckCollector = new AckCollector(); - AckedFakeThreadPoolMasterService( + AckedFakeThreadPoolClusterManagerService( String nodeName, String serviceName, ThreadPool threadPool, @@ -1610,7 +1610,7 @@ void allowClusterStateApplicationFailure() { } } - protected DiscoveryNode createDiscoveryNode(int nodeIndex, boolean masterEligible) { + protected DiscoveryNode createDiscoveryNode(int nodeIndex, boolean clusterManagerEligible) { final TransportAddress address = buildNewFakeTransportAddress(); return new DiscoveryNode( "", @@ -1620,7 +1620,7 @@ protected DiscoveryNode createDiscoveryNode(int nodeIndex, boolean masterEligibl address.getAddress(), address, Collections.emptyMap(), - masterEligible ? DiscoveryNodeRole.BUILT_IN_ROLES : emptySet(), + clusterManagerEligible ? DiscoveryNodeRole.BUILT_IN_ROLES : emptySet(), Version.CURRENT ); } diff --git a/test/framework/src/main/java/org/opensearch/cluster/coordination/CoordinationStateTestCluster.java b/test/framework/src/main/java/org/opensearch/cluster/coordination/CoordinationStateTestCluster.java index 1e7456e03ce6f..ca4a33fa677c6 100644 --- a/test/framework/src/main/java/org/opensearch/cluster/coordination/CoordinationStateTestCluster.java +++ b/test/framework/src/main/java/org/opensearch/cluster/coordination/CoordinationStateTestCluster.java @@ -285,11 +285,11 @@ void runRandomly() { } else if (rarely() && rarely()) { randomFrom(clusterNodes).reboot(); } else if (rarely()) { - final List masterNodes = clusterNodes.stream() + final List clusterManangerNodes = clusterNodes.stream() .filter(cn -> cn.state.electionWon()) .collect(Collectors.toList()); - if (masterNodes.isEmpty() == false) { - final ClusterNode clusterNode = randomFrom(masterNodes); + if (clusterManangerNodes.isEmpty() == false) { + final ClusterNode clusterNode = randomFrom(clusterManangerNodes); final long term = rarely() ? randomLongBetween(0, maxTerm + 1) : clusterNode.state.getCurrentTerm(); final long version = rarely() ? randomIntBetween(0, 5) : clusterNode.state.getLastPublishedVersion() + 1; final CoordinationMetadata.VotingConfiguration acceptedConfig = rarely() @@ -323,13 +323,15 @@ void runRandomly() { } void invariant() { - // one master per term + // one cluster-manager per term messages.stream() .filter(m -> m.payload instanceof PublishRequest) .collect(Collectors.groupingBy(m -> ((PublishRequest) m.payload).getAcceptedState().term())) .forEach((term, publishMessages) -> { - Set mastersForTerm = publishMessages.stream().collect(Collectors.groupingBy(m -> m.sourceNode)).keySet(); - assertThat("Multiple masters " + mastersForTerm + " for term " + term, mastersForTerm, hasSize(1)); + Set clusterManagersForTerm = publishMessages.stream() + .collect(Collectors.groupingBy(m -> m.sourceNode)) + .keySet(); + assertThat("Multiple cluster-managers " + clusterManagersForTerm + " for term " + term, clusterManagersForTerm, hasSize(1)); }); // unique cluster state per (term, version) pair diff --git a/test/framework/src/main/java/org/opensearch/cluster/service/FakeThreadPoolMasterService.java b/test/framework/src/main/java/org/opensearch/cluster/service/FakeThreadPoolMasterService.java index 14d9f9554004f..c532a0cc36472 100644 --- a/test/framework/src/main/java/org/opensearch/cluster/service/FakeThreadPoolMasterService.java +++ b/test/framework/src/main/java/org/opensearch/cluster/service/FakeThreadPoolMasterService.java @@ -116,7 +116,7 @@ private void scheduleNextTaskIfNecessary() { onTaskAvailableToRun.accept(new Runnable() { @Override public String toString() { - return "master service scheduling next task"; + return "cluster-manager service scheduling next task"; } @Override @@ -125,7 +125,7 @@ public void run() { assert waitForPublish == false; assert scheduledNextTask; final int taskIndex = randomInt(pendingTasks.size() - 1); - logger.debug("next master service task: choosing task {} of {}", taskIndex, pendingTasks.size()); + logger.debug("next cluster-manager service task: choosing task {} of {}", taskIndex, pendingTasks.size()); final Runnable task = pendingTasks.remove(taskIndex); taskInProgress = true; scheduledNextTask = false; diff --git a/test/framework/src/main/java/org/opensearch/common/util/MockBigArrays.java b/test/framework/src/main/java/org/opensearch/common/util/MockBigArrays.java index fc628ca5228e6..ed7a1643bf674 100644 --- a/test/framework/src/main/java/org/opensearch/common/util/MockBigArrays.java +++ b/test/framework/src/main/java/org/opensearch/common/util/MockBigArrays.java @@ -66,21 +66,22 @@ public class MockBigArrays extends BigArrays { private static final ConcurrentMap ACQUIRED_ARRAYS = new ConcurrentHashMap<>(); public static void ensureAllArraysAreReleased() throws Exception { - final Map masterCopy = new HashMap<>(ACQUIRED_ARRAYS); - if (!masterCopy.isEmpty()) { + final Map clusterManagerCopy = new HashMap<>(ACQUIRED_ARRAYS); + if (!clusterManagerCopy.isEmpty()) { // not empty, we might be executing on a shared cluster that keeps on obtaining - // and releasing arrays, lets make sure that after a reasonable timeout, all master + // and releasing arrays, lets make sure that after a reasonable timeout, all cluster-manager // copy (snapshot) have been released try { - assertBusy(() -> assertTrue(Sets.haveEmptyIntersection(masterCopy.keySet(), ACQUIRED_ARRAYS.keySet()))); + assertBusy(() -> assertTrue(Sets.haveEmptyIntersection(clusterManagerCopy.keySet(), ACQUIRED_ARRAYS.keySet()))); } catch (AssertionError ex) { - masterCopy.keySet().retainAll(ACQUIRED_ARRAYS.keySet()); - ACQUIRED_ARRAYS.keySet().removeAll(masterCopy.keySet()); // remove all existing master copy we will report on - if (!masterCopy.isEmpty()) { - Iterator causes = masterCopy.values().iterator(); + clusterManagerCopy.keySet().retainAll(ACQUIRED_ARRAYS.keySet()); + // remove all existing cluster-manager copy we will report on + ACQUIRED_ARRAYS.keySet().removeAll(clusterManagerCopy.keySet()); + if (!clusterManagerCopy.isEmpty()) { + Iterator causes = clusterManagerCopy.values().iterator(); Object firstCause = causes.next(); RuntimeException exception = new RuntimeException( - masterCopy.size() + " arrays have not been released", + clusterManagerCopy.size() + " arrays have not been released", firstCause instanceof Throwable ? (Throwable) firstCause : null ); while (causes.hasNext()) { diff --git a/test/framework/src/main/java/org/opensearch/common/util/MockPageCacheRecycler.java b/test/framework/src/main/java/org/opensearch/common/util/MockPageCacheRecycler.java index 471cf01a3f7d2..431267c9dfb0d 100644 --- a/test/framework/src/main/java/org/opensearch/common/util/MockPageCacheRecycler.java +++ b/test/framework/src/main/java/org/opensearch/common/util/MockPageCacheRecycler.java @@ -53,19 +53,23 @@ public class MockPageCacheRecycler extends PageCacheRecycler { private static final ConcurrentMap ACQUIRED_PAGES = new ConcurrentHashMap<>(); public static void ensureAllPagesAreReleased() throws Exception { - final Map masterCopy = new HashMap<>(ACQUIRED_PAGES); - if (!masterCopy.isEmpty()) { + final Map clusterManagerCopy = new HashMap<>(ACQUIRED_PAGES); + if (!clusterManagerCopy.isEmpty()) { // not empty, we might be executing on a shared cluster that keeps on obtaining - // and releasing pages, lets make sure that after a reasonable timeout, all master + // and releasing pages, lets make sure that after a reasonable timeout, all cluster-manager // copy (snapshot) have been released - final boolean success = waitUntil(() -> Sets.haveEmptyIntersection(masterCopy.keySet(), ACQUIRED_PAGES.keySet())); + final boolean success = waitUntil(() -> Sets.haveEmptyIntersection(clusterManagerCopy.keySet(), ACQUIRED_PAGES.keySet())); if (!success) { - masterCopy.keySet().retainAll(ACQUIRED_PAGES.keySet()); - ACQUIRED_PAGES.keySet().removeAll(masterCopy.keySet()); // remove all existing master copy we will report on - if (!masterCopy.isEmpty()) { - Iterator causes = masterCopy.values().iterator(); + clusterManagerCopy.keySet().retainAll(ACQUIRED_PAGES.keySet()); + // remove all existing cluster-manager copy we will report on + ACQUIRED_PAGES.keySet().removeAll(clusterManagerCopy.keySet()); + if (!clusterManagerCopy.isEmpty()) { + Iterator causes = clusterManagerCopy.values().iterator(); Throwable firstCause = causes.next(); - RuntimeException exception = new RuntimeException(masterCopy.size() + " pages have not been released", firstCause); + RuntimeException exception = new RuntimeException( + clusterManagerCopy.size() + " pages have not been released", + firstCause + ); while (causes.hasNext()) { exception.addSuppressed(causes.next()); } diff --git a/test/framework/src/main/java/org/opensearch/repositories/blobstore/BlobStoreTestUtil.java b/test/framework/src/main/java/org/opensearch/repositories/blobstore/BlobStoreTestUtil.java index ad61153b62a06..89d5f6f95bc5a 100644 --- a/test/framework/src/main/java/org/opensearch/repositories/blobstore/BlobStoreTestUtil.java +++ b/test/framework/src/main/java/org/opensearch/repositories/blobstore/BlobStoreTestUtil.java @@ -410,7 +410,7 @@ private static ClusterService mockClusterService(ClusterState initialState) { final ClusterService clusterService = mock(ClusterService.class); final ClusterApplierService clusterApplierService = mock(ClusterApplierService.class); when(clusterService.getClusterApplierService()).thenReturn(clusterApplierService); - // Setting local node as master so it may update the repository metadata in the cluster state + // Setting local node as cluster-manager so it may update the repository metadata in the cluster state final DiscoveryNode localNode = new DiscoveryNode("", buildNewFakeTransportAddress(), Version.CURRENT); final AtomicReference currentState = new AtomicReference<>( ClusterState.builder(initialState) diff --git a/test/framework/src/main/java/org/opensearch/snapshots/AbstractSnapshotIntegTestCase.java b/test/framework/src/main/java/org/opensearch/snapshots/AbstractSnapshotIntegTestCase.java index 3a55848c46150..70839be718e47 100644 --- a/test/framework/src/main/java/org/opensearch/snapshots/AbstractSnapshotIntegTestCase.java +++ b/test/framework/src/main/java/org/opensearch/snapshots/AbstractSnapshotIntegTestCase.java @@ -252,30 +252,30 @@ public SnapshotInfo waitForCompletion(String repository, String snapshotName, Ti } public static String blockMasterFromFinalizingSnapshotOnIndexFile(final String repositoryName) { - final String masterName = internalCluster().getMasterName(); - ((MockRepository) internalCluster().getInstance(RepositoriesService.class, masterName).repository(repositoryName)) + final String clusterManagerName = internalCluster().getMasterName(); + ((MockRepository) internalCluster().getInstance(RepositoriesService.class, clusterManagerName).repository(repositoryName)) .setBlockAndFailOnWriteIndexFile(); - return masterName; + return clusterManagerName; } public static String blockMasterOnWriteIndexFile(final String repositoryName) { - final String masterName = internalCluster().getMasterName(); + final String clusterManagerName = internalCluster().getMasterName(); ((MockRepository) internalCluster().getMasterNodeInstance(RepositoriesService.class).repository(repositoryName)) .setBlockOnWriteIndexFile(); - return masterName; + return clusterManagerName; } public static void blockMasterFromDeletingIndexNFile(String repositoryName) { - final String masterName = internalCluster().getMasterName(); - ((MockRepository) internalCluster().getInstance(RepositoriesService.class, masterName).repository(repositoryName)) + final String clusterManagerName = internalCluster().getMasterName(); + ((MockRepository) internalCluster().getInstance(RepositoriesService.class, clusterManagerName).repository(repositoryName)) .setBlockOnDeleteIndexFile(); } public static String blockMasterFromFinalizingSnapshotOnSnapFile(final String repositoryName) { - final String masterName = internalCluster().getMasterName(); - ((MockRepository) internalCluster().getInstance(RepositoriesService.class, masterName).repository(repositoryName)) + final String clusterManagerName = internalCluster().getMasterName(); + ((MockRepository) internalCluster().getInstance(RepositoriesService.class, clusterManagerName).repository(repositoryName)) .setBlockAndFailOnWriteSnapFiles(true); - return masterName; + return clusterManagerName; } public static String blockNodeWithIndex(final String repositoryName, final String indexName) { @@ -628,10 +628,10 @@ protected SnapshotInfo getSnapshot(String repository, String snapshot) { } protected void awaitMasterFinishRepoOperations() throws Exception { - logger.info("--> waiting for master to finish all repo operations on its SNAPSHOT pool"); - final ThreadPool masterThreadPool = internalCluster().getMasterNodeInstance(ThreadPool.class); + logger.info("--> waiting for cluster-manager to finish all repo operations on its SNAPSHOT pool"); + final ThreadPool clusterManagerThreadPool = internalCluster().getMasterNodeInstance(ThreadPool.class); assertBusy(() -> { - for (ThreadPoolStats.Stats stat : masterThreadPool.stats()) { + for (ThreadPoolStats.Stats stat : clusterManagerThreadPool.stats()) { if (ThreadPool.Names.SNAPSHOT.equals(stat.getName())) { assertEquals(stat.getActive(), 0); break; diff --git a/test/framework/src/main/java/org/opensearch/snapshots/mockstore/MockRepository.java b/test/framework/src/main/java/org/opensearch/snapshots/mockstore/MockRepository.java index b26ffc9bd69d9..4e641f9505e3e 100644 --- a/test/framework/src/main/java/org/opensearch/snapshots/mockstore/MockRepository.java +++ b/test/framework/src/main/java/org/opensearch/snapshots/mockstore/MockRepository.java @@ -143,7 +143,7 @@ public long getFailureCount() { */ private volatile boolean blockOnWriteIndexFile; - /** Allows blocking on writing the snapshot file at the end of snapshot creation to simulate a died master node */ + /** Allows blocking on writing the snapshot file at the end of snapshot creation to simulate a died cluster-manager node */ private volatile boolean blockAndFailOnWriteSnapFile; private volatile boolean blockOnWriteShardLevelMeta; @@ -191,7 +191,7 @@ public RepositoryMetadata getMetadata() { } private static RepositoryMetadata overrideSettings(RepositoryMetadata metadata, Environment environment) { - // TODO: use another method of testing not being able to read the test file written by the master... + // TODO: use another method of testing not being able to read the test file written by the cluster-manager... // this is super duper hacky if (metadata.settings().getAsBoolean("localize_location", false)) { Path location = PathUtils.get(metadata.settings().get("location")); diff --git a/test/framework/src/main/java/org/opensearch/test/AbstractBuilderTestCase.java b/test/framework/src/main/java/org/opensearch/test/AbstractBuilderTestCase.java index ae32db5fe6032..fdf26608509f1 100644 --- a/test/framework/src/main/java/org/opensearch/test/AbstractBuilderTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/AbstractBuilderTestCase.java @@ -248,10 +248,10 @@ public void beforeTest() throws Exception { assert serviceHolderWithNoType == null; // we initialize the serviceHolder and serviceHolderWithNoType just once, but need some // calls to the randomness source during its setup. In order to not mix these calls with - // the randomness source that is later used in the test method, we use the master seed during + // the randomness source that is later used in the test method, we use the cluster-manager seed during // this setup - long masterSeed = SeedUtils.parseSeed(RandomizedTest.getContext().getRunnerSeedAsString()); - RandomizedTest.getContext().runWithPrivateRandomness(masterSeed, (Callable) () -> { + long clusterManagerSeed = SeedUtils.parseSeed(RandomizedTest.getContext().getRunnerSeedAsString()); + RandomizedTest.getContext().runWithPrivateRandomness(clusterManagerSeed, (Callable) () -> { serviceHolder = new ServiceHolder( nodeSettings, createTestIndexSettings(), diff --git a/test/framework/src/main/java/org/opensearch/test/ClusterServiceUtils.java b/test/framework/src/main/java/org/opensearch/test/ClusterServiceUtils.java index b97a35a3431b6..f709d8bcaff34 100644 --- a/test/framework/src/main/java/org/opensearch/test/ClusterServiceUtils.java +++ b/test/framework/src/main/java/org/opensearch/test/ClusterServiceUtils.java @@ -62,19 +62,19 @@ public class ClusterServiceUtils { public static MasterService createMasterService(ThreadPool threadPool, ClusterState initialClusterState) { - MasterService masterService = new MasterService( - Settings.builder().put(Node.NODE_NAME_SETTING.getKey(), "test_master_node").build(), + MasterService clusterManagerService = new MasterService( + Settings.builder().put(Node.NODE_NAME_SETTING.getKey(), "test_cluster_manager_node").build(), new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS), threadPool ); AtomicReference clusterStateRef = new AtomicReference<>(initialClusterState); - masterService.setClusterStatePublisher((event, publishListener, ackListener) -> { + clusterManagerService.setClusterStatePublisher((event, publishListener, ackListener) -> { clusterStateRef.set(event.state()); publishListener.onResponse(null); }); - masterService.setClusterStateSupplier(clusterStateRef::get); - masterService.start(); - return masterService; + clusterManagerService.setClusterStateSupplier(clusterStateRef::get); + clusterManagerService.start(); + return clusterManagerService; } public static MasterService createMasterService(ThreadPool threadPool, DiscoveryNode localNode) { diff --git a/test/framework/src/main/java/org/opensearch/test/ExternalTestCluster.java b/test/framework/src/main/java/org/opensearch/test/ExternalTestCluster.java index 805e578a8e8db..6dec5858b398a 100644 --- a/test/framework/src/main/java/org/opensearch/test/ExternalTestCluster.java +++ b/test/framework/src/main/java/org/opensearch/test/ExternalTestCluster.java @@ -90,7 +90,7 @@ public final class ExternalTestCluster extends TestCluster { private final String clusterName; private final int numDataNodes; - private final int numMasterAndDataNodes; + private final int numClusterManagerAndDataNodes; public ExternalTestCluster( Path tempDir, @@ -141,19 +141,19 @@ public ExternalTestCluster( .get(); httpAddresses = new InetSocketAddress[nodeInfos.getNodes().size()]; int dataNodes = 0; - int masterAndDataNodes = 0; + int clusterManagerAndDataNodes = 0; for (int i = 0; i < nodeInfos.getNodes().size(); i++) { NodeInfo nodeInfo = nodeInfos.getNodes().get(i); httpAddresses[i] = nodeInfo.getInfo(HttpInfo.class).address().publishAddress().address(); if (DiscoveryNode.isDataNode(nodeInfo.getSettings())) { dataNodes++; - masterAndDataNodes++; + clusterManagerAndDataNodes++; } else if (DiscoveryNode.isMasterNode(nodeInfo.getSettings())) { - masterAndDataNodes++; + clusterManagerAndDataNodes++; } } this.numDataNodes = dataNodes; - this.numMasterAndDataNodes = masterAndDataNodes; + this.numClusterManagerAndDataNodes = clusterManagerAndDataNodes; this.client = client; this.node = node; @@ -191,7 +191,7 @@ public int numDataNodes() { @Override public int numDataAndMasterNodes() { - return numMasterAndDataNodes; + return numClusterManagerAndDataNodes; } @Override diff --git a/test/framework/src/main/java/org/opensearch/test/InternalTestCluster.java b/test/framework/src/main/java/org/opensearch/test/InternalTestCluster.java index 99783cb173a8f..5ccdd2c529308 100644 --- a/test/framework/src/main/java/org/opensearch/test/InternalTestCluster.java +++ b/test/framework/src/main/java/org/opensearch/test/InternalTestCluster.java @@ -166,7 +166,6 @@ import static org.opensearch.test.OpenSearchTestCase.assertBusy; import static org.opensearch.test.OpenSearchTestCase.randomFrom; import static org.opensearch.test.NodeRoles.dataOnlyNode; -import static org.opensearch.test.NodeRoles.masterOnlyNode; import static org.opensearch.test.NodeRoles.noRoles; import static org.opensearch.test.NodeRoles.onlyRole; import static org.opensearch.test.NodeRoles.removeRoles; @@ -200,11 +199,11 @@ public final class InternalTestCluster extends TestCluster { nodeAndClient.node.settings() ); - private static final Predicate NO_DATA_NO_MASTER_PREDICATE = nodeAndClient -> DiscoveryNode.isMasterNode( + private static final Predicate NO_DATA_NO_CLUSTER_MANAGER_PREDICATE = nodeAndClient -> DiscoveryNode.isMasterNode( nodeAndClient.node.settings() ) == false && DiscoveryNode.isDataNode(nodeAndClient.node.settings()) == false; - private static final Predicate MASTER_NODE_PREDICATE = nodeAndClient -> DiscoveryNode.isMasterNode( + private static final Predicate CLUSTER_MANAGER_NODE_PREDICATE = nodeAndClient -> DiscoveryNode.isMasterNode( nodeAndClient.node.settings() ); @@ -238,8 +237,8 @@ public final class InternalTestCluster extends TestCluster { * fully shared cluster to be more reproducible */ private final long[] sharedNodesSeeds; - // if set to 0, data nodes will also assume the master role - private final int numSharedDedicatedMasterNodes; + // if set to 0, data nodes will also assume the cluster-manager role + private final int numSharedDedicatedClusterManagerNodes; private final int numSharedDataNodes; @@ -249,7 +248,7 @@ public final class InternalTestCluster extends TestCluster { private final ExecutorService executor; - private final boolean autoManageMasterNodes; + private final boolean autoManageClusterManagerNodes; private final Collection> mockPlugins; @@ -266,13 +265,13 @@ public final class InternalTestCluster extends TestCluster { private ServiceDisruptionScheme activeDisruptionScheme; private final Function clientWrapper; - private int bootstrapMasterNodeIndex = -1; + private int bootstrapClusterManagerNodeIndex = -1; public InternalTestCluster( final long clusterSeed, final Path baseDir, - final boolean randomlyAddDedicatedMasters, - final boolean autoManageMasterNodes, + final boolean randomlyAddDedicatedClusterManagers, + final boolean autoManageClusterManagerNodes, final int minNumDataNodes, final int maxNumDataNodes, final String clusterName, @@ -285,8 +284,8 @@ public InternalTestCluster( this( clusterSeed, baseDir, - randomlyAddDedicatedMasters, - autoManageMasterNodes, + randomlyAddDedicatedClusterManagers, + autoManageClusterManagerNodes, minNumDataNodes, maxNumDataNodes, clusterName, @@ -302,8 +301,8 @@ public InternalTestCluster( public InternalTestCluster( final long clusterSeed, final Path baseDir, - final boolean randomlyAddDedicatedMasters, - final boolean autoManageMasterNodes, + final boolean randomlyAddDedicatedClusterManagers, + final boolean autoManageClusterManagerNodes, final int minNumDataNodes, final int maxNumDataNodes, final String clusterName, @@ -315,7 +314,7 @@ public InternalTestCluster( final boolean forbidPrivateIndexSettings ) { super(clusterSeed); - this.autoManageMasterNodes = autoManageMasterNodes; + this.autoManageClusterManagerNodes = autoManageClusterManagerNodes; this.clientWrapper = clientWrapper; this.forbidPrivateIndexSettings = forbidPrivateIndexSettings; this.baseDir = baseDir; @@ -330,24 +329,24 @@ public InternalTestCluster( Random random = new Random(clusterSeed); - boolean useDedicatedMasterNodes = randomlyAddDedicatedMasters ? random.nextBoolean() : false; + boolean useDedicatedClusterManagerNodes = randomlyAddDedicatedClusterManagers ? random.nextBoolean() : false; this.numSharedDataNodes = RandomNumbers.randomIntBetween(random, minNumDataNodes, maxNumDataNodes); assert this.numSharedDataNodes >= 0; if (numSharedDataNodes == 0) { this.numSharedCoordOnlyNodes = 0; - this.numSharedDedicatedMasterNodes = 0; + this.numSharedDedicatedClusterManagerNodes = 0; } else { - if (useDedicatedMasterNodes) { + if (useDedicatedClusterManagerNodes) { if (random.nextBoolean()) { - // use a dedicated master, but only low number to reduce overhead to tests - this.numSharedDedicatedMasterNodes = DEFAULT_LOW_NUM_MASTER_NODES; + // use a dedicated cluster-manager, but only low number to reduce overhead to tests + this.numSharedDedicatedClusterManagerNodes = DEFAULT_LOW_NUM_MASTER_NODES; } else { - this.numSharedDedicatedMasterNodes = DEFAULT_HIGH_NUM_MASTER_NODES; + this.numSharedDedicatedClusterManagerNodes = DEFAULT_HIGH_NUM_MASTER_NODES; } } else { - this.numSharedDedicatedMasterNodes = 0; + this.numSharedDedicatedClusterManagerNodes = 0; } if (numClientNodes < 0) { this.numSharedCoordOnlyNodes = RandomNumbers.randomIntBetween( @@ -367,20 +366,20 @@ public InternalTestCluster( this.mockPlugins = mockPlugins; - sharedNodesSeeds = new long[numSharedDedicatedMasterNodes + numSharedDataNodes + numSharedCoordOnlyNodes]; + sharedNodesSeeds = new long[numSharedDedicatedClusterManagerNodes + numSharedDataNodes + numSharedCoordOnlyNodes]; for (int i = 0; i < sharedNodesSeeds.length; i++) { sharedNodesSeeds[i] = random.nextLong(); } logger.info( - "Setup InternalTestCluster [{}] with seed [{}] using [{}] dedicated masters, " - + "[{}] (data) nodes and [{}] coord only nodes (min_master_nodes are [{}])", + "Setup InternalTestCluster [{}] with seed [{}] using [{}] dedicated cluster-managers, " + + "[{}] (data) nodes and [{}] coord only nodes (min_cluster_manager_nodes are [{}])", clusterName, SeedUtils.formatSeed(clusterSeed), - numSharedDedicatedMasterNodes, + numSharedDedicatedClusterManagerNodes, numSharedDataNodes, numSharedCoordOnlyNodes, - autoManageMasterNodes ? "auto-managed" : "manual" + autoManageClusterManagerNodes ? "auto-managed" : "manual" ); this.nodeConfigurationSource = nodeConfigurationSource; numDataPaths = random.nextInt(5) == 0 ? 2 + random.nextInt(3) : 1; @@ -433,8 +432,8 @@ public InternalTestCluster( RecoverySettings.INDICES_RECOVERY_MAX_CONCURRENT_OPERATIONS_SETTING.getKey(), RandomNumbers.randomIntBetween(random, 1, 4) ); - // TODO: currently we only randomize "cluster.no_master_block" between "write" and "metadata_write", as "all" is fragile - // and fails shards when a master abdicates, which breaks many tests. + // TODO: currently we only randomize "cluster.no_cluster_manager_block" between "write" and "metadata_write", as "all" is fragile + // and fails shards when a cluster-manager abdicates, which breaks many tests. builder.put(NoMasterBlockService.NO_CLUSTER_MANAGER_BLOCK_SETTING.getKey(), randomFrom(random, "write", "metadata_write")); defaultSettings = builder.build(); executor = OpenSearchExecutors.newScaling( @@ -449,14 +448,15 @@ public InternalTestCluster( } /** - * Sets {@link #bootstrapMasterNodeIndex} to the given value, see {@link #bootstrapMasterNodeWithSpecifiedIndex(List)} + * Sets {@link #bootstrapClusterManagerNodeIndex} to the given value, see {@link #bootstrapClusterManagerNodeWithSpecifiedIndex(List)} * for the description of how this field is used. - * It's only possible to change {@link #bootstrapMasterNodeIndex} value if autoManageMasterNodes is false. + * It's only possible to change {@link #bootstrapClusterManagerNodeIndex} value if autoManageClusterManagerNodes is false. */ - public void setBootstrapMasterNodeIndex(int bootstrapMasterNodeIndex) { - assert autoManageMasterNodes == false || bootstrapMasterNodeIndex == -1 - : "bootstrapMasterNodeIndex should be -1 if autoManageMasterNodes is true, but was " + bootstrapMasterNodeIndex; - this.bootstrapMasterNodeIndex = bootstrapMasterNodeIndex; + public void setBootstrapClusterManagerNodeIndex(int bootstrapClusterManagerNodeIndex) { + assert autoManageClusterManagerNodes == false || bootstrapClusterManagerNodeIndex == -1 + : "bootstrapClusterManagerNodeIndex should be -1 if autoManageClusterManagerNodes is true, but was " + + bootstrapClusterManagerNodeIndex; + this.bootstrapClusterManagerNodeIndex = bootstrapClusterManagerNodeIndex; } @Override @@ -648,7 +648,7 @@ public synchronized void ensureAtLeastNumDataNodes(int n) { int size = numDataNodes(); if (size < n) { logger.info("increasing cluster size from {} to {}", size, n); - if (numSharedDedicatedMasterNodes > 0) { + if (numSharedDedicatedClusterManagerNodes > 0) { startDataOnlyNodes(n - size); } else { startNodes(n - size); @@ -667,7 +667,7 @@ public synchronized void ensureAtMostNumDataNodes(int n) throws IOException { if (size <= n) { return; } - // prevent killing the master if possible and client nodes + // prevent killing the cluster-manager if possible and client nodes final Stream collection = n == 0 ? nodes.values().stream() : nodes.values().stream().filter(DATA_NODE_PREDICATE.and(new NodeNamePredicate(getMasterName()).negate())); @@ -687,7 +687,12 @@ public synchronized void ensureAtMostNumDataNodes(int n) throws IOException { } } - private Settings getNodeSettings(final int nodeId, final long seed, final Settings extraSettings, final int defaultMinMasterNodes) { + private Settings getNodeSettings( + final int nodeId, + final long seed, + final Settings extraSettings, + final int defaultMinClusterManagerNodes + ) { final Settings settings = getSettings(nodeId, seed, extraSettings); final String name = buildNodeName(nodeId, settings); @@ -718,9 +723,9 @@ private Settings getNodeSettings(final int nodeId, final long seed, final Settin final String discoveryType = DISCOVERY_TYPE_SETTING.get(updatedSettings.build()); final boolean usingSingleNodeDiscovery = discoveryType.equals("single-node"); if (usingSingleNodeDiscovery == false) { - if (autoManageMasterNodes) { + if (autoManageClusterManagerNodes) { assertThat( - "if master nodes are automatically managed then nodes must complete a join cycle when starting", + "if cluster-manager nodes are automatically managed then nodes must complete a join cycle when starting", updatedSettings.get(DiscoverySettings.INITIAL_STATE_TIMEOUT_SETTING.getKey()), nullValue() ); @@ -817,26 +822,26 @@ public Client dataNodeClient() { } /** - * Returns a node client to the current master node. + * Returns a node client to the current cluster-manager node. * Note: use this with care tests should not rely on a certain nodes client. */ public Client masterClient() { NodeAndClient randomNodeAndClient = getRandomNodeAndClient(new NodeNamePredicate(getMasterName())); if (randomNodeAndClient != null) { - return randomNodeAndClient.nodeClient(); // ensure node client master is requested + return randomNodeAndClient.nodeClient(); // ensure node client cluster-manager is requested } throw new AssertionError("No cluster-manager client found"); } /** - * Returns a node client to random node but not the master. This method will fail if no non-master client is available. + * Returns a node client to random node but not the cluster-manager. This method will fail if no non-cluster-manager client is available. */ public Client nonMasterClient() { NodeAndClient randomNodeAndClient = getRandomNodeAndClient(new NodeNamePredicate(getMasterName()).negate()); if (randomNodeAndClient != null) { - return randomNodeAndClient.nodeClient(); // ensure node client non-master is requested + return randomNodeAndClient.nodeClient(); // ensure node client non-cluster-manager is requested } - throw new AssertionError("No non-master client found"); + throw new AssertionError("No non-cluster-manager client found"); } /** @@ -844,14 +849,14 @@ public Client nonMasterClient() { */ public synchronized Client coordOnlyNodeClient() { ensureOpen(); - NodeAndClient randomNodeAndClient = getRandomNodeAndClient(NO_DATA_NO_MASTER_PREDICATE); + NodeAndClient randomNodeAndClient = getRandomNodeAndClient(NO_DATA_NO_CLUSTER_MANAGER_PREDICATE); if (randomNodeAndClient != null) { return randomNodeAndClient.client(); } int nodeId = nextNodeId.getAndIncrement(); Settings settings = getSettings(nodeId, random.nextLong(), Settings.EMPTY); startCoordinatingOnlyNode(settings); - return getRandomNodeAndClient(NO_DATA_NO_MASTER_PREDICATE).client(); + return getRandomNodeAndClient(NO_DATA_NO_CLUSTER_MANAGER_PREDICATE).client(); } public synchronized String startCoordinatingOnlyNode(Settings settings) { @@ -981,7 +986,7 @@ void startNode() { /** * closes the node and prepares it to be restarted */ - Settings closeForRestart(RestartCallback callback, int minMasterNodes) throws Exception { + Settings closeForRestart(RestartCallback callback, int minClusterManagerNodes) throws Exception { assert callback != null; close(); removeNode(this); @@ -989,7 +994,7 @@ Settings closeForRestart(RestartCallback callback, int minMasterNodes) throws Ex assert callbackSettings != null; Settings.Builder newSettings = Settings.builder(); newSettings.put(callbackSettings); - if (minMasterNodes >= 0) { + if (minClusterManagerNodes >= 0) { if (INITIAL_CLUSTER_MANAGER_NODES_SETTING.exists(callbackSettings) == false) { newSettings.putList(INITIAL_CLUSTER_MANAGER_NODES_SETTING.getKey()); } @@ -1128,54 +1133,56 @@ private synchronized void reset(boolean wipeData) throws IOException { final int prevNodeCount = nodes.size(); // start any missing node - assert newSize == numSharedDedicatedMasterNodes + numSharedDataNodes + numSharedCoordOnlyNodes; - final int numberOfMasterNodes = numSharedDedicatedMasterNodes > 0 ? numSharedDedicatedMasterNodes : numSharedDataNodes; - final int defaultMinMasterNodes = (numberOfMasterNodes / 2) + 1; + assert newSize == numSharedDedicatedClusterManagerNodes + numSharedDataNodes + numSharedCoordOnlyNodes; + final int numberOfClusterManagerNodes = numSharedDedicatedClusterManagerNodes > 0 + ? numSharedDedicatedClusterManagerNodes + : numSharedDataNodes; + final int defaultMinClusterManagerNodes = (numberOfClusterManagerNodes / 2) + 1; final List toStartAndPublish = new ArrayList<>(); // we want to start nodes in one go final Runnable onTransportServiceStarted = () -> rebuildUnicastHostFiles(toStartAndPublish); final List settings = new ArrayList<>(); - for (int i = 0; i < numSharedDedicatedMasterNodes; i++) { - final Settings nodeSettings = getNodeSettings(i, sharedNodesSeeds[i], Settings.EMPTY, defaultMinMasterNodes); + for (int i = 0; i < numSharedDedicatedClusterManagerNodes; i++) { + final Settings nodeSettings = getNodeSettings(i, sharedNodesSeeds[i], Settings.EMPTY, defaultMinClusterManagerNodes); settings.add(removeRoles(nodeSettings, Collections.singleton(DiscoveryNodeRole.DATA_ROLE))); } - for (int i = numSharedDedicatedMasterNodes; i < numSharedDedicatedMasterNodes + numSharedDataNodes; i++) { - final Settings nodeSettings = getNodeSettings(i, sharedNodesSeeds[i], Settings.EMPTY, defaultMinMasterNodes); - if (numSharedDedicatedMasterNodes > 0) { + for (int i = numSharedDedicatedClusterManagerNodes; i < numSharedDedicatedClusterManagerNodes + numSharedDataNodes; i++) { + final Settings nodeSettings = getNodeSettings(i, sharedNodesSeeds[i], Settings.EMPTY, defaultMinClusterManagerNodes); + if (numSharedDedicatedClusterManagerNodes > 0) { settings.add(removeRoles(nodeSettings, Collections.singleton(DiscoveryNodeRole.MASTER_ROLE))); } else { - // if we don't have dedicated master nodes, keep things default + // if we don't have dedicated cluster-manager nodes, keep things default settings.add(nodeSettings); } } - for (int i = numSharedDedicatedMasterNodes + numSharedDataNodes; i < numSharedDedicatedMasterNodes + numSharedDataNodes - + numSharedCoordOnlyNodes; i++) { + for (int i = numSharedDedicatedClusterManagerNodes + numSharedDataNodes; i < numSharedDedicatedClusterManagerNodes + + numSharedDataNodes + numSharedCoordOnlyNodes; i++) { final Builder extraSettings = Settings.builder().put(noRoles()); - settings.add(getNodeSettings(i, sharedNodesSeeds[i], extraSettings.build(), defaultMinMasterNodes)); + settings.add(getNodeSettings(i, sharedNodesSeeds[i], extraSettings.build(), defaultMinClusterManagerNodes)); } - int autoBootstrapMasterNodeIndex = -1; - final List masterNodeNames = settings.stream() + int autoBootstrapClusterManagerNodeIndex = -1; + final List clusterManagerNodeNames = settings.stream() .filter(DiscoveryNode::isMasterNode) .map(Node.NODE_NAME_SETTING::get) .collect(Collectors.toList()); - if (prevNodeCount == 0 && autoManageMasterNodes) { - if (numSharedDedicatedMasterNodes > 0) { - autoBootstrapMasterNodeIndex = RandomNumbers.randomIntBetween(random, 0, numSharedDedicatedMasterNodes - 1); + if (prevNodeCount == 0 && autoManageClusterManagerNodes) { + if (numSharedDedicatedClusterManagerNodes > 0) { + autoBootstrapClusterManagerNodeIndex = RandomNumbers.randomIntBetween(random, 0, numSharedDedicatedClusterManagerNodes - 1); } else if (numSharedDataNodes > 0) { - autoBootstrapMasterNodeIndex = RandomNumbers.randomIntBetween(random, 0, numSharedDataNodes - 1); + autoBootstrapClusterManagerNodeIndex = RandomNumbers.randomIntBetween(random, 0, numSharedDataNodes - 1); } } - final List updatedSettings = bootstrapMasterNodeWithSpecifiedIndex(settings); + final List updatedSettings = bootstrapClusterManagerNodeWithSpecifiedIndex(settings); - for (int i = 0; i < numSharedDedicatedMasterNodes + numSharedDataNodes + numSharedCoordOnlyNodes; i++) { + for (int i = 0; i < numSharedDedicatedClusterManagerNodes + numSharedDataNodes + numSharedCoordOnlyNodes; i++) { Settings nodeSettings = updatedSettings.get(i); - if (i == autoBootstrapMasterNodeIndex) { + if (i == autoBootstrapClusterManagerNodeIndex) { nodeSettings = Settings.builder() - .putList(INITIAL_CLUSTER_MANAGER_NODES_SETTING.getKey(), masterNodeNames) + .putList(INITIAL_CLUSTER_MANAGER_NODES_SETTING.getKey(), clusterManagerNodeNames) .put(nodeSettings) .build(); } @@ -1187,7 +1194,7 @@ private synchronized void reset(boolean wipeData) throws IOException { nextNodeId.set(newSize); assert size() == newSize; - if (autoManageMasterNodes && newSize > 0) { + if (autoManageClusterManagerNodes && newSize > 0) { validateClusterFormed(); } logger.debug( @@ -1214,11 +1221,11 @@ public synchronized void validateClusterFormed() { .map(ClusterService::state) .collect(Collectors.toList()); final String debugString = ", expected nodes: " + expectedNodes + " and actual cluster states " + states; - // all nodes have a master - assertTrue("Missing master" + debugString, states.stream().allMatch(cs -> cs.nodes().getMasterNodeId() != null)); - // all nodes have the same master (in same term) + // all nodes have a cluster-manager + assertTrue("Missing cluster-manager" + debugString, states.stream().allMatch(cs -> cs.nodes().getMasterNodeId() != null)); + // all nodes have the same cluster-manager (in same term) assertEquals( - "Not all masters in same term" + debugString, + "Not all cluster-managers in same term" + debugString, 1, states.stream().mapToLong(ClusterState::term).distinct().count() ); @@ -1555,11 +1562,11 @@ public synchronized T getCurrentMasterNodeInstance(Class clazz) { } /** - * Returns an Iterable to all instances for the given class >T< across all data and master nodes + * Returns an Iterable to all instances for the given class >T< across all data and cluster-manager nodes * in the cluster. */ public Iterable getDataOrMasterNodeInstances(Class clazz) { - return getInstances(clazz, DATA_NODE_PREDICATE.or(MASTER_NODE_PREDICATE)); + return getInstances(clazz, DATA_NODE_PREDICATE.or(CLUSTER_MANAGER_NODE_PREDICATE)); } private Iterable getInstances(Class clazz, Predicate predicate) { @@ -1583,7 +1590,7 @@ public T getDataNodeInstance(Class clazz) { } public T getMasterNodeInstance(Class clazz) { - return getInstance(clazz, MASTER_NODE_PREDICATE); + return getInstance(clazz, CLUSTER_MANAGER_NODE_PREDICATE); } private synchronized T getInstance(Class clazz, Predicate predicate) { @@ -1653,13 +1660,13 @@ public synchronized void stopRandomNode(final Predicate filter) throws if (nodePrefix.equals(OpenSearchIntegTestCase.SUITE_CLUSTER_NODE_PREFIX) && nodeAndClient.nodeAndClientId() < sharedNodesSeeds.length && nodeAndClient.isMasterEligible() - && autoManageMasterNodes + && autoManageClusterManagerNodes && nodes.values() .stream() .filter(NodeAndClient::isMasterEligible) .filter(n -> n.nodeAndClientId() < sharedNodesSeeds.length) .count() == 1) { - throw new AssertionError("Tried to stop the only master eligible shared node"); + throw new AssertionError("Tried to stop the only cluster-manager eligible shared node"); } logger.info("Closing filtered random node [{}] ", nodeAndClient.name); stopNodesAndClient(nodeAndClient); @@ -1667,36 +1674,36 @@ public synchronized void stopRandomNode(final Predicate filter) throws } /** - * Stops the current master node forcefully + * Stops the current cluster-manager node forcefully */ public synchronized void stopCurrentMasterNode() throws IOException { ensureOpen(); assert size() > 0; - String masterNodeName = getMasterName(); - final NodeAndClient masterNode = nodes.get(masterNodeName); - assert masterNode != null; - logger.info("Closing master node [{}] ", masterNodeName); - stopNodesAndClient(masterNode); + String clusterManagerNodeName = getMasterName(); + final NodeAndClient clusterManagerNode = nodes.get(clusterManagerNodeName); + assert clusterManagerNode != null; + logger.info("Closing cluster-manager node [{}] ", clusterManagerNodeName); + stopNodesAndClient(clusterManagerNode); } /** - * Stops any of the current nodes but not the master node. + * Stops any of the current nodes but not the cluster-manager node. */ public synchronized void stopRandomNonMasterNode() throws IOException { NodeAndClient nodeAndClient = getRandomNodeAndClient(new NodeNamePredicate(getMasterName()).negate()); if (nodeAndClient != null) { - logger.info("Closing random non master node [{}] current master [{}] ", nodeAndClient.name, getMasterName()); + logger.info("Closing random non cluster-manager node [{}] current cluster-manager [{}] ", nodeAndClient.name, getMasterName()); stopNodesAndClient(nodeAndClient); } } private synchronized void startAndPublishNodesAndClients(List nodeAndClients) { if (nodeAndClients.size() > 0) { - final int newMasters = (int) nodeAndClients.stream() + final int newClusterManagers = (int) nodeAndClients.stream() .filter(NodeAndClient::isMasterEligible) - .filter(nac -> nodes.containsKey(nac.name) == false) // filter out old masters + .filter(nac -> nodes.containsKey(nac.name) == false) // filter out old cluster-managers .count(); - final int currentMasters = getMasterNodesCount(); + final int currentClusterManagers = getClusterManagerNodesCount(); rebuildUnicastHostFiles(nodeAndClients); // ensure that new nodes can find the existing nodes when they start List> futures = nodeAndClients.stream().map(node -> executor.submit(node::startNode)).collect(Collectors.toList()); @@ -1713,11 +1720,11 @@ private synchronized void startAndPublishNodesAndClients(List nod } nodeAndClients.forEach(this::publishNode); - if (autoManageMasterNodes - && currentMasters > 0 - && newMasters > 0 - && getMinMasterNodes(currentMasters + newMasters) > currentMasters) { - // update once masters have joined + if (autoManageClusterManagerNodes + && currentClusterManagers > 0 + && newClusterManagers > 0 + && getMinClusterManagerNodes(currentClusterManagers + newClusterManagers) > currentClusterManagers) { + // update once cluster-managers have joined validateClusterFormed(); } } @@ -1758,7 +1765,7 @@ private void stopNodesAndClient(NodeAndClient nodeAndClient) throws IOException } private synchronized void stopNodesAndClients(Collection nodeAndClients) throws IOException { - final Set excludedNodeIds = excludeMasters(nodeAndClients); + final Set excludedNodeIds = excludeClusterManagers(nodeAndClients); for (NodeAndClient nodeAndClient : nodeAndClients) { removeDisruptionSchemeFromNode(nodeAndClient); @@ -1834,11 +1841,11 @@ private void restartNode(NodeAndClient nodeAndClient, RestartCallback callback) activeDisruptionScheme.removeFromNode(nodeAndClient.name, this); } - Set excludedNodeIds = excludeMasters(Collections.singleton(nodeAndClient)); + Set excludedNodeIds = excludeClusterManagers(Collections.singleton(nodeAndClient)); final Settings newSettings = nodeAndClient.closeForRestart( callback, - autoManageMasterNodes ? getMinMasterNodes(getMasterNodesCount()) : -1 + autoManageClusterManagerNodes ? getMinClusterManagerNodes(getClusterManagerNodesCount()) : -1 ); removeExclusions(excludedNodeIds); @@ -1862,22 +1869,23 @@ private NodeAndClient removeNode(NodeAndClient nodeAndClient) { return previous; } - private Set excludeMasters(Collection nodeAndClients) { + private Set excludeClusterManagers(Collection nodeAndClients) { assert Thread.holdsLock(this); final Set excludedNodeNames = new HashSet<>(); - if (autoManageMasterNodes && nodeAndClients.size() > 0) { + if (autoManageClusterManagerNodes && nodeAndClients.size() > 0) { - final long currentMasters = nodes.values().stream().filter(NodeAndClient::isMasterEligible).count(); - final long stoppingMasters = nodeAndClients.stream().filter(NodeAndClient::isMasterEligible).count(); + final long currentClusterManagers = nodes.values().stream().filter(NodeAndClient::isMasterEligible).count(); + final long stoppingClusterManagers = nodeAndClients.stream().filter(NodeAndClient::isMasterEligible).count(); - assert stoppingMasters <= currentMasters : currentMasters + " < " + stoppingMasters; - if (stoppingMasters != currentMasters && stoppingMasters > 0) { - // If stopping few enough master-nodes that there's still a majority left, there is no need to withdraw their votes first. + assert stoppingClusterManagers <= currentClusterManagers : currentClusterManagers + " < " + stoppingClusterManagers; + if (stoppingClusterManagers != currentClusterManagers && stoppingClusterManagers > 0) { + // If stopping few enough cluster-manager-nodes that there's still a majority left, there is no need to withdraw their votes + // first. // However, we do not yet have a way to be sure there's a majority left, because the voting configuration may not yet have // been updated when the previous nodes shut down, so we must always explicitly withdraw votes. // TODO add cluster health API to check that voting configuration is optimal so this isn't always needed nodeAndClients.stream().filter(NodeAndClient::isMasterEligible).map(NodeAndClient::getName).forEach(excludedNodeNames::add); - assert excludedNodeNames.size() == stoppingMasters; + assert excludedNodeNames.size() == stoppingClusterManagers; logger.info("adding voting config exclusions {} prior to restart/shutdown", excludedNodeNames); try { @@ -1912,7 +1920,7 @@ private void removeExclusions(Set excludedNodeIds) { public synchronized void fullRestart(RestartCallback callback) throws Exception { int numNodesRestarted = 0; final Settings[] newNodeSettings = new Settings[nextNodeId.get()]; - final int minMasterNodes = autoManageMasterNodes ? getMinMasterNodes(getMasterNodesCount()) : -1; + final int minClusterManagerNodes = autoManageClusterManagerNodes ? getMinClusterManagerNodes(getClusterManagerNodesCount()) : -1; final List toStartAndPublish = new ArrayList<>(); // we want to start nodes in one go for (NodeAndClient nodeAndClient : nodes.values()) { callback.doAfterNodes(numNodesRestarted++, nodeAndClient.nodeClient()); @@ -1920,7 +1928,7 @@ public synchronized void fullRestart(RestartCallback callback) throws Exception if (activeDisruptionScheme != null) { activeDisruptionScheme.removeFromNode(nodeAndClient.name, this); } - final Settings newSettings = nodeAndClient.closeForRestart(callback, minMasterNodes); + final Settings newSettings = nodeAndClient.closeForRestart(callback, minClusterManagerNodes); newNodeSettings[nodeAndClient.nodeAndClientId()] = newSettings; toStartAndPublish.add(nodeAndClient); } @@ -1943,14 +1951,14 @@ public synchronized void fullRestart(RestartCallback callback) throws Exception } /** - * Returns the name of the current master node in the cluster. + * Returns the name of the current cluster-manager node in the cluster. */ public String getMasterName() { return getMasterName(null); } /** - * Returns the name of the current master node in the cluster and executes the request via the node specified + * Returns the name of the current cluster-manager node in the cluster and executes the request via the node specified * in the viaNode parameter. If viaNode isn't specified a random node will be picked to the send the request to. */ public String getMasterName(@Nullable String viaNode) { @@ -1959,7 +1967,7 @@ public String getMasterName(@Nullable String viaNode) { return client.admin().cluster().prepareState().get().getState().nodes().getMasterNode().getName(); } catch (Exception e) { logger.warn("Can't fetch cluster state", e); - throw new RuntimeException("Can't get master node " + e.getMessage(), e); + throw new RuntimeException("Can't get cluster-manager node " + e.getMessage(), e); } } @@ -1999,14 +2007,14 @@ public synchronized Set nodesInclude(String index) { } /** - * Performs cluster bootstrap when node with index {@link #bootstrapMasterNodeIndex} is started + * Performs cluster bootstrap when node with index {@link #bootstrapClusterManagerNodeIndex} is started * with the names of all existing and new cluster-manager-eligible nodes. * Indexing starts from 0. - * If {@link #bootstrapMasterNodeIndex} is -1 (default), this method does nothing. + * If {@link #bootstrapClusterManagerNodeIndex} is -1 (default), this method does nothing. */ - private List bootstrapMasterNodeWithSpecifiedIndex(List allNodesSettings) { + private List bootstrapClusterManagerNodeWithSpecifiedIndex(List allNodesSettings) { assert Thread.holdsLock(this); - if (bootstrapMasterNodeIndex == -1) { // fast-path + if (bootstrapClusterManagerNodeIndex == -1) { // fast-path return allNodesSettings; } @@ -2018,7 +2026,7 @@ private List bootstrapMasterNodeWithSpecifiedIndex(List allN newSettings.add(settings); } else { currentNodeId++; - if (currentNodeId != bootstrapMasterNodeIndex) { + if (currentNodeId != bootstrapClusterManagerNodeIndex) { newSettings.add(settings); } else { List nodeNames = new ArrayList<>(); @@ -2042,7 +2050,7 @@ private List bootstrapMasterNodeWithSpecifiedIndex(List allN .build() ); - setBootstrapMasterNodeIndex(-1); + setBootstrapClusterManagerNodeIndex(-1); } } } @@ -2089,46 +2097,46 @@ public List startNodes(int numOfNodes, Settings settings) { * Starts multiple nodes with the given settings and returns their names */ public synchronized List startNodes(Settings... extraSettings) { - final int newMasterCount = Math.toIntExact(Stream.of(extraSettings).filter(DiscoveryNode::isMasterNode).count()); - final int defaultMinMasterNodes; - if (autoManageMasterNodes) { - defaultMinMasterNodes = getMinMasterNodes(getMasterNodesCount() + newMasterCount); + final int newClusterManagerCount = Math.toIntExact(Stream.of(extraSettings).filter(DiscoveryNode::isMasterNode).count()); + final int defaultMinClusterManagerNodes; + if (autoManageClusterManagerNodes) { + defaultMinClusterManagerNodes = getMinClusterManagerNodes(getClusterManagerNodesCount() + newClusterManagerCount); } else { - defaultMinMasterNodes = -1; + defaultMinClusterManagerNodes = -1; } final List nodes = new ArrayList<>(); - final int prevMasterCount = getMasterNodesCount(); - int autoBootstrapMasterNodeIndex = autoManageMasterNodes - && prevMasterCount == 0 - && newMasterCount > 0 + final int prevClusterManagerCount = getClusterManagerNodesCount(); + int autoBootstrapClusterManagerNodeIndex = autoManageClusterManagerNodes + && prevClusterManagerCount == 0 + && newClusterManagerCount > 0 && Arrays.stream(extraSettings) .allMatch(s -> DiscoveryNode.isMasterNode(s) == false || ZEN2_DISCOVERY_TYPE.equals(DISCOVERY_TYPE_SETTING.get(s))) - ? RandomNumbers.randomIntBetween(random, 0, newMasterCount - 1) + ? RandomNumbers.randomIntBetween(random, 0, newClusterManagerCount - 1) : -1; final int numOfNodes = extraSettings.length; final int firstNodeId = nextNodeId.getAndIncrement(); final List settings = new ArrayList<>(); for (int i = 0; i < numOfNodes; i++) { - settings.add(getNodeSettings(firstNodeId + i, random.nextLong(), extraSettings[i], defaultMinMasterNodes)); + settings.add(getNodeSettings(firstNodeId + i, random.nextLong(), extraSettings[i], defaultMinClusterManagerNodes)); } nextNodeId.set(firstNodeId + numOfNodes); - final List initialMasterNodes = settings.stream() + final List initialClusterManagerNodes = settings.stream() .filter(DiscoveryNode::isMasterNode) .map(Node.NODE_NAME_SETTING::get) .collect(Collectors.toList()); - final List updatedSettings = bootstrapMasterNodeWithSpecifiedIndex(settings); + final List updatedSettings = bootstrapClusterManagerNodeWithSpecifiedIndex(settings); for (int i = 0; i < numOfNodes; i++) { final Settings nodeSettings = updatedSettings.get(i); final Builder builder = Settings.builder(); if (DiscoveryNode.isMasterNode(nodeSettings)) { - if (autoBootstrapMasterNodeIndex == 0) { - builder.putList(INITIAL_CLUSTER_MANAGER_NODES_SETTING.getKey(), initialMasterNodes); + if (autoBootstrapClusterManagerNodeIndex == 0) { + builder.putList(INITIAL_CLUSTER_MANAGER_NODES_SETTING.getKey(), initialClusterManagerNodes); } - autoBootstrapMasterNodeIndex -= 1; + autoBootstrapClusterManagerNodeIndex -= 1; } final NodeAndClient nodeAndClient = buildNode( @@ -2140,7 +2148,7 @@ public synchronized List startNodes(Settings... extraSettings) { nodes.add(nodeAndClient); } startAndPublishNodesAndClients(nodes); - if (autoManageMasterNodes) { + if (autoManageClusterManagerNodes) { validateClusterFormed(); } return nodes.stream().map(NodeAndClient::getName).collect(Collectors.toList()); @@ -2162,21 +2170,21 @@ public List startDataOnlyNodes(int numNodes, Settings settings) { return startNodes(numNodes, Settings.builder().put(onlyRole(settings, DiscoveryNodeRole.DATA_ROLE)).build()); } - /** calculates a min master nodes value based on the given number of master nodes */ - private static int getMinMasterNodes(int eligibleMasterNodes) { - return eligibleMasterNodes / 2 + 1; + /** calculates a min cluster-manager nodes value based on the given number of cluster-manager nodes */ + private static int getMinClusterManagerNodes(int eligibleClusterManagerNodes) { + return eligibleClusterManagerNodes / 2 + 1; } - private int getMasterNodesCount() { + private int getClusterManagerNodesCount() { return (int) nodes.values().stream().filter(n -> DiscoveryNode.isMasterNode(n.node().settings())).count(); } - public String startMasterOnlyNode() { - return startMasterOnlyNode(Settings.EMPTY); + public String startClusterManagerOnlyNode() { + return startClusterManagerOnlyNode(Settings.EMPTY); } - public String startMasterOnlyNode(Settings settings) { - Settings settings1 = Settings.builder().put(settings).put(masterOnlyNode(settings)).build(); + public String startClusterManagerOnlyNode(Settings settings) { + Settings settings1 = Settings.builder().put(settings).put(NodeRoles.clusterManagerOnlyNode(settings)).build(); return startNode(settings1); } @@ -2208,7 +2216,7 @@ public int numDataNodes() { @Override public int numDataAndMasterNodes() { - return filterNodes(nodes, DATA_NODE_PREDICATE.or(MASTER_NODE_PREDICATE)).size(); + return filterNodes(nodes, DATA_NODE_PREDICATE.or(CLUSTER_MANAGER_NODE_PREDICATE)).size(); } public int numMasterNodes() { diff --git a/test/framework/src/main/java/org/opensearch/test/NodeRoles.java b/test/framework/src/main/java/org/opensearch/test/NodeRoles.java index 64fd6b22e9805..4f448e230a2b6 100644 --- a/test/framework/src/main/java/org/opensearch/test/NodeRoles.java +++ b/test/framework/src/main/java/org/opensearch/test/NodeRoles.java @@ -176,11 +176,11 @@ public static Settings masterNode(final Settings settings) { return addRoles(settings, Collections.singleton(DiscoveryNodeRole.CLUSTER_MANAGER_ROLE)); } - public static Settings masterOnlyNode() { - return masterOnlyNode(Settings.EMPTY); + public static Settings clusterManagerOnlyNode() { + return clusterManagerOnlyNode(Settings.EMPTY); } - public static Settings masterOnlyNode(final Settings settings) { + public static Settings clusterManagerOnlyNode(final Settings settings) { return onlyRole(settings, DiscoveryNodeRole.CLUSTER_MANAGER_ROLE); } diff --git a/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java b/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java index 8a3a5bcb5bb50..f36f4dedfdfaa 100644 --- a/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java @@ -707,17 +707,19 @@ public void setDisruptionScheme(ServiceDisruptionScheme scheme) { } /** - * Creates a disruption that isolates the current master node from all other nodes in the cluster. + * Creates a disruption that isolates the current cluster-manager node from all other nodes in the cluster. * * @param disruptionType type of disruption to create * @return disruption */ protected static NetworkDisruption isolateMasterDisruption(NetworkDisruption.NetworkLinkDisruptionType disruptionType) { - final String masterNode = internalCluster().getMasterName(); + final String clusterManagerNode = internalCluster().getMasterName(); return new NetworkDisruption( new NetworkDisruption.TwoPartitions( - Collections.singleton(masterNode), - Arrays.stream(internalCluster().getNodeNames()).filter(name -> name.equals(masterNode) == false).collect(Collectors.toSet()) + Collections.singleton(clusterManagerNode), + Arrays.stream(internalCluster().getNodeNames()) + .filter(name -> name.equals(clusterManagerNode) == false) + .collect(Collectors.toSet()) ), disruptionType ); @@ -949,12 +951,13 @@ private ClusterHealthStatus ensureColor( .waitForNoRelocatingShards(true) .waitForNoInitializingShards(waitForNoInitializingShards) // We currently often use ensureGreen or ensureYellow to check whether the cluster is back in a good state after shutting down - // a node. If the node that is stopped is the master node, another node will become master and publish a cluster state where it - // is master but where the node that was stopped hasn't been removed yet from the cluster state. It will only subsequently - // publish a second state where the old master is removed. If the ensureGreen/ensureYellow is timed just right, it will get to - // execute before the second cluster state update removes the old master and the condition ensureGreen / ensureYellow will - // trivially hold if it held before the node was shut down. The following "waitForNodes" condition ensures that the node has - // been removed by the master so that the health check applies to the set of nodes we expect to be part of the cluster. + // a node. If the node that is stopped is the cluster-manager node, another node will become cluster-manager and publish a + // cluster state where it is cluster-manager but where the node that was stopped hasn't been removed yet from the cluster state. + // It will only subsequently publish a second state where the old cluster-manager is removed. + // If the ensureGreen/ensureYellow is timed just right, it will get to execute before the second cluster state update removes + // the old cluster-manager and the condition ensureGreen / ensureYellow will trivially hold if it held before the node was + // shut down. The following "waitForNodes" condition ensures that the node has been removed by the cluster-manager + // so that the health check applies to the set of nodes we expect to be part of the cluster. .waitForNodes(Integer.toString(cluster().size())); ClusterHealthResponse actionGet = client().admin().cluster().health(healthRequest).actionGet(); @@ -1085,19 +1088,19 @@ protected void ensureClusterSizeConsistency() { } /** - * Verifies that all nodes that have the same version of the cluster state as master have same cluster state + * Verifies that all nodes that have the same version of the cluster state as cluster-manager have same cluster state */ protected void ensureClusterStateConsistency() throws IOException { if (cluster() != null && cluster().size() > 0) { final NamedWriteableRegistry namedWriteableRegistry = cluster().getNamedWriteableRegistry(); - final Client masterClient = client(); - ClusterState masterClusterState = masterClient.admin().cluster().prepareState().all().get().getState(); - byte[] masterClusterStateBytes = ClusterState.Builder.toBytes(masterClusterState); + final Client clusterManagerClient = client(); + ClusterState clusterManagerClusterState = clusterManagerClient.admin().cluster().prepareState().all().get().getState(); + byte[] masterClusterStateBytes = ClusterState.Builder.toBytes(clusterManagerClusterState); // remove local node reference - masterClusterState = ClusterState.Builder.fromBytes(masterClusterStateBytes, null, namedWriteableRegistry); - Map masterStateMap = convertToMap(masterClusterState); - int masterClusterStateSize = masterClusterState.toString().length(); - String masterId = masterClusterState.nodes().getMasterNodeId(); + clusterManagerClusterState = ClusterState.Builder.fromBytes(masterClusterStateBytes, null, namedWriteableRegistry); + Map clusterManagerStateMap = convertToMap(clusterManagerClusterState); + int clusterManagerClusterStateSize = clusterManagerClusterState.toString().length(); + String clusterManagerId = clusterManagerClusterState.nodes().getMasterNodeId(); for (Client client : cluster().getClients()) { ClusterState localClusterState = client.admin().cluster().prepareState().all().setLocal(true).get().getState(); byte[] localClusterStateBytes = ClusterState.Builder.toBytes(localClusterState); @@ -1105,27 +1108,32 @@ protected void ensureClusterStateConsistency() throws IOException { localClusterState = ClusterState.Builder.fromBytes(localClusterStateBytes, null, namedWriteableRegistry); final Map localStateMap = convertToMap(localClusterState); final int localClusterStateSize = localClusterState.toString().length(); - // Check that the non-master node has the same version of the cluster state as the master and - // that the master node matches the master (otherwise there is no requirement for the cluster state to match) - if (masterClusterState.version() == localClusterState.version() - && masterId.equals(localClusterState.nodes().getMasterNodeId())) { + // Check that the non-cluster-manager node has the same version of the cluster state as the cluster-manager and + // that the cluster-manager node matches the cluster-manager (otherwise there is no requirement for the cluster state to + // match) + if (clusterManagerClusterState.version() == localClusterState.version() + && clusterManagerId.equals(localClusterState.nodes().getMasterNodeId())) { try { - assertEquals("cluster state UUID does not match", masterClusterState.stateUUID(), localClusterState.stateUUID()); + assertEquals( + "cluster state UUID does not match", + clusterManagerClusterState.stateUUID(), + localClusterState.stateUUID() + ); // We cannot compare serialization bytes since serialization order of maps is not guaranteed // We also cannot compare byte array size because CompressedXContent's DeflateCompressor uses // a synced flush that can affect the size of the compressed byte array // (see: DeflateCompressedXContentTests#testDifferentCompressedRepresentation for an example) // instead we compare the string length of cluster state - they should be the same - assertEquals("cluster state size does not match", masterClusterStateSize, localClusterStateSize); + assertEquals("cluster state size does not match", clusterManagerClusterStateSize, localClusterStateSize); // Compare JSON serialization assertNull( "cluster state JSON serialization does not match", - differenceBetweenMapsIgnoringArrayOrder(masterStateMap, localStateMap) + differenceBetweenMapsIgnoringArrayOrder(clusterManagerStateMap, localStateMap) ); } catch (final AssertionError error) { logger.error( - "Cluster state from master:\n{}\nLocal cluster state:\n{}", - masterClusterState.toString(), + "Cluster state from cluster-manager:\n{}\nLocal cluster state:\n{}", + clusterManagerClusterState.toString(), localClusterState.toString() ); throw error; @@ -1138,8 +1146,8 @@ protected void ensureClusterStateConsistency() throws IOException { protected void ensureClusterStateCanBeReadByNodeTool() throws IOException { if (cluster() != null && cluster().size() > 0) { - final Client masterClient = client(); - Metadata metadata = masterClient.admin().cluster().prepareState().all().get().getState().metadata(); + final Client clusterManagerClient = client(); + Metadata metadata = clusterManagerClient.admin().cluster().prepareState().all().get().getState().metadata(); final Map serializationParams = new HashMap<>(2); serializationParams.put("binary", "true"); serializationParams.put(Metadata.CONTEXT_MODE_PARAM, Metadata.CONTEXT_MODE_GATEWAY); @@ -1320,7 +1328,7 @@ protected void ensureStableCluster(int nodeCount, TimeValue timeValue, boolean l /** * Ensures that all nodes in the cluster are connected to each other. * - * Some network disruptions may leave nodes that are not the master disconnected from each other. + * Some network disruptions may leave nodes that are not the cluster-manager disconnected from each other. * {@link org.opensearch.cluster.NodeConnectionsService} will eventually reconnect but it's * handy to be able to ensure this happens faster */ @@ -1738,9 +1746,9 @@ public enum Scope { int maxNumDataNodes() default -1; /** - * Indicates whether the cluster can have dedicated master nodes. If {@code false} means data nodes will serve as master nodes - * and there will be no dedicated master (and data) nodes. Default is {@code false} which means - * dedicated master nodes will be randomly used. + * Indicates whether the cluster can have dedicated cluster-manager nodes. If {@code false} means data nodes will serve as cluster-manager nodes + * and there will be no dedicated cluster-manager (and data) nodes. Default is {@code false} which means + * dedicated cluster-manager nodes will be randomly used. */ boolean supportsDedicatedMasters() default true; @@ -1829,12 +1837,12 @@ private static Scope getCurrentClusterScope(Class clazz) { return annotation == null ? Scope.SUITE : annotation.scope(); } - private boolean getSupportsDedicatedMasters() { + private boolean getSupportsDedicatedClusterManagers() { ClusterScope annotation = getAnnotation(this.getClass(), ClusterScope.class); return annotation == null ? true : annotation.supportsDedicatedMasters(); } - private boolean getAutoManageMasterNodes() { + private boolean getAutoManageClusterManagerNodes() { ClusterScope annotation = getAnnotation(this.getClass(), ClusterScope.class); return annotation == null ? true : annotation.autoManageMasterNodes(); } @@ -1959,7 +1967,7 @@ protected TestCluster buildTestCluster(Scope scope, long seed) throws IOExceptio throw new OpenSearchException("Scope not supported: " + scope); } - boolean supportsDedicatedMasters = getSupportsDedicatedMasters(); + boolean supportsDedicatedClusterManagers = getSupportsDedicatedClusterManagers(); int numDataNodes = getNumDataNodes(); int minNumDataNodes; int maxNumDataNodes; @@ -1983,8 +1991,8 @@ protected TestCluster buildTestCluster(Scope scope, long seed) throws IOExceptio return new InternalTestCluster( seed, createTempDir(), - supportsDedicatedMasters, - getAutoManageMasterNodes(), + supportsDedicatedClusterManagers, + getAutoManageClusterManagerNodes(), minNumDataNodes, maxNumDataNodes, InternalTestCluster.clusterName(scope.name(), seed) + "-cluster", @@ -2227,7 +2235,7 @@ public final void cleanUpCluster() throws Exception { // need to check that there are no more in-flight search contexts before // we remove indices if (isInternalCluster()) { - internalCluster().setBootstrapMasterNodeIndex(-1); + internalCluster().setBootstrapClusterManagerNodeIndex(-1); } super.ensureAllSearchContextsReleased(); if (runTestScopeLifecycle()) { diff --git a/test/framework/src/main/java/org/opensearch/test/OpenSearchSingleNodeTestCase.java b/test/framework/src/main/java/org/opensearch/test/OpenSearchSingleNodeTestCase.java index e3f6e6019546b..04b3773c1d385 100644 --- a/test/framework/src/main/java/org/opensearch/test/OpenSearchSingleNodeTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/OpenSearchSingleNodeTestCase.java @@ -97,7 +97,7 @@ protected void startNode(long seed) throws Exception { assert NODE == null; NODE = RandomizedContext.current().runWithPrivateRandomness(seed, this::newNode); // we must wait for the node to actually be up and running. otherwise the node might have started, - // elected itself master but might not yet have removed the + // elected itself cluster-manager but might not yet have removed the // SERVICE_UNAVAILABLE/1/state not recovered / initialized block ClusterHealthResponse clusterHealthResponse = client().admin().cluster().prepareHealth().setWaitForGreenStatus().get(); assertFalse(clusterHealthResponse.isTimedOut()); diff --git a/test/framework/src/main/java/org/opensearch/test/TestCluster.java b/test/framework/src/main/java/org/opensearch/test/TestCluster.java index 2bc0ffd941502..26081d947431d 100644 --- a/test/framework/src/main/java/org/opensearch/test/TestCluster.java +++ b/test/framework/src/main/java/org/opensearch/test/TestCluster.java @@ -125,7 +125,7 @@ public void assertAfterTest() throws Exception { public abstract int numDataNodes(); /** - * Returns the number of data and master eligible nodes in the cluster. + * Returns the number of data and cluster-manager eligible nodes in the cluster. */ public abstract int numDataAndMasterNodes(); diff --git a/test/framework/src/main/java/org/opensearch/test/VersionUtils.java b/test/framework/src/main/java/org/opensearch/test/VersionUtils.java index 0f8525285fd08..bd7ce2b0f876d 100644 --- a/test/framework/src/main/java/org/opensearch/test/VersionUtils.java +++ b/test/framework/src/main/java/org/opensearch/test/VersionUtils.java @@ -65,7 +65,7 @@ static Tuple, List> resolveReleasedVersions(Version curre Map> majorVersions = Version.getDeclaredVersions(versionClass) .stream() .collect(Collectors.groupingBy(v -> (int) v.major)); - // this breaks b/c 5.x is still in version list but master doesn't care about it! + // this breaks b/c 5.x is still in version list but cluster-manager doesn't care about it! // assert majorVersions.size() == 2; List> oldVersions = new ArrayList<>(0); List> previousMajor = new ArrayList<>(0); @@ -85,7 +85,7 @@ static Tuple, List> resolveReleasedVersions(Version curre List unreleasedVersions = new ArrayList<>(); final List> stableVersions; if (currentMajor.size() == 1) { - // on master branch + // on main branch stableVersions = previousMajor; // remove current moveLastToUnreleased(currentMajor, unreleasedVersions); diff --git a/test/framework/src/main/java/org/opensearch/test/disruption/BlockMasterServiceOnMaster.java b/test/framework/src/main/java/org/opensearch/test/disruption/BlockMasterServiceOnMaster.java index 99397f0ffd953..85f8e5c250066 100644 --- a/test/framework/src/main/java/org/opensearch/test/disruption/BlockMasterServiceOnMaster.java +++ b/test/framework/src/main/java/org/opensearch/test/disruption/BlockMasterServiceOnMaster.java @@ -62,7 +62,7 @@ public void startDisrupting() { if (clusterService == null) { return; } - logger.info("blocking master service on node [{}]", disruptionNodeCopy); + logger.info("blocking cluster-manager service on node [{}]", disruptionNodeCopy); boolean success = disruptionLatch.compareAndSet(null, new CountDownLatch(1)); assert success : "startDisrupting called without waiting on stopDisrupting to complete"; final CountDownLatch started = new CountDownLatch(1); diff --git a/test/framework/src/main/java/org/opensearch/test/disruption/BusyMasterServiceDisruption.java b/test/framework/src/main/java/org/opensearch/test/disruption/BusyMasterServiceDisruption.java index 65cc0dac47a2b..4830f9b0359fb 100644 --- a/test/framework/src/main/java/org/opensearch/test/disruption/BusyMasterServiceDisruption.java +++ b/test/framework/src/main/java/org/opensearch/test/disruption/BusyMasterServiceDisruption.java @@ -61,7 +61,7 @@ public void startDisrupting() { if (clusterService == null) { return; } - logger.info("making master service busy on node [{}] at priority [{}]", disruptionNodeCopy, priority); + logger.info("making cluster-manager service busy on node [{}] at priority [{}]", disruptionNodeCopy, priority); active.set(true); submitTask(clusterService); } diff --git a/test/framework/src/main/java/org/opensearch/test/disruption/NetworkDisruption.java b/test/framework/src/main/java/org/opensearch/test/disruption/NetworkDisruption.java index b3877b202d36d..7f2644d8e857c 100644 --- a/test/framework/src/main/java/org/opensearch/test/disruption/NetworkDisruption.java +++ b/test/framework/src/main/java/org/opensearch/test/disruption/NetworkDisruption.java @@ -109,7 +109,7 @@ public void ensureHealthy(InternalTestCluster cluster) { /** * Ensures that all nodes in the cluster are connected to each other. * - * Some network disruptions may leave nodes that are not the master disconnected from each other. + * Some network disruptions may leave nodes that are not the cluster-manager disconnected from each other. * {@link org.opensearch.cluster.NodeConnectionsService} will eventually reconnect but it's * handy to be able to ensure this happens faster */ diff --git a/test/framework/src/main/java/org/opensearch/test/rest/yaml/ClientYamlDocsTestClient.java b/test/framework/src/main/java/org/opensearch/test/rest/yaml/ClientYamlDocsTestClient.java index d57fa7ff82f07..cd5f1fe168b12 100644 --- a/test/framework/src/main/java/org/opensearch/test/rest/yaml/ClientYamlDocsTestClient.java +++ b/test/framework/src/main/java/org/opensearch/test/rest/yaml/ClientYamlDocsTestClient.java @@ -62,10 +62,10 @@ public ClientYamlDocsTestClient( final RestClient restClient, final List hosts, final Version esVersion, - final Version masterVersion, + final Version clusterManagerVersion, final CheckedSupplier clientBuilderWithSniffedNodes ) { - super(restSpec, restClient, hosts, esVersion, masterVersion, clientBuilderWithSniffedNodes); + super(restSpec, restClient, hosts, esVersion, clusterManagerVersion, clientBuilderWithSniffedNodes); } @Override diff --git a/test/framework/src/main/java/org/opensearch/test/rest/yaml/ClientYamlTestClient.java b/test/framework/src/main/java/org/opensearch/test/rest/yaml/ClientYamlTestClient.java index 7a31c73d24305..6a87a89db4959 100644 --- a/test/framework/src/main/java/org/opensearch/test/rest/yaml/ClientYamlTestClient.java +++ b/test/framework/src/main/java/org/opensearch/test/rest/yaml/ClientYamlTestClient.java @@ -78,7 +78,7 @@ public class ClientYamlTestClient implements Closeable { private final ClientYamlSuiteRestSpec restSpec; private final Map restClients = new HashMap<>(); private final Version esVersion; - private final Version masterVersion; + private final Version clusterManagerVersion; private final CheckedSupplier clientBuilderWithSniffedNodes; ClientYamlTestClient( @@ -86,14 +86,14 @@ public class ClientYamlTestClient implements Closeable { final RestClient restClient, final List hosts, final Version esVersion, - final Version masterVersion, + final Version clusterManagerVersion, final CheckedSupplier clientBuilderWithSniffedNodes ) { assert hosts.size() > 0; this.restSpec = restSpec; this.restClients.put(NodeSelector.ANY, restClient); this.esVersion = esVersion; - this.masterVersion = masterVersion; + this.clusterManagerVersion = clusterManagerVersion; this.clientBuilderWithSniffedNodes = clientBuilderWithSniffedNodes; } @@ -101,8 +101,8 @@ public Version getEsVersion() { return esVersion; } - public Version getMasterVersion() { - return masterVersion; + public Version getClusterManagerVersion() { + return clusterManagerVersion; } /** diff --git a/test/framework/src/main/java/org/opensearch/test/rest/yaml/ClientYamlTestExecutionContext.java b/test/framework/src/main/java/org/opensearch/test/rest/yaml/ClientYamlTestExecutionContext.java index 4c3a1ec863d31..8e6bbd009dc2f 100644 --- a/test/framework/src/main/java/org/opensearch/test/rest/yaml/ClientYamlTestExecutionContext.java +++ b/test/framework/src/main/java/org/opensearch/test/rest/yaml/ClientYamlTestExecutionContext.java @@ -228,7 +228,7 @@ public Version esVersion() { } public Version masterVersion() { - return clientYamlTestClient.getMasterVersion(); + return clientYamlTestClient.getClusterManagerVersion(); } } diff --git a/test/framework/src/main/java/org/opensearch/test/rest/yaml/OpenSearchClientYamlSuiteTestCase.java b/test/framework/src/main/java/org/opensearch/test/rest/yaml/OpenSearchClientYamlSuiteTestCase.java index 1b19f03f46174..f228c87186afd 100644 --- a/test/framework/src/main/java/org/opensearch/test/rest/yaml/OpenSearchClientYamlSuiteTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/rest/yaml/OpenSearchClientYamlSuiteTestCase.java @@ -144,14 +144,14 @@ public void initAndResetContext() throws Exception { final List hosts = getClusterHosts(); Tuple versionVersionTuple = readVersionsFromCatNodes(adminClient()); final Version minVersion = versionVersionTuple.v1(); - final Version masterVersion = versionVersionTuple.v2(); + final Version clusterManagerVersion = versionVersionTuple.v2(); logger.info( - "initializing client, minimum OpenSearch version [{}], master version, [{}], hosts {}", + "initializing client, minimum OpenSearch version [{}], cluster-manager version, [{}], hosts {}", minVersion, - masterVersion, + clusterManagerVersion, hosts ); - clientYamlTestClient = initClientYamlTestClient(restSpec, client(), hosts, minVersion, masterVersion); + clientYamlTestClient = initClientYamlTestClient(restSpec, client(), hosts, minVersion, clusterManagerVersion); restTestExecutionContext = new ClientYamlTestExecutionContext(clientYamlTestClient, randomizeContentType()); adminExecutionContext = new ClientYamlTestExecutionContext(clientYamlTestClient, false); final String[] denylist = resolvePathsProperty(REST_TESTS_DENYLIST, null); @@ -179,9 +179,16 @@ protected ClientYamlTestClient initClientYamlTestClient( final RestClient restClient, final List hosts, final Version esVersion, - final Version masterVersion + final Version clusterManagerVersion ) { - return new ClientYamlTestClient(restSpec, restClient, hosts, esVersion, masterVersion, this::getClientBuilderWithSniffedHosts); + return new ClientYamlTestClient( + restSpec, + restClient, + hosts, + esVersion, + clusterManagerVersion, + this::getClientBuilderWithSniffedHosts + ); } @AfterClass @@ -330,28 +337,28 @@ private static void validateSpec(ClientYamlSuiteRestSpec restSpec) { * Detect minimal node version and master node version of cluster using REST Client. * * @param restClient REST client used to discover cluster nodes - * @return {@link Tuple} of [minimal node version, master node version] + * @return {@link Tuple} of [minimal node version, cluster-manager node version] * @throws IOException When _cat API output parsing fails */ private Tuple readVersionsFromCatNodes(RestClient restClient) throws IOException { // we simply go to the _cat/nodes API and parse all versions in the cluster final Request request = new Request("GET", "/_cat/nodes"); request.addParameter("h", "version,master"); - request.setOptions(getCatNodesVersionMasterRequestOptions()); + request.setOptions(getCatNodesVersionClusterManagerRequestOptions()); Response response = restClient.performRequest(request); ClientYamlTestResponse restTestResponse = new ClientYamlTestResponse(response); String nodesCatResponse = restTestResponse.getBodyAsString(); String[] split = nodesCatResponse.split("\n"); Version version = null; - Version masterVersion = null; + Version clusterManagerVersion = null; for (String perNode : split) { - final String[] versionAndMaster = perNode.split("\\s+"); - assert versionAndMaster.length == 2 : "invalid line: " + perNode + " length: " + versionAndMaster.length; - final Version currentVersion = Version.fromString(versionAndMaster[0]); - final boolean master = versionAndMaster[1].trim().equals("*"); - if (master) { - assert masterVersion == null; - masterVersion = currentVersion; + final String[] versionAndClusterManager = perNode.split("\\s+"); + assert versionAndClusterManager.length == 2 : "invalid line: " + perNode + " length: " + versionAndClusterManager.length; + final Version currentVersion = Version.fromString(versionAndClusterManager[0]); + final boolean clusterManager = versionAndClusterManager[1].trim().equals("*"); + if (clusterManager) { + assert clusterManagerVersion == null; + clusterManagerVersion = currentVersion; } if (version == null) { version = currentVersion; @@ -359,10 +366,10 @@ private Tuple readVersionsFromCatNodes(RestClient restClient) version = currentVersion; } } - return new Tuple<>(version, masterVersion); + return new Tuple<>(version, clusterManagerVersion); } - protected RequestOptions getCatNodesVersionMasterRequestOptions() { + protected RequestOptions getCatNodesVersionClusterManagerRequestOptions() { return RequestOptions.DEFAULT; } diff --git a/test/framework/src/main/java/org/opensearch/test/rest/yaml/section/DoSection.java b/test/framework/src/main/java/org/opensearch/test/rest/yaml/section/DoSection.java index 6f29207e2a823..6fdc77984c339 100644 --- a/test/framework/src/main/java/org/opensearch/test/rest/yaml/section/DoSection.java +++ b/test/framework/src/main/java/org/opensearch/test/rest/yaml/section/DoSection.java @@ -353,7 +353,7 @@ public void execute(ClientYamlTestExecutionContext executionContext) throws IOEx /** * Check that the response contains only the warning headers that we expect. */ - void checkWarningHeaders(final List warningHeaders, final Version masterVersion) { + void checkWarningHeaders(final List warningHeaders, final Version clusterManagerVersion) { final List unexpected = new ArrayList<>(); final List unmatched = new ArrayList<>(); final List missing = new ArrayList<>(); @@ -367,7 +367,7 @@ void checkWarningHeaders(final List warningHeaders, final Version master final boolean matches = matcher.matches(); if (matches) { final String message = HeaderWarning.extractWarningValueFromWarningHeader(header, true); - if (masterVersion.before(LegacyESVersion.V_7_0_0) + if (clusterManagerVersion.before(LegacyESVersion.V_7_0_0) && message.equals( "the default number of shards will change from [5] to [1] in 7.0.0; " + "if you wish to continue using the default of [5] shards, " @@ -375,7 +375,7 @@ void checkWarningHeaders(final List warningHeaders, final Version master )) { /* * This warning header will come back in the vast majority of our tests that create an index when running against an - * older master. Rather than rewrite our tests to assert this warning header, we assume that it is expected. + * older cluster-manager. Rather than rewrite our tests to assert this warning header, we assume that it is expected. */ continue; } diff --git a/test/framework/src/test/java/org/opensearch/cluster/service/FakeThreadPoolMasterServiceTests.java b/test/framework/src/test/java/org/opensearch/cluster/service/FakeThreadPoolMasterServiceTests.java index 4f321019a37ac..dabeeb6742ec4 100644 --- a/test/framework/src/test/java/org/opensearch/cluster/service/FakeThreadPoolMasterServiceTests.java +++ b/test/framework/src/test/java/org/opensearch/cluster/service/FakeThreadPoolMasterServiceTests.java @@ -63,7 +63,7 @@ public class FakeThreadPoolMasterServiceTests extends OpenSearchTestCase { - public void testFakeMasterService() { + public void testFakeClusterManagerService() { List runnableTasks = new ArrayList<>(); AtomicReference lastClusterStateRef = new AtomicReference<>(); DiscoveryNode discoveryNode = new DiscoveryNode( @@ -84,21 +84,21 @@ public void testFakeMasterService() { doAnswer(invocationOnMock -> runnableTasks.add((Runnable) invocationOnMock.getArguments()[0])).when(executorService).execute(any()); when(mockThreadPool.generic()).thenReturn(executorService); - FakeThreadPoolMasterService masterService = new FakeThreadPoolMasterService( + FakeThreadPoolMasterService clusterManagerService = new FakeThreadPoolMasterService( "test_node", "test", mockThreadPool, runnableTasks::add ); - masterService.setClusterStateSupplier(lastClusterStateRef::get); - masterService.setClusterStatePublisher((event, publishListener, ackListener) -> { + clusterManagerService.setClusterStateSupplier(lastClusterStateRef::get); + clusterManagerService.setClusterStatePublisher((event, publishListener, ackListener) -> { lastClusterStateRef.set(event.state()); publishingCallback.set(publishListener); }); - masterService.start(); + clusterManagerService.start(); AtomicBoolean firstTaskCompleted = new AtomicBoolean(); - masterService.submitStateUpdateTask("test1", new ClusterStateUpdateTask() { + clusterManagerService.submitStateUpdateTask("test1", new ClusterStateUpdateTask() { @Override public ClusterState execute(ClusterState currentState) { return ClusterState.builder(currentState) @@ -124,7 +124,7 @@ public void onFailure(String source, Exception e) { assertFalse(firstTaskCompleted.get()); final Runnable scheduleTask = runnableTasks.remove(0); - assertThat(scheduleTask, hasToString("master service scheduling next task")); + assertThat(scheduleTask, hasToString("cluster-manager service scheduling next task")); scheduleTask.run(); final Runnable publishTask = runnableTasks.remove(0); @@ -138,7 +138,7 @@ public void onFailure(String source, Exception e) { assertThat(runnableTasks.size(), equalTo(0)); AtomicBoolean secondTaskCompleted = new AtomicBoolean(); - masterService.submitStateUpdateTask("test2", new ClusterStateUpdateTask() { + clusterManagerService.submitStateUpdateTask("test2", new ClusterStateUpdateTask() { @Override public ClusterState execute(ClusterState currentState) { return ClusterState.builder(currentState) diff --git a/test/framework/src/test/java/org/opensearch/test/disruption/NetworkDisruptionIT.java b/test/framework/src/test/java/org/opensearch/test/disruption/NetworkDisruptionIT.java index b58d4fd45ff93..20ce592bbfd46 100644 --- a/test/framework/src/test/java/org/opensearch/test/disruption/NetworkDisruptionIT.java +++ b/test/framework/src/test/java/org/opensearch/test/disruption/NetworkDisruptionIT.java @@ -76,11 +76,11 @@ protected Collection> nodePlugins() { /** * Creates 3 to 5 mixed-node cluster and splits it into 2 parts. * The first part is guaranteed to have at least the majority of the nodes, - * so that master could be elected on this side. + * so that cluster-manager could be elected on this side. */ private Tuple, Set> prepareDisruptedCluster() { int numOfNodes = randomIntBetween(3, 5); - internalCluster().setBootstrapMasterNodeIndex(numOfNodes - 1); + internalCluster().setBootstrapClusterManagerNodeIndex(numOfNodes - 1); Set nodes = new HashSet<>(internalCluster().startNodes(numOfNodes, DISRUPTION_TUNED_SETTINGS)); ensureGreen(); assertThat(nodes.size(), greaterThanOrEqualTo(3)); @@ -127,7 +127,7 @@ public void testNetworkPartitionRemovalRestoresConnections() throws Exception { } public void testTransportRespondsEventually() throws InterruptedException { - internalCluster().setBootstrapMasterNodeIndex(0); + internalCluster().setBootstrapClusterManagerNodeIndex(0); internalCluster().ensureAtLeastNumDataNodes(randomIntBetween(3, 5)); final NetworkDisruption.DisruptedLinks disruptedLinks; if (randomBoolean()) { diff --git a/test/framework/src/test/java/org/opensearch/test/test/InternalTestClusterIT.java b/test/framework/src/test/java/org/opensearch/test/test/InternalTestClusterIT.java index b650eb2c03022..0464343c2c6ee 100644 --- a/test/framework/src/test/java/org/opensearch/test/test/InternalTestClusterIT.java +++ b/test/framework/src/test/java/org/opensearch/test/test/InternalTestClusterIT.java @@ -79,7 +79,7 @@ public void testStoppingNodesOneByOne() throws IOException { } public void testOperationsDuringRestart() throws Exception { - internalCluster().startMasterOnlyNode(); + internalCluster().startClusterManagerOnlyNode(); internalCluster().startDataOnlyNodes(2); internalCluster().restartRandomDataNode(new InternalTestCluster.RestartCallback() { @Override diff --git a/test/framework/src/test/java/org/opensearch/test/test/InternalTestClusterTests.java b/test/framework/src/test/java/org/opensearch/test/test/InternalTestClusterTests.java index 87cd98a717be6..262008507753e 100644 --- a/test/framework/src/test/java/org/opensearch/test/test/InternalTestClusterTests.java +++ b/test/framework/src/test/java/org/opensearch/test/test/InternalTestClusterTests.java @@ -86,7 +86,7 @@ private static Collection> mockPlugins() { public void testInitializiationIsConsistent() { long clusterSeed = randomLong(); - boolean masterNodes = randomBoolean(); + boolean clusterManagerNodes = randomBoolean(); int minNumDataNodes = randomIntBetween(0, 9); int maxNumDataNodes = randomIntBetween(minNumDataNodes, 10); String clusterName = randomRealisticUnicodeOfCodepointLengthBetween(1, 10); @@ -98,7 +98,7 @@ public void testInitializiationIsConsistent() { InternalTestCluster cluster0 = new InternalTestCluster( clusterSeed, baseDir, - masterNodes, + clusterManagerNodes, randomBoolean(), minNumDataNodes, maxNumDataNodes, @@ -112,7 +112,7 @@ public void testInitializiationIsConsistent() { InternalTestCluster cluster1 = new InternalTestCluster( clusterSeed, baseDir, - masterNodes, + clusterManagerNodes, randomBoolean(), minNumDataNodes, maxNumDataNodes, @@ -165,23 +165,23 @@ public static void assertSettings(Settings left, Settings right, boolean checkCl } public void testBeforeTest() throws Exception { - final boolean autoManageMinMasterNodes = randomBoolean(); + final boolean autoManageMinClusterManagerNodes = randomBoolean(); long clusterSeed = randomLong(); - final boolean masterNodes; + final boolean clusterManagerNodes; final int minNumDataNodes; final int maxNumDataNodes; - final int bootstrapMasterNodeIndex; - if (autoManageMinMasterNodes) { - masterNodes = randomBoolean(); + final int bootstrapClusterManagerNodeIndex; + if (autoManageMinClusterManagerNodes) { + clusterManagerNodes = randomBoolean(); minNumDataNodes = randomIntBetween(0, 3); maxNumDataNodes = randomIntBetween(minNumDataNodes, 4); - bootstrapMasterNodeIndex = -1; + bootstrapClusterManagerNodeIndex = -1; } else { - // if we manage min master nodes, we need to lock down the number of nodes + // if we manage min cluster-manager nodes, we need to lock down the number of nodes minNumDataNodes = randomIntBetween(0, 4); maxNumDataNodes = minNumDataNodes; - masterNodes = false; - bootstrapMasterNodeIndex = maxNumDataNodes == 0 ? -1 : randomIntBetween(0, maxNumDataNodes - 1); + clusterManagerNodes = false; + bootstrapClusterManagerNodeIndex = maxNumDataNodes == 0 ? -1 : randomIntBetween(0, maxNumDataNodes - 1); } final int numClientNodes = randomIntBetween(0, 2); NodeConfigurationSource nodeConfigurationSource = new NodeConfigurationSource() { @@ -191,9 +191,9 @@ public Settings nodeSettings(int nodeOrdinal) { .put(DiscoveryModule.DISCOVERY_SEED_PROVIDERS_SETTING.getKey(), "file") .putList(SettingsBasedSeedHostsProvider.DISCOVERY_SEED_HOSTS_SETTING.getKey()) .put(NetworkModule.TRANSPORT_TYPE_KEY, getTestTransportType()); - if (autoManageMinMasterNodes == false) { + if (autoManageMinClusterManagerNodes == false) { assert minNumDataNodes == maxNumDataNodes; - assert masterNodes == false; + assert clusterManagerNodes == false; } return settings.build(); } @@ -209,8 +209,8 @@ public Path nodeConfigPath(int nodeOrdinal) { InternalTestCluster cluster0 = new InternalTestCluster( clusterSeed, createTempDir(), - masterNodes, - autoManageMinMasterNodes, + clusterManagerNodes, + autoManageMinClusterManagerNodes, minNumDataNodes, maxNumDataNodes, "clustername", @@ -220,13 +220,13 @@ public Path nodeConfigPath(int nodeOrdinal) { mockPlugins(), Function.identity() ); - cluster0.setBootstrapMasterNodeIndex(bootstrapMasterNodeIndex); + cluster0.setBootstrapClusterManagerNodeIndex(bootstrapClusterManagerNodeIndex); InternalTestCluster cluster1 = new InternalTestCluster( clusterSeed, createTempDir(), - masterNodes, - autoManageMinMasterNodes, + clusterManagerNodes, + autoManageMinClusterManagerNodes, minNumDataNodes, maxNumDataNodes, "clustername", @@ -236,7 +236,7 @@ public Path nodeConfigPath(int nodeOrdinal) { mockPlugins(), Function.identity() ); - cluster1.setBootstrapMasterNodeIndex(bootstrapMasterNodeIndex); + cluster1.setBootstrapClusterManagerNodeIndex(bootstrapClusterManagerNodeIndex); assertClusters(cluster0, cluster1, false); long seed = randomLong(); @@ -265,7 +265,7 @@ public Path nodeConfigPath(int nodeOrdinal) { public void testDataFolderAssignmentAndCleaning() throws IOException, InterruptedException { long clusterSeed = randomLong(); - boolean masterNodes = randomBoolean(); + boolean clusterManagerNodes = randomBoolean(); // we need one stable node final int minNumDataNodes = 2; final int maxNumDataNodes = 2; @@ -291,7 +291,7 @@ public Path nodeConfigPath(int nodeOrdinal) { InternalTestCluster cluster = new InternalTestCluster( clusterSeed, baseDir, - masterNodes, + clusterManagerNodes, true, minNumDataNodes, maxNumDataNodes, @@ -304,13 +304,13 @@ public Path nodeConfigPath(int nodeOrdinal) { ); try { cluster.beforeTest(random()); - final int originalMasterCount = cluster.numMasterNodes(); + final int originalClusterManagerCount = cluster.numMasterNodes(); final Map shardNodePaths = new HashMap<>(); for (String name : cluster.getNodeNames()) { shardNodePaths.put(name, getNodePaths(cluster, name)); } String poorNode = randomValueOtherThanMany( - n -> originalMasterCount == 1 && n.equals(cluster.getMasterName()), + n -> originalClusterManagerCount == 1 && n.equals(cluster.getMasterName()), () -> randomFrom(cluster.getNodeNames()) ); Path dataPath = getNodePaths(cluster, poorNode)[0]; @@ -409,7 +409,7 @@ public Path nodeConfigPath(int nodeOrdinal) { roles.add(role); } - cluster.setBootstrapMasterNodeIndex( + cluster.setBootstrapClusterManagerNodeIndex( randomIntBetween(0, (int) roles.stream().filter(role -> role.equals(clusterManagerRole)).count() - 1) ); @@ -419,7 +419,7 @@ public Path nodeConfigPath(int nodeOrdinal) { final DiscoveryNodeRole role = roles.get(i); final String node; if (role == clusterManagerRole) { - node = cluster.startMasterOnlyNode(); + node = cluster.startClusterManagerOnlyNode(); } else if (role == DiscoveryNodeRole.DATA_ROLE) { node = cluster.startDataOnlyNode(); } else if (role == DiscoveryNodeRole.INGEST_ROLE) { From 905191154f420a682de6daef0e063712cbeb4fb8 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 12 May 2022 10:52:12 -0500 Subject: [PATCH 151/514] Bootstrap should implement a denylist of Java versions (ranges) (#3164) (#3292) Signed-off-by: Andriy Redko (cherry picked from commit 677915dc00f990957ff8ec6f9c8e450977c88a0e) --- .../opensearch/bootstrap/BootstrapChecks.java | 22 +++ .../bootstrap/jvm/DenyJvmVersionsParser.java | 169 ++++++++++++++++++ .../bootstrap/jvm/deny-jvm-versions.txt | 10 ++ .../bootstrap/BootstrapChecksTests.java | 29 +++ .../jvm/DenyJvmVersionsParserTests.java | 99 ++++++++++ 5 files changed, 329 insertions(+) create mode 100644 server/src/main/java/org/opensearch/bootstrap/jvm/DenyJvmVersionsParser.java create mode 100644 server/src/main/resources/org/opensearch/bootstrap/jvm/deny-jvm-versions.txt create mode 100644 server/src/test/java/org/opensearch/bootstrap/jvm/DenyJvmVersionsParserTests.java diff --git a/server/src/main/java/org/opensearch/bootstrap/BootstrapChecks.java b/server/src/main/java/org/opensearch/bootstrap/BootstrapChecks.java index 7953dee644ea4..5d595dc1abedf 100644 --- a/server/src/main/java/org/opensearch/bootstrap/BootstrapChecks.java +++ b/server/src/main/java/org/opensearch/bootstrap/BootstrapChecks.java @@ -36,6 +36,7 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; import org.apache.lucene.util.Constants; +import org.opensearch.bootstrap.jvm.DenyJvmVersionsParser; import org.opensearch.cluster.coordination.ClusterBootstrapService; import org.opensearch.common.SuppressForbidden; import org.opensearch.common.io.PathUtils; @@ -224,11 +225,32 @@ static List checks() { checks.add(new OnErrorCheck()); checks.add(new OnOutOfMemoryErrorCheck()); checks.add(new EarlyAccessCheck()); + checks.add(new JavaVersionCheck()); checks.add(new AllPermissionCheck()); checks.add(new DiscoveryConfiguredCheck()); return Collections.unmodifiableList(checks); } + static class JavaVersionCheck implements BootstrapCheck { + @Override + public BootstrapCheckResult check(BootstrapContext context) { + return DenyJvmVersionsParser.getDeniedJvmVersions() + .stream() + .filter(p -> p.test(getVersion())) + .findAny() + .map( + p -> BootstrapCheckResult.failure( + String.format(Locale.ROOT, "The current JVM version %s is not recommended for use: %s", getVersion(), p.getReason()) + ) + ) + .orElseGet(() -> BootstrapCheckResult.success()); + } + + Runtime.Version getVersion() { + return Runtime.version(); + } + } + static class HeapSizeCheck implements BootstrapCheck { @Override diff --git a/server/src/main/java/org/opensearch/bootstrap/jvm/DenyJvmVersionsParser.java b/server/src/main/java/org/opensearch/bootstrap/jvm/DenyJvmVersionsParser.java new file mode 100644 index 0000000000000..a9c908c058508 --- /dev/null +++ b/server/src/main/java/org/opensearch/bootstrap/jvm/DenyJvmVersionsParser.java @@ -0,0 +1,169 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.bootstrap.jvm; + +import org.opensearch.common.Nullable; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.UncheckedIOException; +import java.lang.Runtime.Version; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Collection; +import java.util.function.Predicate; +import java.util.stream.Collectors; + +/** + * Parses the list of JVM versions which should be denied to run Opensearch engine with due to discovered + * issues or flaws. + */ +public class DenyJvmVersionsParser { + public interface VersionPredicate extends Predicate { + String getReason(); + } + + private static class SingleVersion implements VersionPredicate { + final private Version version; + final private String reason; + + public SingleVersion(Version version, String reason) { + this.version = version; + this.reason = reason; + } + + @Override + public boolean test(Version v) { + return version.compareTo(v) == 0; + } + + @Override + public String getReason() { + return reason; + } + } + + private static class VersionRange implements VersionPredicate { + private Version lower; + private boolean lowerIncluded; + private Version upper; + private boolean upperIncluded; + private String reason; + + public VersionRange(@Nullable Version lower, boolean lowerIncluded, @Nullable Version upper, boolean upperIncluded, String reason) { + this.lower = lower; + this.lowerIncluded = lowerIncluded; + this.upper = upper; + this.upperIncluded = upperIncluded; + this.reason = reason; + } + + @Override + public boolean test(Version v) { + if (lower != null) { + int compare = lower.compareTo(v); + if (compare > 0 || (compare == 0 && lowerIncluded != true)) { + return false; + } + } + + if (upper != null) { + int compare = upper.compareTo(v); + if (compare < 0 || (compare == 0 && upperIncluded != true)) { + return false; + } + } + + return true; + } + + @Override + public String getReason() { + return reason; + } + } + + public static Collection getDeniedJvmVersions() { + try ( + final InputStreamReader in = new InputStreamReader( + DenyJvmVersionsParser.class.getResourceAsStream("deny-jvm-versions.txt"), + StandardCharsets.UTF_8 + ) + ) { + try (final BufferedReader reader = new BufferedReader(in)) { + return reader.lines() + .map(String::trim) + // filter empty lines + .filter(line -> line.isEmpty() == false) + // filter out all comments + .filter(line -> line.startsWith("//") == false) + .map(DenyJvmVersionsParser::parse) + .collect(Collectors.toList()); + } + } catch (final IOException ex) { + throw new UncheckedIOException("Unable to read the list of denied JVM versions", ex); + } + } + + /** + * Parse individual line from the list of denied JVM versions. Some version and version range examples are: + *
      + *
    • 11.0.2: "... reason ..." - version 11.0.2
    • + *
    • [11.0.2, 11.0.14): "... reason ..." - versions 11.0.2.2 (included) to 11.0.14 (not included)
    • + *
    • [11.0.2, 11.0.14]: "... reason ..." - versions 11.0.2 to 11.0.14 (both included)
    • + *
    • [11.0.2,): "... reason ..." - versions 11.0.2 and higher
    • + *
    + * @param line line to parse + * @return version or version range predicate + */ + static VersionPredicate parse(String line) { + final String[] parts = Arrays.stream(line.split("[:]", 2)).map(String::trim).toArray(String[]::new); + + if (parts.length != 2) { + throw new IllegalArgumentException("Unable to parse JVM version or version range: " + line); + } + + final String versionOrRange = parts[0]; + final String reason = parts[1]; + + // dealing with version range here + if (versionOrRange.startsWith("[") == true || versionOrRange.startsWith("(") == true) { + if (versionOrRange.endsWith("]") == false && versionOrRange.endsWith(")") == false) { + throw new IllegalArgumentException("Unable to parse JVM version range: " + versionOrRange); + } + + final boolean lowerIncluded = versionOrRange.startsWith("["); + final boolean upperIncluded = versionOrRange.endsWith("]"); + + final String[] range = Arrays.stream(versionOrRange.substring(1, versionOrRange.length() - 1).split("[,]", 2)) + .map(String::trim) + .toArray(String[]::new); + + if (range.length != 2) { + throw new IllegalArgumentException("Unable to parse JVM version range: " + versionOrRange); + } + + Version lower = null; + if (range[0].isEmpty() == false && range[0].equals("*") == false) { + lower = Version.parse(range[0]); + } + + Version upper = null; + if (range[1].isEmpty() == false && range[1].equals("*") == false) { + upper = Version.parse(range[1]); + } + + return new VersionRange(lower, lowerIncluded, upper, upperIncluded, reason); + } else { + // this is just a single version + return new SingleVersion(Version.parse(versionOrRange), reason); + } + } +} diff --git a/server/src/main/resources/org/opensearch/bootstrap/jvm/deny-jvm-versions.txt b/server/src/main/resources/org/opensearch/bootstrap/jvm/deny-jvm-versions.txt new file mode 100644 index 0000000000000..e3bfbea397570 --- /dev/null +++ b/server/src/main/resources/org/opensearch/bootstrap/jvm/deny-jvm-versions.txt @@ -0,0 +1,10 @@ +// Some version and version range examples are: +// 11.0.2: <... reason ...> version 11.0.2. +// [11.0.2, 11.0.14): <... reason ...> versions 11.0.2.2 (included) to 11.0.14 (not included) +// [11.0.2, 11.0.14]: <... reason ...> versions 11.0.2 to 11.0.14 (both included) +// [11.0.2,): <... reason ...> versions 11.0.2 and higher +// [11.0.2,*): <... reason ...> versions 11.0.2 and higher +// (, 11.0.14]: <... reason ...> versions up to 11.0.14 (included) +// (*, 11.0.14]: <... reason ...> versions up to 11.0.14 (included) + +[11.0.2, 11.0.14): for more details, please check https://github.com/opensearch-project/OpenSearch/issues/2791 and https://bugs.openjdk.java.net/browse/JDK-8259541 \ No newline at end of file diff --git a/server/src/test/java/org/opensearch/bootstrap/BootstrapChecksTests.java b/server/src/test/java/org/opensearch/bootstrap/BootstrapChecksTests.java index 88f2047ffaa0f..8edb204ac0402 100644 --- a/server/src/test/java/org/opensearch/bootstrap/BootstrapChecksTests.java +++ b/server/src/test/java/org/opensearch/bootstrap/BootstrapChecksTests.java @@ -47,6 +47,7 @@ import org.opensearch.test.AbstractBootstrapCheckTestCase; import org.hamcrest.Matcher; +import java.lang.Runtime.Version; import java.net.InetAddress; import java.util.ArrayList; import java.util.Arrays; @@ -745,4 +746,32 @@ public void testDiscoveryConfiguredCheck() throws NodeValidationException { // Validate the deprecated setting is still valid during the node bootstrap. ensureChecksPass.accept(Settings.builder().putList(ClusterBootstrapService.INITIAL_MASTER_NODES_SETTING.getKey())); } + + public void testJvmVersionCheck() throws NodeValidationException { + final AtomicReference version = new AtomicReference<>(Version.parse("11.0.13+8")); + final BootstrapCheck check = new BootstrapChecks.JavaVersionCheck() { + @Override + Version getVersion() { + return version.get(); + } + }; + + final NodeValidationException e = expectThrows( + NodeValidationException.class, + () -> BootstrapChecks.check(emptyContext, true, Collections.singletonList(check)) + ); + assertThat( + e.getMessage(), + containsString( + "The current JVM version 11.0.13+8 is not recommended for use: " + + "for more details, please check https://github.com/opensearch-project/OpenSearch/issues/2791 and https://bugs.openjdk.java.net/browse/JDK-8259541" + ) + ); + + version.set(Version.parse("11.0.14")); + BootstrapChecks.check(emptyContext, true, Collections.singletonList(check)); + + version.set(Runtime.version()); + BootstrapChecks.check(emptyContext, true, Collections.singletonList(check)); + } } diff --git a/server/src/test/java/org/opensearch/bootstrap/jvm/DenyJvmVersionsParserTests.java b/server/src/test/java/org/opensearch/bootstrap/jvm/DenyJvmVersionsParserTests.java new file mode 100644 index 0000000000000..c0507c54be36a --- /dev/null +++ b/server/src/test/java/org/opensearch/bootstrap/jvm/DenyJvmVersionsParserTests.java @@ -0,0 +1,99 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.bootstrap.jvm; + +import org.opensearch.bootstrap.jvm.DenyJvmVersionsParser.VersionPredicate; +import org.opensearch.test.OpenSearchTestCase; + +import java.lang.Runtime.Version; +import java.util.Collection; + +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.collection.IsEmptyCollection.empty; + +public class DenyJvmVersionsParserTests extends OpenSearchTestCase { + public void testDefaults() { + final Collection versions = DenyJvmVersionsParser.getDeniedJvmVersions(); + assertThat(versions, not(empty())); + } + + public void testSingleVersion() { + final VersionPredicate predicate = DenyJvmVersionsParser.parse("11.0.2: know to be flawed version"); + assertThat(predicate.test(Version.parse("11.0.2")), is(true)); + assertThat(predicate.test(Version.parse("11.0.1")), is(false)); + assertThat(predicate.test(Version.parse("11.0.3")), is(false)); + assertThat(predicate.getReason(), equalTo("know to be flawed version")); + } + + public void testVersionRangeLowerIncluded() { + final VersionPredicate predicate = DenyJvmVersionsParser.parse("[11.0.2, 11.0.14): know to be flawed version"); + assertThat(predicate.test(Version.parse("11.0.2")), is(true)); + assertThat(predicate.test(Version.parse("11.0.1")), is(false)); + assertThat(predicate.test(Version.parse("11.0.13+1")), is(true)); + assertThat(predicate.test(Version.parse("11.0.14")), is(false)); + assertThat(predicate.getReason(), equalTo("know to be flawed version")); + } + + public void testVersionRangeUpperIncluded() { + final VersionPredicate predicate = DenyJvmVersionsParser.parse("[11.0.2,): know to be flawed version"); + assertThat(predicate.test(Version.parse("11.0.2")), is(true)); + assertThat(predicate.test(Version.parse("11.0.1")), is(false)); + assertThat(predicate.test(Version.parse("11.0.13+1")), is(true)); + assertThat(predicate.test(Version.parse("11.0.14")), is(true)); + assertThat(predicate.test(Version.parse("17.2.1")), is(true)); + assertThat(predicate.getReason(), equalTo("know to be flawed version")); + } + + public void testVersionRangeLowerAndUpperIncluded() { + final VersionPredicate predicate = DenyJvmVersionsParser.parse("[11.0.2, 11.0.14]: know to be flawed version"); + assertThat(predicate.test(Version.parse("11.0.2")), is(true)); + assertThat(predicate.test(Version.parse("11.0.1")), is(false)); + assertThat(predicate.test(Version.parse("11.0.13+1")), is(true)); + assertThat(predicate.test(Version.parse("11.0.14")), is(true)); + assertThat(predicate.test(Version.parse("11.0.14.1")), is(false)); + assertThat(predicate.test(Version.parse("11.0.15")), is(false)); + assertThat(predicate.getReason(), equalTo("know to be flawed version")); + } + + public void testAllVersionsRange() { + final VersionPredicate predicate = DenyJvmVersionsParser.parse("(,): know to be flawed version"); + assertThat(predicate.test(Version.parse("11.0.2")), is(true)); + assertThat(predicate.test(Version.parse("11.0.1")), is(true)); + assertThat(predicate.test(Version.parse("11.0.13+1")), is(true)); + assertThat(predicate.test(Version.parse("11.0.14")), is(true)); + assertThat(predicate.test(Version.parse("11.0.14.1")), is(true)); + assertThat(predicate.test(Version.parse("11.0.15")), is(true)); + assertThat(predicate.test(Version.parse("17.2.1")), is(true)); + assertThat(predicate.getReason(), equalTo("know to be flawed version")); + } + + public void testAllVersionsRangeIncluded() { + final VersionPredicate predicate = DenyJvmVersionsParser.parse("[*, *]: know to be flawed version"); + assertThat(predicate.test(Version.parse("11.0.2")), is(true)); + assertThat(predicate.test(Version.parse("11.0.1")), is(true)); + assertThat(predicate.test(Version.parse("11.0.13+1")), is(true)); + assertThat(predicate.test(Version.parse("11.0.14")), is(true)); + assertThat(predicate.test(Version.parse("11.0.14.1")), is(true)); + assertThat(predicate.test(Version.parse("11.0.15")), is(true)); + assertThat(predicate.test(Version.parse("17.2.1")), is(true)); + assertThat(predicate.getReason(), equalTo("know to be flawed version")); + } + + public void testIncorrectVersionRanges() { + assertThrows(IllegalArgumentException.class, () -> DenyJvmVersionsParser.parse("[*, *: know to be flawed version")); + assertThrows(IllegalArgumentException.class, () -> DenyJvmVersionsParser.parse("*, *: know to be flawed version")); + assertThrows(IllegalArgumentException.class, () -> DenyJvmVersionsParser.parse("*, *): know to be flawed version")); + assertThrows(IllegalArgumentException.class, () -> DenyJvmVersionsParser.parse("(): know to be flawed version")); + assertThrows(IllegalArgumentException.class, () -> DenyJvmVersionsParser.parse("[]: know to be flawed version")); + assertThrows(IllegalArgumentException.class, () -> DenyJvmVersionsParser.parse("[,]")); + assertThrows(IllegalArgumentException.class, () -> DenyJvmVersionsParser.parse("11.0.2")); + } +} From 7d4eba6be9f76dfc40722527604a92d6422aba83 Mon Sep 17 00:00:00 2001 From: Nick Knize Date: Fri, 13 May 2022 11:42:48 -0500 Subject: [PATCH 152/514] [Javadocs] add to o.o.action.admin (#3155) (#3303) Adds javadocs to classes in package o.o.action.admin. Signed-off-by: Nicholas Walter Knize --- gradle/missing-javadoc.gradle | 2 +- .../cluster/allocation/ClusterAllocationExplainAction.java | 2 ++ .../allocation/ClusterAllocationExplainRequest.java | 2 ++ .../allocation/ClusterAllocationExplainRequestBuilder.java | 2 ++ .../allocation/ClusterAllocationExplainResponse.java | 2 ++ .../cluster/allocation/ClusterAllocationExplanation.java | 2 ++ .../TransportClusterAllocationExplainAction.java | 2 ++ .../configuration/AddVotingConfigExclusionsAction.java | 7 ++++++- .../configuration/AddVotingConfigExclusionsRequest.java | 2 ++ .../configuration/AddVotingConfigExclusionsResponse.java | 2 ++ .../configuration/ClearVotingConfigExclusionsAction.java | 5 +++++ .../configuration/ClearVotingConfigExclusionsRequest.java | 2 ++ .../configuration/ClearVotingConfigExclusionsResponse.java | 2 ++ .../TransportAddVotingConfigExclusionsAction.java | 5 +++++ .../TransportClearVotingConfigExclusionsAction.java | 5 +++++ .../action/admin/cluster/health/ClusterHealthAction.java | 5 +++++ .../action/admin/cluster/health/ClusterHealthRequest.java | 5 +++++ .../admin/cluster/health/ClusterHealthRequestBuilder.java | 5 +++++ .../action/admin/cluster/health/ClusterHealthResponse.java | 5 +++++ .../admin/cluster/health/TransportClusterHealthAction.java | 5 +++++ .../admin/cluster/node/hotthreads/NodeHotThreads.java | 5 +++++ .../cluster/node/hotthreads/NodesHotThreadsAction.java | 5 +++++ .../cluster/node/hotthreads/NodesHotThreadsRequest.java | 5 +++++ .../node/hotthreads/NodesHotThreadsRequestBuilder.java | 5 +++++ .../cluster/node/hotthreads/NodesHotThreadsResponse.java | 5 +++++ .../node/hotthreads/TransportNodesHotThreadsAction.java | 5 +++++ .../action/admin/cluster/node/info/NodeInfo.java | 2 ++ .../action/admin/cluster/node/info/NodesInfoAction.java | 5 +++++ .../action/admin/cluster/node/info/NodesInfoRequest.java | 2 ++ .../admin/cluster/node/info/NodesInfoRequestBuilder.java | 5 +++++ .../action/admin/cluster/node/info/NodesInfoResponse.java | 5 +++++ .../action/admin/cluster/node/info/PluginsAndModules.java | 2 ++ .../admin/cluster/node/info/TransportNodesInfoAction.java | 5 +++++ .../admin/cluster/node/liveness/LivenessRequest.java | 2 ++ .../admin/cluster/node/liveness/LivenessResponse.java | 2 ++ .../cluster/node/liveness/TransportLivenessAction.java | 5 +++++ .../node/reload/NodesReloadSecureSettingsAction.java | 5 +++++ .../node/reload/NodesReloadSecureSettingsRequest.java | 2 ++ .../reload/NodesReloadSecureSettingsRequestBuilder.java | 2 ++ .../node/reload/NodesReloadSecureSettingsResponse.java | 2 ++ .../reload/TransportNodesReloadSecureSettingsAction.java | 5 +++++ .../action/admin/cluster/node/stats/NodeStats.java | 2 ++ .../action/admin/cluster/node/stats/NodesStatsAction.java | 5 +++++ .../action/admin/cluster/node/stats/NodesStatsRequest.java | 2 ++ .../admin/cluster/node/stats/NodesStatsRequestBuilder.java | 5 +++++ .../admin/cluster/node/stats/NodesStatsResponse.java | 5 +++++ .../cluster/node/stats/TransportNodesStatsAction.java | 5 +++++ .../admin/cluster/node/tasks/cancel/CancelTasksAction.java | 2 ++ .../cluster/node/tasks/cancel/CancelTasksRequest.java | 2 ++ .../node/tasks/cancel/CancelTasksRequestBuilder.java | 2 ++ .../cluster/node/tasks/cancel/CancelTasksResponse.java | 2 ++ .../node/tasks/cancel/TransportCancelTasksAction.java | 2 ++ .../action/admin/cluster/node/tasks/get/GetTaskAction.java | 2 ++ .../admin/cluster/node/tasks/get/GetTaskRequest.java | 2 ++ .../cluster/node/tasks/get/GetTaskRequestBuilder.java | 2 ++ .../admin/cluster/node/tasks/get/GetTaskResponse.java | 2 ++ .../cluster/node/tasks/get/TransportGetTaskAction.java | 2 ++ .../admin/cluster/node/tasks/list/ListTasksAction.java | 2 ++ .../admin/cluster/node/tasks/list/ListTasksRequest.java | 2 ++ .../cluster/node/tasks/list/ListTasksRequestBuilder.java | 2 ++ .../admin/cluster/node/tasks/list/ListTasksResponse.java | 2 ++ .../action/admin/cluster/node/tasks/list/TaskGroup.java | 2 ++ .../cluster/node/tasks/list/TransportListTasksAction.java | 5 +++++ .../action/admin/cluster/node/usage/NodeUsage.java | 5 +++++ .../action/admin/cluster/node/usage/NodesUsageAction.java | 5 +++++ .../action/admin/cluster/node/usage/NodesUsageRequest.java | 5 +++++ .../admin/cluster/node/usage/NodesUsageRequestBuilder.java | 5 +++++ .../admin/cluster/node/usage/NodesUsageResponse.java | 2 ++ .../cluster/node/usage/TransportNodesUsageAction.java | 5 +++++ .../action/admin/cluster/remote/RemoteInfoAction.java | 5 +++++ .../action/admin/cluster/remote/RemoteInfoRequest.java | 5 +++++ .../admin/cluster/remote/RemoteInfoRequestBuilder.java | 5 +++++ .../action/admin/cluster/remote/RemoteInfoResponse.java | 5 +++++ .../admin/cluster/remote/TransportRemoteInfoAction.java | 5 +++++ .../repositories/cleanup/CleanupRepositoryAction.java | 5 +++++ .../repositories/cleanup/CleanupRepositoryRequest.java | 5 +++++ .../cleanup/CleanupRepositoryRequestBuilder.java | 5 +++++ .../repositories/cleanup/CleanupRepositoryResponse.java | 5 +++++ .../cleanup/TransportCleanupRepositoryAction.java | 2 ++ .../repositories/delete/DeleteRepositoryAction.java | 2 ++ .../repositories/delete/DeleteRepositoryRequest.java | 2 ++ .../delete/DeleteRepositoryRequestBuilder.java | 2 ++ .../delete/TransportDeleteRepositoryAction.java | 2 ++ .../cluster/repositories/get/GetRepositoriesAction.java | 2 ++ .../cluster/repositories/get/GetRepositoriesRequest.java | 2 ++ .../repositories/get/GetRepositoriesRequestBuilder.java | 2 ++ .../cluster/repositories/get/GetRepositoriesResponse.java | 2 ++ .../repositories/get/TransportGetRepositoriesAction.java | 2 ++ .../cluster/repositories/put/PutRepositoryAction.java | 2 ++ .../cluster/repositories/put/PutRepositoryRequest.java | 2 ++ .../repositories/put/PutRepositoryRequestBuilder.java | 2 ++ .../repositories/put/TransportPutRepositoryAction.java | 2 ++ .../verify/TransportVerifyRepositoryAction.java | 2 ++ .../repositories/verify/VerifyRepositoryAction.java | 2 ++ .../repositories/verify/VerifyRepositoryRequest.java | 2 ++ .../verify/VerifyRepositoryRequestBuilder.java | 2 ++ .../repositories/verify/VerifyRepositoryResponse.java | 2 ++ .../action/admin/cluster/reroute/ClusterRerouteAction.java | 5 +++++ .../admin/cluster/reroute/ClusterRerouteRequest.java | 2 ++ .../cluster/reroute/ClusterRerouteRequestBuilder.java | 2 ++ .../admin/cluster/reroute/ClusterRerouteResponse.java | 2 ++ .../cluster/reroute/TransportClusterRerouteAction.java | 5 +++++ .../admin/cluster/settings/ClusterGetSettingsRequest.java | 2 ++ .../admin/cluster/settings/ClusterGetSettingsResponse.java | 2 ++ .../cluster/settings/ClusterUpdateSettingsAction.java | 5 +++++ .../cluster/settings/ClusterUpdateSettingsRequest.java | 2 ++ .../settings/ClusterUpdateSettingsRequestBuilder.java | 2 ++ .../cluster/settings/ClusterUpdateSettingsResponse.java | 2 ++ .../action/admin/cluster/settings/SettingsUpdater.java | 2 ++ .../settings/TransportClusterUpdateSettingsAction.java | 5 +++++ .../admin/cluster/shards/ClusterSearchShardsAction.java | 5 +++++ .../admin/cluster/shards/ClusterSearchShardsGroup.java | 5 +++++ .../admin/cluster/shards/ClusterSearchShardsRequest.java | 5 +++++ .../cluster/shards/ClusterSearchShardsRequestBuilder.java | 5 +++++ .../admin/cluster/shards/ClusterSearchShardsResponse.java | 5 +++++ .../cluster/shards/TransportClusterSearchShardsAction.java | 5 +++++ .../admin/cluster/snapshots/clone/CloneSnapshotAction.java | 5 +++++ .../cluster/snapshots/clone/CloneSnapshotRequest.java | 5 +++++ .../snapshots/clone/CloneSnapshotRequestBuilder.java | 5 +++++ .../snapshots/clone/TransportCloneSnapshotAction.java | 2 ++ .../cluster/snapshots/create/CreateSnapshotAction.java | 2 ++ .../cluster/snapshots/create/CreateSnapshotRequest.java | 2 ++ .../snapshots/create/CreateSnapshotRequestBuilder.java | 2 ++ .../cluster/snapshots/create/CreateSnapshotResponse.java | 2 ++ .../snapshots/create/TransportCreateSnapshotAction.java | 2 ++ .../cluster/snapshots/delete/DeleteSnapshotAction.java | 2 ++ .../cluster/snapshots/delete/DeleteSnapshotRequest.java | 2 ++ .../snapshots/delete/DeleteSnapshotRequestBuilder.java | 2 ++ .../snapshots/delete/TransportDeleteSnapshotAction.java | 2 ++ .../admin/cluster/snapshots/get/GetSnapshotsAction.java | 2 ++ .../admin/cluster/snapshots/get/GetSnapshotsRequest.java | 2 ++ .../cluster/snapshots/get/GetSnapshotsRequestBuilder.java | 2 ++ .../admin/cluster/snapshots/get/GetSnapshotsResponse.java | 2 ++ .../cluster/snapshots/get/TransportGetSnapshotsAction.java | 2 ++ .../snapshots/restore/RestoreClusterStateListener.java | 5 +++++ .../cluster/snapshots/restore/RestoreSnapshotAction.java | 2 ++ .../cluster/snapshots/restore/RestoreSnapshotRequest.java | 2 ++ .../snapshots/restore/RestoreSnapshotRequestBuilder.java | 2 ++ .../cluster/snapshots/restore/RestoreSnapshotResponse.java | 2 ++ .../snapshots/restore/TransportRestoreSnapshotAction.java | 2 ++ .../cluster/snapshots/status/SnapshotIndexShardStage.java | 5 +++++ .../cluster/snapshots/status/SnapshotIndexShardStatus.java | 5 +++++ .../cluster/snapshots/status/SnapshotIndexStatus.java | 2 ++ .../cluster/snapshots/status/SnapshotShardsStats.java | 2 ++ .../admin/cluster/snapshots/status/SnapshotStats.java | 5 +++++ .../admin/cluster/snapshots/status/SnapshotStatus.java | 2 ++ .../cluster/snapshots/status/SnapshotsStatusAction.java | 2 ++ .../cluster/snapshots/status/SnapshotsStatusRequest.java | 2 ++ .../snapshots/status/SnapshotsStatusRequestBuilder.java | 2 ++ .../cluster/snapshots/status/SnapshotsStatusResponse.java | 2 ++ .../snapshots/status/TransportNodesSnapshotsStatus.java | 2 ++ .../snapshots/status/TransportSnapshotsStatusAction.java | 5 +++++ .../action/admin/cluster/state/ClusterStateAction.java | 5 +++++ .../action/admin/cluster/state/ClusterStateRequest.java | 5 +++++ .../admin/cluster/state/ClusterStateRequestBuilder.java | 5 +++++ .../action/admin/cluster/state/ClusterStateResponse.java | 2 ++ .../admin/cluster/state/TransportClusterStateAction.java | 5 +++++ .../action/admin/cluster/stats/AnalysisStats.java | 2 ++ .../action/admin/cluster/stats/ClusterStatsAction.java | 5 +++++ .../action/admin/cluster/stats/ClusterStatsIndices.java | 5 +++++ .../admin/cluster/stats/ClusterStatsNodeResponse.java | 5 +++++ .../action/admin/cluster/stats/ClusterStatsNodes.java | 5 +++++ .../action/admin/cluster/stats/ClusterStatsRequest.java | 2 ++ .../admin/cluster/stats/ClusterStatsRequestBuilder.java | 5 +++++ .../action/admin/cluster/stats/ClusterStatsResponse.java | 5 +++++ .../action/admin/cluster/stats/IndexFeatureStats.java | 2 ++ .../action/admin/cluster/stats/MappingStats.java | 2 ++ .../action/admin/cluster/stats/MappingVisitor.java | 5 +++++ .../admin/cluster/stats/TransportClusterStatsAction.java | 5 +++++ .../cluster/storedscripts/DeleteStoredScriptAction.java | 5 +++++ .../cluster/storedscripts/DeleteStoredScriptRequest.java | 5 +++++ .../storedscripts/DeleteStoredScriptRequestBuilder.java | 5 +++++ .../cluster/storedscripts/GetScriptContextAction.java | 5 +++++ .../cluster/storedscripts/GetScriptContextRequest.java | 5 +++++ .../cluster/storedscripts/GetScriptContextResponse.java | 5 +++++ .../cluster/storedscripts/GetScriptLanguageAction.java | 5 +++++ .../cluster/storedscripts/GetScriptLanguageRequest.java | 5 +++++ .../cluster/storedscripts/GetScriptLanguageResponse.java | 5 +++++ .../admin/cluster/storedscripts/GetStoredScriptAction.java | 5 +++++ .../cluster/storedscripts/GetStoredScriptRequest.java | 5 +++++ .../storedscripts/GetStoredScriptRequestBuilder.java | 5 +++++ .../cluster/storedscripts/GetStoredScriptResponse.java | 5 +++++ .../admin/cluster/storedscripts/PutStoredScriptAction.java | 5 +++++ .../cluster/storedscripts/PutStoredScriptRequest.java | 5 +++++ .../storedscripts/PutStoredScriptRequestBuilder.java | 5 +++++ .../storedscripts/TransportDeleteStoredScriptAction.java | 5 +++++ .../storedscripts/TransportGetScriptContextAction.java | 5 +++++ .../storedscripts/TransportGetScriptLanguageAction.java | 5 +++++ .../storedscripts/TransportGetStoredScriptAction.java | 5 +++++ .../storedscripts/TransportPutStoredScriptAction.java | 5 +++++ .../admin/cluster/tasks/PendingClusterTasksAction.java | 5 +++++ .../admin/cluster/tasks/PendingClusterTasksRequest.java | 5 +++++ .../cluster/tasks/PendingClusterTasksRequestBuilder.java | 5 +++++ .../admin/cluster/tasks/PendingClusterTasksResponse.java | 5 +++++ .../cluster/tasks/TransportPendingClusterTasksAction.java | 5 +++++ .../org/opensearch/action/admin/indices/alias/Alias.java | 2 ++ .../action/admin/indices/alias/IndicesAliasesAction.java | 5 +++++ .../alias/IndicesAliasesClusterStateUpdateRequest.java | 2 ++ .../action/admin/indices/alias/IndicesAliasesRequest.java | 2 ++ .../admin/indices/alias/IndicesAliasesRequestBuilder.java | 2 ++ .../admin/indices/alias/TransportIndicesAliasesAction.java | 2 ++ .../admin/indices/alias/get/BaseAliasesRequestBuilder.java | 5 +++++ .../action/admin/indices/alias/get/GetAliasesAction.java | 5 +++++ .../action/admin/indices/alias/get/GetAliasesRequest.java | 5 +++++ .../admin/indices/alias/get/GetAliasesRequestBuilder.java | 5 +++++ .../action/admin/indices/alias/get/GetAliasesResponse.java | 5 +++++ .../admin/indices/alias/get/TransportGetAliasesAction.java | 5 +++++ .../action/admin/indices/analyze/AnalyzeAction.java | 5 +++++ .../admin/indices/analyze/AnalyzeRequestBuilder.java | 5 +++++ .../admin/indices/analyze/TransportAnalyzeAction.java | 2 ++ .../admin/indices/cache/clear/ClearIndicesCacheAction.java | 5 +++++ .../indices/cache/clear/ClearIndicesCacheRequest.java | 5 +++++ .../cache/clear/ClearIndicesCacheRequestBuilder.java | 5 +++++ .../indices/cache/clear/ClearIndicesCacheResponse.java | 2 ++ .../cache/clear/TransportClearIndicesCacheAction.java | 2 ++ .../action/admin/indices/close/CloseIndexAction.java | 5 +++++ .../indices/close/CloseIndexClusterStateUpdateRequest.java | 2 ++ .../action/admin/indices/close/CloseIndexRequest.java | 2 ++ .../admin/indices/close/CloseIndexRequestBuilder.java | 2 ++ .../action/admin/indices/close/CloseIndexResponse.java | 5 +++++ .../admin/indices/close/TransportCloseIndexAction.java | 2 ++ .../close/TransportVerifyShardBeforeCloseAction.java | 5 +++++ .../action/admin/indices/create/AutoCreateAction.java | 2 ++ .../action/admin/indices/create/CreateIndexAction.java | 5 +++++ .../create/CreateIndexClusterStateUpdateRequest.java | 2 ++ .../action/admin/indices/create/CreateIndexRequest.java | 2 ++ .../admin/indices/create/CreateIndexRequestBuilder.java | 2 ++ .../action/admin/indices/create/CreateIndexResponse.java | 2 ++ .../admin/indices/create/TransportCreateIndexAction.java | 2 ++ .../action/admin/indices/dangling/DanglingIndexInfo.java | 2 ++ .../indices/dangling/delete/DeleteDanglingIndexAction.java | 2 ++ .../dangling/delete/DeleteDanglingIndexRequest.java | 2 ++ .../delete/TransportDeleteDanglingIndexAction.java | 2 ++ .../indices/dangling/find/FindDanglingIndexAction.java | 2 ++ .../indices/dangling/find/FindDanglingIndexRequest.java | 5 +++++ .../indices/dangling/find/FindDanglingIndexResponse.java | 2 ++ .../dangling/find/NodeFindDanglingIndexRequest.java | 2 ++ .../dangling/find/NodeFindDanglingIndexResponse.java | 2 ++ .../dangling/find/TransportFindDanglingIndexAction.java | 2 ++ .../dangling/import_index/ImportDanglingIndexAction.java | 2 ++ .../dangling/import_index/ImportDanglingIndexRequest.java | 2 ++ .../import_index/TransportImportDanglingIndexAction.java | 2 ++ .../indices/dangling/list/ListDanglingIndicesAction.java | 2 ++ .../indices/dangling/list/ListDanglingIndicesRequest.java | 5 +++++ .../indices/dangling/list/ListDanglingIndicesResponse.java | 2 ++ .../dangling/list/NodeListDanglingIndicesRequest.java | 2 ++ .../dangling/list/NodeListDanglingIndicesResponse.java | 2 ++ .../dangling/list/TransportListDanglingIndicesAction.java | 2 ++ .../admin/indices/datastream/CreateDataStreamAction.java | 5 +++++ .../admin/indices/datastream/DataStreamsStatsAction.java | 5 +++++ .../admin/indices/datastream/DeleteDataStreamAction.java | 5 +++++ .../admin/indices/datastream/GetDataStreamAction.java | 5 +++++ .../action/admin/indices/delete/DeleteIndexAction.java | 5 +++++ .../delete/DeleteIndexClusterStateUpdateRequest.java | 2 ++ .../action/admin/indices/delete/DeleteIndexRequest.java | 2 ++ .../admin/indices/delete/DeleteIndexRequestBuilder.java | 5 +++++ .../admin/indices/delete/TransportDeleteIndexAction.java | 2 ++ .../admin/indices/exists/indices/IndicesExistsAction.java | 5 +++++ .../admin/indices/exists/indices/IndicesExistsRequest.java | 5 +++++ .../exists/indices/IndicesExistsRequestBuilder.java | 5 +++++ .../indices/exists/indices/IndicesExistsResponse.java | 5 +++++ .../exists/indices/TransportIndicesExistsAction.java | 2 ++ .../opensearch/action/admin/indices/flush/FlushAction.java | 5 +++++ .../action/admin/indices/flush/FlushRequest.java | 2 ++ .../action/admin/indices/flush/FlushRequestBuilder.java | 5 +++++ .../action/admin/indices/flush/FlushResponse.java | 2 ++ .../action/admin/indices/flush/ShardFlushRequest.java | 5 +++++ .../action/admin/indices/flush/TransportFlushAction.java | 2 ++ .../admin/indices/flush/TransportShardFlushAction.java | 5 +++++ .../action/admin/indices/forcemerge/ForceMergeAction.java | 5 +++++ .../action/admin/indices/forcemerge/ForceMergeRequest.java | 2 ++ .../admin/indices/forcemerge/ForceMergeRequestBuilder.java | 2 ++ .../admin/indices/forcemerge/ForceMergeResponse.java | 2 ++ .../indices/forcemerge/TransportForceMergeAction.java | 2 ++ .../action/admin/indices/get/GetIndexAction.java | 5 +++++ .../action/admin/indices/get/GetIndexRequest.java | 2 ++ .../action/admin/indices/get/GetIndexRequestBuilder.java | 5 +++++ .../action/admin/indices/get/GetIndexResponse.java | 2 ++ .../action/admin/indices/get/TransportGetIndexAction.java | 2 ++ .../admin/indices/mapping/get/GetFieldMappingsAction.java | 5 +++++ .../indices/mapping/get/GetFieldMappingsIndexRequest.java | 5 +++++ .../admin/indices/mapping/get/GetFieldMappingsRequest.java | 2 ++ .../mapping/get/GetFieldMappingsRequestBuilder.java | 6 +++++- .../indices/mapping/get/GetFieldMappingsResponse.java | 2 ++ .../admin/indices/mapping/get/GetMappingsAction.java | 5 +++++ .../admin/indices/mapping/get/GetMappingsRequest.java | 5 +++++ .../indices/mapping/get/GetMappingsRequestBuilder.java | 5 +++++ .../admin/indices/mapping/get/GetMappingsResponse.java | 5 +++++ .../mapping/get/TransportGetFieldMappingsAction.java | 5 +++++ .../mapping/get/TransportGetFieldMappingsIndexAction.java | 2 ++ .../indices/mapping/get/TransportGetMappingsAction.java | 5 +++++ .../admin/indices/mapping/put/AutoPutMappingAction.java | 5 +++++ .../action/admin/indices/mapping/put/PutMappingAction.java | 5 +++++ .../mapping/put/PutMappingClusterStateUpdateRequest.java | 2 ++ .../admin/indices/mapping/put/PutMappingRequest.java | 2 ++ .../indices/mapping/put/PutMappingRequestBuilder.java | 2 ++ .../indices/mapping/put/TransportAutoPutMappingAction.java | 5 +++++ .../indices/mapping/put/TransportPutMappingAction.java | 2 ++ .../action/admin/indices/open/OpenIndexAction.java | 5 +++++ .../indices/open/OpenIndexClusterStateUpdateRequest.java | 2 ++ .../action/admin/indices/open/OpenIndexRequest.java | 2 ++ .../action/admin/indices/open/OpenIndexRequestBuilder.java | 2 ++ .../action/admin/indices/open/OpenIndexResponse.java | 2 ++ .../admin/indices/open/TransportOpenIndexAction.java | 2 ++ .../action/admin/indices/readonly/AddIndexBlockAction.java | 5 +++++ .../readonly/AddIndexBlockClusterStateUpdateRequest.java | 2 ++ .../admin/indices/readonly/AddIndexBlockRequest.java | 2 ++ .../indices/readonly/AddIndexBlockRequestBuilder.java | 2 ++ .../admin/indices/readonly/AddIndexBlockResponse.java | 5 +++++ .../indices/readonly/TransportAddIndexBlockAction.java | 2 ++ .../readonly/TransportVerifyShardIndexBlockAction.java | 2 ++ .../action/admin/indices/recovery/RecoveryAction.java | 2 ++ .../action/admin/indices/recovery/RecoveryRequest.java | 2 ++ .../admin/indices/recovery/RecoveryRequestBuilder.java | 2 ++ .../action/admin/indices/recovery/RecoveryResponse.java | 2 ++ .../admin/indices/recovery/TransportRecoveryAction.java | 2 ++ .../action/admin/indices/refresh/RefreshAction.java | 5 +++++ .../action/admin/indices/refresh/RefreshRequest.java | 2 ++ .../admin/indices/refresh/RefreshRequestBuilder.java | 2 ++ .../action/admin/indices/refresh/RefreshResponse.java | 2 ++ .../admin/indices/refresh/TransportRefreshAction.java | 2 ++ .../admin/indices/refresh/TransportShardRefreshAction.java | 5 +++++ .../action/admin/indices/resolve/ResolveIndexAction.java | 5 +++++ .../action/admin/indices/rollover/Condition.java | 2 ++ .../action/admin/indices/rollover/MaxAgeCondition.java | 2 ++ .../action/admin/indices/rollover/MaxDocsCondition.java | 2 ++ .../action/admin/indices/rollover/MaxSizeCondition.java | 2 ++ .../admin/indices/rollover/MetadataRolloverService.java | 2 ++ .../action/admin/indices/rollover/RolloverAction.java | 5 +++++ .../action/admin/indices/rollover/RolloverInfo.java | 2 ++ .../action/admin/indices/rollover/RolloverRequest.java | 2 ++ .../admin/indices/rollover/RolloverRequestBuilder.java | 5 +++++ .../action/admin/indices/rollover/RolloverResponse.java | 2 ++ .../admin/indices/rollover/TransportRolloverAction.java | 2 ++ .../action/admin/indices/segments/IndexSegments.java | 5 +++++ .../action/admin/indices/segments/IndexShardSegments.java | 5 +++++ .../admin/indices/segments/IndicesSegmentResponse.java | 5 +++++ .../admin/indices/segments/IndicesSegmentsAction.java | 5 +++++ .../admin/indices/segments/IndicesSegmentsRequest.java | 5 +++++ .../indices/segments/IndicesSegmentsRequestBuilder.java | 5 +++++ .../action/admin/indices/segments/ShardSegments.java | 5 +++++ .../indices/segments/TransportIndicesSegmentsAction.java | 5 +++++ .../admin/indices/settings/get/GetSettingsAction.java | 5 +++++ .../admin/indices/settings/get/GetSettingsRequest.java | 5 +++++ .../indices/settings/get/GetSettingsRequestBuilder.java | 5 +++++ .../admin/indices/settings/get/GetSettingsResponse.java | 5 +++++ .../indices/settings/get/TransportGetSettingsAction.java | 5 +++++ .../settings/put/TransportUpdateSettingsAction.java | 5 +++++ .../admin/indices/settings/put/UpdateSettingsAction.java | 5 +++++ .../put/UpdateSettingsClusterStateUpdateRequest.java | 2 ++ .../admin/indices/settings/put/UpdateSettingsRequest.java | 2 ++ .../indices/settings/put/UpdateSettingsRequestBuilder.java | 2 ++ .../indices/shards/IndicesShardStoreRequestBuilder.java | 2 ++ .../admin/indices/shards/IndicesShardStoresAction.java | 2 ++ .../admin/indices/shards/IndicesShardStoresRequest.java | 2 ++ .../admin/indices/shards/IndicesShardStoresResponse.java | 2 ++ .../indices/shards/TransportIndicesShardStoresAction.java | 2 ++ .../action/admin/indices/shrink/ResizeAction.java | 5 +++++ .../action/admin/indices/shrink/ResizeRequest.java | 2 ++ .../action/admin/indices/shrink/ResizeRequestBuilder.java | 5 +++++ .../action/admin/indices/shrink/ResizeResponse.java | 2 ++ .../opensearch/action/admin/indices/shrink/ResizeType.java | 2 ++ .../action/admin/indices/shrink/TransportResizeAction.java | 2 ++ .../opensearch/action/admin/indices/stats/CommonStats.java | 5 +++++ .../action/admin/indices/stats/CommonStatsFlags.java | 5 +++++ .../action/admin/indices/stats/IndexShardStats.java | 5 +++++ .../opensearch/action/admin/indices/stats/IndexStats.java | 5 +++++ .../action/admin/indices/stats/IndicesStatsAction.java | 5 +++++ .../action/admin/indices/stats/IndicesStatsRequest.java | 2 ++ .../admin/indices/stats/IndicesStatsRequestBuilder.java | 2 ++ .../action/admin/indices/stats/IndicesStatsResponse.java | 5 +++++ .../opensearch/action/admin/indices/stats/ShardStats.java | 5 +++++ .../admin/indices/stats/TransportIndicesStatsAction.java | 5 +++++ .../template/delete/DeleteComponentTemplateAction.java | 5 +++++ .../delete/DeleteComposableIndexTemplateAction.java | 5 +++++ .../indices/template/delete/DeleteIndexTemplateAction.java | 5 +++++ .../template/delete/DeleteIndexTemplateRequest.java | 2 ++ .../template/delete/DeleteIndexTemplateRequestBuilder.java | 5 +++++ .../delete/TransportDeleteComponentTemplateAction.java | 5 +++++ .../TransportDeleteComposableIndexTemplateAction.java | 5 +++++ .../delete/TransportDeleteIndexTemplateAction.java | 2 ++ .../indices/template/get/GetComponentTemplateAction.java | 2 ++ .../template/get/GetComposableIndexTemplateAction.java | 5 +++++ .../indices/template/get/GetIndexTemplatesAction.java | 5 +++++ .../indices/template/get/GetIndexTemplatesRequest.java | 2 ++ .../template/get/GetIndexTemplatesRequestBuilder.java | 5 +++++ .../indices/template/get/GetIndexTemplatesResponse.java | 5 +++++ .../template/get/TransportGetComponentTemplateAction.java | 5 +++++ .../get/TransportGetComposableIndexTemplateAction.java | 5 +++++ .../template/get/TransportGetIndexTemplatesAction.java | 5 +++++ .../indices/template/post/SimulateIndexTemplateAction.java | 6 ++++++ .../template/post/SimulateIndexTemplateRequest.java | 6 ++++++ .../template/post/SimulateIndexTemplateResponse.java | 2 ++ .../indices/template/post/SimulateTemplateAction.java | 2 ++ .../post/TransportSimulateIndexTemplateAction.java | 6 ++++++ .../template/post/TransportSimulateTemplateAction.java | 2 ++ .../indices/template/put/PutComponentTemplateAction.java | 2 ++ .../template/put/PutComposableIndexTemplateAction.java | 5 +++++ .../admin/indices/template/put/PutIndexTemplateAction.java | 5 +++++ .../indices/template/put/PutIndexTemplateRequest.java | 2 ++ .../template/put/PutIndexTemplateRequestBuilder.java | 5 +++++ .../template/put/TransportPutComponentTemplateAction.java | 5 +++++ .../put/TransportPutComposableIndexTemplateAction.java | 5 +++++ .../template/put/TransportPutIndexTemplateAction.java | 2 ++ .../admin/indices/upgrade/get/IndexShardUpgradeStatus.java | 5 +++++ .../admin/indices/upgrade/get/IndexUpgradeStatus.java | 5 +++++ .../admin/indices/upgrade/get/ShardUpgradeStatus.java | 5 +++++ .../indices/upgrade/get/TransportUpgradeStatusAction.java | 5 +++++ .../admin/indices/upgrade/get/UpgradeStatusAction.java | 5 +++++ .../admin/indices/upgrade/get/UpgradeStatusRequest.java | 5 +++++ .../indices/upgrade/get/UpgradeStatusRequestBuilder.java | 5 +++++ .../admin/indices/upgrade/get/UpgradeStatusResponse.java | 5 +++++ .../admin/indices/upgrade/post/ShardUpgradeResult.java | 5 +++++ .../admin/indices/upgrade/post/TransportUpgradeAction.java | 2 ++ .../upgrade/post/TransportUpgradeSettingsAction.java | 5 +++++ .../action/admin/indices/upgrade/post/UpgradeAction.java | 2 ++ .../action/admin/indices/upgrade/post/UpgradeRequest.java | 2 ++ .../admin/indices/upgrade/post/UpgradeRequestBuilder.java | 2 ++ .../action/admin/indices/upgrade/post/UpgradeResponse.java | 2 +- .../admin/indices/upgrade/post/UpgradeSettingsAction.java | 5 +++++ .../post/UpgradeSettingsClusterStateUpdateRequest.java | 2 ++ .../admin/indices/upgrade/post/UpgradeSettingsRequest.java | 2 ++ .../admin/indices/validate/query/QueryExplanation.java | 5 +++++ .../indices/validate/query/ShardValidateQueryRequest.java | 2 ++ .../indices/validate/query/ShardValidateQueryResponse.java | 2 +- .../validate/query/TransportValidateQueryAction.java | 5 +++++ .../admin/indices/validate/query/ValidateQueryAction.java | 5 +++++ .../admin/indices/validate/query/ValidateQueryRequest.java | 2 ++ .../validate/query/ValidateQueryRequestBuilder.java | 5 +++++ .../indices/validate/query/ValidateQueryResponse.java | 2 +- .../src/main/java/org/opensearch/plugins/ActionPlugin.java | 5 +++++ .../main/java/org/opensearch/plugins/ExtensiblePlugin.java | 5 +++++ .../main/java/org/opensearch/plugins/PluginsService.java | 5 +++++ .../org/opensearch/transport/RequestHandlerRegistry.java | 7 ++++++- .../main/java/org/opensearch/transport/StatsTracker.java | 7 ++++++- 435 files changed, 1526 insertions(+), 8 deletions(-) diff --git a/gradle/missing-javadoc.gradle b/gradle/missing-javadoc.gradle index 2dea9a0e11d91..29fede8967a59 100644 --- a/gradle/missing-javadoc.gradle +++ b/gradle/missing-javadoc.gradle @@ -180,7 +180,7 @@ configure(project(":server")) { project.tasks.withType(MissingJavadocTask) { isExcluded = true // TODO: reenable after fixing missing javadocs - // javadocMissingLevel = "class" + javadocMissingLevel = "class" } } diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainAction.java index 4c95d1e336b3a..0e99513a8fc7e 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainAction.java @@ -36,6 +36,8 @@ /** * ActionType for explaining shard allocation for a shard in the cluster + * + * @opensearch.internal */ public class ClusterAllocationExplainAction extends ActionType { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainRequest.java index 1a055fa0d14c2..0102cc517dbcd 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainRequest.java @@ -47,6 +47,8 @@ /** * A request to explain the allocation of a shard in the cluster + * + * @opensearch.internal */ public class ClusterAllocationExplainRequest extends MasterNodeRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainRequestBuilder.java index 78a22cd59b284..240520241c42b 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainRequestBuilder.java @@ -37,6 +37,8 @@ /** * Builder for requests to explain the allocation of a shard in the cluster + * + * @opensearch.internal */ public class ClusterAllocationExplainRequestBuilder extends MasterNodeOperationRequestBuilder< ClusterAllocationExplainRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainResponse.java index 2fc72ccb13e28..5ce26aba3b395 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplainResponse.java @@ -40,6 +40,8 @@ /** * Explanation response for a shard in the cluster + * + * @opensearch.internal */ public class ClusterAllocationExplainResponse extends ActionResponse { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplanation.java b/server/src/main/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplanation.java index e9505c7fc83c2..e0fb92560ebf4 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplanation.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/allocation/ClusterAllocationExplanation.java @@ -57,6 +57,8 @@ * A {@code ClusterAllocationExplanation} is an explanation of why a shard is unassigned, * or if it is not unassigned, then which nodes it could possibly be relocated to. * It is an immutable class. + * + * @opensearch.internal */ public final class ClusterAllocationExplanation implements ToXContentObject, Writeable { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/allocation/TransportClusterAllocationExplainAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/allocation/TransportClusterAllocationExplainAction.java index baa2ce0847501..233cc506a32c1 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/allocation/TransportClusterAllocationExplainAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/allocation/TransportClusterAllocationExplainAction.java @@ -65,6 +65,8 @@ /** * The {@code TransportClusterAllocationExplainAction} is responsible for actually executing the explanation of a shard's allocation on the * cluster-manager node in the cluster. + * + * @opensearch.internal */ public class TransportClusterAllocationExplainAction extends TransportMasterNodeAction< ClusterAllocationExplainRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/configuration/AddVotingConfigExclusionsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/configuration/AddVotingConfigExclusionsAction.java index 963a5d567c0bc..4a4f28b360801 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/configuration/AddVotingConfigExclusionsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/configuration/AddVotingConfigExclusionsAction.java @@ -33,7 +33,12 @@ import org.opensearch.action.ActionType; -public class AddVotingConfigExclusionsAction extends ActionType { +/** + * Transport endpoint for adding exclusions to voting config + * + * @opensearch.internal + */ +public final class AddVotingConfigExclusionsAction extends ActionType { public static final AddVotingConfigExclusionsAction INSTANCE = new AddVotingConfigExclusionsAction(); public static final String NAME = "cluster:admin/voting_config/add_exclusions"; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/configuration/AddVotingConfigExclusionsRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/configuration/AddVotingConfigExclusionsRequest.java index e0e5bf622b99e..ba44fdfeb8ff6 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/configuration/AddVotingConfigExclusionsRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/configuration/AddVotingConfigExclusionsRequest.java @@ -56,6 +56,8 @@ /** * A request to add voting config exclusions for certain cluster-manager-eligible nodes, and wait for these nodes to be removed from the voting * configuration. + * + * @opensearch.internal */ public class AddVotingConfigExclusionsRequest extends MasterNodeRequest { public static final String DEPRECATION_MESSAGE = "nodeDescription is deprecated and will be removed, use nodeIds or nodeNames instead"; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/configuration/AddVotingConfigExclusionsResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/configuration/AddVotingConfigExclusionsResponse.java index 0493de7c439de..22b2d54bfd69d 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/configuration/AddVotingConfigExclusionsResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/configuration/AddVotingConfigExclusionsResponse.java @@ -42,6 +42,8 @@ /** * A response to {@link AddVotingConfigExclusionsRequest} indicating that voting config exclusions have been added for the requested nodes * and these nodes have been removed from the voting configuration. + * + * @opensearch.internal */ public class AddVotingConfigExclusionsResponse extends ActionResponse implements ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/configuration/ClearVotingConfigExclusionsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/configuration/ClearVotingConfigExclusionsAction.java index ce31abceb6738..e0fcad8f8ccd8 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/configuration/ClearVotingConfigExclusionsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/configuration/ClearVotingConfigExclusionsAction.java @@ -33,6 +33,11 @@ import org.opensearch.action.ActionType; +/** + * Transport endpoint for clearing exclusions to voting config + * + * @opensearch.internal + */ public class ClearVotingConfigExclusionsAction extends ActionType { public static final ClearVotingConfigExclusionsAction INSTANCE = new ClearVotingConfigExclusionsAction(); public static final String NAME = "cluster:admin/voting_config/clear_exclusions"; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/configuration/ClearVotingConfigExclusionsRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/configuration/ClearVotingConfigExclusionsRequest.java index 9ccccc88f3365..cbe19abe069b2 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/configuration/ClearVotingConfigExclusionsRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/configuration/ClearVotingConfigExclusionsRequest.java @@ -42,6 +42,8 @@ /** * A request to clear the voting config exclusions from the cluster state, optionally waiting for these nodes to be removed from the * cluster first. + * + * @opensearch.internal */ public class ClearVotingConfigExclusionsRequest extends MasterNodeRequest { private boolean waitForRemoval = true; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/configuration/ClearVotingConfigExclusionsResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/configuration/ClearVotingConfigExclusionsResponse.java index ed07f33b6c6a6..a8744bc8f666f 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/configuration/ClearVotingConfigExclusionsResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/configuration/ClearVotingConfigExclusionsResponse.java @@ -42,6 +42,8 @@ /** * A response to {@link ClearVotingConfigExclusionsRequest} indicating that voting config exclusions have been cleared from the * cluster state. + * + * @opensearch.internal */ public class ClearVotingConfigExclusionsResponse extends ActionResponse implements ToXContentObject { public ClearVotingConfigExclusionsResponse() {} diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsAction.java index 30ba799db044a..c9b27f4822fcd 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsAction.java @@ -66,6 +66,11 @@ import java.util.function.Predicate; import java.util.stream.Collectors; +/** + * Transport endpoint action for adding exclusions to voting config + * + * @opensearch.internal + */ public class TransportAddVotingConfigExclusionsAction extends TransportMasterNodeAction< AddVotingConfigExclusionsRequest, AddVotingConfigExclusionsResponse> { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/configuration/TransportClearVotingConfigExclusionsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/configuration/TransportClearVotingConfigExclusionsAction.java index 31a1d07608071..3791b3e8301ee 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/configuration/TransportClearVotingConfigExclusionsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/configuration/TransportClearVotingConfigExclusionsAction.java @@ -60,6 +60,11 @@ import java.io.IOException; import java.util.function.Predicate; +/** + * Transport endpoint action for clearing exclusions to voting config + * + * @opensearch.internal + */ public class TransportClearVotingConfigExclusionsAction extends TransportMasterNodeAction< ClearVotingConfigExclusionsRequest, ClearVotingConfigExclusionsResponse> { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthAction.java index a37c0b0f1cb88..5c712b801f927 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport endpoint action for obtaining cluster health + * + * @opensearch.internal + */ public class ClusterHealthAction extends ActionType { public static final ClusterHealthAction INSTANCE = new ClusterHealthAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthRequest.java index 204a182edafab..d6d494c4261bd 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthRequest.java @@ -48,6 +48,11 @@ import java.util.Objects; import java.util.concurrent.TimeUnit; +/** + * Transport request for requesting cluster health + * + * @opensearch.internal + */ public class ClusterHealthRequest extends MasterNodeReadRequest implements IndicesRequest.Replaceable { private String[] indices; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthRequestBuilder.java index 86fee83130bb3..d1e68e0a22510 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthRequestBuilder.java @@ -40,6 +40,11 @@ import org.opensearch.common.Priority; import org.opensearch.common.unit.TimeValue; +/** + * Builder for requesting cluster health + * + * @opensearch.internal + */ public class ClusterHealthRequestBuilder extends MasterNodeReadOperationRequestBuilder< ClusterHealthRequest, ClusterHealthResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthResponse.java index ce731fd1c8aca..e4ec75fb7045a 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthResponse.java @@ -60,6 +60,11 @@ import static org.opensearch.common.xcontent.ConstructingObjectParser.constructorArg; import static org.opensearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +/** + * Transport response for Cluster Health + * + * @opensearch.internal + */ public class ClusterHealthResponse extends ActionResponse implements StatusToXContentObject { private static final String CLUSTER_NAME = "cluster_name"; private static final String STATUS = "status"; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/health/TransportClusterHealthAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/health/TransportClusterHealthAction.java index 98c264e54a1d0..09082536dfbbb 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/health/TransportClusterHealthAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/health/TransportClusterHealthAction.java @@ -67,6 +67,11 @@ import java.util.function.Consumer; import java.util.function.Predicate; +/** + * Transport action for obtaining Cluster Health + * + * @opensearch.internal + */ public class TransportClusterHealthAction extends TransportMasterNodeReadAction { private static final Logger logger = LogManager.getLogger(TransportClusterHealthAction.class); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/NodeHotThreads.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/NodeHotThreads.java index 7d873bd22719d..7de148b0a1000 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/NodeHotThreads.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/NodeHotThreads.java @@ -39,6 +39,11 @@ import java.io.IOException; +/** + * Transport for OpenSearch Hot Threads + * + * @opensearch.internal + */ public class NodeHotThreads extends BaseNodeResponse { private String hotThreads; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/NodesHotThreadsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/NodesHotThreadsAction.java index 1a09bccf0b34e..64689b2e3bc6d 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/NodesHotThreadsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/NodesHotThreadsAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for requesting OpenSearch Hot Threads + * + * @opensearch.internal + */ public class NodesHotThreadsAction extends ActionType { public static final NodesHotThreadsAction INSTANCE = new NodesHotThreadsAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/NodesHotThreadsRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/NodesHotThreadsRequest.java index 5f5c566e7b6d2..34d0d812ae609 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/NodesHotThreadsRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/NodesHotThreadsRequest.java @@ -40,6 +40,11 @@ import java.io.IOException; import java.util.concurrent.TimeUnit; +/** + * Transport request for OpenSearch Hot Threads + * + * @opensearch.internal + */ public class NodesHotThreadsRequest extends BaseNodesRequest { int threads = 3; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/NodesHotThreadsRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/NodesHotThreadsRequestBuilder.java index 54a99de61c854..3639439dd3fb8 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/NodesHotThreadsRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/NodesHotThreadsRequestBuilder.java @@ -36,6 +36,11 @@ import org.opensearch.client.OpenSearchClient; import org.opensearch.common.unit.TimeValue; +/** + * Builder class for requesting OpenSearch Hot Threads + * + * @opensearch.internal + */ public class NodesHotThreadsRequestBuilder extends NodesOperationRequestBuilder< NodesHotThreadsRequest, NodesHotThreadsResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/NodesHotThreadsResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/NodesHotThreadsResponse.java index 62c73101eddbb..a5789cee8b740 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/NodesHotThreadsResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/NodesHotThreadsResponse.java @@ -41,6 +41,11 @@ import java.io.IOException; import java.util.List; +/** + * Transport response for OpenSearch Hot Threads + * + * @opensearch.internal + */ public class NodesHotThreadsResponse extends BaseNodesResponse { public NodesHotThreadsResponse(StreamInput in) throws IOException { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/TransportNodesHotThreadsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/TransportNodesHotThreadsAction.java index 4274bc9be188c..e8429580ec887 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/TransportNodesHotThreadsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/hotthreads/TransportNodesHotThreadsAction.java @@ -48,6 +48,11 @@ import java.io.IOException; import java.util.List; +/** + * Transport action for OpenSearch Hot Threads + * + * @opensearch.internal + */ public class TransportNodesHotThreadsAction extends TransportNodesAction< NodesHotThreadsRequest, NodesHotThreadsResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/info/NodeInfo.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/info/NodeInfo.java index ddef959e66473..192815af1908f 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/info/NodeInfo.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/info/NodeInfo.java @@ -58,6 +58,8 @@ /** * Node information (static, does not change over time). + * + * @opensearch.internal */ public class NodeInfo extends BaseNodeResponse { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/info/NodesInfoAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/info/NodesInfoAction.java index 6850cbee55412..ea0c9d9d7f3c9 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/info/NodesInfoAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/info/NodesInfoAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for OpenSearch Node Information + * + * @opensearch.internal + */ public class NodesInfoAction extends ActionType { public static final NodesInfoAction INSTANCE = new NodesInfoAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/info/NodesInfoRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/info/NodesInfoRequest.java index 4024c9b0c12a9..d51be9bc27ac9 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/info/NodesInfoRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/info/NodesInfoRequest.java @@ -47,6 +47,8 @@ /** * A request to get node (cluster) level information. + * + * @opensearch.internal */ public class NodesInfoRequest extends BaseNodesRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/info/NodesInfoRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/info/NodesInfoRequestBuilder.java index 179239cac5257..76ef75b77a1cf 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/info/NodesInfoRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/info/NodesInfoRequestBuilder.java @@ -35,6 +35,11 @@ import org.opensearch.action.support.nodes.NodesOperationRequestBuilder; import org.opensearch.client.OpenSearchClient; +/** + * Transport action for OpenSearch Node Information + * + * @opensearch.internal + */ public class NodesInfoRequestBuilder extends NodesOperationRequestBuilder { public NodesInfoRequestBuilder(OpenSearchClient client, NodesInfoAction action) { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/info/NodesInfoResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/info/NodesInfoResponse.java index a483a2fa1f845..08ca022b026ee 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/info/NodesInfoResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/info/NodesInfoResponse.java @@ -56,6 +56,11 @@ import java.util.List; import java.util.Map; +/** + * Transport response for OpenSearch Node Information + * + * @opensearch.internal + */ public class NodesInfoResponse extends BaseNodesResponse implements ToXContentFragment { public NodesInfoResponse(StreamInput in) throws IOException { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/info/PluginsAndModules.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/info/PluginsAndModules.java index a51a0ab7b6ea6..b2d94b7a97c22 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/info/PluginsAndModules.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/info/PluginsAndModules.java @@ -46,6 +46,8 @@ /** * Information about plugins and modules + * + * @opensearch.internal */ public class PluginsAndModules implements ReportingService.Info { private final List plugins; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/info/TransportNodesInfoAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/info/TransportNodesInfoAction.java index 7aa04f029f3ba..7bcf83ba28111 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/info/TransportNodesInfoAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/info/TransportNodesInfoAction.java @@ -48,6 +48,11 @@ import java.util.List; import java.util.Set; +/** + * Transport action for OpenSearch Node Information + * + * @opensearch.internal + */ public class TransportNodesInfoAction extends TransportNodesAction< NodesInfoRequest, NodesInfoResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/liveness/LivenessRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/liveness/LivenessRequest.java index c75e020c269eb..fc67ccb0f5574 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/liveness/LivenessRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/liveness/LivenessRequest.java @@ -40,6 +40,8 @@ /** * Transport level private response for the transport handler registered under * {@value TransportLivenessAction#NAME} + * + * @opensearch.internal */ public final class LivenessRequest extends ActionRequest { public LivenessRequest() {} diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/liveness/LivenessResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/liveness/LivenessResponse.java index 1737d868f0afb..8fdbf66f10e64 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/liveness/LivenessResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/liveness/LivenessResponse.java @@ -43,6 +43,8 @@ /** * Transport level private response for the transport handler registered under * {@value TransportLivenessAction#NAME} + * + * @opensearch.internal */ public final class LivenessResponse extends ActionResponse { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/liveness/TransportLivenessAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/liveness/TransportLivenessAction.java index 83f945ab85557..8a075cbee6e90 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/liveness/TransportLivenessAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/liveness/TransportLivenessAction.java @@ -40,6 +40,11 @@ import org.opensearch.transport.TransportRequestHandler; import org.opensearch.transport.TransportService; +/** + * Transport action for OpenSearch Node Liveness + * + * @opensearch.internal + */ public final class TransportLivenessAction implements TransportRequestHandler { private final ClusterService clusterService; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/NodesReloadSecureSettingsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/NodesReloadSecureSettingsAction.java index 252c4491bc56c..0f7c847582349 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/NodesReloadSecureSettingsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/NodesReloadSecureSettingsAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for reloading OpenSearch Secure Settings + * + * @opensearch.internal + */ public class NodesReloadSecureSettingsAction extends ActionType { public static final NodesReloadSecureSettingsAction INSTANCE = new NodesReloadSecureSettingsAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/NodesReloadSecureSettingsRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/NodesReloadSecureSettingsRequest.java index 5a6c4c2ae7c83..e31f5f304c836 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/NodesReloadSecureSettingsRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/NodesReloadSecureSettingsRequest.java @@ -49,6 +49,8 @@ /** * Request for a reload secure settings action + * + * @opensearch.internal */ public class NodesReloadSecureSettingsRequest extends BaseNodesRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/NodesReloadSecureSettingsRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/NodesReloadSecureSettingsRequestBuilder.java index 8bb67f5042893..36a4a22460126 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/NodesReloadSecureSettingsRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/NodesReloadSecureSettingsRequestBuilder.java @@ -38,6 +38,8 @@ /** * Builder for the reload secure settings nodes request + * + * @opensearch.internal */ public class NodesReloadSecureSettingsRequestBuilder extends NodesOperationRequestBuilder< NodesReloadSecureSettingsRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/NodesReloadSecureSettingsResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/NodesReloadSecureSettingsResponse.java index 40bdee3d288a5..9325b2febcd1e 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/NodesReloadSecureSettingsResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/NodesReloadSecureSettingsResponse.java @@ -49,6 +49,8 @@ /** * The response for the reload secure settings action + * + * @opensearch.internal */ public class NodesReloadSecureSettingsResponse extends BaseNodesResponse implements diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/TransportNodesReloadSecureSettingsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/TransportNodesReloadSecureSettingsAction.java index eeed105d8407b..4ddc7b3a8362d 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/TransportNodesReloadSecureSettingsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/reload/TransportNodesReloadSecureSettingsAction.java @@ -60,6 +60,11 @@ import java.util.ArrayList; import java.util.List; +/** + * Transport action for reloading OpenSearch Secure Settings + * + * @opensearch.internal + */ public class TransportNodesReloadSecureSettingsAction extends TransportNodesAction< NodesReloadSecureSettingsRequest, NodesReloadSecureSettingsResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/NodeStats.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/NodeStats.java index dd2c649e07c28..7f0ac615cc449 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/NodeStats.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/NodeStats.java @@ -64,6 +64,8 @@ /** * Node statistics (dynamic, changes depending on when created). + * + * @opensearch.internal */ public class NodeStats extends BaseNodeResponse implements ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/NodesStatsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/NodesStatsAction.java index 77bb141966651..fc039778f05af 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/NodesStatsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/NodesStatsAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for obtaining OpenSearch Node Stats + * + * @opensearch.internal + */ public class NodesStatsAction extends ActionType { public static final NodesStatsAction INSTANCE = new NodesStatsAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/NodesStatsRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/NodesStatsRequest.java index 2ebf2ca424c27..babec0b7c119f 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/NodesStatsRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/NodesStatsRequest.java @@ -47,6 +47,8 @@ /** * A request to get node (cluster) level stats. + * + * @opensearch.internal */ public class NodesStatsRequest extends BaseNodesRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/NodesStatsRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/NodesStatsRequestBuilder.java index 40d6946823727..e382278f5ddb8 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/NodesStatsRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/NodesStatsRequestBuilder.java @@ -36,6 +36,11 @@ import org.opensearch.action.support.nodes.NodesOperationRequestBuilder; import org.opensearch.client.OpenSearchClient; +/** + * Transport builder for obtaining OpenSearch Node Stats + * + * @opensearch.internal + */ public class NodesStatsRequestBuilder extends NodesOperationRequestBuilder< NodesStatsRequest, NodesStatsResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/NodesStatsResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/NodesStatsResponse.java index 8c84775e356c4..8ba39b6e0b8f4 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/NodesStatsResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/NodesStatsResponse.java @@ -45,6 +45,11 @@ import java.io.IOException; import java.util.List; +/** + * Transport response for obtaining OpenSearch Node Stats + * + * @opensearch.internal + */ public class NodesStatsResponse extends BaseNodesResponse implements ToXContentFragment { public NodesStatsResponse(StreamInput in) throws IOException { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/TransportNodesStatsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/TransportNodesStatsAction.java index 9daf67b2152e6..644c7f02d45f0 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/TransportNodesStatsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/TransportNodesStatsAction.java @@ -48,6 +48,11 @@ import java.util.List; import java.util.Set; +/** + * Transport action for obtaining OpenSearch Node Stats + * + * @opensearch.internal + */ public class TransportNodesStatsAction extends TransportNodesAction< NodesStatsRequest, NodesStatsResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksAction.java index 6d6098adaa92c..d4f6dc39c93f7 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksAction.java @@ -36,6 +36,8 @@ /** * ActionType for cancelling running tasks + * + * @opensearch.internal */ public class CancelTasksAction extends ActionType { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksRequest.java index ea7e225051b80..a4b24a7a91f1f 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksRequest.java @@ -44,6 +44,8 @@ /** * A request to cancel tasks + * + * @opensearch.internal */ public class CancelTasksRequest extends BaseTasksRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksRequestBuilder.java index c0686f166c859..ee19e8b104603 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksRequestBuilder.java @@ -37,6 +37,8 @@ /** * Builder for the request to cancel tasks running on the specified nodes + * + * @opensearch.internal */ public class CancelTasksRequestBuilder extends TasksRequestBuilder { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksResponse.java index 056463b85fe80..78aea59bcd10e 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/cancel/CancelTasksResponse.java @@ -47,6 +47,8 @@ /** * Returns the list of tasks that were cancelled + * + * @opensearch.internal */ public class CancelTasksResponse extends ListTasksResponse { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/cancel/TransportCancelTasksAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/cancel/TransportCancelTasksAction.java index 963ebe24ae8e2..909fb009aa100 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/cancel/TransportCancelTasksAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/cancel/TransportCancelTasksAction.java @@ -54,6 +54,8 @@ *

    * For a task to be cancellable it has to return an instance of * {@link CancellableTask} from {@link TransportRequest#createTask} + * + * @opensearch.internal */ public class TransportCancelTasksAction extends TransportTasksAction { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/get/GetTaskAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/get/GetTaskAction.java index 4297e911d6bde..3b429d61c31b3 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/get/GetTaskAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/get/GetTaskAction.java @@ -36,6 +36,8 @@ /** * ActionType for retrieving a list of currently running tasks + * + * @opensearch.internal */ public class GetTaskAction extends ActionType { public static final String TASKS_ORIGIN = "tasks"; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/get/GetTaskRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/get/GetTaskRequest.java index a8fee2dc22d30..663fe51f35adc 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/get/GetTaskRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/get/GetTaskRequest.java @@ -45,6 +45,8 @@ /** * A request to get node tasks + * + * @opensearch.internal */ public class GetTaskRequest extends ActionRequest { private TaskId taskId = TaskId.EMPTY_TASK_ID; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/get/GetTaskRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/get/GetTaskRequestBuilder.java index d7d0be125bee3..17b2a21b2863b 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/get/GetTaskRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/get/GetTaskRequestBuilder.java @@ -39,6 +39,8 @@ /** * Builder for the request to retrieve the list of tasks running on the specified nodes + * + * @opensearch.internal */ public class GetTaskRequestBuilder extends ActionRequestBuilder { public GetTaskRequestBuilder(OpenSearchClient client, GetTaskAction action) { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/get/GetTaskResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/get/GetTaskResponse.java index 32d7062449a71..1097831113971 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/get/GetTaskResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/get/GetTaskResponse.java @@ -46,6 +46,8 @@ /** * Returns the list of tasks currently running on the nodes + * + * @opensearch.internal */ public class GetTaskResponse extends ActionResponse implements ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/get/TransportGetTaskAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/get/TransportGetTaskAction.java index 80049b5e30fdf..0d6926fe9a2fa 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/get/TransportGetTaskAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/get/TransportGetTaskAction.java @@ -74,6 +74,8 @@ *

  • Look up the task and return it if it exists *
  • If it doesn't then look up the task from the results index * + * + * @opensearch.internal */ public class TransportGetTaskAction extends HandledTransportAction { private final ThreadPool threadPool; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/ListTasksAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/ListTasksAction.java index 76c07cd570622..7c8b83ad9c913 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/ListTasksAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/ListTasksAction.java @@ -36,6 +36,8 @@ /** * ActionType for retrieving a list of currently running tasks + * + * @opensearch.internal */ public class ListTasksAction extends ActionType { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/ListTasksRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/ListTasksRequest.java index 4f1a5765d1eea..decd26e3058f5 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/ListTasksRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/ListTasksRequest.java @@ -40,6 +40,8 @@ /** * A request to get node tasks + * + * @opensearch.internal */ public class ListTasksRequest extends BaseTasksRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/ListTasksRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/ListTasksRequestBuilder.java index dc10fb99e90b9..45beb0dd899b5 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/ListTasksRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/ListTasksRequestBuilder.java @@ -37,6 +37,8 @@ /** * Builder for the request to retrieve the list of tasks running on the specified nodes + * + * @opensearch.internal */ public class ListTasksRequestBuilder extends TasksRequestBuilder { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/ListTasksResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/ListTasksResponse.java index db0b1491fd693..8d2ad55df1a8c 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/ListTasksResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/ListTasksResponse.java @@ -62,6 +62,8 @@ /** * Returns the list of tasks currently running on the nodes + * + * @opensearch.internal */ public class ListTasksResponse extends BaseTasksResponse implements ToXContentObject { private static final String TASKS = "tasks"; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/TaskGroup.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/TaskGroup.java index 68e04141a3cfd..ee2f157c7c034 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/TaskGroup.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/TaskGroup.java @@ -44,6 +44,8 @@ /** * Information about a currently running task and all its subtasks. + * + * @opensearch.internal */ public class TaskGroup implements ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/TransportListTasksAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/TransportListTasksAction.java index b7875c5f99774..796ea023edd40 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/TransportListTasksAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/tasks/list/TransportListTasksAction.java @@ -50,6 +50,11 @@ import static org.opensearch.common.unit.TimeValue.timeValueSeconds; +/** + * Transport action for listing tasks currently running on the nodes + * + * @opensearch.internal + */ public class TransportListTasksAction extends TransportTasksAction { public static long waitForCompletionTimeout(TimeValue timeout) { if (timeout == null) { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/NodeUsage.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/NodeUsage.java index 2094861185b50..58e43ca9f3568 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/NodeUsage.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/NodeUsage.java @@ -43,6 +43,11 @@ import java.io.IOException; import java.util.Map; +/** + * Concrete class for collecting OpenSearch telemetry + * + * @opensearch.internal + */ public class NodeUsage extends BaseNodeResponse implements ToXContentFragment { private final long timestamp; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/NodesUsageAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/NodesUsageAction.java index 2a3c6be6e0bbe..8a3aec7679709 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/NodesUsageAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/NodesUsageAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for collecting OpenSearch telemetry + * + * @opensearch.internal + */ public class NodesUsageAction extends ActionType { public static final NodesUsageAction INSTANCE = new NodesUsageAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/NodesUsageRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/NodesUsageRequest.java index 0a94f2a9bfca7..01f66bd843642 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/NodesUsageRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/NodesUsageRequest.java @@ -39,6 +39,11 @@ import java.io.IOException; +/** + * Transport request for collecting OpenSearch telemetry + * + * @opensearch.internal + */ public class NodesUsageRequest extends BaseNodesRequest { private boolean restActions; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/NodesUsageRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/NodesUsageRequestBuilder.java index fefccf4368230..7d1823b59dc04 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/NodesUsageRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/NodesUsageRequestBuilder.java @@ -36,6 +36,11 @@ import org.opensearch.action.support.nodes.NodesOperationRequestBuilder; import org.opensearch.client.OpenSearchClient; +/** + * Transport builder for collecting OpenSearch telemetry + * + * @opensearch.internal + */ public class NodesUsageRequestBuilder extends NodesOperationRequestBuilder< NodesUsageRequest, NodesUsageResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/NodesUsageResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/NodesUsageResponse.java index d3e5aeea72193..77b6cf067a1d2 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/NodesUsageResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/NodesUsageResponse.java @@ -48,6 +48,8 @@ /** * The response for the nodes usage api which contains the individual usage * statistics for all nodes queried. + * + * @opensearch.internal */ public class NodesUsageResponse extends BaseNodesResponse implements ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/TransportNodesUsageAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/TransportNodesUsageAction.java index 5906184b8b629..c7612f7e15838 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/TransportNodesUsageAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/usage/TransportNodesUsageAction.java @@ -49,6 +49,11 @@ import java.util.List; import java.util.Map; +/** + * Transport action for collecting OpenSearch telemetry + * + * @opensearch.internal + */ public class TransportNodesUsageAction extends TransportNodesAction< NodesUsageRequest, NodesUsageResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/remote/RemoteInfoAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/remote/RemoteInfoAction.java index 099b3abc7438c..55f75a142a53c 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/remote/RemoteInfoAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/remote/RemoteInfoAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for remote monitoring + * + * @opensearch.internal + */ public final class RemoteInfoAction extends ActionType { public static final String NAME = "cluster:monitor/remote/info"; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/remote/RemoteInfoRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/remote/RemoteInfoRequest.java index c140a639ac3ae..e022ef504bd46 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/remote/RemoteInfoRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/remote/RemoteInfoRequest.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Transport request for remote monitoring + * + * @opensearch.internal + */ public final class RemoteInfoRequest extends ActionRequest { public RemoteInfoRequest() {} diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/remote/RemoteInfoRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/remote/RemoteInfoRequestBuilder.java index 5fceced383731..03fd2a3f778ec 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/remote/RemoteInfoRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/remote/RemoteInfoRequestBuilder.java @@ -35,6 +35,11 @@ import org.opensearch.action.ActionRequestBuilder; import org.opensearch.client.OpenSearchClient; +/** + * Transport builder for remote monitoring + * + * @opensearch.internal + */ public final class RemoteInfoRequestBuilder extends ActionRequestBuilder { public RemoteInfoRequestBuilder(OpenSearchClient client, RemoteInfoAction action) { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/remote/RemoteInfoResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/remote/RemoteInfoResponse.java index 415e71e6d1010..08ff58d6cbee1 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/remote/RemoteInfoResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/remote/RemoteInfoResponse.java @@ -45,6 +45,11 @@ import java.util.Collections; import java.util.List; +/** + * Transport response for remote monitoring + * + * @opensearch.internal + */ public final class RemoteInfoResponse extends ActionResponse implements ToXContentObject { private List infos; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/remote/TransportRemoteInfoAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/remote/TransportRemoteInfoAction.java index 10b1917b0c94b..794d21f1cbc7c 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/remote/TransportRemoteInfoAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/remote/TransportRemoteInfoAction.java @@ -43,6 +43,11 @@ import static java.util.stream.Collectors.toList; +/** + * Transport action for remote monitoring + * + * @opensearch.internal + */ public final class TransportRemoteInfoAction extends HandledTransportAction { private final RemoteClusterService remoteClusterService; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/cleanup/CleanupRepositoryAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/cleanup/CleanupRepositoryAction.java index 4feb755c3e5a1..0ec1281648cdb 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/cleanup/CleanupRepositoryAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/cleanup/CleanupRepositoryAction.java @@ -33,6 +33,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for cleaning up snapshot repositories + * + * @opensearch.internal + */ public final class CleanupRepositoryAction extends ActionType { public static final CleanupRepositoryAction INSTANCE = new CleanupRepositoryAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/cleanup/CleanupRepositoryRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/cleanup/CleanupRepositoryRequest.java index d1fc914201390..0f265681cd241 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/cleanup/CleanupRepositoryRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/cleanup/CleanupRepositoryRequest.java @@ -40,6 +40,11 @@ import static org.opensearch.action.ValidateActions.addValidationError; +/** + * Transport request for cleaning up snapshot repositories + * + * @opensearch.internal + */ public class CleanupRepositoryRequest extends AcknowledgedRequest { private String repository; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/cleanup/CleanupRepositoryRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/cleanup/CleanupRepositoryRequestBuilder.java index b5db8d7eca669..fc5365e7e836d 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/cleanup/CleanupRepositoryRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/cleanup/CleanupRepositoryRequestBuilder.java @@ -35,6 +35,11 @@ import org.opensearch.action.support.master.MasterNodeOperationRequestBuilder; import org.opensearch.client.OpenSearchClient; +/** + * Transport builder for cleaning up snapshot repositories + * + * @opensearch.internal + */ public class CleanupRepositoryRequestBuilder extends MasterNodeOperationRequestBuilder< CleanupRepositoryRequest, CleanupRepositoryResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/cleanup/CleanupRepositoryResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/cleanup/CleanupRepositoryResponse.java index e6bb65e732082..3f6c9000dedac 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/cleanup/CleanupRepositoryResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/cleanup/CleanupRepositoryResponse.java @@ -43,6 +43,11 @@ import java.io.IOException; +/** + * Transport response for cleaning up snapshot repositories + * + * @opensearch.internal + */ public final class CleanupRepositoryResponse extends ActionResponse implements ToXContentObject { private static final ObjectParser PARSER = new ObjectParser<>( diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/cleanup/TransportCleanupRepositoryAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/cleanup/TransportCleanupRepositoryAction.java index c56b2fd2b2205..fb972136bf695 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/cleanup/TransportCleanupRepositoryAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/cleanup/TransportCleanupRepositoryAction.java @@ -82,6 +82,8 @@ * {@link BlobStoreRepository#cleanup} ensures that the repository state id has not changed between creation of the cluster state entry * and any delete/write operations. TODO: This will not work if we also want to clean up at the shard level as those will involve writes * as well as deletes. + * + * @opensearch.internal */ public final class TransportCleanupRepositoryAction extends TransportMasterNodeAction { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/delete/DeleteRepositoryAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/delete/DeleteRepositoryAction.java index 3e6cbcbae8a8f..2031e4f7a716f 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/delete/DeleteRepositoryAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/delete/DeleteRepositoryAction.java @@ -37,6 +37,8 @@ /** * Unregister repository action + * + * @opensearch.internal */ public class DeleteRepositoryAction extends ActionType { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/delete/DeleteRepositoryRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/delete/DeleteRepositoryRequest.java index 610b985eb0484..a3f4bb768c649 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/delete/DeleteRepositoryRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/delete/DeleteRepositoryRequest.java @@ -45,6 +45,8 @@ * Unregister repository request. *

    * The unregister repository command just unregisters the repository. No data is getting deleted from the repository. + * + * @opensearch.internal */ public class DeleteRepositoryRequest extends AcknowledgedRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/delete/DeleteRepositoryRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/delete/DeleteRepositoryRequestBuilder.java index 3a390dd1df2ab..ffef8d5b41979 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/delete/DeleteRepositoryRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/delete/DeleteRepositoryRequestBuilder.java @@ -38,6 +38,8 @@ /** * Builder for unregister repository request + * + * @opensearch.internal */ public class DeleteRepositoryRequestBuilder extends AcknowledgedRequestBuilder< DeleteRepositoryRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/delete/TransportDeleteRepositoryAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/delete/TransportDeleteRepositoryAction.java index c7369cabbc75d..97a0463df0e41 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/delete/TransportDeleteRepositoryAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/delete/TransportDeleteRepositoryAction.java @@ -51,6 +51,8 @@ /** * Transport action for unregister repository operation + * + * @opensearch.internal */ public class TransportDeleteRepositoryAction extends TransportMasterNodeAction { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/get/GetRepositoriesAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/get/GetRepositoriesAction.java index 86bc21ef8fd41..8d0fa4dc5010c 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/get/GetRepositoriesAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/get/GetRepositoriesAction.java @@ -36,6 +36,8 @@ /** * Get repositories action + * + * @opensearch.internal */ public class GetRepositoriesAction extends ActionType { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/get/GetRepositoriesRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/get/GetRepositoriesRequest.java index 02b42d82e6702..9e93b7ab68dc3 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/get/GetRepositoriesRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/get/GetRepositoriesRequest.java @@ -44,6 +44,8 @@ /** * Get repository request + * + * @opensearch.internal */ public class GetRepositoriesRequest extends MasterNodeReadRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/get/GetRepositoriesRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/get/GetRepositoriesRequestBuilder.java index 8c4555ce54f1e..2174d02c6852e 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/get/GetRepositoriesRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/get/GetRepositoriesRequestBuilder.java @@ -38,6 +38,8 @@ /** * Get repository request builder + * + * @opensearch.internal */ public class GetRepositoriesRequestBuilder extends MasterNodeReadOperationRequestBuilder< GetRepositoriesRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/get/GetRepositoriesResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/get/GetRepositoriesResponse.java index ffb78f9622228..a599474290061 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/get/GetRepositoriesResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/get/GetRepositoriesResponse.java @@ -49,6 +49,8 @@ /** * Get repositories response + * + * @opensearch.internal */ public class GetRepositoriesResponse extends ActionResponse implements ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/get/TransportGetRepositoriesAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/get/TransportGetRepositoriesAction.java index d3a66671b585b..e7cef381a2346 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/get/TransportGetRepositoriesAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/get/TransportGetRepositoriesAction.java @@ -59,6 +59,8 @@ /** * Transport action for get repositories operation + * + * @opensearch.internal */ public class TransportGetRepositoriesAction extends TransportMasterNodeReadAction { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/put/PutRepositoryAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/put/PutRepositoryAction.java index 35bcdb6444ed7..c2f90d869d873 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/put/PutRepositoryAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/put/PutRepositoryAction.java @@ -37,6 +37,8 @@ /** * Register repository action + * + * @opensearch.internal */ public class PutRepositoryAction extends ActionType { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/put/PutRepositoryRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/put/PutRepositoryRequest.java index a3561f6b3052a..1bdc8e024447d 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/put/PutRepositoryRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/put/PutRepositoryRequest.java @@ -54,6 +54,8 @@ *

    * Registers a repository with given name, type and settings. If the repository with the same name already * exists in the cluster, the new repository will replace the existing repository. + * + * @opensearch.internal */ public class PutRepositoryRequest extends AcknowledgedRequest implements ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/put/PutRepositoryRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/put/PutRepositoryRequestBuilder.java index 09a33533c8889..6e1b2795b6375 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/put/PutRepositoryRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/put/PutRepositoryRequestBuilder.java @@ -42,6 +42,8 @@ /** * Register repository request builder + * + * @opensearch.internal */ public class PutRepositoryRequestBuilder extends AcknowledgedRequestBuilder< PutRepositoryRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/put/TransportPutRepositoryAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/put/TransportPutRepositoryAction.java index c91f492209bdd..1d47dbb0fd194 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/put/TransportPutRepositoryAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/put/TransportPutRepositoryAction.java @@ -51,6 +51,8 @@ /** * Transport action for register repository operation + * + * @opensearch.internal */ public class TransportPutRepositoryAction extends TransportMasterNodeAction { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/verify/TransportVerifyRepositoryAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/verify/TransportVerifyRepositoryAction.java index 2c727ece7f130..661e99aa1dee3 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/verify/TransportVerifyRepositoryAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/verify/TransportVerifyRepositoryAction.java @@ -51,6 +51,8 @@ /** * Transport action for verifying repository operation + * + * @opensearch.internal */ public class TransportVerifyRepositoryAction extends TransportMasterNodeAction { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/verify/VerifyRepositoryAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/verify/VerifyRepositoryAction.java index 98239c9da0f80..10b82f2d5c0f0 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/verify/VerifyRepositoryAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/verify/VerifyRepositoryAction.java @@ -36,6 +36,8 @@ /** * Verify repository action + * + * @opensearch.internal */ public class VerifyRepositoryAction extends ActionType { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/verify/VerifyRepositoryRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/verify/VerifyRepositoryRequest.java index 12788a421c75f..001030f6a67f5 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/verify/VerifyRepositoryRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/verify/VerifyRepositoryRequest.java @@ -43,6 +43,8 @@ /** * Verify repository request. + * + * @opensearch.internal */ public class VerifyRepositoryRequest extends AcknowledgedRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/verify/VerifyRepositoryRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/verify/VerifyRepositoryRequestBuilder.java index db01ac2268b9a..85c6d4e341e72 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/verify/VerifyRepositoryRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/verify/VerifyRepositoryRequestBuilder.java @@ -37,6 +37,8 @@ /** * Builder for verify repository request + * + * @opensearch.internal */ public class VerifyRepositoryRequestBuilder extends MasterNodeOperationRequestBuilder< VerifyRepositoryRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/verify/VerifyRepositoryResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/verify/VerifyRepositoryResponse.java index 97b69760c4f36..7562bec6fec42 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/repositories/verify/VerifyRepositoryResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/repositories/verify/VerifyRepositoryResponse.java @@ -52,6 +52,8 @@ /** * Verify repository response + * + * @opensearch.internal */ public class VerifyRepositoryResponse extends ActionResponse implements ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteAction.java index f52169911e3a9..d6a09f47cbf12 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for rerouting allocation commands + * + * @opensearch.internal + */ public class ClusterRerouteAction extends ActionType { public static final ClusterRerouteAction INSTANCE = new ClusterRerouteAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteRequest.java index ddef4f62c5298..1ca5ca1148b87 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteRequest.java @@ -44,6 +44,8 @@ /** * Request to submit cluster reroute allocation commands + * + * @opensearch.internal */ public class ClusterRerouteRequest extends AcknowledgedRequest { private AllocationCommands commands = new AllocationCommands(); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteRequestBuilder.java index 8e0116bb3646e..01d52cb43320d 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteRequestBuilder.java @@ -38,6 +38,8 @@ /** * Builder for a cluster reroute request + * + * @opensearch.internal */ public class ClusterRerouteRequestBuilder extends AcknowledgedRequestBuilder< ClusterRerouteRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteResponse.java index da4cfb4333b3d..dcddc98bdc43a 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/reroute/ClusterRerouteResponse.java @@ -45,6 +45,8 @@ /** * Response returned after a cluster reroute request + * + * @opensearch.internal */ public class ClusterRerouteResponse extends AcknowledgedResponse implements ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/reroute/TransportClusterRerouteAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/reroute/TransportClusterRerouteAction.java index 385bd64d40f9a..406ff4bcd8e06 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/reroute/TransportClusterRerouteAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/reroute/TransportClusterRerouteAction.java @@ -70,6 +70,11 @@ import java.util.List; import java.util.Map; +/** + * Transport action for rerouting cluster allocation commands + * + * @opensearch.internal + */ public class TransportClusterRerouteAction extends TransportMasterNodeAction { private static final Logger logger = LogManager.getLogger(TransportClusterRerouteAction.class); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/settings/ClusterGetSettingsRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/settings/ClusterGetSettingsRequest.java index b490f172ce7ad..01aeb0f6ec988 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/settings/ClusterGetSettingsRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/settings/ClusterGetSettingsRequest.java @@ -39,6 +39,8 @@ /** * This request is specific to the REST client. {@link ClusterStateRequest} * is used on the transport layer. + * + * @opensearch.internal */ public class ClusterGetSettingsRequest extends MasterNodeReadRequest { private boolean includeDefaults = false; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/settings/ClusterGetSettingsResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/settings/ClusterGetSettingsResponse.java index 95c148e9fe5d3..93d921c7b0f3a 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/settings/ClusterGetSettingsResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/settings/ClusterGetSettingsResponse.java @@ -52,6 +52,8 @@ /** * This response is specific to the REST client. {@link ClusterStateResponse} * is used on the transport layer. + * + * @opensearch.internal */ public class ClusterGetSettingsResponse extends ActionResponse implements ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsAction.java index dcc7c786cc3ae..12134e6936ddb 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for updating cluster settings + * + * @opensearch.internal + */ public class ClusterUpdateSettingsAction extends ActionType { public static final ClusterUpdateSettingsAction INSTANCE = new ClusterUpdateSettingsAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsRequest.java index 12cce7cf74efa..f3f7db03ac67e 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsRequest.java @@ -54,6 +54,8 @@ /** * Request for an update cluster settings action + * + * @opensearch.internal */ public class ClusterUpdateSettingsRequest extends AcknowledgedRequest implements ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsRequestBuilder.java index 1ec7bd6cfb47d..4d08c94f78b6a 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsRequestBuilder.java @@ -41,6 +41,8 @@ /** * Builder for a cluster update settings request + * + * @opensearch.internal */ public class ClusterUpdateSettingsRequestBuilder extends AcknowledgedRequestBuilder< ClusterUpdateSettingsRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsResponse.java index 91955126dd745..a4edd1d99148a 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/settings/ClusterUpdateSettingsResponse.java @@ -48,6 +48,8 @@ /** * A response for a cluster update settings action. + * + * @opensearch.internal */ public class ClusterUpdateSettingsResponse extends AcknowledgedResponse { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/settings/SettingsUpdater.java b/server/src/main/java/org/opensearch/action/admin/cluster/settings/SettingsUpdater.java index bcc95c01b4189..340d868c25853 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/settings/SettingsUpdater.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/settings/SettingsUpdater.java @@ -50,6 +50,8 @@ /** * Updates transient and persistent cluster state settings if there are any changes * due to the update. + * + * @opensearch.internal */ final class SettingsUpdater { final Settings.Builder transientUpdates = Settings.builder(); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/settings/TransportClusterUpdateSettingsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/settings/TransportClusterUpdateSettingsAction.java index 3bfdf2a0cbd5a..af5da6f538d67 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/settings/TransportClusterUpdateSettingsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/settings/TransportClusterUpdateSettingsAction.java @@ -58,6 +58,11 @@ import java.io.IOException; +/** + * Transport action for updating cluster settings + * + * @opensearch.internal + */ public class TransportClusterUpdateSettingsAction extends TransportMasterNodeAction< ClusterUpdateSettingsRequest, ClusterUpdateSettingsResponse> { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsAction.java index 9d6b0f9677a95..176d52d3eeaab 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for searching shards + * + * @opensearch.internal + */ public class ClusterSearchShardsAction extends ActionType { public static final ClusterSearchShardsAction INSTANCE = new ClusterSearchShardsAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsGroup.java b/server/src/main/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsGroup.java index 660c4629f6db2..6e1a99c95a878 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsGroup.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsGroup.java @@ -42,6 +42,11 @@ import java.io.IOException; +/** + * Transport action for searching shard groups + * + * @opensearch.internal + */ public class ClusterSearchShardsGroup implements Writeable, ToXContentObject { private final ShardId shardId; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsRequest.java index 7ae4a70d6bd36..e79697a415f1e 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsRequest.java @@ -44,6 +44,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Transport request for searching shards + * + * @opensearch.internal + */ public class ClusterSearchShardsRequest extends MasterNodeReadRequest implements IndicesRequest.Replaceable { private String[] indices = Strings.EMPTY_ARRAY; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsRequestBuilder.java index ae5c22a1c57a7..26246197cbfa8 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsRequestBuilder.java @@ -36,6 +36,11 @@ import org.opensearch.action.support.master.MasterNodeReadOperationRequestBuilder; import org.opensearch.client.OpenSearchClient; +/** + * Transport request builder for searching shards + * + * @opensearch.internal + */ public class ClusterSearchShardsRequestBuilder extends MasterNodeReadOperationRequestBuilder< ClusterSearchShardsRequest, ClusterSearchShardsResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsResponse.java index 1381a39664a49..6ef55458e413d 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/shards/ClusterSearchShardsResponse.java @@ -44,6 +44,11 @@ import java.util.Arrays; import java.util.Map; +/** + * Transport response for searching shards + * + * @opensearch.internal + */ public class ClusterSearchShardsResponse extends ActionResponse implements ToXContentObject { private final ClusterSearchShardsGroup[] groups; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/shards/TransportClusterSearchShardsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/shards/TransportClusterSearchShardsAction.java index 37a556216c2c9..1d0173b2446dd 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/shards/TransportClusterSearchShardsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/shards/TransportClusterSearchShardsAction.java @@ -58,6 +58,11 @@ import java.util.Map; import java.util.Set; +/** + * Transport action for searching shards + * + * @opensearch.internal + */ public class TransportClusterSearchShardsAction extends TransportMasterNodeReadAction< ClusterSearchShardsRequest, ClusterSearchShardsResponse> { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/clone/CloneSnapshotAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/clone/CloneSnapshotAction.java index 0ecc088ff462a..c6fe102544a7e 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/clone/CloneSnapshotAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/clone/CloneSnapshotAction.java @@ -35,6 +35,11 @@ import org.opensearch.action.ActionType; import org.opensearch.action.support.master.AcknowledgedResponse; +/** + * Transport action for cloning a snapshot + * + * @opensearch.internal + */ public final class CloneSnapshotAction extends ActionType { public static final CloneSnapshotAction INSTANCE = new CloneSnapshotAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/clone/CloneSnapshotRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/clone/CloneSnapshotRequest.java index 58725c23b7fc5..7044a7412058a 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/clone/CloneSnapshotRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/clone/CloneSnapshotRequest.java @@ -46,6 +46,11 @@ import static org.opensearch.action.ValidateActions.addValidationError; +/** + * Transport request for cloning a snapshot + * + * @opensearch.internal + */ public class CloneSnapshotRequest extends MasterNodeRequest implements IndicesRequest.Replaceable, ToXContentObject { private final String repository; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/clone/CloneSnapshotRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/clone/CloneSnapshotRequestBuilder.java index ba6f7a61bdc8d..c2dd9b2b491f2 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/clone/CloneSnapshotRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/clone/CloneSnapshotRequestBuilder.java @@ -39,6 +39,11 @@ import org.opensearch.client.OpenSearchClient; import org.opensearch.common.Strings; +/** + * Transport request builder for cloning a snapshot + * + * @opensearch.internal + */ public class CloneSnapshotRequestBuilder extends MasterNodeOperationRequestBuilder< CloneSnapshotRequest, AcknowledgedResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/clone/TransportCloneSnapshotAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/clone/TransportCloneSnapshotAction.java index 806cb4a82c3c5..a17d19bb870fa 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/clone/TransportCloneSnapshotAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/clone/TransportCloneSnapshotAction.java @@ -51,6 +51,8 @@ /** * Transport action for the clone snapshot operation. + * + * @opensearch.internal */ public final class TransportCloneSnapshotAction extends TransportMasterNodeAction { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotAction.java index 324a28027949f..fb95e311a9783 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotAction.java @@ -36,6 +36,8 @@ /** * Create snapshot action + * + * @opensearch.internal */ public class CreateSnapshotAction extends ActionType { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotRequest.java index 438d2fd006e63..b9d96ed2a752d 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotRequest.java @@ -75,6 +75,8 @@ *

  • must be lowercase
  • *
  • must not contain invalid file name characters {@link org.opensearch.common.Strings#INVALID_FILENAME_CHARS}
  • * + * + * @opensearch.internal */ public class CreateSnapshotRequest extends MasterNodeRequest implements diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotRequestBuilder.java index db30ce8295530..3f74e7d24bcdb 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotRequestBuilder.java @@ -42,6 +42,8 @@ /** * Create snapshot request builder + * + * @opensearch.internal */ public class CreateSnapshotRequestBuilder extends MasterNodeOperationRequestBuilder< CreateSnapshotRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotResponse.java index 9a92971a2a791..c62b1e3f69cb5 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/create/CreateSnapshotResponse.java @@ -50,6 +50,8 @@ /** * Create snapshot response + * + * @opensearch.internal */ public class CreateSnapshotResponse extends ActionResponse implements ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/create/TransportCreateSnapshotAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/create/TransportCreateSnapshotAction.java index 377fe03a9b030..f05980f2eb41f 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/create/TransportCreateSnapshotAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/create/TransportCreateSnapshotAction.java @@ -50,6 +50,8 @@ /** * Transport action for create snapshot operation + * + * @opensearch.internal */ public class TransportCreateSnapshotAction extends TransportMasterNodeAction { private final SnapshotsService snapshotsService; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/delete/DeleteSnapshotAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/delete/DeleteSnapshotAction.java index 4c577bd0bbce2..0b98a4b31fd53 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/delete/DeleteSnapshotAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/delete/DeleteSnapshotAction.java @@ -37,6 +37,8 @@ /** * Delete snapshot action + * + * @opensearch.internal */ public class DeleteSnapshotAction extends ActionType { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/delete/DeleteSnapshotRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/delete/DeleteSnapshotRequest.java index fe9dc4db626f7..d446221e8e175 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/delete/DeleteSnapshotRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/delete/DeleteSnapshotRequest.java @@ -47,6 +47,8 @@ *

    * Delete snapshot request removes snapshots from the repository and cleans up all files that are associated with the snapshots. * All files that are shared with at least one other existing snapshot are left intact. + * + * @opensearch.internal */ public class DeleteSnapshotRequest extends MasterNodeRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/delete/DeleteSnapshotRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/delete/DeleteSnapshotRequestBuilder.java index 951f86bafb7b1..684d96d1aa8d9 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/delete/DeleteSnapshotRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/delete/DeleteSnapshotRequestBuilder.java @@ -38,6 +38,8 @@ /** * Delete snapshot request builder + * + * @opensearch.internal */ public class DeleteSnapshotRequestBuilder extends MasterNodeOperationRequestBuilder< DeleteSnapshotRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/delete/TransportDeleteSnapshotAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/delete/TransportDeleteSnapshotAction.java index 0781f01e9bc61..ad71f970edcd5 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/delete/TransportDeleteSnapshotAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/delete/TransportDeleteSnapshotAction.java @@ -51,6 +51,8 @@ /** * Transport action for delete snapshot operation + * + * @opensearch.internal */ public class TransportDeleteSnapshotAction extends TransportMasterNodeAction { private final SnapshotsService snapshotsService; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/get/GetSnapshotsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/get/GetSnapshotsAction.java index 22e3e859394c7..59d7969d04f86 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/get/GetSnapshotsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/get/GetSnapshotsAction.java @@ -36,6 +36,8 @@ /** * Get snapshots action + * + * @opensearch.internal */ public class GetSnapshotsAction extends ActionType { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/get/GetSnapshotsRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/get/GetSnapshotsRequest.java index 549e3cea70deb..822598bd7f78b 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/get/GetSnapshotsRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/get/GetSnapshotsRequest.java @@ -44,6 +44,8 @@ /** * Get snapshot request + * + * @opensearch.internal */ public class GetSnapshotsRequest extends MasterNodeRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/get/GetSnapshotsRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/get/GetSnapshotsRequestBuilder.java index bd2ced2733169..46317a3493650 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/get/GetSnapshotsRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/get/GetSnapshotsRequestBuilder.java @@ -38,6 +38,8 @@ /** * Get snapshots request builder + * + * @opensearch.internal */ public class GetSnapshotsRequestBuilder extends MasterNodeOperationRequestBuilder< GetSnapshotsRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/get/GetSnapshotsResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/get/GetSnapshotsResponse.java index 28981a6bdafe2..4d0daf6b67e45 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/get/GetSnapshotsResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/get/GetSnapshotsResponse.java @@ -51,6 +51,8 @@ /** * Get snapshots response + * + * @opensearch.internal */ public class GetSnapshotsResponse extends ActionResponse implements ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/get/TransportGetSnapshotsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/get/TransportGetSnapshotsAction.java index 91cec4b268f9b..dab87c72c5dce 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/get/TransportGetSnapshotsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/get/TransportGetSnapshotsAction.java @@ -76,6 +76,8 @@ /** * Transport Action for get snapshots operation + * + * @opensearch.internal */ public class TransportGetSnapshotsAction extends TransportMasterNodeAction { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreClusterStateListener.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreClusterStateListener.java index cb6f8493551f6..7d2ca99e3dbf5 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreClusterStateListener.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreClusterStateListener.java @@ -46,6 +46,11 @@ import static org.opensearch.snapshots.RestoreService.restoreInProgress; +/** + * Transport listener for cluster state updates + * + * @opensearch.internal + */ public class RestoreClusterStateListener implements ClusterStateListener { private static final Logger logger = LogManager.getLogger(RestoreClusterStateListener.class); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotAction.java index e86ad12b8a231..1813e8214aeb0 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotAction.java @@ -36,6 +36,8 @@ /** * Restore snapshot action + * + * @opensearch.internal */ public class RestoreSnapshotAction extends ActionType { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java index ed45ba4f65941..ec3809fb52516 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java @@ -61,6 +61,8 @@ /** * Restore snapshot request + * + * @opensearch.internal */ public class RestoreSnapshotRequest extends MasterNodeRequest implements ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequestBuilder.java index 19fc86c9c4ace..34a6586d52917 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequestBuilder.java @@ -43,6 +43,8 @@ /** * Restore snapshot request builder + * + * @opensearch.internal */ public class RestoreSnapshotRequestBuilder extends MasterNodeOperationRequestBuilder< RestoreSnapshotRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotResponse.java index 324e3054fb1a3..658d7139644c1 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/RestoreSnapshotResponse.java @@ -52,6 +52,8 @@ /** * Contains information about restores snapshot + * + * @opensearch.internal */ public class RestoreSnapshotResponse extends ActionResponse implements ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/TransportRestoreSnapshotAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/TransportRestoreSnapshotAction.java index c07f771081902..2deed9f2dc93b 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/TransportRestoreSnapshotAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/restore/TransportRestoreSnapshotAction.java @@ -50,6 +50,8 @@ /** * Transport action for restore snapshot operation + * + * @opensearch.internal */ public class TransportRestoreSnapshotAction extends TransportMasterNodeAction { private final RestoreService restoreService; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStage.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStage.java index 59ead89c4a4ee..6e250962d1210 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStage.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStage.java @@ -32,6 +32,11 @@ package org.opensearch.action.admin.cluster.snapshots.status; +/** + * Stage for snapshotting an Index Shard + * + * @opensearch.internal + */ public enum SnapshotIndexShardStage { /** diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStatus.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStatus.java index 41ee6719f75e5..6956de88cadae 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStatus.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexShardStatus.java @@ -53,6 +53,11 @@ import static org.opensearch.common.xcontent.ConstructingObjectParser.constructorArg; import static org.opensearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +/** + * Status for snapshotting an Index Shard + * + * @opensearch.internal + */ public class SnapshotIndexShardStatus extends BroadcastShardResponse implements ToXContentFragment { private SnapshotIndexShardStage stage = SnapshotIndexShardStage.INIT; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexStatus.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexStatus.java index ae85458a7acb1..ae9a6d1fc8c89 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexStatus.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotIndexStatus.java @@ -53,6 +53,8 @@ /** * Represents snapshot status of all shards in the index + * + * @opensearch.internal */ public class SnapshotIndexStatus implements Iterable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotShardsStats.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotShardsStats.java index be4299041e42e..ba58130cead29 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotShardsStats.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotShardsStats.java @@ -46,6 +46,8 @@ /** * Status of a snapshot shards + * + * @opensearch.internal */ public class SnapshotShardsStats implements ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotStats.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotStats.java index 74f5c5175882a..f649bc4694fca 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotStats.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotStats.java @@ -46,6 +46,11 @@ import java.io.IOException; +/** + * Stats for snapshots + * + * @opensearch.internal + */ public class SnapshotStats implements Writeable, ToXContentObject { private long startTime; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotStatus.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotStatus.java index 76764a39ff7e2..8fd1ed22a0d14 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotStatus.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotStatus.java @@ -67,6 +67,8 @@ /** * Status of a snapshot + * + * @opensearch.internal */ public class SnapshotStatus implements ToXContentObject, Writeable { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotsStatusAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotsStatusAction.java index d4f398d543b81..c4fe06e985f6f 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotsStatusAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotsStatusAction.java @@ -36,6 +36,8 @@ /** * Snapshots status action + * + * @opensearch.internal */ public class SnapshotsStatusAction extends ActionType { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotsStatusRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotsStatusRequest.java index f7e29cfef0bb4..d5c7c63b0db43 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotsStatusRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotsStatusRequest.java @@ -44,6 +44,8 @@ /** * Get snapshot status request + * + * @opensearch.internal */ public class SnapshotsStatusRequest extends MasterNodeRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotsStatusRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotsStatusRequestBuilder.java index 67c82182e38c9..3e281ce8059d1 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotsStatusRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotsStatusRequestBuilder.java @@ -38,6 +38,8 @@ /** * Snapshots status request builder + * + * @opensearch.internal */ public class SnapshotsStatusRequestBuilder extends MasterNodeOperationRequestBuilder< SnapshotsStatusRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotsStatusResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotsStatusResponse.java index 8519b1f6a3379..86183d8a2d8eb 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotsStatusResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/SnapshotsStatusResponse.java @@ -50,6 +50,8 @@ /** * Snapshot status response + * + * @opensearch.internal */ public class SnapshotsStatusResponse extends ActionResponse implements ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/TransportNodesSnapshotsStatus.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/TransportNodesSnapshotsStatus.java index 20e626ab02e68..86d0499a23f9e 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/TransportNodesSnapshotsStatus.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/TransportNodesSnapshotsStatus.java @@ -63,6 +63,8 @@ /** * Transport action that collects snapshot shard statuses from data nodes + * + * @opensearch.internal */ public class TransportNodesSnapshotsStatus extends TransportNodesAction< TransportNodesSnapshotsStatus.Request, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/TransportSnapshotsStatusAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/TransportSnapshotsStatusAction.java index 1e29a70e1f41f..dec169a6633cf 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/TransportSnapshotsStatusAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/snapshots/status/TransportSnapshotsStatusAction.java @@ -84,6 +84,11 @@ import static java.util.Collections.unmodifiableMap; +/** + * Transport action for accessing snapshot status + * + * @opensearch.internal + */ public class TransportSnapshotsStatusAction extends TransportMasterNodeAction { private static final Logger logger = LogManager.getLogger(TransportSnapshotsStatusAction.class); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/state/ClusterStateAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/state/ClusterStateAction.java index dff45b708fb13..ba3658d68296e 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/state/ClusterStateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/state/ClusterStateAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for obtaining cluster state + * + * @opensearch.internal + */ public class ClusterStateAction extends ActionType { public static final ClusterStateAction INSTANCE = new ClusterStateAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/state/ClusterStateRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/state/ClusterStateRequest.java index 91e01aa74f8a5..bf2204a9f8e15 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/state/ClusterStateRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/state/ClusterStateRequest.java @@ -43,6 +43,11 @@ import java.io.IOException; +/** + * Transport request for obtaining cluster state + * + * @opensearch.internal + */ public class ClusterStateRequest extends MasterNodeReadRequest implements IndicesRequest.Replaceable { public static final TimeValue DEFAULT_WAIT_FOR_NODE_TIMEOUT = TimeValue.timeValueMinutes(1); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/state/ClusterStateRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/state/ClusterStateRequestBuilder.java index cf3eabfc4167d..530d99f5db808 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/state/ClusterStateRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/state/ClusterStateRequestBuilder.java @@ -37,6 +37,11 @@ import org.opensearch.client.OpenSearchClient; import org.opensearch.common.unit.TimeValue; +/** + * Transport request builder for obtaining cluster state + * + * @opensearch.internal + */ public class ClusterStateRequestBuilder extends MasterNodeReadOperationRequestBuilder< ClusterStateRequest, ClusterStateResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/state/ClusterStateResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/state/ClusterStateResponse.java index 80d1f7022967d..ec2697fbd7339 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/state/ClusterStateResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/state/ClusterStateResponse.java @@ -46,6 +46,8 @@ /** * The response for getting the cluster state. + * + * @opensearch.internal */ public class ClusterStateResponse extends ActionResponse { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/state/TransportClusterStateAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/state/TransportClusterStateAction.java index 595127d83d4bf..885769dd200cf 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/state/TransportClusterStateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/state/TransportClusterStateAction.java @@ -58,6 +58,11 @@ import java.io.IOException; import java.util.function.Predicate; +/** + * Transport action for obtaining cluster state + * + * @opensearch.internal + */ public class TransportClusterStateAction extends TransportMasterNodeReadAction { private final Logger logger = LogManager.getLogger(getClass()); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/stats/AnalysisStats.java b/server/src/main/java/org/opensearch/action/admin/cluster/stats/AnalysisStats.java index 3ae8d684ee870..1f1920d8d675d 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/stats/AnalysisStats.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/stats/AnalysisStats.java @@ -59,6 +59,8 @@ /** * Statistics about analysis usage. + * + * @opensearch.internal */ public final class AnalysisStats implements ToXContentFragment, Writeable { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsAction.java index baeeec91bd8ce..ef20087a667df 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for obtaining cluster stats + * + * @opensearch.internal + */ public class ClusterStatsAction extends ActionType { public static final ClusterStatsAction INSTANCE = new ClusterStatsAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsIndices.java b/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsIndices.java index 6b9ba90dde9ea..e72d2a6bbdb7d 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsIndices.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsIndices.java @@ -47,6 +47,11 @@ import java.io.IOException; import java.util.List; +/** + * Cluster Stats per index + * + * @opensearch.internal + */ public class ClusterStatsIndices implements ToXContentFragment { private int indexCount; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsNodeResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsNodeResponse.java index 01d4d5ac0fb53..2d684c3333f24 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsNodeResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsNodeResponse.java @@ -44,6 +44,11 @@ import java.io.IOException; +/** + * Transport action for obtaining cluster stats from node level + * + * @opensearch.internal + */ public class ClusterStatsNodeResponse extends BaseNodeResponse { private final NodeInfo nodeInfo; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsNodes.java b/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsNodes.java index 7d23ba6fa3a14..b76d209a4894f 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsNodes.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsNodes.java @@ -69,6 +69,11 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; +/** + * Per Node Cluster Stats + * + * @opensearch.internal + */ public class ClusterStatsNodes implements ToXContentFragment { private final Counts counts; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsRequest.java index ed658ae23999a..43b3cf11237f7 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsRequest.java @@ -40,6 +40,8 @@ /** * A request to get cluster level stats. + * + * @opensearch.internal */ public class ClusterStatsRequest extends BaseNodesRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsRequestBuilder.java index 33c346a493986..aaf5e3aeffeb8 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsRequestBuilder.java @@ -35,6 +35,11 @@ import org.opensearch.action.support.nodes.NodesOperationRequestBuilder; import org.opensearch.client.OpenSearchClient; +/** + * Transport request builder for obtaining cluster stats + * + * @opensearch.internal + */ public class ClusterStatsRequestBuilder extends NodesOperationRequestBuilder< ClusterStatsRequest, ClusterStatsResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsResponse.java index 172159a1efe5b..c6519d6669ea8 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsResponse.java @@ -49,6 +49,11 @@ import java.util.List; import java.util.Locale; +/** + * Transport response for obtaining cluster stats + * + * @opensearch.internal + */ public class ClusterStatsResponse extends BaseNodesResponse implements ToXContentFragment { final ClusterStatsNodes nodesStats; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/stats/IndexFeatureStats.java b/server/src/main/java/org/opensearch/action/admin/cluster/stats/IndexFeatureStats.java index 0c428ee4fe0ee..0da99097aa4f4 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/stats/IndexFeatureStats.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/stats/IndexFeatureStats.java @@ -43,6 +43,8 @@ /** * Statistics about an index feature. + * + * @opensearch.internal */ public final class IndexFeatureStats implements ToXContent, Writeable { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/stats/MappingStats.java b/server/src/main/java/org/opensearch/action/admin/cluster/stats/MappingStats.java index fc4b61af4ddde..71e183e6158dc 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/stats/MappingStats.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/stats/MappingStats.java @@ -56,6 +56,8 @@ /** * Usage statistics about mappings usage. + * + * @opensearch.internal */ public final class MappingStats implements ToXContentFragment, Writeable { diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/stats/MappingVisitor.java b/server/src/main/java/org/opensearch/action/admin/cluster/stats/MappingVisitor.java index 4f16dbcff668e..b2a5acb235ace 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/stats/MappingVisitor.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/stats/MappingVisitor.java @@ -35,6 +35,11 @@ import java.util.Map; import java.util.function.Consumer; +/** + * Visitor pattern for obtaining index mappings + * + * @opensearch.internal + */ final class MappingVisitor { private MappingVisitor() {} diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/stats/TransportClusterStatsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/stats/TransportClusterStatsAction.java index bf0deb71f4134..984735a648dc7 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/stats/TransportClusterStatsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/stats/TransportClusterStatsAction.java @@ -64,6 +64,11 @@ import java.util.ArrayList; import java.util.List; +/** + * Transport action for obtaining cluster state + * + * @opensearch.internal + */ public class TransportClusterStatsAction extends TransportNodesAction< ClusterStatsRequest, ClusterStatsResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/DeleteStoredScriptAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/DeleteStoredScriptAction.java index ab20c4052938d..3645ef21d2e12 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/DeleteStoredScriptAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/DeleteStoredScriptAction.java @@ -35,6 +35,11 @@ import org.opensearch.action.ActionType; import org.opensearch.action.support.master.AcknowledgedResponse; +/** + * Transport action for deleting stored scripts + * + * @opensearch.internal + */ public class DeleteStoredScriptAction extends ActionType { public static final DeleteStoredScriptAction INSTANCE = new DeleteStoredScriptAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/DeleteStoredScriptRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/DeleteStoredScriptRequest.java index eda9aa053854f..93d2c3ba3c452 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/DeleteStoredScriptRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/DeleteStoredScriptRequest.java @@ -41,6 +41,11 @@ import static org.opensearch.action.ValidateActions.addValidationError; +/** + * Transport request for deleting stored scripts + * + * @opensearch.internal + */ public class DeleteStoredScriptRequest extends AcknowledgedRequest { private String id; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/DeleteStoredScriptRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/DeleteStoredScriptRequestBuilder.java index d45b0b02d9d83..34e0d429f2098 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/DeleteStoredScriptRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/DeleteStoredScriptRequestBuilder.java @@ -36,6 +36,11 @@ import org.opensearch.action.support.master.AcknowledgedResponse; import org.opensearch.client.OpenSearchClient; +/** + * Transport request builder for deleting stored scripts + * + * @opensearch.internal + */ public class DeleteStoredScriptRequestBuilder extends AcknowledgedRequestBuilder< DeleteStoredScriptRequest, AcknowledgedResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptContextAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptContextAction.java index 9aebd60c8997b..df33aa8081849 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptContextAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptContextAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for getting stored scripts + * + * @opensearch.internal + */ public class GetScriptContextAction extends ActionType { public static final GetScriptContextAction INSTANCE = new GetScriptContextAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptContextRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptContextRequest.java index 90ec611eeae9d..385948b613199 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptContextRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptContextRequest.java @@ -37,6 +37,11 @@ import java.io.IOException; +/** + * Transport context for getting stored scripts + * + * @opensearch.internal + */ public class GetScriptContextRequest extends ActionRequest { public GetScriptContextRequest() { super(); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptContextResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptContextResponse.java index 7bfcface8b75c..b06e10834abfc 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptContextResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptContextResponse.java @@ -54,6 +54,11 @@ import java.util.function.Function; import java.util.stream.Collectors; +/** + * Transport context response for getting stored scripts + * + * @opensearch.internal + */ public class GetScriptContextResponse extends ActionResponse implements StatusToXContentObject { private static final ParseField CONTEXTS = new ParseField("contexts"); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptLanguageAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptLanguageAction.java index 90cc05ba983de..b2da146a7ccbe 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptLanguageAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptLanguageAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for getting script language + * + * @opensearch.internal + */ public class GetScriptLanguageAction extends ActionType { public static final GetScriptLanguageAction INSTANCE = new GetScriptLanguageAction(); public static final String NAME = "cluster:admin/script_language/get"; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptLanguageRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptLanguageRequest.java index 0a68af3acd5d7..b6159e10cecb7 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptLanguageRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptLanguageRequest.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Transport request for getting script language + * + * @opensearch.internal + */ public class GetScriptLanguageRequest extends ActionRequest { public GetScriptLanguageRequest() { super(); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptLanguageResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptLanguageResponse.java index d9d6fa9e650de..45d69a2596b19 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptLanguageResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetScriptLanguageResponse.java @@ -45,6 +45,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Transport response for getting script language + * + * @opensearch.internal + */ public class GetScriptLanguageResponse extends ActionResponse implements StatusToXContentObject, Writeable { public final ScriptLanguagesInfo info; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetStoredScriptAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetStoredScriptAction.java index 40d887987ae40..f4cb82d68456a 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetStoredScriptAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetStoredScriptAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for getting stored script + * + * @opensearch.internal + */ public class GetStoredScriptAction extends ActionType { public static final GetStoredScriptAction INSTANCE = new GetStoredScriptAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetStoredScriptRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetStoredScriptRequest.java index afecdc09d991d..2a51bd9ad3eef 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetStoredScriptRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetStoredScriptRequest.java @@ -41,6 +41,11 @@ import static org.opensearch.action.ValidateActions.addValidationError; +/** + * Transport request for getting stored script + * + * @opensearch.internal + */ public class GetStoredScriptRequest extends MasterNodeReadRequest { protected String id; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetStoredScriptRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetStoredScriptRequestBuilder.java index cbae829e76c04..3c8b74c240f29 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetStoredScriptRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetStoredScriptRequestBuilder.java @@ -35,6 +35,11 @@ import org.opensearch.action.support.master.MasterNodeReadOperationRequestBuilder; import org.opensearch.client.OpenSearchClient; +/** + * Transport request builder for getting stored script + * + * @opensearch.internal + */ public class GetStoredScriptRequestBuilder extends MasterNodeReadOperationRequestBuilder< GetStoredScriptRequest, GetStoredScriptResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetStoredScriptResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetStoredScriptResponse.java index 7739f87db74f9..799e308acae39 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetStoredScriptResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/GetStoredScriptResponse.java @@ -50,6 +50,11 @@ import static org.opensearch.common.xcontent.ConstructingObjectParser.constructorArg; import static org.opensearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +/** + * Transport response for getting stored script + * + * @opensearch.internal + */ public class GetStoredScriptResponse extends ActionResponse implements StatusToXContentObject { public static final ParseField _ID_PARSE_FIELD = new ParseField("_id"); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/PutStoredScriptAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/PutStoredScriptAction.java index 75a2dc12d81f6..2845d895a69e8 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/PutStoredScriptAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/PutStoredScriptAction.java @@ -35,6 +35,11 @@ import org.opensearch.action.ActionType; import org.opensearch.action.support.master.AcknowledgedResponse; +/** + * Transport action for putting stored script + * + * @opensearch.internal + */ public class PutStoredScriptAction extends ActionType { public static final PutStoredScriptAction INSTANCE = new PutStoredScriptAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/PutStoredScriptRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/PutStoredScriptRequest.java index 4665354918c8f..2bddf2823f962 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/PutStoredScriptRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/PutStoredScriptRequest.java @@ -48,6 +48,11 @@ import static org.opensearch.action.ValidateActions.addValidationError; +/** + * Transport request for putting stored script + * + * @opensearch.internal + */ public class PutStoredScriptRequest extends AcknowledgedRequest implements ToXContentFragment { private String id; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/PutStoredScriptRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/PutStoredScriptRequestBuilder.java index 414ed3d273b75..ef3c14df29627 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/PutStoredScriptRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/PutStoredScriptRequestBuilder.java @@ -38,6 +38,11 @@ import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.xcontent.XContentType; +/** + * Transport request builder for putting stored script + * + * @opensearch.internal + */ public class PutStoredScriptRequestBuilder extends AcknowledgedRequestBuilder< PutStoredScriptRequest, AcknowledgedResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/TransportDeleteStoredScriptAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/TransportDeleteStoredScriptAction.java index 0b5f9d3040add..1550af534e5bf 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/TransportDeleteStoredScriptAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/TransportDeleteStoredScriptAction.java @@ -49,6 +49,11 @@ import java.io.IOException; +/** + * Transport action for deleting stored script + * + * @opensearch.internal + */ public class TransportDeleteStoredScriptAction extends TransportMasterNodeAction { private final ScriptService scriptService; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/TransportGetScriptContextAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/TransportGetScriptContextAction.java index 0bcd9a71109ed..88184d59932ea 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/TransportGetScriptContextAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/TransportGetScriptContextAction.java @@ -42,6 +42,11 @@ import java.util.Set; +/** + * Transport action for getting script context + * + * @opensearch.internal + */ public class TransportGetScriptContextAction extends HandledTransportAction { private final ScriptService scriptService; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/TransportGetScriptLanguageAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/TransportGetScriptLanguageAction.java index 255889b63dbd8..0ecd6e8cf35d7 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/TransportGetScriptLanguageAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/TransportGetScriptLanguageAction.java @@ -40,6 +40,11 @@ import org.opensearch.tasks.Task; import org.opensearch.transport.TransportService; +/** + * Transport action for getting script language + * + * @opensearch.internal + */ public class TransportGetScriptLanguageAction extends HandledTransportAction { private final ScriptService scriptService; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/TransportGetStoredScriptAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/TransportGetStoredScriptAction.java index 4a87f6795da50..b3f5890de40b9 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/TransportGetStoredScriptAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/TransportGetStoredScriptAction.java @@ -48,6 +48,11 @@ import java.io.IOException; +/** + * Transport action for getting stored script + * + * @opensearch.internal + */ public class TransportGetStoredScriptAction extends TransportMasterNodeReadAction { private final ScriptService scriptService; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/TransportPutStoredScriptAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/TransportPutStoredScriptAction.java index a8288fc0147c2..fa0e97d4c02f1 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/TransportPutStoredScriptAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/storedscripts/TransportPutStoredScriptAction.java @@ -49,6 +49,11 @@ import java.io.IOException; +/** + * Transport action for putting stored script + * + * @opensearch.internal + */ public class TransportPutStoredScriptAction extends TransportMasterNodeAction { private final ScriptService scriptService; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/tasks/PendingClusterTasksAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/tasks/PendingClusterTasksAction.java index 851b88f1e639a..9f3e8720d1f56 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/tasks/PendingClusterTasksAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/tasks/PendingClusterTasksAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for getting pending cluster tasks + * + * @opensearch.internal + */ public class PendingClusterTasksAction extends ActionType { public static final PendingClusterTasksAction INSTANCE = new PendingClusterTasksAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/tasks/PendingClusterTasksRequest.java b/server/src/main/java/org/opensearch/action/admin/cluster/tasks/PendingClusterTasksRequest.java index 463481fe5d0e5..27f5e3bc9b991 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/tasks/PendingClusterTasksRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/tasks/PendingClusterTasksRequest.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Transport request for getting pending cluster tasks + * + * @opensearch.internal + */ public class PendingClusterTasksRequest extends MasterNodeReadRequest { public PendingClusterTasksRequest() {} diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/tasks/PendingClusterTasksRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/cluster/tasks/PendingClusterTasksRequestBuilder.java index 8f3bccdf5e55f..08afa81a8194d 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/tasks/PendingClusterTasksRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/tasks/PendingClusterTasksRequestBuilder.java @@ -35,6 +35,11 @@ import org.opensearch.action.support.master.MasterNodeReadOperationRequestBuilder; import org.opensearch.client.OpenSearchClient; +/** + * Transport request builder for getting pending cluster tasks + * + * @opensearch.internal + */ public class PendingClusterTasksRequestBuilder extends MasterNodeReadOperationRequestBuilder< PendingClusterTasksRequest, PendingClusterTasksResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/tasks/PendingClusterTasksResponse.java b/server/src/main/java/org/opensearch/action/admin/cluster/tasks/PendingClusterTasksResponse.java index bab71f776c7d0..e7f17153b8506 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/tasks/PendingClusterTasksResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/tasks/PendingClusterTasksResponse.java @@ -43,6 +43,11 @@ import java.util.Iterator; import java.util.List; +/** + * Transport response for getting pending cluster tasks + * + * @opensearch.internal + */ public class PendingClusterTasksResponse extends ActionResponse implements Iterable, ToXContentObject { private final List pendingTasks; diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/tasks/TransportPendingClusterTasksAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/tasks/TransportPendingClusterTasksAction.java index 932722eae8a80..13a805e1e49f0 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/tasks/TransportPendingClusterTasksAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/tasks/TransportPendingClusterTasksAction.java @@ -50,6 +50,11 @@ import java.io.IOException; import java.util.List; +/** + * Transport action for getting pending cluster tasks + * + * @opensearch.internal + */ public class TransportPendingClusterTasksAction extends TransportMasterNodeReadAction< PendingClusterTasksRequest, PendingClusterTasksResponse> { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/alias/Alias.java b/server/src/main/java/org/opensearch/action/admin/indices/alias/Alias.java index d8853bcede3ef..f9a785d1759d8 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/alias/Alias.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/alias/Alias.java @@ -55,6 +55,8 @@ /** * Represents an alias, to be associated with an index + * + * @opensearch.internal */ public class Alias implements Writeable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/alias/IndicesAliasesAction.java b/server/src/main/java/org/opensearch/action/admin/indices/alias/IndicesAliasesAction.java index 33566820d9762..4d735e984c34e 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/alias/IndicesAliasesAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/alias/IndicesAliasesAction.java @@ -35,6 +35,11 @@ import org.opensearch.action.ActionType; import org.opensearch.action.support.master.AcknowledgedResponse; +/** + * Transport action for listing index aliases + * + * @opensearch.internal + */ public class IndicesAliasesAction extends ActionType { public static final IndicesAliasesAction INSTANCE = new IndicesAliasesAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/alias/IndicesAliasesClusterStateUpdateRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/alias/IndicesAliasesClusterStateUpdateRequest.java index f89f8a06727c1..4a445ca92d2dd 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/alias/IndicesAliasesClusterStateUpdateRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/alias/IndicesAliasesClusterStateUpdateRequest.java @@ -38,6 +38,8 @@ /** * Cluster state update request that allows to add or remove aliases + * + * @opensearch.internal */ public class IndicesAliasesClusterStateUpdateRequest extends ClusterStateUpdateRequest { private final List actions; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/alias/IndicesAliasesRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/alias/IndicesAliasesRequest.java index 587c5c3c7a5a8..d6a1488f3f226 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/alias/IndicesAliasesRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/alias/IndicesAliasesRequest.java @@ -72,6 +72,8 @@ /** * A request to add/remove aliases for one or more indices. + * + * @opensearch.internal */ public class IndicesAliasesRequest extends AcknowledgedRequest implements ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/alias/IndicesAliasesRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/alias/IndicesAliasesRequestBuilder.java index f74363db3dcfd..13c57cc781925 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/alias/IndicesAliasesRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/alias/IndicesAliasesRequestBuilder.java @@ -41,6 +41,8 @@ /** * Builder for request to modify many aliases at once. + * + * @opensearch.internal */ public class IndicesAliasesRequestBuilder extends AcknowledgedRequestBuilder< IndicesAliasesRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/alias/TransportIndicesAliasesAction.java b/server/src/main/java/org/opensearch/action/admin/indices/alias/TransportIndicesAliasesAction.java index 82eb3aed7da16..2e5cf23360125 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/alias/TransportIndicesAliasesAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/alias/TransportIndicesAliasesAction.java @@ -72,6 +72,8 @@ /** * Add/remove aliases action + * + * @opensearch.internal */ public class TransportIndicesAliasesAction extends TransportMasterNodeAction { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/alias/get/BaseAliasesRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/alias/get/BaseAliasesRequestBuilder.java index 3d8fa05fb7658..82f9d9a35dd2c 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/alias/get/BaseAliasesRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/alias/get/BaseAliasesRequestBuilder.java @@ -39,6 +39,11 @@ import org.opensearch.client.OpenSearchClient; import org.opensearch.common.util.ArrayUtils; +/** + * Base request builder for listing index aliases + * + * @opensearch.internal + */ public abstract class BaseAliasesRequestBuilder< Response extends ActionResponse, Builder extends BaseAliasesRequestBuilder> extends MasterNodeReadOperationRequestBuilder< diff --git a/server/src/main/java/org/opensearch/action/admin/indices/alias/get/GetAliasesAction.java b/server/src/main/java/org/opensearch/action/admin/indices/alias/get/GetAliasesAction.java index 198fa328111b8..d45f988330010 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/alias/get/GetAliasesAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/alias/get/GetAliasesAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for listing index aliases + * + * @opensearch.internal + */ public class GetAliasesAction extends ActionType { public static final GetAliasesAction INSTANCE = new GetAliasesAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/alias/get/GetAliasesRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/alias/get/GetAliasesRequest.java index 661af82d7020d..46f2ee8765910 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/alias/get/GetAliasesRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/alias/get/GetAliasesRequest.java @@ -41,6 +41,11 @@ import java.io.IOException; +/** + * Transport request for listing index aliases + * + * @opensearch.internal + */ public class GetAliasesRequest extends MasterNodeReadRequest implements AliasesRequest { private String[] indices = Strings.EMPTY_ARRAY; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/alias/get/GetAliasesRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/alias/get/GetAliasesRequestBuilder.java index f7902ef73fbd5..aecbd689a647c 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/alias/get/GetAliasesRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/alias/get/GetAliasesRequestBuilder.java @@ -34,6 +34,11 @@ import org.opensearch.client.OpenSearchClient; +/** + * Transport request builder for listing index aliases + * + * @opensearch.internal + */ public class GetAliasesRequestBuilder extends BaseAliasesRequestBuilder { public GetAliasesRequestBuilder(OpenSearchClient client, GetAliasesAction action, String... aliases) { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/alias/get/GetAliasesResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/alias/get/GetAliasesResponse.java index 8901a067bb020..60c0a403566d5 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/alias/get/GetAliasesResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/alias/get/GetAliasesResponse.java @@ -42,6 +42,11 @@ import java.util.List; import java.util.Objects; +/** + * Transport response for listing index aliases + * + * @opensearch.internal + */ public class GetAliasesResponse extends ActionResponse { private final ImmutableOpenMap> aliases; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/alias/get/TransportGetAliasesAction.java b/server/src/main/java/org/opensearch/action/admin/indices/alias/get/TransportGetAliasesAction.java index fa26560e4fedf..1996b11901c3a 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/alias/get/TransportGetAliasesAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/alias/get/TransportGetAliasesAction.java @@ -59,6 +59,11 @@ import java.util.Set; import java.util.stream.Collectors; +/** + * Transport action for listing index aliases + * + * @opensearch.internal + */ public class TransportGetAliasesAction extends TransportMasterNodeReadAction { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(TransportGetAliasesAction.class); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/analyze/AnalyzeAction.java b/server/src/main/java/org/opensearch/action/admin/indices/analyze/AnalyzeAction.java index aa4587b93ff87..e1d890025fdeb 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/analyze/AnalyzeAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/analyze/AnalyzeAction.java @@ -59,6 +59,11 @@ import static org.opensearch.action.ValidateActions.addValidationError; +/** + * Transport action for analyzing text + * + * @opensearch.internal + */ public class AnalyzeAction extends ActionType { public static final AnalyzeAction INSTANCE = new AnalyzeAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/analyze/AnalyzeRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/analyze/AnalyzeRequestBuilder.java index 167feb7935be2..a7f21b2af16fc 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/analyze/AnalyzeRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/analyze/AnalyzeRequestBuilder.java @@ -36,6 +36,11 @@ import java.util.Map; +/** + * Transport request builder for analyzing text + * + * @opensearch.internal + */ public class AnalyzeRequestBuilder extends SingleShardOperationRequestBuilder< AnalyzeAction.Request, AnalyzeAction.Response, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/analyze/TransportAnalyzeAction.java b/server/src/main/java/org/opensearch/action/admin/indices/analyze/TransportAnalyzeAction.java index f9fc16fe26e9a..e5efe9055592d 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/analyze/TransportAnalyzeAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/analyze/TransportAnalyzeAction.java @@ -82,6 +82,8 @@ /** * Transport action used to execute analyze requests + * + * @opensearch.internal */ public class TransportAnalyzeAction extends TransportSingleShardAction { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheAction.java b/server/src/main/java/org/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheAction.java index b21b52f063691..f605f042a05ac 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for clearing cache + * + * @opensearch.internal + */ public class ClearIndicesCacheAction extends ActionType { public static final ClearIndicesCacheAction INSTANCE = new ClearIndicesCacheAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheRequest.java index a9eafc7defaba..35913c2579aa9 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheRequest.java @@ -39,6 +39,11 @@ import java.io.IOException; +/** + * Transport request for clearing cache + * + * @opensearch.internal + */ public class ClearIndicesCacheRequest extends BroadcastRequest { private boolean queryCache = false; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheRequestBuilder.java index c7365a0e22e83..2a48e7d7e0eeb 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheRequestBuilder.java @@ -35,6 +35,11 @@ import org.opensearch.action.support.broadcast.BroadcastOperationRequestBuilder; import org.opensearch.client.OpenSearchClient; +/** + * Transport request builder for clearing cache + * + * @opensearch.internal + */ public class ClearIndicesCacheRequestBuilder extends BroadcastOperationRequestBuilder< ClearIndicesCacheRequest, ClearIndicesCacheResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheResponse.java index 58d8767697528..707a3cedf72d6 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/cache/clear/ClearIndicesCacheResponse.java @@ -44,6 +44,8 @@ /** * The response of a clear cache action. + * + * @opensearch.internal */ public class ClearIndicesCacheResponse extends BroadcastResponse { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/cache/clear/TransportClearIndicesCacheAction.java b/server/src/main/java/org/opensearch/action/admin/indices/cache/clear/TransportClearIndicesCacheAction.java index baa51e023e75a..12f1c78cea0c7 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/cache/clear/TransportClearIndicesCacheAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/cache/clear/TransportClearIndicesCacheAction.java @@ -53,6 +53,8 @@ /** * Indices clear cache action. + * + * @opensearch.internal */ public class TransportClearIndicesCacheAction extends TransportBroadcastByNodeAction< ClearIndicesCacheRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/close/CloseIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/close/CloseIndexAction.java index ae8347a5ce812..2dea3e415ae0d 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/close/CloseIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/close/CloseIndexAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for closing an index + * + * @opensearch.internal + */ public class CloseIndexAction extends ActionType { public static final CloseIndexAction INSTANCE = new CloseIndexAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/close/CloseIndexClusterStateUpdateRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/close/CloseIndexClusterStateUpdateRequest.java index b94d080a331be..4b446f9d1ad2a 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/close/CloseIndexClusterStateUpdateRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/close/CloseIndexClusterStateUpdateRequest.java @@ -36,6 +36,8 @@ /** * Cluster state update request that allows to close one or more indices + * + * @opensearch.internal */ public class CloseIndexClusterStateUpdateRequest extends IndicesClusterStateUpdateRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/close/CloseIndexRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/close/CloseIndexRequest.java index 3fa1c8f066135..b16cabfda4d67 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/close/CloseIndexRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/close/CloseIndexRequest.java @@ -48,6 +48,8 @@ /** * A request to close an index. + * + * @opensearch.internal */ public class CloseIndexRequest extends AcknowledgedRequest implements IndicesRequest.Replaceable { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/close/CloseIndexRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/close/CloseIndexRequestBuilder.java index 66dc07e35fbaa..b3b53a0043c70 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/close/CloseIndexRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/close/CloseIndexRequestBuilder.java @@ -39,6 +39,8 @@ /** * Builder for close index request + * + * @opensearch.internal */ public class CloseIndexRequestBuilder extends AcknowledgedRequestBuilder { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/close/CloseIndexResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/close/CloseIndexResponse.java index 93bf90f741a75..1fc9017359a8c 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/close/CloseIndexResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/close/CloseIndexResponse.java @@ -52,6 +52,11 @@ import static java.util.Collections.emptyList; import static java.util.Collections.unmodifiableList; +/** + * Transport response for closing an index + * + * @opensearch.internal + */ public class CloseIndexResponse extends ShardsAcknowledgedResponse { private final List indices; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/close/TransportCloseIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/close/TransportCloseIndexAction.java index 13525a2a3b23e..0084977d0fdf0 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/close/TransportCloseIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/close/TransportCloseIndexAction.java @@ -61,6 +61,8 @@ /** * Close index action + * + * @opensearch.internal */ public class TransportCloseIndexAction extends TransportMasterNodeAction { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/close/TransportVerifyShardBeforeCloseAction.java b/server/src/main/java/org/opensearch/action/admin/indices/close/TransportVerifyShardBeforeCloseAction.java index 642026c15d81e..fe39e2a254301 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/close/TransportVerifyShardBeforeCloseAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/close/TransportVerifyShardBeforeCloseAction.java @@ -60,6 +60,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Transport action for verifying a shard before closing an index + * + * @opensearch.internal + */ public class TransportVerifyShardBeforeCloseAction extends TransportReplicationAction< TransportVerifyShardBeforeCloseAction.ShardRequest, TransportVerifyShardBeforeCloseAction.ShardRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/create/AutoCreateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/create/AutoCreateAction.java index fc4acf5abba0f..6b510291f1ccb 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/create/AutoCreateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/create/AutoCreateAction.java @@ -62,6 +62,8 @@ /** * Api that auto creates an index or data stream that originate from requests that write into an index that doesn't yet exist. + * + * @opensearch.internal */ public final class AutoCreateAction extends ActionType { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexAction.java index 87bbc093fce43..220620790fa4d 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for creating an index + * + * @opensearch.internal + */ public class CreateIndexAction extends ActionType { public static final CreateIndexAction INSTANCE = new CreateIndexAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexClusterStateUpdateRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexClusterStateUpdateRequest.java index 5ca6fb4226b64..aba5a60ef2804 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexClusterStateUpdateRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexClusterStateUpdateRequest.java @@ -46,6 +46,8 @@ /** * Cluster state update request that allows to create an index + * + * @opensearch.internal */ public class CreateIndexClusterStateUpdateRequest extends ClusterStateUpdateRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexRequest.java index 26ff4f1da3ba4..95837d82be7ac 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexRequest.java @@ -80,6 +80,8 @@ * @see org.opensearch.client.IndicesAdminClient#create(CreateIndexRequest) * @see org.opensearch.client.Requests#createIndexRequest(String) * @see CreateIndexResponse + * + * @opensearch.internal */ public class CreateIndexRequest extends AcknowledgedRequest implements IndicesRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexRequestBuilder.java index cc99f63c6a844..4c5780b87b3f2 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexRequestBuilder.java @@ -46,6 +46,8 @@ /** * Builder for a create index request + * + * @opensearch.internal */ public class CreateIndexRequestBuilder extends AcknowledgedRequestBuilder< CreateIndexRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexResponse.java index dedc022180cda..871576d8e336a 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/create/CreateIndexResponse.java @@ -48,6 +48,8 @@ /** * A response for a create index action. + * + * @opensearch.internal */ public class CreateIndexResponse extends ShardsAcknowledgedResponse { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/create/TransportCreateIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/create/TransportCreateIndexAction.java index 2269931deafc8..859a9d6b21bd3 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/create/TransportCreateIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/create/TransportCreateIndexAction.java @@ -50,6 +50,8 @@ /** * Create index action. + * + * @opensearch.internal */ public class TransportCreateIndexAction extends TransportMasterNodeAction { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/DanglingIndexInfo.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/DanglingIndexInfo.java index decca8ab4151c..cd0feae4428db 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/dangling/DanglingIndexInfo.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/DanglingIndexInfo.java @@ -41,6 +41,8 @@ /** * Contains information about a dangling index, i.e. an index that OpenSearch has found * on-disk but is not present in the cluster state. + * + * @opensearch.internal */ public class DanglingIndexInfo implements Writeable { private final String nodeId; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/delete/DeleteDanglingIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/delete/DeleteDanglingIndexAction.java index f151a3ea46465..6559ef4cd89bd 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/dangling/delete/DeleteDanglingIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/delete/DeleteDanglingIndexAction.java @@ -37,6 +37,8 @@ /** * This action causes a dangling index to be considered as deleted by the cluster. + * + * @opensearch.internal */ public class DeleteDanglingIndexAction extends ActionType { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/delete/DeleteDanglingIndexRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/delete/DeleteDanglingIndexRequest.java index 733fb0a24ebec..4fad5498de375 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/dangling/delete/DeleteDanglingIndexRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/delete/DeleteDanglingIndexRequest.java @@ -43,6 +43,8 @@ /** * Represents a request to delete a particular dangling index, specified by its UUID. The {@link #acceptDataLoss} * flag must also be explicitly set to true, or later validation will fail. + * + * @opensearch.internal */ public class DeleteDanglingIndexRequest extends AcknowledgedRequest { private final String indexUUID; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/delete/TransportDeleteDanglingIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/delete/TransportDeleteDanglingIndexAction.java index baa173a0cdf88..495e8cb1fcac8 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/dangling/delete/TransportDeleteDanglingIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/delete/TransportDeleteDanglingIndexAction.java @@ -70,6 +70,8 @@ * Implements the deletion of a dangling index. When handling a {@link DeleteDanglingIndexAction}, * this class first checks that such a dangling index exists. It then submits a cluster state update * to add the index to the index graveyard. + * + * @opensearch.internal */ public class TransportDeleteDanglingIndexAction extends TransportMasterNodeAction { private static final Logger logger = LogManager.getLogger(TransportDeleteDanglingIndexAction.class); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/FindDanglingIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/FindDanglingIndexAction.java index fa55661788d3e..f308728c7a85e 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/FindDanglingIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/FindDanglingIndexAction.java @@ -36,6 +36,8 @@ /** * Represents a request to find a particular dangling index by UUID. + * + * @opensearch.internal */ public class FindDanglingIndexAction extends ActionType { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/FindDanglingIndexRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/FindDanglingIndexRequest.java index c5a3621bd8340..5c1e3c0a23eae 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/FindDanglingIndexRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/FindDanglingIndexRequest.java @@ -39,6 +39,11 @@ import java.io.IOException; +/** + * Transport request for finding a dangling index + * + * @opensearch.internal + */ public class FindDanglingIndexRequest extends BaseNodesRequest { private final String indexUUID; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/FindDanglingIndexResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/FindDanglingIndexResponse.java index c1b1a2901e5e2..8c99ad8c55f10 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/FindDanglingIndexResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/FindDanglingIndexResponse.java @@ -44,6 +44,8 @@ /** * Models a response to a {@link FindDanglingIndexRequest}. A find request queries every node in the * cluster looking for a dangling index with a specific UUID. + * + * @opensearch.internal */ public class FindDanglingIndexResponse extends BaseNodesResponse { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/NodeFindDanglingIndexRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/NodeFindDanglingIndexRequest.java index ddb16ec51a080..6026dd10c607b 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/NodeFindDanglingIndexRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/NodeFindDanglingIndexRequest.java @@ -40,6 +40,8 @@ /** * Used when querying every node in the cluster for a specific dangling index. + * + * @opensearch.internal */ public class NodeFindDanglingIndexRequest extends BaseNodeRequest { private final String indexUUID; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/NodeFindDanglingIndexResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/NodeFindDanglingIndexResponse.java index 0f21db3eb7a91..cfe71a7acf9a3 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/NodeFindDanglingIndexResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/NodeFindDanglingIndexResponse.java @@ -43,6 +43,8 @@ /** * Used when querying every node in the cluster for a specific dangling index. + * + * @opensearch.internal */ public class NodeFindDanglingIndexResponse extends BaseNodeResponse { /** diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/TransportFindDanglingIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/TransportFindDanglingIndexAction.java index 0da65f79db2af..3119625c6b796 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/TransportFindDanglingIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/find/TransportFindDanglingIndexAction.java @@ -50,6 +50,8 @@ /** * Finds a specified dangling index by its UUID, searching across all nodes. + * + * @opensearch.internal */ public class TransportFindDanglingIndexAction extends TransportNodesAction< FindDanglingIndexRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/import_index/ImportDanglingIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/import_index/ImportDanglingIndexAction.java index 1f6bbdecc7c12..5f7a096b1d749 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/dangling/import_index/ImportDanglingIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/import_index/ImportDanglingIndexAction.java @@ -37,6 +37,8 @@ /** * Represents a request to import a particular dangling index. + * + * @opensearch.internal */ public class ImportDanglingIndexAction extends ActionType { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/import_index/ImportDanglingIndexRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/import_index/ImportDanglingIndexRequest.java index b154d048a10d6..73fbad248b8b1 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/dangling/import_index/ImportDanglingIndexRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/import_index/ImportDanglingIndexRequest.java @@ -45,6 +45,8 @@ * Represents a request to import a particular dangling index, specified * by its UUID. The {@link #acceptDataLoss} flag must also be * explicitly set to true, or later validation will fail. + * + * @opensearch.internal */ public class ImportDanglingIndexRequest extends AcknowledgedRequest { private final String indexUUID; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/import_index/TransportImportDanglingIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/import_index/TransportImportDanglingIndexAction.java index c648f9eea837a..2010515249371 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/dangling/import_index/TransportImportDanglingIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/import_index/TransportImportDanglingIndexAction.java @@ -62,6 +62,8 @@ * Implements the import of a dangling index. When handling a {@link ImportDanglingIndexAction}, * this class first checks that such a dangling index exists. It then calls {@link LocalAllocateDangledIndices} * to perform the actual allocation. + * + * @opensearch.internal */ public class TransportImportDanglingIndexAction extends HandledTransportAction { private static final Logger logger = LogManager.getLogger(TransportImportDanglingIndexAction.class); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/ListDanglingIndicesAction.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/ListDanglingIndicesAction.java index 0e797ca930400..d8ace959c61d3 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/ListDanglingIndicesAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/ListDanglingIndicesAction.java @@ -36,6 +36,8 @@ /** * Represents a request to list all dangling indices known to the cluster. + * + * @opensearch.internal */ public class ListDanglingIndicesAction extends ActionType { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/ListDanglingIndicesRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/ListDanglingIndicesRequest.java index 6c2bd386119a2..ba5fd8fc139ec 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/ListDanglingIndicesRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/ListDanglingIndicesRequest.java @@ -39,6 +39,11 @@ import java.io.IOException; +/** + * Transport request for listing a dangling indices + * + * @opensearch.internal + */ public class ListDanglingIndicesRequest extends BaseNodesRequest { /** * Filter the response by index UUID. Leave as null to find all indices. diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/ListDanglingIndicesResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/ListDanglingIndicesResponse.java index 4ba053078407a..de0a0279a4297 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/ListDanglingIndicesResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/ListDanglingIndicesResponse.java @@ -57,6 +57,8 @@ * cluster and aggregates their responses. When the aggregated response is converted to {@link XContent}, * information for each dangling index is presented under the "dangling_indices" key. If any nodes * in the cluster failed to answer, the details are presented under the "_nodes.failures" key. + * + * @opensearch.internal */ public class ListDanglingIndicesResponse extends BaseNodesResponse implements StatusToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/NodeListDanglingIndicesRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/NodeListDanglingIndicesRequest.java index ad0ed102145b5..9b737fff8316e 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/NodeListDanglingIndicesRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/NodeListDanglingIndicesRequest.java @@ -40,6 +40,8 @@ /** * Used when querying every node in the cluster for dangling indices, in response to a list request. + * + * @opensearch.internal */ public class NodeListDanglingIndicesRequest extends BaseNodeRequest { /** diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/NodeListDanglingIndicesResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/NodeListDanglingIndicesResponse.java index 3495a028af3c0..5f0fa78ff231a 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/NodeListDanglingIndicesResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/NodeListDanglingIndicesResponse.java @@ -43,6 +43,8 @@ /** * Used when querying every node in the cluster for dangling indices, in response to a list request. + * + * @opensearch.internal */ public class NodeListDanglingIndicesResponse extends BaseNodeResponse { private final List indexMetaData; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/TransportListDanglingIndicesAction.java b/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/TransportListDanglingIndicesAction.java index 1274010bfb8a2..6641ff172c2f0 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/TransportListDanglingIndicesAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/dangling/list/TransportListDanglingIndicesAction.java @@ -52,6 +52,8 @@ /** * Implements the listing of all dangling indices. All nodes in the cluster are queried, and * their answers aggregated. Finding dangling indices is performed in {@link DanglingIndicesState}. + * + * @opensearch.internal */ public class TransportListDanglingIndicesAction extends TransportNodesAction< ListDanglingIndicesRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/datastream/CreateDataStreamAction.java b/server/src/main/java/org/opensearch/action/admin/indices/datastream/CreateDataStreamAction.java index c763b74339b32..955f1f9475360 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/datastream/CreateDataStreamAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/datastream/CreateDataStreamAction.java @@ -58,6 +58,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Transport action for creating a datastream + * + * @opensearch.internal + */ public class CreateDataStreamAction extends ActionType { public static final CreateDataStreamAction INSTANCE = new CreateDataStreamAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/datastream/DataStreamsStatsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/datastream/DataStreamsStatsAction.java index ef2b7e566ce0d..4ac4b3e1abf3e 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/datastream/DataStreamsStatsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/datastream/DataStreamsStatsAction.java @@ -78,6 +78,11 @@ import java.util.SortedMap; import java.util.stream.Stream; +/** + * Transport action for retrieving datastream stats + * + * @opensearch.internal + */ public class DataStreamsStatsAction extends ActionType { public static final DataStreamsStatsAction INSTANCE = new DataStreamsStatsAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/datastream/DeleteDataStreamAction.java b/server/src/main/java/org/opensearch/action/admin/indices/datastream/DeleteDataStreamAction.java index 0fcb343c59055..95ac25c47e842 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/datastream/DeleteDataStreamAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/datastream/DeleteDataStreamAction.java @@ -73,6 +73,11 @@ import static org.opensearch.action.ValidateActions.addValidationError; +/** + * Transport action for deleting a datastream + * + * @opensearch.internal + */ public class DeleteDataStreamAction extends ActionType { private static final Logger logger = LogManager.getLogger(DeleteDataStreamAction.class); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/datastream/GetDataStreamAction.java b/server/src/main/java/org/opensearch/action/admin/indices/datastream/GetDataStreamAction.java index 3b57063034e7b..c8270424e42df 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/datastream/GetDataStreamAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/datastream/GetDataStreamAction.java @@ -73,6 +73,11 @@ import java.util.Objects; import java.util.stream.Collectors; +/** + * Transport action for getting a datastream + * + * @opensearch.internal + */ public class GetDataStreamAction extends ActionType { public static final GetDataStreamAction INSTANCE = new GetDataStreamAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/delete/DeleteIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/delete/DeleteIndexAction.java index 6f0dd781b4cec..696c1244c7504 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/delete/DeleteIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/delete/DeleteIndexAction.java @@ -35,6 +35,11 @@ import org.opensearch.action.ActionType; import org.opensearch.action.support.master.AcknowledgedResponse; +/** + * Transport action for deleting an index + * + * @opensearch.internal + */ public class DeleteIndexAction extends ActionType { public static final DeleteIndexAction INSTANCE = new DeleteIndexAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/delete/DeleteIndexClusterStateUpdateRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/delete/DeleteIndexClusterStateUpdateRequest.java index a6d06833ebae9..5088d021ca9b8 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/delete/DeleteIndexClusterStateUpdateRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/delete/DeleteIndexClusterStateUpdateRequest.java @@ -35,6 +35,8 @@ /** * Cluster state update request that allows to close one or more indices + * + * @opensearch.internal */ public class DeleteIndexClusterStateUpdateRequest extends IndicesClusterStateUpdateRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/delete/DeleteIndexRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/delete/DeleteIndexRequest.java index c29072b135b85..7475121a910c4 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/delete/DeleteIndexRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/delete/DeleteIndexRequest.java @@ -46,6 +46,8 @@ /** * A request to delete an index. Best created with {@link org.opensearch.client.Requests#deleteIndexRequest(String)}. + * + * @opensearch.internal */ public class DeleteIndexRequest extends AcknowledgedRequest implements IndicesRequest.Replaceable { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/delete/DeleteIndexRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/delete/DeleteIndexRequestBuilder.java index 741f46d44d8b7..33f6342e94139 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/delete/DeleteIndexRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/delete/DeleteIndexRequestBuilder.java @@ -37,6 +37,11 @@ import org.opensearch.action.support.master.AcknowledgedResponse; import org.opensearch.client.OpenSearchClient; +/** + * Transport request builder for deleting an index + * + * @opensearch.internal + */ public class DeleteIndexRequestBuilder extends AcknowledgedRequestBuilder< DeleteIndexRequest, AcknowledgedResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/delete/TransportDeleteIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/delete/TransportDeleteIndexAction.java index ec8c0fe8ed011..70cb6d8115f15 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/delete/TransportDeleteIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/delete/TransportDeleteIndexAction.java @@ -60,6 +60,8 @@ /** * Delete index action. + * + * @opensearch.internal */ public class TransportDeleteIndexAction extends TransportMasterNodeAction { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/exists/indices/IndicesExistsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/exists/indices/IndicesExistsAction.java index 1eae6b99bc1ee..6bd0cddc00d07 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/exists/indices/IndicesExistsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/exists/indices/IndicesExistsAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for checking if an index exists + * + * @opensearch.internal + */ public class IndicesExistsAction extends ActionType { public static final IndicesExistsAction INSTANCE = new IndicesExistsAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/exists/indices/IndicesExistsRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/exists/indices/IndicesExistsRequest.java index d511c18f5505e..89c237a990dc8 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/exists/indices/IndicesExistsRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/exists/indices/IndicesExistsRequest.java @@ -44,6 +44,11 @@ import static org.opensearch.action.ValidateActions.addValidationError; +/** + * Transport request for checking if an index exists + * + * @opensearch.internal + */ public class IndicesExistsRequest extends MasterNodeReadRequest implements IndicesRequest.Replaceable { private String[] indices = Strings.EMPTY_ARRAY; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/exists/indices/IndicesExistsRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/exists/indices/IndicesExistsRequestBuilder.java index bb38d14530588..9b83d2b29302c 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/exists/indices/IndicesExistsRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/exists/indices/IndicesExistsRequestBuilder.java @@ -35,6 +35,11 @@ import org.opensearch.action.support.master.MasterNodeReadOperationRequestBuilder; import org.opensearch.client.OpenSearchClient; +/** + * Transport request builder for checking if an index exists + * + * @opensearch.internal + */ public class IndicesExistsRequestBuilder extends MasterNodeReadOperationRequestBuilder< IndicesExistsRequest, IndicesExistsResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/exists/indices/IndicesExistsResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/exists/indices/IndicesExistsResponse.java index 336bb6147d07d..5bf51fe2ba653 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/exists/indices/IndicesExistsResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/exists/indices/IndicesExistsResponse.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Transport response for checking if an index exists + * + * @opensearch.internal + */ public class IndicesExistsResponse extends ActionResponse { private boolean exists; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/exists/indices/TransportIndicesExistsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/exists/indices/TransportIndicesExistsAction.java index 076e2ecc2c119..49ab15dadb19a 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/exists/indices/TransportIndicesExistsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/exists/indices/TransportIndicesExistsAction.java @@ -51,6 +51,8 @@ /** * Indices exists action. + * + * @opensearch.internal */ public class TransportIndicesExistsAction extends TransportMasterNodeReadAction { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/flush/FlushAction.java b/server/src/main/java/org/opensearch/action/admin/indices/flush/FlushAction.java index ace63f2346e30..288a46977521e 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/flush/FlushAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/flush/FlushAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for flushing one or more indices + * + * @opensearch.internal + */ public class FlushAction extends ActionType { public static final FlushAction INSTANCE = new FlushAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/flush/FlushRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/flush/FlushRequest.java index 1020a0cfb33a9..0ff502dee8396 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/flush/FlushRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/flush/FlushRequest.java @@ -51,6 +51,8 @@ * @see org.opensearch.client.Requests#flushRequest(String...) * @see org.opensearch.client.IndicesAdminClient#flush(FlushRequest) * @see FlushResponse + * + * @opensearch.internal */ public class FlushRequest extends BroadcastRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/flush/FlushRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/flush/FlushRequestBuilder.java index c72a55b1f8519..d0cbd1d27fba6 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/flush/FlushRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/flush/FlushRequestBuilder.java @@ -35,6 +35,11 @@ import org.opensearch.action.support.broadcast.BroadcastOperationRequestBuilder; import org.opensearch.client.OpenSearchClient; +/** + * Transport request builder for flushing one or more indices + * + * @opensearch.internal + */ public class FlushRequestBuilder extends BroadcastOperationRequestBuilder { public FlushRequestBuilder(OpenSearchClient client, FlushAction action) { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/flush/FlushResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/flush/FlushResponse.java index 9ab04dfe8c081..0345f42ab52f1 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/flush/FlushResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/flush/FlushResponse.java @@ -44,6 +44,8 @@ /** * A response to flush action. + * + * @opensearch.internal */ public class FlushResponse extends BroadcastResponse { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/flush/ShardFlushRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/flush/ShardFlushRequest.java index d49bf04af623b..f56a5cc6dd5e2 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/flush/ShardFlushRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/flush/ShardFlushRequest.java @@ -40,6 +40,11 @@ import java.io.IOException; +/** + * Transport request for flushing one or more indices + * + * @opensearch.internal + */ public class ShardFlushRequest extends ReplicationRequest { private final FlushRequest request; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/flush/TransportFlushAction.java b/server/src/main/java/org/opensearch/action/admin/indices/flush/TransportFlushAction.java index 552f88400a87d..28faed924de6e 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/flush/TransportFlushAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/flush/TransportFlushAction.java @@ -46,6 +46,8 @@ /** * Flush ActionType. + * + * @opensearch.internal */ public class TransportFlushAction extends TransportBroadcastReplicationAction< FlushRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/flush/TransportShardFlushAction.java b/server/src/main/java/org/opensearch/action/admin/indices/flush/TransportShardFlushAction.java index 20ba92faaec41..5a5a57b4bcc00 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/flush/TransportShardFlushAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/flush/TransportShardFlushAction.java @@ -55,6 +55,11 @@ import java.io.IOException; +/** + * Transport action for flushing one or more indices + * + * @opensearch.internal + */ public class TransportShardFlushAction extends TransportReplicationAction { public static final String NAME = FlushAction.NAME + "[s]"; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/forcemerge/ForceMergeAction.java b/server/src/main/java/org/opensearch/action/admin/indices/forcemerge/ForceMergeAction.java index 07b337e61323e..06b639fadc1c7 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/forcemerge/ForceMergeAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/forcemerge/ForceMergeAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action to request force merging the segments of one or more indices. + * + * @opensearch.internal + */ public class ForceMergeAction extends ActionType { public static final ForceMergeAction INSTANCE = new ForceMergeAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/forcemerge/ForceMergeRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/forcemerge/ForceMergeRequest.java index 780c545dcdbae..b428c3523b666 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/forcemerge/ForceMergeRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/forcemerge/ForceMergeRequest.java @@ -54,6 +54,8 @@ * @see org.opensearch.client.Requests#forceMergeRequest(String...) * @see org.opensearch.client.IndicesAdminClient#forceMerge(ForceMergeRequest) * @see ForceMergeResponse + * + * @opensearch.internal */ public class ForceMergeRequest extends BroadcastRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/forcemerge/ForceMergeRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/forcemerge/ForceMergeRequestBuilder.java index 2d0e7d4401a01..cff05f194cac4 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/forcemerge/ForceMergeRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/forcemerge/ForceMergeRequestBuilder.java @@ -41,6 +41,8 @@ * {@link #setMaxNumSegments(int)} allows to control the number of segments to force * merge down to. By default, will cause the force merge process to merge down * to half the configured number of segments. + * + * @opensearch.internal */ public class ForceMergeRequestBuilder extends BroadcastOperationRequestBuilder< ForceMergeRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/forcemerge/ForceMergeResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/forcemerge/ForceMergeResponse.java index c898dad8bcdc9..4f8cd7efb59f6 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/forcemerge/ForceMergeResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/forcemerge/ForceMergeResponse.java @@ -44,6 +44,8 @@ /** * A response for force merge action. + * + * @opensearch.internal */ public class ForceMergeResponse extends BroadcastResponse { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/forcemerge/TransportForceMergeAction.java b/server/src/main/java/org/opensearch/action/admin/indices/forcemerge/TransportForceMergeAction.java index 22f4b912cbe0b..dc48e3c93176a 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/forcemerge/TransportForceMergeAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/forcemerge/TransportForceMergeAction.java @@ -54,6 +54,8 @@ /** * ForceMerge index/indices action. + * + * @opensearch.internal */ public class TransportForceMergeAction extends TransportBroadcastByNodeAction< ForceMergeRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/get/GetIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/get/GetIndexAction.java index 6d5875a012b91..92200c71ef685 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/get/GetIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/get/GetIndexAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action to get information about an index. + * + * @opensearch.internal + */ public class GetIndexAction extends ActionType { public static final GetIndexAction INSTANCE = new GetIndexAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/get/GetIndexRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/get/GetIndexRequest.java index e1e0b2c54c904..909092078b6ae 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/get/GetIndexRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/get/GetIndexRequest.java @@ -42,6 +42,8 @@ /** * A request to retrieve information about an index. + * + * @opensearch.internal */ public class GetIndexRequest extends ClusterInfoRequest { public enum Feature { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/get/GetIndexRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/get/GetIndexRequestBuilder.java index 6f93614fe3487..3019191e5570e 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/get/GetIndexRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/get/GetIndexRequestBuilder.java @@ -35,6 +35,11 @@ import org.opensearch.action.support.master.info.ClusterInfoRequestBuilder; import org.opensearch.client.OpenSearchClient; +/** + * Transport request builder to get information about an index. + * + * @opensearch.internal + */ public class GetIndexRequestBuilder extends ClusterInfoRequestBuilder { public GetIndexRequestBuilder(OpenSearchClient client, GetIndexAction action, String... indices) { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/get/GetIndexResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/get/GetIndexResponse.java index 4465dc88fe87d..e93fbe86e4ece 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/get/GetIndexResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/get/GetIndexResponse.java @@ -56,6 +56,8 @@ /** * A response for a get index action. + * + * @opensearch.internal */ public class GetIndexResponse extends ActionResponse implements ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/get/TransportGetIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/get/TransportGetIndexAction.java index 0cd3214307359..493d3354a1b70 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/get/TransportGetIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/get/TransportGetIndexAction.java @@ -58,6 +58,8 @@ /** * Get index action. + * + * @opensearch.internal */ public class TransportGetIndexAction extends TransportClusterInfoAction { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsAction.java index 320cfa622f11a..2ddd763be20fd 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action to get field mappings. + * + * @opensearch.internal + */ public class GetFieldMappingsAction extends ActionType { public static final GetFieldMappingsAction INSTANCE = new GetFieldMappingsAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsIndexRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsIndexRequest.java index 961662ecdcf7e..176eca5e35cec 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsIndexRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsIndexRequest.java @@ -43,6 +43,11 @@ import java.io.IOException; +/** + * Transport action to get field mappings. + * + * @opensearch.internal + */ public class GetFieldMappingsIndexRequest extends SingleShardRequest { private final boolean includeDefaults; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsRequest.java index e6a2ad3187250..db00f3d5244ac 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsRequest.java @@ -49,6 +49,8 @@ * * Note: there is a new class with the same name for the Java HLRC that uses a typeless format. * Any changes done to this class should go to that client class as well. + * + * @opensearch.internal */ public class GetFieldMappingsRequest extends ActionRequest implements IndicesRequest.Replaceable { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsRequestBuilder.java index 4a8c624e7e06e..ebc0c015c5140 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsRequestBuilder.java @@ -37,7 +37,11 @@ import org.opensearch.client.OpenSearchClient; import org.opensearch.common.util.ArrayUtils; -/** A helper class to build {@link GetFieldMappingsRequest} objects */ +/** + * A helper class to build {@link GetFieldMappingsRequest} objects + * + * @opensearch.internal + **/ public class GetFieldMappingsRequestBuilder extends ActionRequestBuilder { public GetFieldMappingsRequestBuilder(OpenSearchClient client, GetFieldMappingsAction action, String... indices) { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsResponse.java index 7b37920e84d82..db112713b48b6 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetFieldMappingsResponse.java @@ -64,6 +64,8 @@ * * Note: there is a new class with the same name for the Java HLRC that uses a typeless format. * Any changes done to this class should go to that client class as well. + * + * @opensearch.internal */ public class GetFieldMappingsResponse extends ActionResponse implements ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetMappingsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetMappingsAction.java index 6d9ed5ba0411a..a78625a1595ad 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetMappingsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetMappingsAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action to get field mappings. + * + * @opensearch.internal + */ public class GetMappingsAction extends ActionType { public static final GetMappingsAction INSTANCE = new GetMappingsAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetMappingsRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetMappingsRequest.java index ae78f5f3a0b30..2c9bec8398b66 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetMappingsRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetMappingsRequest.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Transport request to get field mappings. + * + * @opensearch.internal + */ public class GetMappingsRequest extends ClusterInfoRequest { public GetMappingsRequest() {} diff --git a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetMappingsRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetMappingsRequestBuilder.java index 8401272353eaf..85bf8c2ffd9c6 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetMappingsRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetMappingsRequestBuilder.java @@ -35,6 +35,11 @@ import org.opensearch.action.support.master.info.ClusterInfoRequestBuilder; import org.opensearch.client.OpenSearchClient; +/** + * Transport request builder to get field mappings. + * + * @opensearch.internal + */ public class GetMappingsRequestBuilder extends ClusterInfoRequestBuilder< GetMappingsRequest, GetMappingsResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetMappingsResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetMappingsResponse.java index 3be8e75be7290..643ed719b5e2a 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetMappingsResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/GetMappingsResponse.java @@ -47,6 +47,11 @@ import java.io.IOException; +/** + * Transport response to get field mappings. + * + * @opensearch.internal + */ public class GetMappingsResponse extends ActionResponse implements ToXContentFragment { private static final ParseField MAPPINGS = new ParseField("mappings"); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/TransportGetFieldMappingsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/TransportGetFieldMappingsAction.java index bdb5222a6dcba..93f76f42b2f05 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/TransportGetFieldMappingsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/TransportGetFieldMappingsAction.java @@ -50,6 +50,11 @@ import static java.util.Collections.emptyMap; import static java.util.Collections.unmodifiableMap; +/** + * Transport action to get field mappings. + * + * @opensearch.internal + */ public class TransportGetFieldMappingsAction extends HandledTransportAction { private final ClusterService clusterService; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/TransportGetFieldMappingsIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/TransportGetFieldMappingsIndexAction.java index ca07475f0deab..64f76db5e1549 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/TransportGetFieldMappingsIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/TransportGetFieldMappingsIndexAction.java @@ -69,6 +69,8 @@ /** * Transport action used to retrieve the mappings related to fields that belong to a specific index + * + * @opensearch.internal */ public class TransportGetFieldMappingsIndexAction extends TransportSingleShardAction< GetFieldMappingsIndexRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/TransportGetMappingsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/TransportGetMappingsAction.java index 3f6cb8ed35af9..1edbba547a917 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/TransportGetMappingsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/mapping/get/TransportGetMappingsAction.java @@ -50,6 +50,11 @@ import java.io.IOException; +/** + * Transport action to get field mappings. + * + * @opensearch.internal + */ public class TransportGetMappingsAction extends TransportClusterInfoAction { private static final Logger logger = LogManager.getLogger(TransportGetMappingsAction.class); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/AutoPutMappingAction.java b/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/AutoPutMappingAction.java index 72cfcdaffca31..f2430eb54db9b 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/AutoPutMappingAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/AutoPutMappingAction.java @@ -35,6 +35,11 @@ import org.opensearch.action.ActionType; import org.opensearch.action.support.master.AcknowledgedResponse; +/** + * Transport action to automatically put field mappings. + * + * @opensearch.internal + */ public class AutoPutMappingAction extends ActionType { public static final AutoPutMappingAction INSTANCE = new AutoPutMappingAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/PutMappingAction.java b/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/PutMappingAction.java index 4f90e38ac4416..8bca1b59ee2e2 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/PutMappingAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/PutMappingAction.java @@ -35,6 +35,11 @@ import org.opensearch.action.ActionType; import org.opensearch.action.support.master.AcknowledgedResponse; +/** + * Transport action to put field mappings. + * + * @opensearch.internal + */ public class PutMappingAction extends ActionType { public static final PutMappingAction INSTANCE = new PutMappingAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/PutMappingClusterStateUpdateRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/PutMappingClusterStateUpdateRequest.java index 27081048fcdae..8d51182d838cc 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/PutMappingClusterStateUpdateRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/PutMappingClusterStateUpdateRequest.java @@ -36,6 +36,8 @@ /** * Cluster state update request that allows to put a mapping + * + * @opensearch.internal */ public class PutMappingClusterStateUpdateRequest extends IndicesClusterStateUpdateRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/PutMappingRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/PutMappingRequest.java index be3e676a4a1a2..85fd74f0762a5 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/PutMappingRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/PutMappingRequest.java @@ -74,6 +74,8 @@ * @see org.opensearch.client.Requests#putMappingRequest(String...) * @see org.opensearch.client.IndicesAdminClient#putMapping(PutMappingRequest) * @see AcknowledgedResponse + * + * @opensearch.internal */ public class PutMappingRequest extends AcknowledgedRequest implements IndicesRequest.Replaceable, ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/PutMappingRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/PutMappingRequestBuilder.java index 3ef96254b3f9b..78115e1fab4ec 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/PutMappingRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/PutMappingRequestBuilder.java @@ -44,6 +44,8 @@ /** * Builder for a put mapping request + * + * @opensearch.internal */ public class PutMappingRequestBuilder extends AcknowledgedRequestBuilder< PutMappingRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/TransportAutoPutMappingAction.java b/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/TransportAutoPutMappingAction.java index a172fce831c8f..5252fd24fd2fa 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/TransportAutoPutMappingAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/TransportAutoPutMappingAction.java @@ -50,6 +50,11 @@ import java.io.IOException; +/** + * Transport action to automatically put field mappings. + * + * @opensearch.internal + */ public class TransportAutoPutMappingAction extends TransportMasterNodeAction { private final MetadataMappingService metadataMappingService; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/TransportPutMappingAction.java b/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/TransportPutMappingAction.java index f1093a15a3d26..ec5a92ada4454 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/TransportPutMappingAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/mapping/put/TransportPutMappingAction.java @@ -63,6 +63,8 @@ /** * Put mapping action. + * + * @opensearch.internal */ public class TransportPutMappingAction extends TransportMasterNodeAction { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/open/OpenIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/open/OpenIndexAction.java index 1b80e5cb8a347..5c4302d94e4a6 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/open/OpenIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/open/OpenIndexAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action to open an index. + * + * @opensearch.internal + */ public class OpenIndexAction extends ActionType { public static final OpenIndexAction INSTANCE = new OpenIndexAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/open/OpenIndexClusterStateUpdateRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/open/OpenIndexClusterStateUpdateRequest.java index bf299d103ba78..a36c2744f7669 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/open/OpenIndexClusterStateUpdateRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/open/OpenIndexClusterStateUpdateRequest.java @@ -36,6 +36,8 @@ /** * Cluster state update request that allows to open one or more indices + * + * @opensearch.internal */ public class OpenIndexClusterStateUpdateRequest extends IndicesClusterStateUpdateRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/open/OpenIndexRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/open/OpenIndexRequest.java index be0e0254edff6..c6c1c2dc8f0cb 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/open/OpenIndexRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/open/OpenIndexRequest.java @@ -47,6 +47,8 @@ /** * A request to open an index. + * + * @opensearch.internal */ public class OpenIndexRequest extends AcknowledgedRequest implements IndicesRequest.Replaceable { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/open/OpenIndexRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/open/OpenIndexRequestBuilder.java index 5aadd81cc8838..bf09c3f173491 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/open/OpenIndexRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/open/OpenIndexRequestBuilder.java @@ -39,6 +39,8 @@ /** * Builder for for open index request + * + * @opensearch.internal */ public class OpenIndexRequestBuilder extends AcknowledgedRequestBuilder { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/open/OpenIndexResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/open/OpenIndexResponse.java index 4b811b215d717..f7bd4cf31aa17 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/open/OpenIndexResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/open/OpenIndexResponse.java @@ -42,6 +42,8 @@ /** * A response for a open index action. + * + * @opensearch.internal */ public class OpenIndexResponse extends ShardsAcknowledgedResponse { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/open/TransportOpenIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/open/TransportOpenIndexAction.java index 05b3bfd7a885e..6cd3c0682e851 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/open/TransportOpenIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/open/TransportOpenIndexAction.java @@ -57,6 +57,8 @@ /** * Open index action + * + * @opensearch.internal */ public class TransportOpenIndexAction extends TransportMasterNodeAction { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/readonly/AddIndexBlockAction.java b/server/src/main/java/org/opensearch/action/admin/indices/readonly/AddIndexBlockAction.java index 482f543ae6b04..3bca633554908 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/readonly/AddIndexBlockAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/readonly/AddIndexBlockAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action to add an index block. + * + * @opensearch.internal + */ public class AddIndexBlockAction extends ActionType { public static final AddIndexBlockAction INSTANCE = new AddIndexBlockAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/readonly/AddIndexBlockClusterStateUpdateRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/readonly/AddIndexBlockClusterStateUpdateRequest.java index c934cad44b097..4b44624ece303 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/readonly/AddIndexBlockClusterStateUpdateRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/readonly/AddIndexBlockClusterStateUpdateRequest.java @@ -36,6 +36,8 @@ /** * Cluster state update request that allows to add a block to one or more indices + * + * @opensearch.internal */ public class AddIndexBlockClusterStateUpdateRequest extends IndicesClusterStateUpdateRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/readonly/AddIndexBlockRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/readonly/AddIndexBlockRequest.java index c2f24d3e927b5..7d208b5e0ac77 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/readonly/AddIndexBlockRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/readonly/AddIndexBlockRequest.java @@ -48,6 +48,8 @@ /** * A request to add a block to an index. + * + * @opensearch.internal */ public class AddIndexBlockRequest extends AcknowledgedRequest implements IndicesRequest.Replaceable { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/readonly/AddIndexBlockRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/readonly/AddIndexBlockRequestBuilder.java index 074e7fc5f6664..8322ba19f433e 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/readonly/AddIndexBlockRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/readonly/AddIndexBlockRequestBuilder.java @@ -39,6 +39,8 @@ /** * Builder for add index block request + * + * @opensearch.internal */ public class AddIndexBlockRequestBuilder extends AcknowledgedRequestBuilder< AddIndexBlockRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/readonly/AddIndexBlockResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/readonly/AddIndexBlockResponse.java index 5f67d6f491cfc..6a07a645f9315 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/readonly/AddIndexBlockResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/readonly/AddIndexBlockResponse.java @@ -50,6 +50,11 @@ import static java.util.Collections.unmodifiableList; +/** + * Transport response to open an index. + * + * @opensearch.internal + */ public class AddIndexBlockResponse extends ShardsAcknowledgedResponse { private final List indices; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/readonly/TransportAddIndexBlockAction.java b/server/src/main/java/org/opensearch/action/admin/indices/readonly/TransportAddIndexBlockAction.java index a58d199287ff7..80af0a2c2dcc9 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/readonly/TransportAddIndexBlockAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/readonly/TransportAddIndexBlockAction.java @@ -62,6 +62,8 @@ * in-flight writes to an index have been completed prior to the response being returned. These actions * are done in multiple cluster state updates (at least two). See also {@link TransportVerifyShardIndexBlockAction} * for the eventual delegation for shard-level verification. + * + * @opensearch.internal */ public class TransportAddIndexBlockAction extends TransportMasterNodeAction { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/readonly/TransportVerifyShardIndexBlockAction.java b/server/src/main/java/org/opensearch/action/admin/indices/readonly/TransportVerifyShardIndexBlockAction.java index edf3efbbb190f..11b5b86823a28 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/readonly/TransportVerifyShardIndexBlockAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/readonly/TransportVerifyShardIndexBlockAction.java @@ -64,6 +64,8 @@ * and are no longer executing any operations in violation of that block. This action * requests all operation permits of the shard in order to wait for all write operations * to complete. + * + * @opensearch.internal */ public class TransportVerifyShardIndexBlockAction extends TransportReplicationAction< TransportVerifyShardIndexBlockAction.ShardRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/recovery/RecoveryAction.java b/server/src/main/java/org/opensearch/action/admin/indices/recovery/RecoveryAction.java index ce764f8890f86..ac00e7f404b37 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/recovery/RecoveryAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/recovery/RecoveryAction.java @@ -36,6 +36,8 @@ /** * Recovery information action + * + * @opensearch.internal */ public class RecoveryAction extends ActionType { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/recovery/RecoveryRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/recovery/RecoveryRequest.java index 2457ca3fc5b90..8b1fe1e88da22 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/recovery/RecoveryRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/recovery/RecoveryRequest.java @@ -42,6 +42,8 @@ /** * Request for recovery information + * + * @opensearch.internal */ public class RecoveryRequest extends BroadcastRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/recovery/RecoveryRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/recovery/RecoveryRequestBuilder.java index 12c58c22fe8c8..99a1fb430fb28 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/recovery/RecoveryRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/recovery/RecoveryRequestBuilder.java @@ -37,6 +37,8 @@ /** * Recovery information request builder. + * + * @opensearch.internal */ public class RecoveryRequestBuilder extends BroadcastOperationRequestBuilder { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/recovery/RecoveryResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/recovery/RecoveryResponse.java index 9c2b380392b03..e95110c732d79 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/recovery/RecoveryResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/recovery/RecoveryResponse.java @@ -46,6 +46,8 @@ /** * Information regarding the recovery state of indices and their associated shards. + * + * @opensearch.internal */ public class RecoveryResponse extends BroadcastResponse { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/recovery/TransportRecoveryAction.java b/server/src/main/java/org/opensearch/action/admin/indices/recovery/TransportRecoveryAction.java index 7c3666e44f093..132354ed83b6c 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/recovery/TransportRecoveryAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/recovery/TransportRecoveryAction.java @@ -60,6 +60,8 @@ /** * Transport action for shard recovery operation. This transport action does not actually * perform shard recovery, it only reports on recoveries (both active and complete). + * + * @opensearch.internal */ public class TransportRecoveryAction extends TransportBroadcastByNodeAction { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/refresh/RefreshAction.java b/server/src/main/java/org/opensearch/action/admin/indices/refresh/RefreshAction.java index 6b7006c3b70ce..c321700ae65bd 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/refresh/RefreshAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/refresh/RefreshAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Refresh information action + * + * @opensearch.internal + */ public class RefreshAction extends ActionType { public static final RefreshAction INSTANCE = new RefreshAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/refresh/RefreshRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/refresh/RefreshRequest.java index c113527d1cc2f..4f078f8d9a23d 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/refresh/RefreshRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/refresh/RefreshRequest.java @@ -45,6 +45,8 @@ * @see org.opensearch.client.Requests#refreshRequest(String...) * @see org.opensearch.client.IndicesAdminClient#refresh(RefreshRequest) * @see RefreshResponse + * + * @opensearch.internal */ public class RefreshRequest extends BroadcastRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/refresh/RefreshRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/refresh/RefreshRequestBuilder.java index 47a16f2fc968d..5b27ae13f24be 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/refresh/RefreshRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/refresh/RefreshRequestBuilder.java @@ -39,6 +39,8 @@ * A refresh request making all operations performed since the last refresh available for search. The (near) real-time * capabilities depends on the index engine used. For example, the internal one requires refresh to be called, but by * default a refresh is scheduled periodically. + * + * @opensearch.internal */ public class RefreshRequestBuilder extends BroadcastOperationRequestBuilder { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/refresh/RefreshResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/refresh/RefreshResponse.java index deae44b1c4676..19cd70410317e 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/refresh/RefreshResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/refresh/RefreshResponse.java @@ -44,6 +44,8 @@ /** * The response of a refresh action. + * + * @opensearch.internal */ public class RefreshResponse extends BroadcastResponse { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/refresh/TransportRefreshAction.java b/server/src/main/java/org/opensearch/action/admin/indices/refresh/TransportRefreshAction.java index 97e8344d32664..7fb4a9908c422 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/refresh/TransportRefreshAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/refresh/TransportRefreshAction.java @@ -48,6 +48,8 @@ /** * Refresh action. + * + * @opensearch.internal */ public class TransportRefreshAction extends TransportBroadcastReplicationAction< RefreshRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/refresh/TransportShardRefreshAction.java b/server/src/main/java/org/opensearch/action/admin/indices/refresh/TransportShardRefreshAction.java index c58d8c520ad0b..9c955c8157459 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/refresh/TransportShardRefreshAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/refresh/TransportShardRefreshAction.java @@ -49,6 +49,11 @@ import java.io.IOException; +/** + * Refresh information action + * + * @opensearch.internal + */ public class TransportShardRefreshAction extends TransportReplicationAction< BasicReplicationRequest, BasicReplicationRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/resolve/ResolveIndexAction.java b/server/src/main/java/org/opensearch/action/admin/indices/resolve/ResolveIndexAction.java index 381fa6d933344..51bdca4c4a10e 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/resolve/ResolveIndexAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/resolve/ResolveIndexAction.java @@ -79,6 +79,11 @@ import java.util.TreeMap; import java.util.stream.StreamSupport; +/** + * Transport action to resolve an index. + * + * @opensearch.internal + */ public class ResolveIndexAction extends ActionType { public static final ResolveIndexAction INSTANCE = new ResolveIndexAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/rollover/Condition.java b/server/src/main/java/org/opensearch/action/admin/indices/rollover/Condition.java index e997d9b00e17b..5fa52455f944a 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/rollover/Condition.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/rollover/Condition.java @@ -41,6 +41,8 @@ /** * Base class for rollover request conditions + * + * @opensearch.internal */ public abstract class Condition implements NamedWriteable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/rollover/MaxAgeCondition.java b/server/src/main/java/org/opensearch/action/admin/indices/rollover/MaxAgeCondition.java index 20c45d88c8d32..5c2fc43f94b3c 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/rollover/MaxAgeCondition.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/rollover/MaxAgeCondition.java @@ -43,6 +43,8 @@ /** * Condition for index maximum age. Evaluates to true * when the index is at least {@link #value} old + * + * @opensearch.internal */ public class MaxAgeCondition extends Condition { public static final String NAME = "max_age"; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/rollover/MaxDocsCondition.java b/server/src/main/java/org/opensearch/action/admin/indices/rollover/MaxDocsCondition.java index 8491b381fd9d3..6d67c61cf9758 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/rollover/MaxDocsCondition.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/rollover/MaxDocsCondition.java @@ -42,6 +42,8 @@ /** * Condition for maximum index docs. Evaluates to true * when the index has at least {@link #value} docs + * + * @opensearch.internal */ public class MaxDocsCondition extends Condition { public static final String NAME = "max_docs"; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/rollover/MaxSizeCondition.java b/server/src/main/java/org/opensearch/action/admin/indices/rollover/MaxSizeCondition.java index 147d81a52961d..720a81fc167bb 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/rollover/MaxSizeCondition.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/rollover/MaxSizeCondition.java @@ -44,6 +44,8 @@ /** * A size-based condition for an index size. * Evaluates to true if the index size is at least {@link #value}. + * + * @opensearch.internal */ public class MaxSizeCondition extends Condition { public static final String NAME = "max_size"; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/rollover/MetadataRolloverService.java b/server/src/main/java/org/opensearch/action/admin/indices/rollover/MetadataRolloverService.java index 3f85d9a1cd143..e3e09442764e2 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/rollover/MetadataRolloverService.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/rollover/MetadataRolloverService.java @@ -69,6 +69,8 @@ /** * Service responsible for handling rollover requests for write aliases and data streams + * + * @opensearch.internal */ public class MetadataRolloverService { private static final Pattern INDEX_NAME_PATTERN = Pattern.compile("^.*-\\d+$"); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/rollover/RolloverAction.java b/server/src/main/java/org/opensearch/action/admin/indices/rollover/RolloverAction.java index f95cf1b83250a..e6c22cc48c1ad 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/rollover/RolloverAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/rollover/RolloverAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action to rollover an index. + * + * @opensearch.internal + */ public class RolloverAction extends ActionType { public static final RolloverAction INSTANCE = new RolloverAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/rollover/RolloverInfo.java b/server/src/main/java/org/opensearch/action/admin/indices/rollover/RolloverInfo.java index 3fd145a7c7655..801238f213b6b 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/rollover/RolloverInfo.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/rollover/RolloverInfo.java @@ -50,6 +50,8 @@ /** * Class for holding Rollover related information within an index + * + * @opensearch.internal */ public class RolloverInfo extends AbstractDiffable implements Writeable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/rollover/RolloverRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/rollover/RolloverRequest.java index 402b3741205a2..db5dd0af6ab2a 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/rollover/RolloverRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/rollover/RolloverRequest.java @@ -57,6 +57,8 @@ * * Note: there is a new class with the same name for the Java HLRC that uses a typeless format. * Any changes done to this class should also go to that client class. + * + * @opensearch.internal */ public class RolloverRequest extends AcknowledgedRequest implements IndicesRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/rollover/RolloverRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/rollover/RolloverRequestBuilder.java index c74f71a70e09d..bec084450b389 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/rollover/RolloverRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/rollover/RolloverRequestBuilder.java @@ -39,6 +39,11 @@ import org.opensearch.common.unit.ByteSizeValue; import org.opensearch.common.unit.TimeValue; +/** + * Transport request to rollover an index. + * + * @opensearch.internal + */ public class RolloverRequestBuilder extends MasterNodeOperationRequestBuilder { public RolloverRequestBuilder(OpenSearchClient client, RolloverAction action) { super(client, action, new RolloverRequest()); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/rollover/RolloverResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/rollover/RolloverResponse.java index 5600d05120abb..330d258f9461f 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/rollover/RolloverResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/rollover/RolloverResponse.java @@ -54,6 +54,8 @@ * * Note: there is a new class with the same name for the Java HLRC that uses a typeless format. * Any changes done to this class should also go to that client class. + * + * @opensearch.internal */ public final class RolloverResponse extends ShardsAcknowledgedResponse implements ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/rollover/TransportRolloverAction.java b/server/src/main/java/org/opensearch/action/admin/indices/rollover/TransportRolloverAction.java index 38f25422a5956..1a2f4be522e2b 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/rollover/TransportRolloverAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/rollover/TransportRolloverAction.java @@ -69,6 +69,8 @@ /** * Main class to swap the index pointed to by an alias, given some conditions + * + * @opensearch.internal */ public class TransportRolloverAction extends TransportMasterNodeAction { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/segments/IndexSegments.java b/server/src/main/java/org/opensearch/action/admin/indices/segments/IndexSegments.java index 907f352a5ed89..88973ce094d8b 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/segments/IndexSegments.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/segments/IndexSegments.java @@ -38,6 +38,11 @@ import java.util.List; import java.util.Map; +/** + * List of Index Segments + * + * @opensearch.internal + */ public class IndexSegments implements Iterable { private final String index; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/segments/IndexShardSegments.java b/server/src/main/java/org/opensearch/action/admin/indices/segments/IndexShardSegments.java index 470480c2ac064..e0633d3d557ae 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/segments/IndexShardSegments.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/segments/IndexShardSegments.java @@ -37,6 +37,11 @@ import java.util.Arrays; import java.util.Iterator; +/** + * List of Index Shard Segments + * + * @opensearch.internal + */ public class IndexShardSegments implements Iterable { private final ShardId shardId; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/segments/IndicesSegmentResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/segments/IndicesSegmentResponse.java index 37433b91c1033..c3992f8d42967 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/segments/IndicesSegmentResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/segments/IndicesSegmentResponse.java @@ -55,6 +55,11 @@ import java.util.Map; import java.util.Set; +/** + * Transport response for retrieving indices segment information + * + * @opensearch.internal + */ public class IndicesSegmentResponse extends BroadcastResponse { private final ShardSegments[] shards; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/segments/IndicesSegmentsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/segments/IndicesSegmentsAction.java index 467de4590e746..54a10ce259190 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/segments/IndicesSegmentsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/segments/IndicesSegmentsAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for retrieving indices segment information + * + * @opensearch.internal + */ public class IndicesSegmentsAction extends ActionType { public static final IndicesSegmentsAction INSTANCE = new IndicesSegmentsAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/segments/IndicesSegmentsRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/segments/IndicesSegmentsRequest.java index 14f6999692731..dd8c02a97c0f7 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/segments/IndicesSegmentsRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/segments/IndicesSegmentsRequest.java @@ -39,6 +39,11 @@ import java.io.IOException; +/** + * Transport request for retrieving indices segment information + * + * @opensearch.internal + */ public class IndicesSegmentsRequest extends BroadcastRequest { protected boolean verbose = false; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/segments/IndicesSegmentsRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/segments/IndicesSegmentsRequestBuilder.java index 4352344114f85..4b758e1f4bfb1 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/segments/IndicesSegmentsRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/segments/IndicesSegmentsRequestBuilder.java @@ -35,6 +35,11 @@ import org.opensearch.action.support.broadcast.BroadcastOperationRequestBuilder; import org.opensearch.client.OpenSearchClient; +/** + * Transport request builder for retrieving indices segment information + * + * @opensearch.internal + */ public class IndicesSegmentsRequestBuilder extends BroadcastOperationRequestBuilder< IndicesSegmentsRequest, IndicesSegmentResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/segments/ShardSegments.java b/server/src/main/java/org/opensearch/action/admin/indices/segments/ShardSegments.java index a6e34d1d55823..7214d0203966c 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/segments/ShardSegments.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/segments/ShardSegments.java @@ -42,6 +42,11 @@ import java.util.Iterator; import java.util.List; +/** + * Collection of shard segments + * + * @opensearch.internal + */ public class ShardSegments implements Writeable, Iterable { private final ShardRouting shardRouting; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/segments/TransportIndicesSegmentsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/segments/TransportIndicesSegmentsAction.java index 7ff7bb3591f1d..eb3d64188a6e7 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/segments/TransportIndicesSegmentsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/segments/TransportIndicesSegmentsAction.java @@ -53,6 +53,11 @@ import java.io.IOException; import java.util.List; +/** + * Transport response for retrieving indices segment information + * + * @opensearch.internal + */ public class TransportIndicesSegmentsAction extends TransportBroadcastByNodeAction< IndicesSegmentsRequest, IndicesSegmentResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/settings/get/GetSettingsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/settings/get/GetSettingsAction.java index cc64009682d43..e035b4d9ef622 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/settings/get/GetSettingsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/settings/get/GetSettingsAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for getting index segments + * + * @opensearch.internal + */ public class GetSettingsAction extends ActionType { public static final GetSettingsAction INSTANCE = new GetSettingsAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/settings/get/GetSettingsRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/settings/get/GetSettingsRequest.java index 739dfcae6287c..bf68a66d24c5a 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/settings/get/GetSettingsRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/settings/get/GetSettingsRequest.java @@ -45,6 +45,11 @@ import java.util.Arrays; import java.util.Objects; +/** + * Transport request for getting index segments + * + * @opensearch.internal + */ public class GetSettingsRequest extends MasterNodeReadRequest implements IndicesRequest.Replaceable { private String[] indices = Strings.EMPTY_ARRAY; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/settings/get/GetSettingsRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/settings/get/GetSettingsRequestBuilder.java index 034d5d64f1ca7..d978ffd90386a 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/settings/get/GetSettingsRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/settings/get/GetSettingsRequestBuilder.java @@ -37,6 +37,11 @@ import org.opensearch.client.OpenSearchClient; import org.opensearch.common.util.ArrayUtils; +/** + * Transport request builder for getting index segments + * + * @opensearch.internal + */ public class GetSettingsRequestBuilder extends MasterNodeReadOperationRequestBuilder< GetSettingsRequest, GetSettingsResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/settings/get/GetSettingsResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/settings/get/GetSettingsResponse.java index 0694f93f585ee..d16c629dd082e 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/settings/get/GetSettingsResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/settings/get/GetSettingsResponse.java @@ -52,6 +52,11 @@ import java.util.Map; import java.util.Objects; +/** + * Transport response for getting index segments + * + * @opensearch.internal + */ public class GetSettingsResponse extends ActionResponse implements ToXContentObject { private final ImmutableOpenMap indexToSettings; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/settings/get/TransportGetSettingsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/settings/get/TransportGetSettingsAction.java index 5e2c13b5037e2..4f55cf3c4b5ca 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/settings/get/TransportGetSettingsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/settings/get/TransportGetSettingsAction.java @@ -55,6 +55,11 @@ import java.io.IOException; +/** + * Transport action for getting index settings + * + * @opensearch.internal + */ public class TransportGetSettingsAction extends TransportMasterNodeReadAction { private final SettingsFilter settingsFilter; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/settings/put/TransportUpdateSettingsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/settings/put/TransportUpdateSettingsAction.java index 8b81bb8d8a821..52ce7dffbad80 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/settings/put/TransportUpdateSettingsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/settings/put/TransportUpdateSettingsAction.java @@ -55,6 +55,11 @@ import java.io.IOException; +/** + * Transport action for updating index settings + * + * @opensearch.internal + */ public class TransportUpdateSettingsAction extends TransportMasterNodeAction { private static final Logger logger = LogManager.getLogger(TransportUpdateSettingsAction.class); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/settings/put/UpdateSettingsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/settings/put/UpdateSettingsAction.java index 7c0182b0704de..2333a2aad6bc6 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/settings/put/UpdateSettingsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/settings/put/UpdateSettingsAction.java @@ -35,6 +35,11 @@ import org.opensearch.action.ActionType; import org.opensearch.action.support.master.AcknowledgedResponse; +/** + * Action for updating index settings + * + * @opensearch.internal + */ public class UpdateSettingsAction extends ActionType { public static final UpdateSettingsAction INSTANCE = new UpdateSettingsAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/settings/put/UpdateSettingsClusterStateUpdateRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/settings/put/UpdateSettingsClusterStateUpdateRequest.java index ce36e01ac465e..4b0dd05575309 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/settings/put/UpdateSettingsClusterStateUpdateRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/settings/put/UpdateSettingsClusterStateUpdateRequest.java @@ -37,6 +37,8 @@ /** * Cluster state update request that allows to update settings for some indices + * + * @opensearch.internal */ public class UpdateSettingsClusterStateUpdateRequest extends IndicesClusterStateUpdateRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/settings/put/UpdateSettingsRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/settings/put/UpdateSettingsRequest.java index 70f3dc683d599..2b0452301a5f5 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/settings/put/UpdateSettingsRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/settings/put/UpdateSettingsRequest.java @@ -58,6 +58,8 @@ /** * Request for an update index settings action + * + * @opensearch.internal */ public class UpdateSettingsRequest extends AcknowledgedRequest implements diff --git a/server/src/main/java/org/opensearch/action/admin/indices/settings/put/UpdateSettingsRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/settings/put/UpdateSettingsRequestBuilder.java index dd3b78ce901f4..7501f0c7798de 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/settings/put/UpdateSettingsRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/settings/put/UpdateSettingsRequestBuilder.java @@ -43,6 +43,8 @@ /** * Builder for an update index settings request + * + * @opensearch.internal */ public class UpdateSettingsRequestBuilder extends AcknowledgedRequestBuilder< UpdateSettingsRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/shards/IndicesShardStoreRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/shards/IndicesShardStoreRequestBuilder.java index 8a5b8bea75119..6eec8ccb63d20 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/shards/IndicesShardStoreRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/shards/IndicesShardStoreRequestBuilder.java @@ -40,6 +40,8 @@ /** * Request builder for {@link IndicesShardStoresRequest} + * + * @opensearch.internal */ public class IndicesShardStoreRequestBuilder extends MasterNodeReadOperationRequestBuilder< IndicesShardStoresRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/shards/IndicesShardStoresAction.java b/server/src/main/java/org/opensearch/action/admin/indices/shards/IndicesShardStoresAction.java index ec67ae051a5b1..79a6f88b1dbc4 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/shards/IndicesShardStoresAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/shards/IndicesShardStoresAction.java @@ -40,6 +40,8 @@ * Exposes shard store information for requested indices. * Shard store information reports which nodes hold shard copies, how recent they are * and any exceptions on opening the shard index or from previous engine failures + * + * @opensearch.internal */ public class IndicesShardStoresAction extends ActionType { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/shards/IndicesShardStoresRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/shards/IndicesShardStoresRequest.java index ff5b5c4cf0c2a..0b66e314731d1 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/shards/IndicesShardStoresRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/shards/IndicesShardStoresRequest.java @@ -45,6 +45,8 @@ /** * Request for {@link IndicesShardStoresAction} + * + * @opensearch.internal */ public class IndicesShardStoresRequest extends MasterNodeReadRequest implements IndicesRequest.Replaceable { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/shards/IndicesShardStoresResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/shards/IndicesShardStoresResponse.java index 0d050533ccbc4..bd5d9c651af7a 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/shards/IndicesShardStoresResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/shards/IndicesShardStoresResponse.java @@ -56,6 +56,8 @@ * * Consists of {@link StoreStatus}s for requested indices grouped by * indices and shard ids and a list of encountered node {@link Failure}s + * + * @opensearch.internal */ public class IndicesShardStoresResponse extends ActionResponse implements ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/shards/TransportIndicesShardStoresAction.java b/server/src/main/java/org/opensearch/action/admin/indices/shards/TransportIndicesShardStoresAction.java index 6e3444e3758b1..077bee78021c3 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/shards/TransportIndicesShardStoresAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/shards/TransportIndicesShardStoresAction.java @@ -78,6 +78,8 @@ /** * Transport action that reads the cluster state for shards with the requested criteria (see {@link ClusterHealthStatus}) of specific * indices and fetches store information from all the nodes using {@link TransportNodesListGatewayStartedShards} + * + * @opensearch.internal */ public class TransportIndicesShardStoresAction extends TransportMasterNodeReadAction< IndicesShardStoresRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/shrink/ResizeAction.java b/server/src/main/java/org/opensearch/action/admin/indices/shrink/ResizeAction.java index 5ecdd62206177..7ea6391f1c429 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/shrink/ResizeAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/shrink/ResizeAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for resizing an index + * + * @opensearch.internal + */ public class ResizeAction extends ActionType { public static final ResizeAction INSTANCE = new ResizeAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/shrink/ResizeRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/shrink/ResizeRequest.java index b74c6c8f8d195..50784e60a3f19 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/shrink/ResizeRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/shrink/ResizeRequest.java @@ -55,6 +55,8 @@ /** * Request class to shrink an index into a single shard + * + * @opensearch.internal */ public class ResizeRequest extends AcknowledgedRequest implements IndicesRequest, ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/shrink/ResizeRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/shrink/ResizeRequestBuilder.java index 766ed78e63497..418e83a5431ec 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/shrink/ResizeRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/shrink/ResizeRequestBuilder.java @@ -38,6 +38,11 @@ import org.opensearch.client.OpenSearchClient; import org.opensearch.common.settings.Settings; +/** + * Transport request builder for resizing an index + * + * @opensearch.internal + */ public class ResizeRequestBuilder extends AcknowledgedRequestBuilder { public ResizeRequestBuilder(OpenSearchClient client, ActionType action) { super(client, action, new ResizeRequest()); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/shrink/ResizeResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/shrink/ResizeResponse.java index 3846591d26f3a..88c38856d5025 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/shrink/ResizeResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/shrink/ResizeResponse.java @@ -41,6 +41,8 @@ /** * A response for a resize index action, either shrink or split index. + * + * @opensearch.internal */ public final class ResizeResponse extends CreateIndexResponse { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/shrink/ResizeType.java b/server/src/main/java/org/opensearch/action/admin/indices/shrink/ResizeType.java index 62b20ed9d3dcf..6403ed735ae49 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/shrink/ResizeType.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/shrink/ResizeType.java @@ -34,6 +34,8 @@ /** * The type of the resize operation + * + * @opensearch.internal */ public enum ResizeType { SHRINK, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java b/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java index b35febe60af31..24c5466c2ba0b 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java @@ -66,6 +66,8 @@ /** * Main class to initiate resizing (shrink / split) an index into a new index + * + * @opensearch.internal */ public class TransportResizeAction extends TransportMasterNodeAction { private final MetadataCreateIndexService createIndexService; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/stats/CommonStats.java b/server/src/main/java/org/opensearch/action/admin/indices/stats/CommonStats.java index 2949af00a30d0..472fb45f452dd 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/stats/CommonStats.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/stats/CommonStats.java @@ -65,6 +65,11 @@ import java.util.Objects; import java.util.stream.Stream; +/** + * Common Stats for OpenSearch + * + * @opensearch.internal + */ public class CommonStats implements Writeable, ToXContentFragment { @Nullable diff --git a/server/src/main/java/org/opensearch/action/admin/indices/stats/CommonStatsFlags.java b/server/src/main/java/org/opensearch/action/admin/indices/stats/CommonStatsFlags.java index e17b497ce312a..9eec34d87c384 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/stats/CommonStatsFlags.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/stats/CommonStatsFlags.java @@ -43,6 +43,11 @@ import java.util.Collections; import java.util.EnumSet; +/** + * Common Stats Flags for OpenSearch + * + * @opensearch.internal + */ public class CommonStatsFlags implements Writeable, Cloneable { public static final CommonStatsFlags ALL = new CommonStatsFlags().all(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/stats/IndexShardStats.java b/server/src/main/java/org/opensearch/action/admin/indices/stats/IndexShardStats.java index b8ecd6d4bfc3d..6a423cf8d15ea 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/stats/IndexShardStats.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/stats/IndexShardStats.java @@ -41,6 +41,11 @@ import java.util.Arrays; import java.util.Iterator; +/** + * IndexShardStats for OpenSearch + * + * @opensearch.internal + */ public class IndexShardStats implements Iterable, Writeable { private final ShardId shardId; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/stats/IndexStats.java b/server/src/main/java/org/opensearch/action/admin/indices/stats/IndexStats.java index b7cfe4ee6db33..c98d46a0caed6 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/stats/IndexStats.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/stats/IndexStats.java @@ -38,6 +38,11 @@ import java.util.List; import java.util.Map; +/** + * Index Stats for OpenSearch + * + * @opensearch.internal + */ public class IndexStats implements Iterable { private final String index; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/stats/IndicesStatsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/stats/IndicesStatsAction.java index c0a56c3f00536..bee33671ee291 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/stats/IndicesStatsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/stats/IndicesStatsAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Transport action for retrieving index stats + * + * @opensearch.internal + */ public class IndicesStatsAction extends ActionType { public static final IndicesStatsAction INSTANCE = new IndicesStatsAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/stats/IndicesStatsRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/stats/IndicesStatsRequest.java index bbe69b700b876..06315377797d9 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/stats/IndicesStatsRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/stats/IndicesStatsRequest.java @@ -45,6 +45,8 @@ *

    * All the stats to be returned can be cleared using {@link #clear()}, at which point, specific * stats can be enabled. + * + * @opensearch.internal */ public class IndicesStatsRequest extends BroadcastRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/stats/IndicesStatsRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/stats/IndicesStatsRequestBuilder.java index 23c33401966b4..c211812b32c48 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/stats/IndicesStatsRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/stats/IndicesStatsRequestBuilder.java @@ -44,6 +44,8 @@ *

    * All the stats to be returned can be cleared using {@link #clear()}, at which point, specific * stats can be enabled. + * + * @opensearch.internal */ public class IndicesStatsRequestBuilder extends BroadcastOperationRequestBuilder< IndicesStatsRequest, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/stats/IndicesStatsResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/stats/IndicesStatsResponse.java index 38ad4a0dca481..5b3fe22df4d6e 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/stats/IndicesStatsResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/stats/IndicesStatsResponse.java @@ -50,6 +50,11 @@ import static java.util.Collections.unmodifiableMap; +/** + * Transport response for retrieving indices stats + * + * @opensearch.internal + */ public class IndicesStatsResponse extends BroadcastResponse { private ShardStats[] shards; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/stats/ShardStats.java b/server/src/main/java/org/opensearch/action/admin/indices/stats/ShardStats.java index bab1d793f50b5..f6e7c0687b9e7 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/stats/ShardStats.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/stats/ShardStats.java @@ -46,6 +46,11 @@ import java.io.IOException; +/** + * Shard Stats for OpenSearch + * + * @opensearch.internal + */ public class ShardStats implements Writeable, ToXContentFragment { private ShardRouting shardRouting; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/stats/TransportIndicesStatsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/stats/TransportIndicesStatsAction.java index 11ca1462787e8..39e0338aac5f6 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/stats/TransportIndicesStatsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/stats/TransportIndicesStatsAction.java @@ -58,6 +58,11 @@ import java.io.IOException; import java.util.List; +/** + * Transport action for retrieving indices stats + * + * @opensearch.internal + */ public class TransportIndicesStatsAction extends TransportBroadcastByNodeAction { private final IndicesService indicesService; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/delete/DeleteComponentTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/delete/DeleteComponentTemplateAction.java index 3a05d99f65247..70c5a42f6e7ae 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/delete/DeleteComponentTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/delete/DeleteComponentTemplateAction.java @@ -43,6 +43,11 @@ import static org.opensearch.action.ValidateActions.addValidationError; +/** + * Transport action for deleting an index template component + * + * @opensearch.internal + */ public class DeleteComponentTemplateAction extends ActionType { public static final DeleteComponentTemplateAction INSTANCE = new DeleteComponentTemplateAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/delete/DeleteComposableIndexTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/delete/DeleteComposableIndexTemplateAction.java index 635755e1be5ca..ae1ca59d2ed56 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/delete/DeleteComposableIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/delete/DeleteComposableIndexTemplateAction.java @@ -44,6 +44,11 @@ import static org.opensearch.action.ValidateActions.addValidationError; +/** + * Transport action for deleting a composable index template + * + * @opensearch.internal + */ public class DeleteComposableIndexTemplateAction extends ActionType { public static final DeleteComposableIndexTemplateAction INSTANCE = new DeleteComposableIndexTemplateAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/delete/DeleteIndexTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/delete/DeleteIndexTemplateAction.java index a91ec2850a107..789d03f8e8d8c 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/delete/DeleteIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/delete/DeleteIndexTemplateAction.java @@ -35,6 +35,11 @@ import org.opensearch.action.ActionType; import org.opensearch.action.support.master.AcknowledgedResponse; +/** + * Transport action for deleting an index template + * + * @opensearch.internal + */ public class DeleteIndexTemplateAction extends ActionType { public static final DeleteIndexTemplateAction INSTANCE = new DeleteIndexTemplateAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/delete/DeleteIndexTemplateRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/template/delete/DeleteIndexTemplateRequest.java index a3762bb62fb94..e3a92107670ff 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/delete/DeleteIndexTemplateRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/delete/DeleteIndexTemplateRequest.java @@ -42,6 +42,8 @@ /** * A request to delete an index template. + * + * @opensearch.internal */ public class DeleteIndexTemplateRequest extends MasterNodeRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/delete/DeleteIndexTemplateRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/template/delete/DeleteIndexTemplateRequestBuilder.java index b58cdd06da5e9..2fc958ba93c6b 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/delete/DeleteIndexTemplateRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/delete/DeleteIndexTemplateRequestBuilder.java @@ -35,6 +35,11 @@ import org.opensearch.action.support.master.MasterNodeOperationRequestBuilder; import org.opensearch.client.OpenSearchClient; +/** + * Transport request builder for deleting an index template + * + * @opensearch.internal + */ public class DeleteIndexTemplateRequestBuilder extends MasterNodeOperationRequestBuilder< DeleteIndexTemplateRequest, AcknowledgedResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/delete/TransportDeleteComponentTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/delete/TransportDeleteComponentTemplateAction.java index 15ed0443525fb..491b3e520ee51 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/delete/TransportDeleteComponentTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/delete/TransportDeleteComponentTemplateAction.java @@ -51,6 +51,11 @@ import java.io.IOException; +/** + * Transport action for deleting a component template + * + * @opensearch.internal + */ public class TransportDeleteComponentTemplateAction extends TransportMasterNodeAction< DeleteComponentTemplateAction.Request, AcknowledgedResponse> { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/delete/TransportDeleteComposableIndexTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/delete/TransportDeleteComposableIndexTemplateAction.java index 87b3a883a3c10..4e7f3f292d810 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/delete/TransportDeleteComposableIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/delete/TransportDeleteComposableIndexTemplateAction.java @@ -51,6 +51,11 @@ import java.io.IOException; +/** + * Transport action for deleting a composable index template + * + * @opensearch.internal + */ public class TransportDeleteComposableIndexTemplateAction extends TransportMasterNodeAction< DeleteComposableIndexTemplateAction.Request, AcknowledgedResponse> { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/delete/TransportDeleteIndexTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/delete/TransportDeleteIndexTemplateAction.java index e75d3aafe6a85..89668fd0ed164 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/delete/TransportDeleteIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/delete/TransportDeleteIndexTemplateAction.java @@ -53,6 +53,8 @@ /** * Delete index action. + * + * @opensearch.internal */ public class TransportDeleteIndexTemplateAction extends TransportMasterNodeAction { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetComponentTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetComponentTemplateAction.java index 286be16ea9660..6722be7a066a4 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetComponentTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetComponentTemplateAction.java @@ -50,6 +50,8 @@ /** * Action to retrieve one or more component templates + * + * @opensearch.internal */ public class GetComponentTemplateAction extends ActionType { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetComposableIndexTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetComposableIndexTemplateAction.java index 0dc30a57d650e..79760e9914784 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetComposableIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetComposableIndexTemplateAction.java @@ -48,6 +48,11 @@ import java.util.Map; import java.util.Objects; +/** + * Action to retrieve one or more Composable Index templates + * + * @opensearch.internal + */ public class GetComposableIndexTemplateAction extends ActionType { public static final GetComposableIndexTemplateAction INSTANCE = new GetComposableIndexTemplateAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetIndexTemplatesAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetIndexTemplatesAction.java index 1194abbab1cbb..f380ad6fddb55 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetIndexTemplatesAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetIndexTemplatesAction.java @@ -33,6 +33,11 @@ import org.opensearch.action.ActionType; +/** + * Action to retrieve one or more Index templates + * + * @opensearch.internal + */ public class GetIndexTemplatesAction extends ActionType { public static final GetIndexTemplatesAction INSTANCE = new GetIndexTemplatesAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetIndexTemplatesRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetIndexTemplatesRequest.java index da48bc4d8bc29..806b1ee0b9162 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetIndexTemplatesRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetIndexTemplatesRequest.java @@ -43,6 +43,8 @@ /** * Request that allows to retrieve index templates + * + * @opensearch.internal */ public class GetIndexTemplatesRequest extends MasterNodeReadRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetIndexTemplatesRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetIndexTemplatesRequestBuilder.java index 348075d051616..d5e5845955dae 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetIndexTemplatesRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetIndexTemplatesRequestBuilder.java @@ -34,6 +34,11 @@ import org.opensearch.action.support.master.MasterNodeReadOperationRequestBuilder; import org.opensearch.client.OpenSearchClient; +/** + * Request builder to retrieve one or more Index templates + * + * @opensearch.internal + */ public class GetIndexTemplatesRequestBuilder extends MasterNodeReadOperationRequestBuilder< GetIndexTemplatesRequest, GetIndexTemplatesResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetIndexTemplatesResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetIndexTemplatesResponse.java index e6d487e0a40b3..556d809315edc 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetIndexTemplatesResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/get/GetIndexTemplatesResponse.java @@ -46,6 +46,11 @@ import static java.util.Collections.singletonMap; +/** + * Response for retrieving one or more Index templates + * + * @opensearch.internal + */ public class GetIndexTemplatesResponse extends ActionResponse implements ToXContentObject { private final List indexTemplates; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/get/TransportGetComponentTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/get/TransportGetComponentTemplateAction.java index 62615465fbb4a..b7efb584ba92f 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/get/TransportGetComponentTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/get/TransportGetComponentTemplateAction.java @@ -52,6 +52,11 @@ import java.util.HashMap; import java.util.Map; +/** + * Action to retrieve one or more Component templates + * + * @opensearch.internal + */ public class TransportGetComponentTemplateAction extends TransportMasterNodeReadAction< GetComponentTemplateAction.Request, GetComponentTemplateAction.Response> { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/get/TransportGetComposableIndexTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/get/TransportGetComposableIndexTemplateAction.java index efa6d4723ce0d..e3eb619b52569 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/get/TransportGetComposableIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/get/TransportGetComposableIndexTemplateAction.java @@ -52,6 +52,11 @@ import java.util.HashMap; import java.util.Map; +/** + * Transport Action to retrieve one or more Composable Index templates + * + * @opensearch.internal + */ public class TransportGetComposableIndexTemplateAction extends TransportMasterNodeReadAction< GetComposableIndexTemplateAction.Request, GetComposableIndexTemplateAction.Response> { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/get/TransportGetIndexTemplatesAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/get/TransportGetIndexTemplatesAction.java index df6531d0a3862..993f40fd4f625 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/get/TransportGetIndexTemplatesAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/get/TransportGetIndexTemplatesAction.java @@ -52,6 +52,11 @@ import java.util.Arrays; import java.util.List; +/** + * Transport action to retrieve one or more Index templates + * + * @opensearch.internal + */ public class TransportGetIndexTemplatesAction extends TransportMasterNodeReadAction { @Inject diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/post/SimulateIndexTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/post/SimulateIndexTemplateAction.java index 3e6a586638e58..66b15c8b807f8 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/post/SimulateIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/post/SimulateIndexTemplateAction.java @@ -34,6 +34,12 @@ import org.opensearch.action.ActionType; +/** + * Transport Action for handling simulating an index template either by name (looking it up in the + * cluster state), or by a provided template configuration + * + * @opensearch.internal + */ public class SimulateIndexTemplateAction extends ActionType { public static final SimulateIndexTemplateAction INSTANCE = new SimulateIndexTemplateAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/post/SimulateIndexTemplateRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/template/post/SimulateIndexTemplateRequest.java index 9d6735751ac7e..3db0ec47c5df2 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/post/SimulateIndexTemplateRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/post/SimulateIndexTemplateRequest.java @@ -43,6 +43,12 @@ import java.io.IOException; import java.util.Objects; +/** + * Transport Request for handling simulating an index template either by name (looking it up in the + * cluster state), or by a provided template configuration + * + * @opensearch.internal + */ public class SimulateIndexTemplateRequest extends MasterNodeReadRequest { private String indexName; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/post/SimulateIndexTemplateResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/template/post/SimulateIndexTemplateResponse.java index 9116db02459ef..517d61a1e4dbc 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/post/SimulateIndexTemplateResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/post/SimulateIndexTemplateResponse.java @@ -49,6 +49,8 @@ /** * Contains the information on what V2 templates would match a given index. + * + * @opensearch.internal */ public class SimulateIndexTemplateResponse extends ActionResponse implements ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/post/SimulateTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/post/SimulateTemplateAction.java index 744f401c87941..8cd5aa53f3373 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/post/SimulateTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/post/SimulateTemplateAction.java @@ -47,6 +47,8 @@ /** * An action for simulating the complete composed settings of the specified * index template name, or index template configuration + * + * @opensearch.internal */ public class SimulateTemplateAction extends ActionType { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/post/TransportSimulateIndexTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/post/TransportSimulateIndexTemplateAction.java index 598b5bdbf6d3b..89d04dc3f59f5 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/post/TransportSimulateIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/post/TransportSimulateIndexTemplateAction.java @@ -75,6 +75,12 @@ import static org.opensearch.cluster.metadata.MetadataIndexTemplateService.findV2Template; import static org.opensearch.cluster.metadata.MetadataIndexTemplateService.resolveSettings; +/** + * Transport Action for handling simulating an index template either by name (looking it up in the + * cluster state), or by a provided template configuration + * + * @opensearch.internal + */ public class TransportSimulateIndexTemplateAction extends TransportMasterNodeReadAction< SimulateIndexTemplateRequest, SimulateIndexTemplateResponse> { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/post/TransportSimulateTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/post/TransportSimulateTemplateAction.java index e12544a02be4c..5b14d0a00ebfe 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/post/TransportSimulateTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/post/TransportSimulateTemplateAction.java @@ -64,6 +64,8 @@ /** * Handles simulating an index template either by name (looking it up in the * cluster state), or by a provided template configuration + * + * @opensearch.internal */ public class TransportSimulateTemplateAction extends TransportMasterNodeReadAction< SimulateTemplateAction.Request, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/put/PutComponentTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/put/PutComponentTemplateAction.java index ac9905fd6d0ab..ff2fdeaab8582 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/put/PutComponentTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/put/PutComponentTemplateAction.java @@ -48,6 +48,8 @@ /** * An action for putting a single component template into the cluster state + * + * @opensearch.internal */ public class PutComponentTemplateAction extends ActionType { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/put/PutComposableIndexTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/put/PutComposableIndexTemplateAction.java index c3bd81edfb9d6..17cbe83faa625 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/put/PutComposableIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/put/PutComposableIndexTemplateAction.java @@ -51,6 +51,11 @@ import static org.opensearch.action.ValidateActions.addValidationError; +/** + * An action for putting a composable template into the cluster state + * + * @opensearch.internal + */ public class PutComposableIndexTemplateAction extends ActionType { public static final PutComposableIndexTemplateAction INSTANCE = new PutComposableIndexTemplateAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/put/PutIndexTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/put/PutIndexTemplateAction.java index e3c072908596f..06a9f6fbba409 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/put/PutIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/put/PutIndexTemplateAction.java @@ -35,6 +35,11 @@ import org.opensearch.action.ActionType; import org.opensearch.action.support.master.AcknowledgedResponse; +/** + * An action for putting an index template into the cluster state + * + * @opensearch.internal + */ public class PutIndexTemplateAction extends ActionType { public static final PutIndexTemplateAction INSTANCE = new PutIndexTemplateAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/put/PutIndexTemplateRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/template/put/PutIndexTemplateRequest.java index 608e3da699318..4c826477978fc 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/put/PutIndexTemplateRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/put/PutIndexTemplateRequest.java @@ -77,6 +77,8 @@ /** * A request to create an index template. + * + * @opensearch.internal */ public class PutIndexTemplateRequest extends MasterNodeRequest implements IndicesRequest, ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/put/PutIndexTemplateRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/template/put/PutIndexTemplateRequestBuilder.java index e5a02acb4a6e9..df12dc5d66998 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/put/PutIndexTemplateRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/put/PutIndexTemplateRequestBuilder.java @@ -43,6 +43,11 @@ import java.util.List; import java.util.Map; +/** + * A request builder for putting an index template into the cluster state + * + * @opensearch.internal + */ public class PutIndexTemplateRequestBuilder extends MasterNodeOperationRequestBuilder< PutIndexTemplateRequest, AcknowledgedResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/put/TransportPutComponentTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/put/TransportPutComponentTemplateAction.java index 022ffbeb7e03a..469c20e497822 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/put/TransportPutComponentTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/put/TransportPutComponentTemplateAction.java @@ -54,6 +54,11 @@ import java.io.IOException; +/** + * An action for putting a single component template into the cluster state + * + * @opensearch.internal + */ public class TransportPutComponentTemplateAction extends TransportMasterNodeAction< PutComponentTemplateAction.Request, AcknowledgedResponse> { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/put/TransportPutComposableIndexTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/put/TransportPutComposableIndexTemplateAction.java index 7739c66b4cbd4..19485afe5d706 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/put/TransportPutComposableIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/put/TransportPutComposableIndexTemplateAction.java @@ -50,6 +50,11 @@ import java.io.IOException; +/** + * An action for putting a composable index template into the cluster state + * + * @opensearch.internal + */ public class TransportPutComposableIndexTemplateAction extends TransportMasterNodeAction< PutComposableIndexTemplateAction.Request, AcknowledgedResponse> { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/template/put/TransportPutIndexTemplateAction.java b/server/src/main/java/org/opensearch/action/admin/indices/template/put/TransportPutIndexTemplateAction.java index 42d932c62da55..778e0b374e2aa 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/template/put/TransportPutIndexTemplateAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/template/put/TransportPutIndexTemplateAction.java @@ -56,6 +56,8 @@ /** * Put index template action. + * + * @opensearch.internal */ public class TransportPutIndexTemplateAction extends TransportMasterNodeAction { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/IndexShardUpgradeStatus.java b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/IndexShardUpgradeStatus.java index 954ab28542904..df937fab349ec 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/IndexShardUpgradeStatus.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/IndexShardUpgradeStatus.java @@ -37,6 +37,11 @@ import java.util.Arrays; import java.util.Iterator; +/** + * Status for an Index Shard Upgrade + * + * @opensearch.internal + */ public class IndexShardUpgradeStatus implements Iterable { private final ShardId shardId; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/IndexUpgradeStatus.java b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/IndexUpgradeStatus.java index 19f97faff3c61..2cff1f04d3fd2 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/IndexUpgradeStatus.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/IndexUpgradeStatus.java @@ -38,6 +38,11 @@ import java.util.List; import java.util.Map; +/** + * Status for an Index Upgrade + * + * @opensearch.internal + */ public class IndexUpgradeStatus implements Iterable { private final String index; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/ShardUpgradeStatus.java b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/ShardUpgradeStatus.java index 579bd5e969eef..8ca8188899d02 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/ShardUpgradeStatus.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/ShardUpgradeStatus.java @@ -39,6 +39,11 @@ import java.io.IOException; +/** + * Status for a Shard Upgrade + * + * @opensearch.internal + */ public class ShardUpgradeStatus extends BroadcastShardResponse { private ShardRouting shardRouting; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/TransportUpgradeStatusAction.java b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/TransportUpgradeStatusAction.java index fcad2ccc6298d..b2f6cd62b1be7 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/TransportUpgradeStatusAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/TransportUpgradeStatusAction.java @@ -55,6 +55,11 @@ import java.io.IOException; import java.util.List; +/** + * Transport Action for Upgrading an Index + * + * @opensearch.internal + */ public class TransportUpgradeStatusAction extends TransportBroadcastByNodeAction< UpgradeStatusRequest, UpgradeStatusResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/UpgradeStatusAction.java b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/UpgradeStatusAction.java index 7612bcb4464d4..a43d7580a571f 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/UpgradeStatusAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/UpgradeStatusAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Action for Upgrading an Index + * + * @opensearch.internal + */ public class UpgradeStatusAction extends ActionType { public static final UpgradeStatusAction INSTANCE = new UpgradeStatusAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/UpgradeStatusRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/UpgradeStatusRequest.java index bc7f0f31a6197..48a19ccdf0b94 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/UpgradeStatusRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/UpgradeStatusRequest.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Transport Request for retrieving status of upgrading an Index + * + * @opensearch.internal + */ public class UpgradeStatusRequest extends BroadcastRequest { public UpgradeStatusRequest() { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/UpgradeStatusRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/UpgradeStatusRequestBuilder.java index 6f4f601a81d8a..c698c38fe12d5 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/UpgradeStatusRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/UpgradeStatusRequestBuilder.java @@ -35,6 +35,11 @@ import org.opensearch.action.support.broadcast.BroadcastOperationRequestBuilder; import org.opensearch.client.OpenSearchClient; +/** + * Transport Request Builder for retrieving status of upgrading an Index + * + * @opensearch.internal + */ public class UpgradeStatusRequestBuilder extends BroadcastOperationRequestBuilder< UpgradeStatusRequest, UpgradeStatusResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/UpgradeStatusResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/UpgradeStatusResponse.java index fbff92f197292..311f86b0fe3b9 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/UpgradeStatusResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/get/UpgradeStatusResponse.java @@ -47,6 +47,11 @@ import java.util.Map; import java.util.Set; +/** + * Transport Response for retrieving status of upgrading an Index + * + * @opensearch.internal + */ public class UpgradeStatusResponse extends BroadcastResponse { private ShardUpgradeStatus[] shards; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/ShardUpgradeResult.java b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/ShardUpgradeResult.java index a4fcbaca55299..4eea1f01742bd 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/ShardUpgradeResult.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/ShardUpgradeResult.java @@ -41,6 +41,11 @@ import java.io.IOException; import java.text.ParseException; +/** + * Result for Upgrading a Shard + * + * @opensearch.internal + */ class ShardUpgradeResult implements Writeable { private ShardId shardId; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/TransportUpgradeAction.java b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/TransportUpgradeAction.java index 1048de90b214e..e50c8a94d5e20 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/TransportUpgradeAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/TransportUpgradeAction.java @@ -67,6 +67,8 @@ /** * Upgrade index/indices action. + * + * @opensearch.internal */ public class TransportUpgradeAction extends TransportBroadcastByNodeAction { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/TransportUpgradeSettingsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/TransportUpgradeSettingsAction.java index cacd341730e12..4c352a172c040 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/TransportUpgradeSettingsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/TransportUpgradeSettingsAction.java @@ -53,6 +53,11 @@ import java.io.IOException; +/** + * Transport action for upgrading index settings + * + * @opensearch.internal + */ public class TransportUpgradeSettingsAction extends TransportMasterNodeAction { private static final Logger logger = LogManager.getLogger(TransportUpgradeSettingsAction.class); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeAction.java b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeAction.java index ee9da454ad141..369503bb54ecf 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeAction.java @@ -36,6 +36,8 @@ /** * Upgrade index/indices action. + * + * @opensearch.internal */ public class UpgradeAction extends ActionType { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeRequest.java index e9833c51b97a4..fc75da23c805e 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeRequest.java @@ -44,6 +44,8 @@ * @see org.opensearch.client.Requests#upgradeRequest(String...) * @see org.opensearch.client.IndicesAdminClient#upgrade(UpgradeRequest) * @see UpgradeResponse + * + * @opensearch.internal */ public class UpgradeRequest extends BroadcastRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeRequestBuilder.java index 5deff45aadc9b..8203f9d51b8e4 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeRequestBuilder.java @@ -38,6 +38,8 @@ /** * A request to upgrade one or more indices. In order to optimize on all the indices, pass an empty array or * {@code null} for the indices. + * + * @opensearch.internal */ public class UpgradeRequestBuilder extends BroadcastOperationRequestBuilder { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeResponse.java index 07f9debbbf97b..ff1fd2b5635c0 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeResponse.java @@ -47,7 +47,7 @@ /** * A response for the upgrade action. * - * + * @opensearch.internal */ public class UpgradeResponse extends BroadcastResponse { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeSettingsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeSettingsAction.java index f9ecc9ace9171..05944e781d109 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeSettingsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeSettingsAction.java @@ -35,6 +35,11 @@ import org.opensearch.action.ActionType; import org.opensearch.action.support.master.AcknowledgedResponse; +/** + * Transport action for upgrading index settings + * + * @opensearch.internal + */ public class UpgradeSettingsAction extends ActionType { public static final UpgradeSettingsAction INSTANCE = new UpgradeSettingsAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeSettingsClusterStateUpdateRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeSettingsClusterStateUpdateRequest.java index cf24e20a44ee3..ee6c6161713ac 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeSettingsClusterStateUpdateRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeSettingsClusterStateUpdateRequest.java @@ -40,6 +40,8 @@ /** * Cluster state update request that allows to change minimum compatibility settings for some indices + * + * @opensearch.internal */ public class UpgradeSettingsClusterStateUpdateRequest extends ClusterStateUpdateRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeSettingsRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeSettingsRequest.java index dc3a60c62033b..d6b784e44befb 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeSettingsRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/upgrade/post/UpgradeSettingsRequest.java @@ -46,6 +46,8 @@ /** * Request for an update index settings action + * + * @opensearch.internal */ public class UpgradeSettingsRequest extends AcknowledgedRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/validate/query/QueryExplanation.java b/server/src/main/java/org/opensearch/action/admin/indices/validate/query/QueryExplanation.java index 3764cfd1e608b..087c5e4d2b1ab 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/validate/query/QueryExplanation.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/validate/query/QueryExplanation.java @@ -47,6 +47,11 @@ import static org.opensearch.common.xcontent.ConstructingObjectParser.constructorArg; import static org.opensearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; +/** + * Query Explanation + * + * @opensearch.internal + */ public class QueryExplanation implements Writeable, ToXContentFragment { public static final String INDEX_FIELD = "index"; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/validate/query/ShardValidateQueryRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/validate/query/ShardValidateQueryRequest.java index 4d6525d002381..7df5a27929778 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/validate/query/ShardValidateQueryRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/validate/query/ShardValidateQueryRequest.java @@ -45,6 +45,8 @@ /** * Internal validate request executed directly against a specific index shard. + * + * @opensearch.internal */ public class ShardValidateQueryRequest extends BroadcastShardRequest { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/validate/query/ShardValidateQueryResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/validate/query/ShardValidateQueryResponse.java index 88080bd7667f3..7da73f5038e92 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/validate/query/ShardValidateQueryResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/validate/query/ShardValidateQueryResponse.java @@ -42,7 +42,7 @@ /** * Internal validate response of a shard validate request executed directly against a specific shard. * - * + * @opensearch.internal */ class ShardValidateQueryResponse extends BroadcastShardResponse { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/validate/query/TransportValidateQueryAction.java b/server/src/main/java/org/opensearch/action/admin/indices/validate/query/TransportValidateQueryAction.java index 1849b41ce707f..431c5468d1850 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/validate/query/TransportValidateQueryAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/validate/query/TransportValidateQueryAction.java @@ -72,6 +72,11 @@ import java.util.concurrent.atomic.AtomicReferenceArray; import java.util.function.LongSupplier; +/** + * Transport Action to Validate a Query + * + * @opensearch.internal + */ public class TransportValidateQueryAction extends TransportBroadcastAction< ValidateQueryRequest, ValidateQueryResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/validate/query/ValidateQueryAction.java b/server/src/main/java/org/opensearch/action/admin/indices/validate/query/ValidateQueryAction.java index a9b0954287c30..cdeb9e818a52f 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/validate/query/ValidateQueryAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/validate/query/ValidateQueryAction.java @@ -34,6 +34,11 @@ import org.opensearch.action.ActionType; +/** + * Action to Validate a Query + * + * @opensearch.internal + */ public class ValidateQueryAction extends ActionType { public static final ValidateQueryAction INSTANCE = new ValidateQueryAction(); diff --git a/server/src/main/java/org/opensearch/action/admin/indices/validate/query/ValidateQueryRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/validate/query/ValidateQueryRequest.java index 1bb85c4e84483..75295f74582b9 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/validate/query/ValidateQueryRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/validate/query/ValidateQueryRequest.java @@ -52,6 +52,8 @@ * A request to validate a specific query. *

    * The request requires the query to be set using {@link #query(QueryBuilder)} + * + * @opensearch.internal */ public class ValidateQueryRequest extends BroadcastRequest implements ToXContentObject { diff --git a/server/src/main/java/org/opensearch/action/admin/indices/validate/query/ValidateQueryRequestBuilder.java b/server/src/main/java/org/opensearch/action/admin/indices/validate/query/ValidateQueryRequestBuilder.java index 88261e6536240..6209f41d88be2 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/validate/query/ValidateQueryRequestBuilder.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/validate/query/ValidateQueryRequestBuilder.java @@ -36,6 +36,11 @@ import org.opensearch.client.OpenSearchClient; import org.opensearch.index.query.QueryBuilder; +/** + * Transport Request Builder to Validate a Query + * + * @opensearch.internal + */ public class ValidateQueryRequestBuilder extends BroadcastOperationRequestBuilder< ValidateQueryRequest, ValidateQueryResponse, diff --git a/server/src/main/java/org/opensearch/action/admin/indices/validate/query/ValidateQueryResponse.java b/server/src/main/java/org/opensearch/action/admin/indices/validate/query/ValidateQueryResponse.java index 53d1463c23351..2e843369f6af0 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/validate/query/ValidateQueryResponse.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/validate/query/ValidateQueryResponse.java @@ -52,7 +52,7 @@ /** * The response of the validate action. * - * + * @opensearch.internal */ public class ValidateQueryResponse extends BroadcastResponse { diff --git a/server/src/main/java/org/opensearch/plugins/ActionPlugin.java b/server/src/main/java/org/opensearch/plugins/ActionPlugin.java index f6bfb815ccf1e..d9792d60ae735 100644 --- a/server/src/main/java/org/opensearch/plugins/ActionPlugin.java +++ b/server/src/main/java/org/opensearch/plugins/ActionPlugin.java @@ -152,6 +152,11 @@ default UnaryOperator getRestHandlerWrapper(ThreadContext threadCon return null; } + /** + * Class responsible for handing Transport Actions + * + * @opensearch.internal + */ final class ActionHandler { private final ActionType action; private final Class> transportAction; diff --git a/server/src/main/java/org/opensearch/plugins/ExtensiblePlugin.java b/server/src/main/java/org/opensearch/plugins/ExtensiblePlugin.java index 52a01c817fcb1..4dd4010383934 100644 --- a/server/src/main/java/org/opensearch/plugins/ExtensiblePlugin.java +++ b/server/src/main/java/org/opensearch/plugins/ExtensiblePlugin.java @@ -44,6 +44,11 @@ */ public interface ExtensiblePlugin { + /** + * Extension point for external plugins to be extendable + * + * @opensearch.api + */ interface ExtensionLoader { /** * Load extensions of the type from all extending plugins. The concrete extensions must have either a no-arg constructor diff --git a/server/src/main/java/org/opensearch/plugins/PluginsService.java b/server/src/main/java/org/opensearch/plugins/PluginsService.java index 4ef2dc4617de9..bff880e5a41d7 100644 --- a/server/src/main/java/org/opensearch/plugins/PluginsService.java +++ b/server/src/main/java/org/opensearch/plugins/PluginsService.java @@ -83,6 +83,11 @@ import static org.opensearch.common.io.FileSystemUtils.isAccessibleDirectory; +/** + * Service responsible for loading plugins and modules (internal and external) + * + * @opensearch.internal + */ public class PluginsService implements ReportingService { private static final Logger logger = LogManager.getLogger(PluginsService.class); diff --git a/server/src/main/java/org/opensearch/transport/RequestHandlerRegistry.java b/server/src/main/java/org/opensearch/transport/RequestHandlerRegistry.java index dcb021531f0ac..b65b72b745a01 100644 --- a/server/src/main/java/org/opensearch/transport/RequestHandlerRegistry.java +++ b/server/src/main/java/org/opensearch/transport/RequestHandlerRegistry.java @@ -43,7 +43,12 @@ import java.io.IOException; -public class RequestHandlerRegistry { +/** + * Registry for OpenSearch RequestHandlers + * + * @opensearch.internal + */ +public final class RequestHandlerRegistry { private final String action; private final TransportRequestHandler handler; diff --git a/server/src/main/java/org/opensearch/transport/StatsTracker.java b/server/src/main/java/org/opensearch/transport/StatsTracker.java index a97a9c6a9374b..5548d2d558ae2 100644 --- a/server/src/main/java/org/opensearch/transport/StatsTracker.java +++ b/server/src/main/java/org/opensearch/transport/StatsTracker.java @@ -36,7 +36,12 @@ import java.util.concurrent.atomic.LongAdder; -public class StatsTracker { +/** + * Tracks transport statistics + * + * @opensearch.internal + */ +public final class StatsTracker { private final LongAdder bytesRead = new LongAdder(); private final LongAdder messagesReceived = new LongAdder(); From 0cf076307196b69929f4adf5f622e2a30fe6936c Mon Sep 17 00:00:00 2001 From: Nick Knize Date: Fri, 13 May 2022 12:27:47 -0500 Subject: [PATCH 153/514] [Javadocs] add to o.o.cluster (#3170) (#3177) Adds javadocs to classes in the o.o.cluster package. Signed-off-by: Nicholas Walter Knize --- .../main/java/org/opensearch/cluster/AbstractDiffable.java | 2 ++ .../java/org/opensearch/cluster/AbstractNamedDiffable.java | 2 ++ .../opensearch/cluster/AckedClusterStateTaskListener.java | 5 +++++ .../org/opensearch/cluster/AckedClusterStateUpdateTask.java | 2 ++ .../java/org/opensearch/cluster/ClusterChangedEvent.java | 2 ++ .../src/main/java/org/opensearch/cluster/ClusterInfo.java | 2 ++ .../java/org/opensearch/cluster/ClusterInfoService.java | 2 ++ .../src/main/java/org/opensearch/cluster/ClusterModule.java | 2 ++ .../src/main/java/org/opensearch/cluster/ClusterName.java | 5 +++++ .../src/main/java/org/opensearch/cluster/ClusterState.java | 2 ++ .../java/org/opensearch/cluster/ClusterStateApplier.java | 2 ++ .../java/org/opensearch/cluster/ClusterStateListener.java | 2 +- .../java/org/opensearch/cluster/ClusterStateObserver.java | 2 ++ .../java/org/opensearch/cluster/ClusterStateTaskConfig.java | 2 ++ .../org/opensearch/cluster/ClusterStateTaskExecutor.java | 5 +++++ .../org/opensearch/cluster/ClusterStateTaskListener.java | 5 +++++ .../java/org/opensearch/cluster/ClusterStateUpdateTask.java | 2 ++ server/src/main/java/org/opensearch/cluster/Diff.java | 2 ++ server/src/main/java/org/opensearch/cluster/Diffable.java | 2 ++ .../src/main/java/org/opensearch/cluster/DiffableUtils.java | 5 +++++ server/src/main/java/org/opensearch/cluster/DiskUsage.java | 2 ++ .../org/opensearch/cluster/EmptyClusterInfoService.java | 2 ++ .../cluster/IncompatibleClusterStateVersionException.java | 2 ++ .../org/opensearch/cluster/InternalClusterInfoService.java | 2 ++ .../java/org/opensearch/cluster/LocalClusterUpdateTask.java | 2 ++ .../org/opensearch/cluster/LocalNodeMasterListener.java | 2 ++ .../org/opensearch/cluster/MasterNodeChangePredicate.java | 5 +++++ .../java/org/opensearch/cluster/MergableCustomMetadata.java | 2 ++ server/src/main/java/org/opensearch/cluster/NamedDiff.java | 2 ++ .../src/main/java/org/opensearch/cluster/NamedDiffable.java | 2 ++ .../opensearch/cluster/NamedDiffableValueSerializer.java | 2 ++ .../java/org/opensearch/cluster/NodeConnectionsService.java | 2 ++ .../java/org/opensearch/cluster/NotMasterException.java | 2 ++ .../org/opensearch/cluster/RepositoryCleanupInProgress.java | 5 +++++ .../main/java/org/opensearch/cluster/RestoreInProgress.java | 2 ++ .../org/opensearch/cluster/SnapshotDeletionsInProgress.java | 2 ++ .../java/org/opensearch/cluster/SnapshotsInProgress.java | 2 ++ .../org/opensearch/cluster/TimeoutClusterStateListener.java | 2 +- .../main/java/org/opensearch/cluster/ack/AckedRequest.java | 2 ++ .../opensearch/cluster/ack/ClusterStateUpdateRequest.java | 2 ++ .../opensearch/cluster/ack/ClusterStateUpdateResponse.java | 2 ++ .../cluster/ack/CreateIndexClusterStateUpdateResponse.java | 2 ++ .../cluster/ack/IndicesClusterStateUpdateRequest.java | 2 ++ .../cluster/ack/OpenIndexClusterStateUpdateResponse.java | 2 ++ .../cluster/action/index/MappingUpdatedAction.java | 2 ++ .../cluster/action/index/NodeMappingRefreshAction.java | 5 +++++ .../opensearch/cluster/action/shard/ShardStateAction.java | 5 +++++ .../java/org/opensearch/cluster/block/ClusterBlock.java | 5 +++++ .../org/opensearch/cluster/block/ClusterBlockException.java | 5 +++++ .../org/opensearch/cluster/block/ClusterBlockLevel.java | 5 +++++ .../java/org/opensearch/cluster/block/ClusterBlocks.java | 2 ++ .../opensearch/cluster/coordination/ApplyCommitRequest.java | 2 ++ .../cluster/coordination/ClusterBootstrapService.java | 5 +++++ .../cluster/coordination/ClusterFormationFailureHelper.java | 5 +++++ .../cluster/coordination/ClusterStatePublisher.java | 5 +++++ .../cluster/coordination/CoordinationMetadata.java | 5 +++++ .../opensearch/cluster/coordination/CoordinationState.java | 2 ++ .../coordination/CoordinationStateRejectedException.java | 2 ++ .../org/opensearch/cluster/coordination/Coordinator.java | 5 +++++ .../cluster/coordination/DetachClusterCommand.java | 5 +++++ .../cluster/coordination/ElectionSchedulerFactory.java | 2 ++ .../opensearch/cluster/coordination/ElectionStrategy.java | 2 ++ .../coordination/FailedToCommitClusterStateException.java | 2 ++ .../opensearch/cluster/coordination/FollowersChecker.java | 2 ++ .../cluster/coordination/InMemoryPersistedState.java | 5 +++++ .../main/java/org/opensearch/cluster/coordination/Join.java | 2 ++ .../org/opensearch/cluster/coordination/JoinHelper.java | 5 +++++ .../org/opensearch/cluster/coordination/JoinRequest.java | 5 +++++ .../opensearch/cluster/coordination/JoinTaskExecutor.java | 5 +++++ .../org/opensearch/cluster/coordination/LagDetector.java | 2 ++ .../org/opensearch/cluster/coordination/LeaderChecker.java | 2 ++ .../cluster/coordination/NoMasterBlockService.java | 5 +++++ .../coordination/NodeHealthCheckFailureException.java | 2 ++ .../coordination/NodeRemovalClusterStateTaskExecutor.java | 5 +++++ .../org/opensearch/cluster/coordination/NodeToolCli.java | 6 ++++++ .../cluster/coordination/OpenSearchNodeCommand.java | 5 +++++ .../org/opensearch/cluster/coordination/PeersResponse.java | 5 +++++ .../cluster/coordination/PendingClusterStateStats.java | 2 ++ .../opensearch/cluster/coordination/PreVoteCollector.java | 5 +++++ .../org/opensearch/cluster/coordination/PreVoteRequest.java | 5 +++++ .../opensearch/cluster/coordination/PreVoteResponse.java | 5 +++++ .../org/opensearch/cluster/coordination/Publication.java | 5 +++++ .../cluster/coordination/PublicationTransportHandler.java | 5 +++++ .../cluster/coordination/PublishClusterStateStats.java | 2 ++ .../org/opensearch/cluster/coordination/PublishRequest.java | 2 ++ .../opensearch/cluster/coordination/PublishResponse.java | 2 ++ .../cluster/coordination/PublishWithJoinResponse.java | 2 ++ .../org/opensearch/cluster/coordination/Reconfigurator.java | 2 ++ .../cluster/coordination/RemoveCustomsCommand.java | 5 +++++ .../cluster/coordination/RemoveSettingsCommand.java | 5 +++++ .../opensearch/cluster/coordination/StartJoinRequest.java | 2 ++ .../opensearch/cluster/coordination/TermVersionRequest.java | 5 +++++ .../cluster/coordination/UnsafeBootstrapMasterCommand.java | 5 +++++ .../cluster/coordination/ValidateJoinRequest.java | 5 +++++ .../org/opensearch/cluster/health/ClusterHealthStatus.java | 5 +++++ .../org/opensearch/cluster/health/ClusterIndexHealth.java | 5 +++++ .../org/opensearch/cluster/health/ClusterShardHealth.java | 5 +++++ .../org/opensearch/cluster/health/ClusterStateHealth.java | 5 +++++ .../java/org/opensearch/cluster/metadata/AliasAction.java | 2 ++ .../java/org/opensearch/cluster/metadata/AliasMetadata.java | 5 +++++ .../org/opensearch/cluster/metadata/AliasValidator.java | 2 ++ .../org/opensearch/cluster/metadata/AutoExpandReplicas.java | 2 ++ .../cluster/metadata/ClusterNameExpressionResolver.java | 2 ++ .../org/opensearch/cluster/metadata/ComponentTemplate.java | 2 ++ .../cluster/metadata/ComponentTemplateMetadata.java | 2 ++ .../cluster/metadata/ComposableIndexTemplate.java | 2 ++ .../cluster/metadata/ComposableIndexTemplateMetadata.java | 2 ++ .../java/org/opensearch/cluster/metadata/DataStream.java | 5 +++++ .../org/opensearch/cluster/metadata/DataStreamMetadata.java | 2 ++ .../org/opensearch/cluster/metadata/DiffableStringMap.java | 2 ++ .../org/opensearch/cluster/metadata/IndexAbstraction.java | 2 ++ .../cluster/metadata/IndexAbstractionResolver.java | 5 +++++ .../org/opensearch/cluster/metadata/IndexGraveyard.java | 2 ++ .../java/org/opensearch/cluster/metadata/IndexMetadata.java | 5 +++++ .../cluster/metadata/IndexNameExpressionResolver.java | 5 +++++ .../opensearch/cluster/metadata/IndexTemplateMetadata.java | 5 +++++ .../main/java/org/opensearch/cluster/metadata/Manifest.java | 2 ++ .../org/opensearch/cluster/metadata/MappingMetadata.java | 2 ++ .../main/java/org/opensearch/cluster/metadata/Metadata.java | 5 +++++ .../cluster/metadata/MetadataCreateDataStreamService.java | 5 +++++ .../cluster/metadata/MetadataCreateIndexService.java | 2 ++ .../cluster/metadata/MetadataDeleteIndexService.java | 2 ++ .../cluster/metadata/MetadataIndexAliasesService.java | 2 ++ .../cluster/metadata/MetadataIndexStateService.java | 2 ++ .../cluster/metadata/MetadataIndexTemplateService.java | 2 ++ .../cluster/metadata/MetadataIndexUpgradeService.java | 2 ++ .../opensearch/cluster/metadata/MetadataMappingService.java | 2 ++ .../cluster/metadata/MetadataUpdateSettingsService.java | 2 ++ .../metadata/ProcessClusterEventTimeoutException.java | 5 +++++ .../opensearch/cluster/metadata/RepositoriesMetadata.java | 2 ++ .../org/opensearch/cluster/metadata/RepositoryMetadata.java | 2 ++ .../cluster/metadata/SystemIndexMetadataUpgradeService.java | 2 ++ .../main/java/org/opensearch/cluster/metadata/Template.java | 2 ++ .../opensearch/cluster/metadata/TemplateUpgradeService.java | 2 ++ .../java/org/opensearch/cluster/node/DiscoveryNode.java | 2 ++ .../org/opensearch/cluster/node/DiscoveryNodeFilters.java | 5 +++++ .../java/org/opensearch/cluster/node/DiscoveryNodeRole.java | 2 ++ .../java/org/opensearch/cluster/node/DiscoveryNodes.java | 2 ++ .../java/org/opensearch/cluster/routing/AllocationId.java | 2 ++ .../opensearch/cluster/routing/BatchedRerouteService.java | 2 ++ .../cluster/routing/DelayedAllocationService.java | 2 ++ .../org/opensearch/cluster/routing/GroupShardsIterator.java | 2 ++ .../cluster/routing/IllegalShardRoutingStateException.java | 2 ++ .../org/opensearch/cluster/routing/IndexRoutingTable.java | 2 ++ .../opensearch/cluster/routing/IndexShardRoutingTable.java | 2 ++ .../org/opensearch/cluster/routing/Murmur3HashFunction.java | 2 ++ .../org/opensearch/cluster/routing/OperationRouting.java | 5 +++++ .../org/opensearch/cluster/routing/PlainShardIterator.java | 2 ++ .../org/opensearch/cluster/routing/PlainShardsIterator.java | 2 ++ .../java/org/opensearch/cluster/routing/Preference.java | 2 ++ .../java/org/opensearch/cluster/routing/RecoverySource.java | 2 ++ .../java/org/opensearch/cluster/routing/RerouteService.java | 2 ++ .../opensearch/cluster/routing/RotationShardShuffler.java | 2 ++ .../opensearch/cluster/routing/RoutingChangesObserver.java | 2 ++ .../org/opensearch/cluster/routing/RoutingException.java | 2 ++ .../java/org/opensearch/cluster/routing/RoutingNode.java | 2 ++ .../java/org/opensearch/cluster/routing/RoutingNodes.java | 2 ++ .../java/org/opensearch/cluster/routing/RoutingTable.java | 2 ++ .../java/org/opensearch/cluster/routing/ShardIterator.java | 2 ++ .../java/org/opensearch/cluster/routing/ShardRouting.java | 2 ++ .../org/opensearch/cluster/routing/ShardRoutingState.java | 2 ++ .../java/org/opensearch/cluster/routing/ShardShuffler.java | 2 ++ .../java/org/opensearch/cluster/routing/ShardsIterator.java | 2 ++ .../java/org/opensearch/cluster/routing/UnassignedInfo.java | 2 ++ .../routing/allocation/AbstractAllocationDecision.java | 2 ++ .../routing/allocation/AllocateUnassignedDecision.java | 2 ++ .../cluster/routing/allocation/AllocationConstraints.java | 2 ++ .../cluster/routing/allocation/AllocationDecision.java | 2 ++ .../cluster/routing/allocation/AllocationService.java | 2 ++ .../cluster/routing/allocation/DiskThresholdMonitor.java | 2 ++ .../cluster/routing/allocation/DiskThresholdSettings.java | 2 ++ .../cluster/routing/allocation/ExistingShardsAllocator.java | 2 ++ .../opensearch/cluster/routing/allocation/FailedShard.java | 2 ++ .../cluster/routing/allocation/IndexMetadataUpdater.java | 2 ++ .../opensearch/cluster/routing/allocation/MoveDecision.java | 2 ++ .../cluster/routing/allocation/NodeAllocationResult.java | 2 ++ .../cluster/routing/allocation/RerouteExplanation.java | 2 ++ .../cluster/routing/allocation/RoutingAllocation.java | 2 ++ .../cluster/routing/allocation/RoutingExplanations.java | 2 ++ .../routing/allocation/RoutingNodesChangedObserver.java | 2 ++ .../cluster/routing/allocation/ShardAllocationDecision.java | 2 ++ .../opensearch/cluster/routing/allocation/StaleShard.java | 2 ++ .../allocation/allocator/BalancedShardsAllocator.java | 2 ++ .../routing/allocation/allocator/ShardsAllocator.java | 2 ++ .../command/AbstractAllocateAllocationCommand.java | 2 ++ .../command/AllocateEmptyPrimaryAllocationCommand.java | 2 ++ .../command/AllocateReplicaAllocationCommand.java | 2 ++ .../command/AllocateStalePrimaryAllocationCommand.java | 2 ++ .../routing/allocation/command/AllocationCommand.java | 2 ++ .../routing/allocation/command/AllocationCommands.java | 2 ++ .../allocation/command/BasePrimaryAllocationCommand.java | 2 ++ .../routing/allocation/command/CancelAllocationCommand.java | 2 ++ .../routing/allocation/command/MoveAllocationCommand.java | 2 ++ .../routing/allocation/decider/AllocationDecider.java | 2 ++ .../routing/allocation/decider/AllocationDeciders.java | 2 ++ .../allocation/decider/AwarenessAllocationDecider.java | 2 ++ .../decider/ClusterRebalanceAllocationDecider.java | 2 ++ .../decider/ConcurrentRebalanceAllocationDecider.java | 2 ++ .../decider/ConcurrentRecoveriesAllocationDecider.java | 2 ++ .../cluster/routing/allocation/decider/Decision.java | 2 ++ .../routing/allocation/decider/DiskThresholdDecider.java | 2 ++ .../routing/allocation/decider/EnableAllocationDecider.java | 2 ++ .../routing/allocation/decider/FilterAllocationDecider.java | 2 ++ .../allocation/decider/MaxRetryAllocationDecider.java | 1 + .../allocation/decider/NodeLoadAwareAllocationDecider.java | 2 ++ .../allocation/decider/NodeVersionAllocationDecider.java | 2 ++ .../decider/RebalanceOnlyWhenActiveAllocationDecider.java | 2 ++ .../decider/ReplicaAfterPrimaryActiveAllocationDecider.java | 2 ++ .../routing/allocation/decider/ResizeAllocationDecider.java | 2 ++ .../decider/RestoreInProgressAllocationDecider.java | 2 ++ .../allocation/decider/SameShardAllocationDecider.java | 2 ++ .../allocation/decider/ShardsLimitAllocationDecider.java | 2 ++ .../decider/SnapshotInProgressAllocationDecider.java | 2 ++ .../allocation/decider/ThrottlingAllocationDecider.java | 2 ++ .../java/org/opensearch/cluster/service/ClusterApplier.java | 5 +++++ .../opensearch/cluster/service/ClusterApplierService.java | 5 +++++ .../java/org/opensearch/cluster/service/ClusterService.java | 5 +++++ .../java/org/opensearch/cluster/service/MasterService.java | 5 +++++ .../org/opensearch/cluster/service/PendingClusterTask.java | 5 +++++ .../cluster/service/SourcePrioritizedRunnable.java | 2 ++ .../java/org/opensearch/cluster/service/TaskBatcher.java | 2 ++ 221 files changed, 611 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/opensearch/cluster/AbstractDiffable.java b/server/src/main/java/org/opensearch/cluster/AbstractDiffable.java index 7b95545e58101..600f972fd9d63 100644 --- a/server/src/main/java/org/opensearch/cluster/AbstractDiffable.java +++ b/server/src/main/java/org/opensearch/cluster/AbstractDiffable.java @@ -41,6 +41,8 @@ /** * Abstract diffable object with simple diffs implementation that sends the entire object if object has changed or * nothing if object remained the same. + * + * @opensearch.internal */ public abstract class AbstractDiffable> implements Diffable { diff --git a/server/src/main/java/org/opensearch/cluster/AbstractNamedDiffable.java b/server/src/main/java/org/opensearch/cluster/AbstractNamedDiffable.java index 43ff74f30a249..8af061a0874c9 100644 --- a/server/src/main/java/org/opensearch/cluster/AbstractNamedDiffable.java +++ b/server/src/main/java/org/opensearch/cluster/AbstractNamedDiffable.java @@ -43,6 +43,8 @@ /** * Abstract diffable object with simple diffs implementation that sends the entire object if object has changed or * nothing is object remained the same. Comparing to AbstractDiffable, this class also works with NamedWriteables + * + * @opensearch.internal */ public abstract class AbstractNamedDiffable> implements Diffable, NamedWriteable { diff --git a/server/src/main/java/org/opensearch/cluster/AckedClusterStateTaskListener.java b/server/src/main/java/org/opensearch/cluster/AckedClusterStateTaskListener.java index 0f6531fb09be9..482087be1c8eb 100644 --- a/server/src/main/java/org/opensearch/cluster/AckedClusterStateTaskListener.java +++ b/server/src/main/java/org/opensearch/cluster/AckedClusterStateTaskListener.java @@ -35,6 +35,11 @@ import org.opensearch.common.Nullable; import org.opensearch.common.unit.TimeValue; +/** + * Listener when cluster state task is acknowledged + * + * @opensearch.internal + */ public interface AckedClusterStateTaskListener extends ClusterStateTaskListener { /** diff --git a/server/src/main/java/org/opensearch/cluster/AckedClusterStateUpdateTask.java b/server/src/main/java/org/opensearch/cluster/AckedClusterStateUpdateTask.java index 82ea05274d0d1..21c4460964067 100644 --- a/server/src/main/java/org/opensearch/cluster/AckedClusterStateUpdateTask.java +++ b/server/src/main/java/org/opensearch/cluster/AckedClusterStateUpdateTask.java @@ -41,6 +41,8 @@ /** * An extension interface to {@link ClusterStateUpdateTask} that allows to be notified when * all the nodes have acknowledged a cluster state update request + * + * @opensearch.internal */ public abstract class AckedClusterStateUpdateTask extends ClusterStateUpdateTask implements AckedClusterStateTaskListener { diff --git a/server/src/main/java/org/opensearch/cluster/ClusterChangedEvent.java b/server/src/main/java/org/opensearch/cluster/ClusterChangedEvent.java index 387a27da46820..dd4f6c59fabaa 100644 --- a/server/src/main/java/org/opensearch/cluster/ClusterChangedEvent.java +++ b/server/src/main/java/org/opensearch/cluster/ClusterChangedEvent.java @@ -53,6 +53,8 @@ /** * An event received by the local node, signaling that the cluster state has changed. + * + * @opensearch.internal */ public class ClusterChangedEvent { diff --git a/server/src/main/java/org/opensearch/cluster/ClusterInfo.java b/server/src/main/java/org/opensearch/cluster/ClusterInfo.java index 19e026c570c74..8803af9a5419a 100644 --- a/server/src/main/java/org/opensearch/cluster/ClusterInfo.java +++ b/server/src/main/java/org/opensearch/cluster/ClusterInfo.java @@ -55,6 +55,8 @@ * and a map of shard ids to shard sizes, see * InternalClusterInfoService.shardIdentifierFromRouting(String) * for the key used in the shardSizes map + * + * @opensearch.internal */ public class ClusterInfo implements ToXContentFragment, Writeable { private final ImmutableOpenMap leastAvailableSpaceUsage; diff --git a/server/src/main/java/org/opensearch/cluster/ClusterInfoService.java b/server/src/main/java/org/opensearch/cluster/ClusterInfoService.java index 03ef68fbd1c4d..50675d11003bb 100644 --- a/server/src/main/java/org/opensearch/cluster/ClusterInfoService.java +++ b/server/src/main/java/org/opensearch/cluster/ClusterInfoService.java @@ -36,6 +36,8 @@ /** * Interface for a class used to gather information about a cluster periodically. + * + * @opensearch.internal */ @FunctionalInterface public interface ClusterInfoService { diff --git a/server/src/main/java/org/opensearch/cluster/ClusterModule.java b/server/src/main/java/org/opensearch/cluster/ClusterModule.java index c85691b80d7c3..900dceb8564c9 100644 --- a/server/src/main/java/org/opensearch/cluster/ClusterModule.java +++ b/server/src/main/java/org/opensearch/cluster/ClusterModule.java @@ -110,6 +110,8 @@ /** * Configures classes and services that affect the entire cluster. + * + * @opensearch.internal */ public class ClusterModule extends AbstractModule { diff --git a/server/src/main/java/org/opensearch/cluster/ClusterName.java b/server/src/main/java/org/opensearch/cluster/ClusterName.java index 86b182c6f6c2d..77fc21b739f1a 100644 --- a/server/src/main/java/org/opensearch/cluster/ClusterName.java +++ b/server/src/main/java/org/opensearch/cluster/ClusterName.java @@ -42,6 +42,11 @@ import java.util.Objects; import java.util.function.Predicate; +/** + * Cluster Name + * + * @opensearch.internal + */ public class ClusterName implements Writeable { public static final Setting CLUSTER_NAME_SETTING = new Setting<>("cluster.name", "opensearch", (s) -> { diff --git a/server/src/main/java/org/opensearch/cluster/ClusterState.java b/server/src/main/java/org/opensearch/cluster/ClusterState.java index 3eaac99bad998..4010002561930 100644 --- a/server/src/main/java/org/opensearch/cluster/ClusterState.java +++ b/server/src/main/java/org/opensearch/cluster/ClusterState.java @@ -97,6 +97,8 @@ * make sure that the correct diffs are applied. If uuids don’t match, the {@link ClusterStateDiff#apply} method * throws the {@link IncompatibleClusterStateVersionException}, which causes the publishing mechanism to send * a full version of the cluster state to the node on which this exception was thrown. + * + * @opensearch.internal */ public class ClusterState implements ToXContentFragment, Diffable { diff --git a/server/src/main/java/org/opensearch/cluster/ClusterStateApplier.java b/server/src/main/java/org/opensearch/cluster/ClusterStateApplier.java index 6ba7cba0b463d..140e6426bb801 100644 --- a/server/src/main/java/org/opensearch/cluster/ClusterStateApplier.java +++ b/server/src/main/java/org/opensearch/cluster/ClusterStateApplier.java @@ -37,6 +37,8 @@ /** * A component that is in charge of applying an incoming cluster state to the node internal data structures. * The single apply method is called before the cluster state becomes visible via {@link ClusterService#state()}. + * + * @opensearch.internal */ public interface ClusterStateApplier { diff --git a/server/src/main/java/org/opensearch/cluster/ClusterStateListener.java b/server/src/main/java/org/opensearch/cluster/ClusterStateListener.java index bbd41508fd630..01a8e51a3d13e 100644 --- a/server/src/main/java/org/opensearch/cluster/ClusterStateListener.java +++ b/server/src/main/java/org/opensearch/cluster/ClusterStateListener.java @@ -35,7 +35,7 @@ /** * A listener to be notified when a cluster state changes. * - * + * @opensearch.internal */ public interface ClusterStateListener { diff --git a/server/src/main/java/org/opensearch/cluster/ClusterStateObserver.java b/server/src/main/java/org/opensearch/cluster/ClusterStateObserver.java index 4f3372b4e9069..5e99ebe229c6a 100644 --- a/server/src/main/java/org/opensearch/cluster/ClusterStateObserver.java +++ b/server/src/main/java/org/opensearch/cluster/ClusterStateObserver.java @@ -50,6 +50,8 @@ * A utility class which simplifies interacting with the cluster state in cases where * one tries to take action based on the current state but may want to wait for a new state * and retry upon failure. + * + * @opensearch.internal */ public class ClusterStateObserver { diff --git a/server/src/main/java/org/opensearch/cluster/ClusterStateTaskConfig.java b/server/src/main/java/org/opensearch/cluster/ClusterStateTaskConfig.java index ec038df7a9096..8d775b92a0431 100644 --- a/server/src/main/java/org/opensearch/cluster/ClusterStateTaskConfig.java +++ b/server/src/main/java/org/opensearch/cluster/ClusterStateTaskConfig.java @@ -37,6 +37,8 @@ /** * Cluster state update task configuration for timeout and priority + * + * @opensearch.internal */ public interface ClusterStateTaskConfig { /** diff --git a/server/src/main/java/org/opensearch/cluster/ClusterStateTaskExecutor.java b/server/src/main/java/org/opensearch/cluster/ClusterStateTaskExecutor.java index 48d3dd7d03cb5..8d40f447abe98 100644 --- a/server/src/main/java/org/opensearch/cluster/ClusterStateTaskExecutor.java +++ b/server/src/main/java/org/opensearch/cluster/ClusterStateTaskExecutor.java @@ -37,6 +37,11 @@ import java.util.List; import java.util.Map; +/** + * Interface that updates the cluster state based on the task + * + * @opensearch.internal + */ public interface ClusterStateTaskExecutor { /** * Update the cluster state based on the current state and the given tasks. Return the *same instance* if no state diff --git a/server/src/main/java/org/opensearch/cluster/ClusterStateTaskListener.java b/server/src/main/java/org/opensearch/cluster/ClusterStateTaskListener.java index d5b9eebbc3b5d..91137a7efae92 100644 --- a/server/src/main/java/org/opensearch/cluster/ClusterStateTaskListener.java +++ b/server/src/main/java/org/opensearch/cluster/ClusterStateTaskListener.java @@ -35,6 +35,11 @@ import java.util.List; +/** + * Interface to implement a cluster state change listener + * + * @opensearch.internal + */ public interface ClusterStateTaskListener { /** diff --git a/server/src/main/java/org/opensearch/cluster/ClusterStateUpdateTask.java b/server/src/main/java/org/opensearch/cluster/ClusterStateUpdateTask.java index 9393663b309fc..f9de49a1f7e58 100644 --- a/server/src/main/java/org/opensearch/cluster/ClusterStateUpdateTask.java +++ b/server/src/main/java/org/opensearch/cluster/ClusterStateUpdateTask.java @@ -40,6 +40,8 @@ /** * A task that can update the cluster state. + * + * @opensearch.internal */ public abstract class ClusterStateUpdateTask implements diff --git a/server/src/main/java/org/opensearch/cluster/Diff.java b/server/src/main/java/org/opensearch/cluster/Diff.java index 165fb750f3f53..9af6afed0d13b 100644 --- a/server/src/main/java/org/opensearch/cluster/Diff.java +++ b/server/src/main/java/org/opensearch/cluster/Diff.java @@ -36,6 +36,8 @@ /** * Represents difference between states of cluster state parts + * + * @opensearch.internal */ public interface Diff extends Writeable { diff --git a/server/src/main/java/org/opensearch/cluster/Diffable.java b/server/src/main/java/org/opensearch/cluster/Diffable.java index 3dcac5459d27d..23c30527befa9 100644 --- a/server/src/main/java/org/opensearch/cluster/Diffable.java +++ b/server/src/main/java/org/opensearch/cluster/Diffable.java @@ -36,6 +36,8 @@ /** * Cluster state part, changes in which can be serialized + * + * @opensearch.internal */ public interface Diffable extends Writeable { diff --git a/server/src/main/java/org/opensearch/cluster/DiffableUtils.java b/server/src/main/java/org/opensearch/cluster/DiffableUtils.java index 76da490eca1f3..88a240938c468 100644 --- a/server/src/main/java/org/opensearch/cluster/DiffableUtils.java +++ b/server/src/main/java/org/opensearch/cluster/DiffableUtils.java @@ -53,6 +53,11 @@ import java.util.Map; import java.util.Set; +/** + * Utility class for a diffable + * + * @opensearch.internal + */ public final class DiffableUtils { private DiffableUtils() {} diff --git a/server/src/main/java/org/opensearch/cluster/DiskUsage.java b/server/src/main/java/org/opensearch/cluster/DiskUsage.java index e7f04ffb749b9..69bca6ae5b2c5 100644 --- a/server/src/main/java/org/opensearch/cluster/DiskUsage.java +++ b/server/src/main/java/org/opensearch/cluster/DiskUsage.java @@ -45,6 +45,8 @@ /** * Encapsulation class used to represent the amount of disk used on a node. + * + * @opensearch.internal */ public class DiskUsage implements ToXContentFragment, Writeable { final String nodeId; diff --git a/server/src/main/java/org/opensearch/cluster/EmptyClusterInfoService.java b/server/src/main/java/org/opensearch/cluster/EmptyClusterInfoService.java index cf2ce4c3f9ae0..27d1c706eb012 100644 --- a/server/src/main/java/org/opensearch/cluster/EmptyClusterInfoService.java +++ b/server/src/main/java/org/opensearch/cluster/EmptyClusterInfoService.java @@ -36,6 +36,8 @@ /** * {@link ClusterInfoService} that provides empty maps for disk usage and shard sizes + * + * @opensearch.internal */ public class EmptyClusterInfoService implements ClusterInfoService { public static final EmptyClusterInfoService INSTANCE = new EmptyClusterInfoService(); diff --git a/server/src/main/java/org/opensearch/cluster/IncompatibleClusterStateVersionException.java b/server/src/main/java/org/opensearch/cluster/IncompatibleClusterStateVersionException.java index 5ce71c651ae61..8dd988b0fba5d 100644 --- a/server/src/main/java/org/opensearch/cluster/IncompatibleClusterStateVersionException.java +++ b/server/src/main/java/org/opensearch/cluster/IncompatibleClusterStateVersionException.java @@ -39,6 +39,8 @@ /** * Thrown by {@link Diff#apply} method + * + * @opensearch.internal */ public class IncompatibleClusterStateVersionException extends OpenSearchException { public IncompatibleClusterStateVersionException(String msg) { diff --git a/server/src/main/java/org/opensearch/cluster/InternalClusterInfoService.java b/server/src/main/java/org/opensearch/cluster/InternalClusterInfoService.java index 5b1c026e5259b..ac70e42149086 100644 --- a/server/src/main/java/org/opensearch/cluster/InternalClusterInfoService.java +++ b/server/src/main/java/org/opensearch/cluster/InternalClusterInfoService.java @@ -83,6 +83,8 @@ * * Every time the timer runs, gathers information about the disk usage and * shard sizes across the cluster. + * + * @opensearch.internal */ public class InternalClusterInfoService implements ClusterInfoService, ClusterStateListener { diff --git a/server/src/main/java/org/opensearch/cluster/LocalClusterUpdateTask.java b/server/src/main/java/org/opensearch/cluster/LocalClusterUpdateTask.java index ffcd63b3b57c1..dfa02b60ee9dc 100644 --- a/server/src/main/java/org/opensearch/cluster/LocalClusterUpdateTask.java +++ b/server/src/main/java/org/opensearch/cluster/LocalClusterUpdateTask.java @@ -39,6 +39,8 @@ /** * Used to apply state updates on nodes that are not necessarily cluster-manager + * + * @opensearch.internal */ public abstract class LocalClusterUpdateTask implements diff --git a/server/src/main/java/org/opensearch/cluster/LocalNodeMasterListener.java b/server/src/main/java/org/opensearch/cluster/LocalNodeMasterListener.java index d4456b379237c..612141807ab14 100644 --- a/server/src/main/java/org/opensearch/cluster/LocalNodeMasterListener.java +++ b/server/src/main/java/org/opensearch/cluster/LocalNodeMasterListener.java @@ -34,6 +34,8 @@ /** * Enables listening to cluster-manager changes events of the local node (when the local node becomes the cluster-manager, and when the local * node cease being a cluster-manager). + * + * @opensearch.internal */ public interface LocalNodeMasterListener extends ClusterStateListener { diff --git a/server/src/main/java/org/opensearch/cluster/MasterNodeChangePredicate.java b/server/src/main/java/org/opensearch/cluster/MasterNodeChangePredicate.java index 8eeaedd83cb26..7ff5161c443a1 100644 --- a/server/src/main/java/org/opensearch/cluster/MasterNodeChangePredicate.java +++ b/server/src/main/java/org/opensearch/cluster/MasterNodeChangePredicate.java @@ -36,6 +36,11 @@ import java.util.function.Predicate; +/** + * Utility class to build a predicate that accepts cluster state changes + * + * @opensearch.internal + */ public final class MasterNodeChangePredicate { private MasterNodeChangePredicate() { diff --git a/server/src/main/java/org/opensearch/cluster/MergableCustomMetadata.java b/server/src/main/java/org/opensearch/cluster/MergableCustomMetadata.java index 521fbe52848f8..b9898e79e3e6f 100644 --- a/server/src/main/java/org/opensearch/cluster/MergableCustomMetadata.java +++ b/server/src/main/java/org/opensearch/cluster/MergableCustomMetadata.java @@ -40,6 +40,8 @@ * Custom metadata can be merged using {@link #merge(Metadata.Custom)}. * * @param type of custom meta data + * + * @opensearch.internal */ public interface MergableCustomMetadata { diff --git a/server/src/main/java/org/opensearch/cluster/NamedDiff.java b/server/src/main/java/org/opensearch/cluster/NamedDiff.java index 7ab73b965188c..2b8dfa14f9ea6 100644 --- a/server/src/main/java/org/opensearch/cluster/NamedDiff.java +++ b/server/src/main/java/org/opensearch/cluster/NamedDiff.java @@ -37,6 +37,8 @@ /** * Diff that also support NamedWriteable interface + * + * @opensearch.internal */ public interface NamedDiff> extends Diff, NamedWriteable { /** diff --git a/server/src/main/java/org/opensearch/cluster/NamedDiffable.java b/server/src/main/java/org/opensearch/cluster/NamedDiffable.java index 7073053d1d840..b47e180cf583e 100644 --- a/server/src/main/java/org/opensearch/cluster/NamedDiffable.java +++ b/server/src/main/java/org/opensearch/cluster/NamedDiffable.java @@ -36,5 +36,7 @@ /** * Diff that also support {@link VersionedNamedWriteable} interface + * + * @opensearch.internal */ public interface NamedDiffable extends Diffable, VersionedNamedWriteable {} diff --git a/server/src/main/java/org/opensearch/cluster/NamedDiffableValueSerializer.java b/server/src/main/java/org/opensearch/cluster/NamedDiffableValueSerializer.java index d7bd39de42884..ecf42e413459c 100644 --- a/server/src/main/java/org/opensearch/cluster/NamedDiffableValueSerializer.java +++ b/server/src/main/java/org/opensearch/cluster/NamedDiffableValueSerializer.java @@ -39,6 +39,8 @@ /** * Value Serializer for named diffables + * + * @opensearch.internal */ public class NamedDiffableValueSerializer> extends DiffableUtils.DiffableValueSerializer { diff --git a/server/src/main/java/org/opensearch/cluster/NodeConnectionsService.java b/server/src/main/java/org/opensearch/cluster/NodeConnectionsService.java index 696df6278dbb6..c642d3652c47a 100644 --- a/server/src/main/java/org/opensearch/cluster/NodeConnectionsService.java +++ b/server/src/main/java/org/opensearch/cluster/NodeConnectionsService.java @@ -80,6 +80,8 @@ *

    * This component does not block on disconnections at all, because a disconnection might need to wait for an ongoing (background) connection * attempt to complete first. + * + * @opensearch.internal */ public class NodeConnectionsService extends AbstractLifecycleComponent { private static final Logger logger = LogManager.getLogger(NodeConnectionsService.class); diff --git a/server/src/main/java/org/opensearch/cluster/NotMasterException.java b/server/src/main/java/org/opensearch/cluster/NotMasterException.java index c8ec32ed77eb9..a855f3b665ac3 100644 --- a/server/src/main/java/org/opensearch/cluster/NotMasterException.java +++ b/server/src/main/java/org/opensearch/cluster/NotMasterException.java @@ -40,6 +40,8 @@ * Thrown when a node join request or a cluster-manager ping reaches a node which is not * currently acting as a cluster-manager or when a cluster state update task is to be executed * on a node that is no longer cluster-manager. + * + * @opensearch.internal */ public class NotMasterException extends OpenSearchException { diff --git a/server/src/main/java/org/opensearch/cluster/RepositoryCleanupInProgress.java b/server/src/main/java/org/opensearch/cluster/RepositoryCleanupInProgress.java index bae464606c0f2..0f69acf12272a 100644 --- a/server/src/main/java/org/opensearch/cluster/RepositoryCleanupInProgress.java +++ b/server/src/main/java/org/opensearch/cluster/RepositoryCleanupInProgress.java @@ -45,6 +45,11 @@ import java.util.Collections; import java.util.List; +/** + * Information passed during repository cleanup + * + * @opensearch.internal + */ public final class RepositoryCleanupInProgress extends AbstractNamedDiffable implements ClusterState.Custom { public static final RepositoryCleanupInProgress EMPTY = new RepositoryCleanupInProgress(Collections.emptyList()); diff --git a/server/src/main/java/org/opensearch/cluster/RestoreInProgress.java b/server/src/main/java/org/opensearch/cluster/RestoreInProgress.java index 205084261f2a9..45d9c8b373298 100644 --- a/server/src/main/java/org/opensearch/cluster/RestoreInProgress.java +++ b/server/src/main/java/org/opensearch/cluster/RestoreInProgress.java @@ -54,6 +54,8 @@ /** * Meta data about restore processes that are currently executing + * + * @opensearch.internal */ public class RestoreInProgress extends AbstractNamedDiffable implements Custom, Iterable { diff --git a/server/src/main/java/org/opensearch/cluster/SnapshotDeletionsInProgress.java b/server/src/main/java/org/opensearch/cluster/SnapshotDeletionsInProgress.java index 67ba285f45130..bf2ab3f269357 100644 --- a/server/src/main/java/org/opensearch/cluster/SnapshotDeletionsInProgress.java +++ b/server/src/main/java/org/opensearch/cluster/SnapshotDeletionsInProgress.java @@ -57,6 +57,8 @@ /** * A class that represents the snapshot deletions that are in progress in the cluster. + * + * @opensearch.internal */ public class SnapshotDeletionsInProgress extends AbstractNamedDiffable implements Custom { diff --git a/server/src/main/java/org/opensearch/cluster/SnapshotsInProgress.java b/server/src/main/java/org/opensearch/cluster/SnapshotsInProgress.java index d0d5aea9d036b..033c0bafc971d 100644 --- a/server/src/main/java/org/opensearch/cluster/SnapshotsInProgress.java +++ b/server/src/main/java/org/opensearch/cluster/SnapshotsInProgress.java @@ -71,6 +71,8 @@ /** * Meta data about snapshots that are currently executing + * + * @opensearch.internal */ public class SnapshotsInProgress extends AbstractNamedDiffable implements Custom { diff --git a/server/src/main/java/org/opensearch/cluster/TimeoutClusterStateListener.java b/server/src/main/java/org/opensearch/cluster/TimeoutClusterStateListener.java index d7465fa00a50c..eb31fa2b7e69d 100644 --- a/server/src/main/java/org/opensearch/cluster/TimeoutClusterStateListener.java +++ b/server/src/main/java/org/opensearch/cluster/TimeoutClusterStateListener.java @@ -37,7 +37,7 @@ /** * An exception to cluster state listener that allows for timeouts and for post added notifications. * - * + * @opensearch.internal */ public interface TimeoutClusterStateListener extends ClusterStateListener { diff --git a/server/src/main/java/org/opensearch/cluster/ack/AckedRequest.java b/server/src/main/java/org/opensearch/cluster/ack/AckedRequest.java index 97d628e3231c9..a3f74cb45a880 100644 --- a/server/src/main/java/org/opensearch/cluster/ack/AckedRequest.java +++ b/server/src/main/java/org/opensearch/cluster/ack/AckedRequest.java @@ -36,6 +36,8 @@ /** * Identifies a cluster state update request with acknowledgement support + * + * @opensearch.internal */ public interface AckedRequest { diff --git a/server/src/main/java/org/opensearch/cluster/ack/ClusterStateUpdateRequest.java b/server/src/main/java/org/opensearch/cluster/ack/ClusterStateUpdateRequest.java index 0931086ab3ff0..dd5769d7c7f89 100644 --- a/server/src/main/java/org/opensearch/cluster/ack/ClusterStateUpdateRequest.java +++ b/server/src/main/java/org/opensearch/cluster/ack/ClusterStateUpdateRequest.java @@ -37,6 +37,8 @@ /** * Base class to be used when needing to update the cluster state * Contains the basic fields that are always needed + * + * @opensearch.internal */ public abstract class ClusterStateUpdateRequest> implements AckedRequest { diff --git a/server/src/main/java/org/opensearch/cluster/ack/ClusterStateUpdateResponse.java b/server/src/main/java/org/opensearch/cluster/ack/ClusterStateUpdateResponse.java index 3a79e15380165..db26496c6f263 100644 --- a/server/src/main/java/org/opensearch/cluster/ack/ClusterStateUpdateResponse.java +++ b/server/src/main/java/org/opensearch/cluster/ack/ClusterStateUpdateResponse.java @@ -34,6 +34,8 @@ /** * Base response returned after a cluster state update + * + * @opensearch.internal */ public class ClusterStateUpdateResponse { diff --git a/server/src/main/java/org/opensearch/cluster/ack/CreateIndexClusterStateUpdateResponse.java b/server/src/main/java/org/opensearch/cluster/ack/CreateIndexClusterStateUpdateResponse.java index 9c9beb1cd986e..52b04b9961ff8 100644 --- a/server/src/main/java/org/opensearch/cluster/ack/CreateIndexClusterStateUpdateResponse.java +++ b/server/src/main/java/org/opensearch/cluster/ack/CreateIndexClusterStateUpdateResponse.java @@ -34,6 +34,8 @@ /** * A cluster state update response with specific fields for index creation. + * + * @opensearch.internal */ public class CreateIndexClusterStateUpdateResponse extends ClusterStateUpdateResponse { diff --git a/server/src/main/java/org/opensearch/cluster/ack/IndicesClusterStateUpdateRequest.java b/server/src/main/java/org/opensearch/cluster/ack/IndicesClusterStateUpdateRequest.java index 7410378760a3a..c235b132d8f71 100644 --- a/server/src/main/java/org/opensearch/cluster/ack/IndicesClusterStateUpdateRequest.java +++ b/server/src/main/java/org/opensearch/cluster/ack/IndicesClusterStateUpdateRequest.java @@ -35,6 +35,8 @@ /** * Base cluster state update request that allows to execute update against multiple indices + * + * @opensearch.internal */ public abstract class IndicesClusterStateUpdateRequest> extends ClusterStateUpdateRequest { diff --git a/server/src/main/java/org/opensearch/cluster/ack/OpenIndexClusterStateUpdateResponse.java b/server/src/main/java/org/opensearch/cluster/ack/OpenIndexClusterStateUpdateResponse.java index 70915ea162a8a..faf9e3e9bebbc 100644 --- a/server/src/main/java/org/opensearch/cluster/ack/OpenIndexClusterStateUpdateResponse.java +++ b/server/src/main/java/org/opensearch/cluster/ack/OpenIndexClusterStateUpdateResponse.java @@ -33,6 +33,8 @@ /** * A cluster state update response with specific fields for index opening. + * + * @opensearch.internal */ public class OpenIndexClusterStateUpdateResponse extends ClusterStateUpdateResponse { diff --git a/server/src/main/java/org/opensearch/cluster/action/index/MappingUpdatedAction.java b/server/src/main/java/org/opensearch/cluster/action/index/MappingUpdatedAction.java index cf1f2d3141ccd..eddf873d56ac7 100644 --- a/server/src/main/java/org/opensearch/cluster/action/index/MappingUpdatedAction.java +++ b/server/src/main/java/org/opensearch/cluster/action/index/MappingUpdatedAction.java @@ -58,6 +58,8 @@ /** * Called by shards in the cluster when their mapping was dynamically updated and it needs to be updated * in the cluster state meta data (and broadcast to all members). + * + * @opensearch.internal */ public class MappingUpdatedAction { diff --git a/server/src/main/java/org/opensearch/cluster/action/index/NodeMappingRefreshAction.java b/server/src/main/java/org/opensearch/cluster/action/index/NodeMappingRefreshAction.java index b40665a1bcf1b..9cce2ff042dcd 100644 --- a/server/src/main/java/org/opensearch/cluster/action/index/NodeMappingRefreshAction.java +++ b/server/src/main/java/org/opensearch/cluster/action/index/NodeMappingRefreshAction.java @@ -53,6 +53,11 @@ import java.io.IOException; +/** + * Transport action for refreshing the Node Mapping + * + * @opensearch.internal + */ public class NodeMappingRefreshAction { private static final Logger logger = LogManager.getLogger(NodeMappingRefreshAction.class); diff --git a/server/src/main/java/org/opensearch/cluster/action/shard/ShardStateAction.java b/server/src/main/java/org/opensearch/cluster/action/shard/ShardStateAction.java index fd6a5367146a4..47ad61913a947 100644 --- a/server/src/main/java/org/opensearch/cluster/action/shard/ShardStateAction.java +++ b/server/src/main/java/org/opensearch/cluster/action/shard/ShardStateAction.java @@ -87,6 +87,11 @@ import java.util.function.Predicate; import java.util.function.Supplier; +/** + * Transport action for retrieving the shard state + * + * @opensearch.internal + */ public class ShardStateAction { private static final Logger logger = LogManager.getLogger(ShardStateAction.class); diff --git a/server/src/main/java/org/opensearch/cluster/block/ClusterBlock.java b/server/src/main/java/org/opensearch/cluster/block/ClusterBlock.java index 9da2bdeaabd8e..1314596f925d6 100644 --- a/server/src/main/java/org/opensearch/cluster/block/ClusterBlock.java +++ b/server/src/main/java/org/opensearch/cluster/block/ClusterBlock.java @@ -45,6 +45,11 @@ import java.util.Locale; import java.util.Objects; +/** + * Blocks the cluster for concurrency + * + * @opensearch.internal + */ public class ClusterBlock implements Writeable, ToXContentFragment { private final int id; diff --git a/server/src/main/java/org/opensearch/cluster/block/ClusterBlockException.java b/server/src/main/java/org/opensearch/cluster/block/ClusterBlockException.java index 8a6401b985b90..c507b76168e82 100644 --- a/server/src/main/java/org/opensearch/cluster/block/ClusterBlockException.java +++ b/server/src/main/java/org/opensearch/cluster/block/ClusterBlockException.java @@ -46,6 +46,11 @@ import static java.util.Collections.unmodifiableSet; +/** + * Internal exception on obtaining a cluster block + * + * @opensearch.internal + */ public class ClusterBlockException extends OpenSearchException { private final Set blocks; diff --git a/server/src/main/java/org/opensearch/cluster/block/ClusterBlockLevel.java b/server/src/main/java/org/opensearch/cluster/block/ClusterBlockLevel.java index fa8f7f19b752a..06181f809be22 100644 --- a/server/src/main/java/org/opensearch/cluster/block/ClusterBlockLevel.java +++ b/server/src/main/java/org/opensearch/cluster/block/ClusterBlockLevel.java @@ -34,6 +34,11 @@ import java.util.EnumSet; +/** + * What level to block the cluster + * + * @opensearch.internal + */ public enum ClusterBlockLevel { READ, WRITE, diff --git a/server/src/main/java/org/opensearch/cluster/block/ClusterBlocks.java b/server/src/main/java/org/opensearch/cluster/block/ClusterBlocks.java index a9bde418e962c..b889688bdd390 100644 --- a/server/src/main/java/org/opensearch/cluster/block/ClusterBlocks.java +++ b/server/src/main/java/org/opensearch/cluster/block/ClusterBlocks.java @@ -59,6 +59,8 @@ /** * Represents current cluster level blocks to block dirty operations done against the cluster. + * + * @opensearch.internal */ public class ClusterBlocks extends AbstractDiffable { public static final ClusterBlocks EMPTY_CLUSTER_BLOCK = new ClusterBlocks(emptySet(), ImmutableOpenMap.of()); diff --git a/server/src/main/java/org/opensearch/cluster/coordination/ApplyCommitRequest.java b/server/src/main/java/org/opensearch/cluster/coordination/ApplyCommitRequest.java index 2ace3e86b31de..3536a11f9e2e0 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/ApplyCommitRequest.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/ApplyCommitRequest.java @@ -41,6 +41,8 @@ * A cluster-manager node sends this request to its peers to inform them that it could commit the * cluster state with the given term and version. Peers that have accepted the given cluster * state will then consider it as committed and proceed to apply the state locally. + * + * @opensearch.internal */ public class ApplyCommitRequest extends TermVersionRequest { diff --git a/server/src/main/java/org/opensearch/cluster/coordination/ClusterBootstrapService.java b/server/src/main/java/org/opensearch/cluster/coordination/ClusterBootstrapService.java index 979b36110b6a3..cdf673c00fe56 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/ClusterBootstrapService.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/ClusterBootstrapService.java @@ -69,6 +69,11 @@ import static org.opensearch.discovery.SettingsBasedSeedHostsProvider.DISCOVERY_SEED_HOSTS_SETTING; import static org.opensearch.discovery.SettingsBasedSeedHostsProvider.LEGACY_DISCOVERY_ZEN_PING_UNICAST_HOSTS_SETTING; +/** + * Service for bootstrapping the OpenSearch cluster + * + * @opensearch.internal + */ public class ClusterBootstrapService { public static final Setting> INITIAL_MASTER_NODES_SETTING = Setting.listSetting( diff --git a/server/src/main/java/org/opensearch/cluster/coordination/ClusterFormationFailureHelper.java b/server/src/main/java/org/opensearch/cluster/coordination/ClusterFormationFailureHelper.java index 80fc90f126860..4e627127a89a1 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/ClusterFormationFailureHelper.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/ClusterFormationFailureHelper.java @@ -59,6 +59,11 @@ import static org.opensearch.cluster.coordination.ClusterBootstrapService.INITIAL_CLUSTER_MANAGER_NODES_SETTING; import static org.opensearch.monitor.StatusInfo.Status.UNHEALTHY; +/** + * Helper for cluster failure events + * + * @opensearch.internal + */ public class ClusterFormationFailureHelper { private static final Logger logger = LogManager.getLogger(ClusterFormationFailureHelper.class); diff --git a/server/src/main/java/org/opensearch/cluster/coordination/ClusterStatePublisher.java b/server/src/main/java/org/opensearch/cluster/coordination/ClusterStatePublisher.java index ef35c6f8b3249..6e932afb34ab1 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/ClusterStatePublisher.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/ClusterStatePublisher.java @@ -37,6 +37,11 @@ import org.opensearch.common.Nullable; import org.opensearch.common.unit.TimeValue; +/** + * Publishes the cluster state + * + * @opensearch.internal + */ public interface ClusterStatePublisher { /** * Publish all the changes to the cluster from the cluster-manager (can be called just by the cluster-manager). The publish diff --git a/server/src/main/java/org/opensearch/cluster/coordination/CoordinationMetadata.java b/server/src/main/java/org/opensearch/cluster/coordination/CoordinationMetadata.java index 6efd5475ccb97..b0ee9b214d78b 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/CoordinationMetadata.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/CoordinationMetadata.java @@ -52,6 +52,11 @@ import java.util.Set; import java.util.stream.Collectors; +/** + * Metadata for cluster coordination + * + * @opensearch.internal + */ public class CoordinationMetadata implements Writeable, ToXContentFragment { public static final CoordinationMetadata EMPTY_METADATA = builder().build(); diff --git a/server/src/main/java/org/opensearch/cluster/coordination/CoordinationState.java b/server/src/main/java/org/opensearch/cluster/coordination/CoordinationState.java index 9713c841caaf7..eff55e6d88193 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/CoordinationState.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/CoordinationState.java @@ -53,6 +53,8 @@ /** * The core class of the cluster state coordination algorithm, directly implementing the * formal model + * + * @opensearch.internal */ public class CoordinationState { diff --git a/server/src/main/java/org/opensearch/cluster/coordination/CoordinationStateRejectedException.java b/server/src/main/java/org/opensearch/cluster/coordination/CoordinationStateRejectedException.java index 078424a079f02..ece8f3e6d7345 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/CoordinationStateRejectedException.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/CoordinationStateRejectedException.java @@ -43,6 +43,8 @@ * Occurrences of this exception don't always signal failures, but can often be just caused by the * asynchronous, distributed nature of the system. They will, for example, naturally happen during * leader election, if multiple nodes are trying to become leader at the same time. + * + * @opensearch.internal */ public class CoordinationStateRejectedException extends OpenSearchException { public CoordinationStateRejectedException(String msg, Object... args) { diff --git a/server/src/main/java/org/opensearch/cluster/coordination/Coordinator.java b/server/src/main/java/org/opensearch/cluster/coordination/Coordinator.java index ef578300cdbe2..52052b3c1adde 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/Coordinator.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/Coordinator.java @@ -110,6 +110,11 @@ import static org.opensearch.gateway.GatewayService.STATE_NOT_RECOVERED_BLOCK; import static org.opensearch.monitor.StatusInfo.Status.UNHEALTHY; +/** + * The main lifecycle resource coordinator + * + * @opensearch.internal + */ public class Coordinator extends AbstractLifecycleComponent implements Discovery { public static final long ZEN1_BWC_TERM = 0; diff --git a/server/src/main/java/org/opensearch/cluster/coordination/DetachClusterCommand.java b/server/src/main/java/org/opensearch/cluster/coordination/DetachClusterCommand.java index afc8a68a74e9c..d17ef31f1b818 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/DetachClusterCommand.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/DetachClusterCommand.java @@ -41,6 +41,11 @@ import java.io.IOException; import java.nio.file.Path; +/** + * Command to detach a node from the cluster + * + * @opensearch.internal + */ public class DetachClusterCommand extends OpenSearchNodeCommand { static final String NODE_DETACHED_MSG = "Node was successfully detached from the cluster"; diff --git a/server/src/main/java/org/opensearch/cluster/coordination/ElectionSchedulerFactory.java b/server/src/main/java/org/opensearch/cluster/coordination/ElectionSchedulerFactory.java index f0ec9681d76cc..dfaed3a598acc 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/ElectionSchedulerFactory.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/ElectionSchedulerFactory.java @@ -56,6 +56,8 @@ * randomly at reasonably high frequency and backing off (linearly) until one of them succeeds. We also place an upper bound on the backoff * so that if elections are failing due to a network partition that lasts for a long time then when the partition heals there is an election * attempt reasonably quickly. + * + * @opensearch.internal */ public class ElectionSchedulerFactory { diff --git a/server/src/main/java/org/opensearch/cluster/coordination/ElectionStrategy.java b/server/src/main/java/org/opensearch/cluster/coordination/ElectionStrategy.java index f3f7fd0c1b072..c6ea4649faaf0 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/ElectionStrategy.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/ElectionStrategy.java @@ -38,6 +38,8 @@ /** * Allows plugging in a custom election strategy, restricting the notion of an election quorum. * Custom additional quorum restrictions can be defined by implementing the {@link #satisfiesAdditionalQuorumConstraints} method. + * + * @opensearch.internal */ public abstract class ElectionStrategy { diff --git a/server/src/main/java/org/opensearch/cluster/coordination/FailedToCommitClusterStateException.java b/server/src/main/java/org/opensearch/cluster/coordination/FailedToCommitClusterStateException.java index 59cd94aecdd57..db431a1a018c8 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/FailedToCommitClusterStateException.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/FailedToCommitClusterStateException.java @@ -38,6 +38,8 @@ /** * Thrown when failing to publish a cluster state. See {@link ClusterStatePublisher} for more details. + * + * @opensearch.internal */ public class FailedToCommitClusterStateException extends OpenSearchException { diff --git a/server/src/main/java/org/opensearch/cluster/coordination/FollowersChecker.java b/server/src/main/java/org/opensearch/cluster/coordination/FollowersChecker.java index c5fcee712b683..24eac6ac06a8c 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/FollowersChecker.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/FollowersChecker.java @@ -76,6 +76,8 @@ * follower has failed the leader will remove it from the cluster. We are fairly lenient, possibly allowing multiple checks to fail before * considering a follower to be faulty, to allow for a brief network partition or a long GC cycle to occur without triggering the removal of * a node and the consequent shard reallocation. + * + * @opensearch.internal */ public class FollowersChecker { diff --git a/server/src/main/java/org/opensearch/cluster/coordination/InMemoryPersistedState.java b/server/src/main/java/org/opensearch/cluster/coordination/InMemoryPersistedState.java index d9c10f7fe0af9..67ef82ee7b2e9 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/InMemoryPersistedState.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/InMemoryPersistedState.java @@ -33,6 +33,11 @@ import org.opensearch.cluster.ClusterState; +/** + * Persist state in memory + * + * @opensearch.internal + */ public class InMemoryPersistedState implements CoordinationState.PersistedState { private long currentTerm; diff --git a/server/src/main/java/org/opensearch/cluster/coordination/Join.java b/server/src/main/java/org/opensearch/cluster/coordination/Join.java index 50225c70620c5..d039ccc8a1127 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/Join.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/Join.java @@ -46,6 +46,8 @@ * information about the current state of the node that provided the vote, so that * the receiver of the vote can determine if it has a more up-to-date state than the * source node. + * + * @opensearch.internal */ public class Join implements Writeable { private final DiscoveryNode sourceNode; diff --git a/server/src/main/java/org/opensearch/cluster/coordination/JoinHelper.java b/server/src/main/java/org/opensearch/cluster/coordination/JoinHelper.java index 693a997d318cd..54894c4e28196 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/JoinHelper.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/JoinHelper.java @@ -84,6 +84,11 @@ import static org.opensearch.monitor.StatusInfo.Status.UNHEALTHY; +/** + * Helper utility class for joining the cluster + * + * @opensearch.internal + */ public class JoinHelper { private static final Logger logger = LogManager.getLogger(JoinHelper.class); diff --git a/server/src/main/java/org/opensearch/cluster/coordination/JoinRequest.java b/server/src/main/java/org/opensearch/cluster/coordination/JoinRequest.java index 84adf834d85e8..d5a5228f485f3 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/JoinRequest.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/JoinRequest.java @@ -41,6 +41,11 @@ import java.util.Objects; import java.util.Optional; +/** + * Request for a node to join the cluster + * + * @opensearch.internal + */ public class JoinRequest extends TransportRequest { /** diff --git a/server/src/main/java/org/opensearch/cluster/coordination/JoinTaskExecutor.java b/server/src/main/java/org/opensearch/cluster/coordination/JoinTaskExecutor.java index f0edeeb9319c5..aaaa73e891073 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/JoinTaskExecutor.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/JoinTaskExecutor.java @@ -62,6 +62,11 @@ import static org.opensearch.gateway.GatewayService.STATE_NOT_RECOVERED_BLOCK; +/** + * Main executor for Nodes joining the OpenSearch cluster + * + * @opensearch.internal + */ public class JoinTaskExecutor implements ClusterStateTaskExecutor { private final AllocationService allocationService; diff --git a/server/src/main/java/org/opensearch/cluster/coordination/LagDetector.java b/server/src/main/java/org/opensearch/cluster/coordination/LagDetector.java index 70a1c4f3ec220..3aef8d11bcca5 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/LagDetector.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/LagDetector.java @@ -56,6 +56,8 @@ * A publication can succeed and complete before all nodes have applied the published state and acknowledged it; however we need every node * eventually either to apply the published state (or a later state) or be removed from the cluster. This component achieves this by * removing any lagging nodes from the cluster after a timeout. + * + * @opensearch.internal */ public class LagDetector { diff --git a/server/src/main/java/org/opensearch/cluster/coordination/LeaderChecker.java b/server/src/main/java/org/opensearch/cluster/coordination/LeaderChecker.java index fcf54aff7f478..7cb306bfd89f6 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/LeaderChecker.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/LeaderChecker.java @@ -75,6 +75,8 @@ * fairly lenient, possibly allowing multiple checks to fail before considering the leader to be faulty, to allow for the leader to * temporarily stand down on occasion, e.g. if it needs to move to a higher term. On deciding that the leader has failed a follower will * become a candidate and attempt to become a leader itself. + * + * @opensearch.internal */ public class LeaderChecker { diff --git a/server/src/main/java/org/opensearch/cluster/coordination/NoMasterBlockService.java b/server/src/main/java/org/opensearch/cluster/coordination/NoMasterBlockService.java index f020ae4081f06..533a2337bd76e 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/NoMasterBlockService.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/NoMasterBlockService.java @@ -41,6 +41,11 @@ import java.util.EnumSet; +/** + * Service to block the master node + * + * @opensearch.internal + */ public class NoMasterBlockService { public static final int NO_MASTER_BLOCK_ID = 2; public static final ClusterBlock NO_MASTER_BLOCK_WRITES = new ClusterBlock( diff --git a/server/src/main/java/org/opensearch/cluster/coordination/NodeHealthCheckFailureException.java b/server/src/main/java/org/opensearch/cluster/coordination/NodeHealthCheckFailureException.java index 273a220d1eadb..d0919aa9e8686 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/NodeHealthCheckFailureException.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/NodeHealthCheckFailureException.java @@ -40,6 +40,8 @@ /** * This exception is thrown if the File system is reported unhealthy by @{@link org.opensearch.monitor.fs.FsHealthService} * and this nodes needs to be removed from the cluster + * + * @opensearch.internal */ public class NodeHealthCheckFailureException extends OpenSearchException { diff --git a/server/src/main/java/org/opensearch/cluster/coordination/NodeRemovalClusterStateTaskExecutor.java b/server/src/main/java/org/opensearch/cluster/coordination/NodeRemovalClusterStateTaskExecutor.java index e8ab2f8d53d3f..3625366fa4de1 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/NodeRemovalClusterStateTaskExecutor.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/NodeRemovalClusterStateTaskExecutor.java @@ -43,6 +43,11 @@ import java.util.List; +/** + * Update cluster state when node is removed from the cluster + * + * @opensearch.internal + */ public class NodeRemovalClusterStateTaskExecutor implements ClusterStateTaskExecutor, diff --git a/server/src/main/java/org/opensearch/cluster/coordination/NodeToolCli.java b/server/src/main/java/org/opensearch/cluster/coordination/NodeToolCli.java index 72a3b3969e2e2..3db2171b4cca0 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/NodeToolCli.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/NodeToolCli.java @@ -44,6 +44,12 @@ // Even if we avoid making a static reference to Logger class, there is no nice way to avoid declaring // UNSAFE_BOOTSTRAP, which depends on ClusterService, which in turn has static Logger. // TODO execute CommandLoggingConfigurator.configureLoggingWithoutConfig() in the constructor of commands, not in beforeMain + +/** + * Command Line Interface tool for Nodes + * + * @opensearch.internal + */ public class NodeToolCli extends MultiCommand { public NodeToolCli() { diff --git a/server/src/main/java/org/opensearch/cluster/coordination/OpenSearchNodeCommand.java b/server/src/main/java/org/opensearch/cluster/coordination/OpenSearchNodeCommand.java index bc7bd3abbca86..9110f1789521e 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/OpenSearchNodeCommand.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/OpenSearchNodeCommand.java @@ -70,6 +70,11 @@ import java.util.Map; import java.util.Objects; +/** + * Main set of node commands + * + * @opensearch.internal + */ public abstract class OpenSearchNodeCommand extends EnvironmentAwareCommand { private static final Logger logger = LogManager.getLogger(OpenSearchNodeCommand.class); protected static final String DELIMITER = "------------------------------------------------------------------------\n"; diff --git a/server/src/main/java/org/opensearch/cluster/coordination/PeersResponse.java b/server/src/main/java/org/opensearch/cluster/coordination/PeersResponse.java index e667052ca5fdd..8e2e6fde3a485 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/PeersResponse.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/PeersResponse.java @@ -42,6 +42,11 @@ import java.util.Objects; import java.util.Optional; +/** + * Response from peer nodes + * + * @opensearch.internal + */ public class PeersResponse extends TransportResponse { private final Optional clusterManagerNode; private final List knownPeers; diff --git a/server/src/main/java/org/opensearch/cluster/coordination/PendingClusterStateStats.java b/server/src/main/java/org/opensearch/cluster/coordination/PendingClusterStateStats.java index 92dd926b2fa0a..d6f767d3e6235 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/PendingClusterStateStats.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/PendingClusterStateStats.java @@ -42,6 +42,8 @@ /** * Class encapsulating stats about the PendingClusterStatsQueue + * + * @opensearch.internal */ public class PendingClusterStateStats implements Writeable, ToXContentFragment { diff --git a/server/src/main/java/org/opensearch/cluster/coordination/PreVoteCollector.java b/server/src/main/java/org/opensearch/cluster/coordination/PreVoteCollector.java index 1b934b5f000cd..c635dee173792 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/PreVoteCollector.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/PreVoteCollector.java @@ -58,6 +58,11 @@ import static org.opensearch.common.util.concurrent.ConcurrentCollections.newConcurrentMap; import static org.opensearch.monitor.StatusInfo.Status.UNHEALTHY; +/** + * Collects information prior to a promotion vote + * + * @opensearch.internal + */ public class PreVoteCollector { private static final Logger logger = LogManager.getLogger(PreVoteCollector.class); diff --git a/server/src/main/java/org/opensearch/cluster/coordination/PreVoteRequest.java b/server/src/main/java/org/opensearch/cluster/coordination/PreVoteRequest.java index e99b2716a263f..c133a51239335 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/PreVoteRequest.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/PreVoteRequest.java @@ -40,6 +40,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Requests pre vote information collection + * + * @opensearch.internal + */ public class PreVoteRequest extends TransportRequest { private final DiscoveryNode sourceNode; diff --git a/server/src/main/java/org/opensearch/cluster/coordination/PreVoteResponse.java b/server/src/main/java/org/opensearch/cluster/coordination/PreVoteResponse.java index 09259867ebf53..f18726c8af229 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/PreVoteResponse.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/PreVoteResponse.java @@ -39,6 +39,11 @@ import java.io.IOException; import java.util.Objects; +/** + * Response for a PreVoteRequest + * + * @opensearch.internal + */ public class PreVoteResponse extends TransportResponse { private final long currentTerm; private final long lastAcceptedTerm; diff --git a/server/src/main/java/org/opensearch/cluster/coordination/Publication.java b/server/src/main/java/org/opensearch/cluster/coordination/Publication.java index 5529c3248345c..3580de423ac95 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/Publication.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/Publication.java @@ -52,6 +52,11 @@ import java.util.function.LongSupplier; import java.util.stream.Collectors; +/** + * Publication task + * + * @opensearch.internal + */ public abstract class Publication { protected final Logger logger = LogManager.getLogger(getClass()); diff --git a/server/src/main/java/org/opensearch/cluster/coordination/PublicationTransportHandler.java b/server/src/main/java/org/opensearch/cluster/coordination/PublicationTransportHandler.java index 9a1a392348660..7591a09b07740 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/PublicationTransportHandler.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/PublicationTransportHandler.java @@ -72,6 +72,11 @@ import java.util.function.Consumer; import java.util.function.Function; +/** + * Transport handler for publication + * + * @opensearch.internal + */ public class PublicationTransportHandler { private static final Logger logger = LogManager.getLogger(PublicationTransportHandler.class); diff --git a/server/src/main/java/org/opensearch/cluster/coordination/PublishClusterStateStats.java b/server/src/main/java/org/opensearch/cluster/coordination/PublishClusterStateStats.java index b4adad898271e..1adb43ca68ce4 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/PublishClusterStateStats.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/PublishClusterStateStats.java @@ -42,6 +42,8 @@ /** * Class encapsulating stats about the PublishClusterStateAction + * + * @opensearch.internal */ public class PublishClusterStateStats implements Writeable, ToXContentObject { diff --git a/server/src/main/java/org/opensearch/cluster/coordination/PublishRequest.java b/server/src/main/java/org/opensearch/cluster/coordination/PublishRequest.java index 86ae9ce8bc081..e7c3e2d2c965b 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/PublishRequest.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/PublishRequest.java @@ -38,6 +38,8 @@ /** * Request which is used by the cluster-manager node to publish cluster state changes. * Actual serialization of this request is done by {@link PublicationTransportHandler} + * + * @opensearch.internal */ public class PublishRequest { diff --git a/server/src/main/java/org/opensearch/cluster/coordination/PublishResponse.java b/server/src/main/java/org/opensearch/cluster/coordination/PublishResponse.java index 9d219331c0d0e..5d809617019ac 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/PublishResponse.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/PublishResponse.java @@ -40,6 +40,8 @@ /** * Response to a {@link PublishRequest}, carrying the term and version of the request. * Typically wrapped in a {@link PublishWithJoinResponse}. + * + * @opensearch.internal */ public class PublishResponse implements Writeable { diff --git a/server/src/main/java/org/opensearch/cluster/coordination/PublishWithJoinResponse.java b/server/src/main/java/org/opensearch/cluster/coordination/PublishWithJoinResponse.java index 430e539fd3255..f02f917e67800 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/PublishWithJoinResponse.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/PublishWithJoinResponse.java @@ -41,6 +41,8 @@ /** * Response to a {@link PublishRequest}. Encapsulates both a {@link PublishResponse} * and an optional {@link Join}. + * + * @opensearch.internal */ public class PublishWithJoinResponse extends TransportResponse { private final PublishResponse publishResponse; diff --git a/server/src/main/java/org/opensearch/cluster/coordination/Reconfigurator.java b/server/src/main/java/org/opensearch/cluster/coordination/Reconfigurator.java index 1c26dff45775f..931f8ff228d9c 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/Reconfigurator.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/Reconfigurator.java @@ -47,6 +47,8 @@ /** * Computes the optimal configuration of voting nodes in the cluster. + * + * @opensearch.internal */ public class Reconfigurator { diff --git a/server/src/main/java/org/opensearch/cluster/coordination/RemoveCustomsCommand.java b/server/src/main/java/org/opensearch/cluster/coordination/RemoveCustomsCommand.java index 83f3298862776..5e7614d86cecd 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/RemoveCustomsCommand.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/RemoveCustomsCommand.java @@ -48,6 +48,11 @@ import java.nio.file.Path; import java.util.List; +/** + * Removes custom metadata + * + * @opensearch.internal + */ public class RemoveCustomsCommand extends OpenSearchNodeCommand { static final String CUSTOMS_REMOVED_MSG = "Customs were successfully removed from the cluster state"; diff --git a/server/src/main/java/org/opensearch/cluster/coordination/RemoveSettingsCommand.java b/server/src/main/java/org/opensearch/cluster/coordination/RemoveSettingsCommand.java index 298dfde7858cd..da7adec6c4f11 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/RemoveSettingsCommand.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/RemoveSettingsCommand.java @@ -48,6 +48,11 @@ import java.nio.file.Path; import java.util.List; +/** + * Removes custom settings + * + * @opensearch.internal + */ public class RemoveSettingsCommand extends OpenSearchNodeCommand { static final String SETTINGS_REMOVED_MSG = "Settings were successfully removed from the cluster state"; diff --git a/server/src/main/java/org/opensearch/cluster/coordination/StartJoinRequest.java b/server/src/main/java/org/opensearch/cluster/coordination/StartJoinRequest.java index efdbd37a9c0b6..09ebcd7fd074e 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/StartJoinRequest.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/StartJoinRequest.java @@ -41,6 +41,8 @@ /** * Represents the action of requesting a join vote (see {@link Join}) from a node. * The source node represents the node that is asking for join votes. + * + * @opensearch.internal */ public class StartJoinRequest extends TransportRequest { diff --git a/server/src/main/java/org/opensearch/cluster/coordination/TermVersionRequest.java b/server/src/main/java/org/opensearch/cluster/coordination/TermVersionRequest.java index cea8c43302a23..0b210ef21f45b 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/TermVersionRequest.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/TermVersionRequest.java @@ -39,6 +39,11 @@ import java.io.IOException; +/** + * Get's the version of a term + * + * @opensearch.internal + */ abstract class TermVersionRequest extends TransportRequest implements Writeable { protected final DiscoveryNode sourceNode; protected final long term; diff --git a/server/src/main/java/org/opensearch/cluster/coordination/UnsafeBootstrapMasterCommand.java b/server/src/main/java/org/opensearch/cluster/coordination/UnsafeBootstrapMasterCommand.java index 6b31c39d71eb3..1f17844adf4fe 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/UnsafeBootstrapMasterCommand.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/UnsafeBootstrapMasterCommand.java @@ -54,6 +54,11 @@ import java.util.Locale; import java.util.Objects; +/** + * Tool to run an unsafe bootstrap + * + * @opensearch.internal + */ public class UnsafeBootstrapMasterCommand extends OpenSearchNodeCommand { static final String CLUSTER_STATE_TERM_VERSION_MSG_FORMAT = "Current node cluster state (term, version) pair is (%s, %s)"; diff --git a/server/src/main/java/org/opensearch/cluster/coordination/ValidateJoinRequest.java b/server/src/main/java/org/opensearch/cluster/coordination/ValidateJoinRequest.java index afdd124bddef2..3f8c00da9a76c 100644 --- a/server/src/main/java/org/opensearch/cluster/coordination/ValidateJoinRequest.java +++ b/server/src/main/java/org/opensearch/cluster/coordination/ValidateJoinRequest.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Transport request to validate node join + * + * @opensearch.internal + */ public class ValidateJoinRequest extends TransportRequest { private ClusterState state; diff --git a/server/src/main/java/org/opensearch/cluster/health/ClusterHealthStatus.java b/server/src/main/java/org/opensearch/cluster/health/ClusterHealthStatus.java index 07a66a3731ff6..4daf0cb6adbb2 100644 --- a/server/src/main/java/org/opensearch/cluster/health/ClusterHealthStatus.java +++ b/server/src/main/java/org/opensearch/cluster/health/ClusterHealthStatus.java @@ -38,6 +38,11 @@ import java.io.IOException; +/** + * Cluster health status + * + * @opensearch.internal + */ public enum ClusterHealthStatus implements Writeable { GREEN((byte) 0), YELLOW((byte) 1), diff --git a/server/src/main/java/org/opensearch/cluster/health/ClusterIndexHealth.java b/server/src/main/java/org/opensearch/cluster/health/ClusterIndexHealth.java index ffe54e42355f8..b2234d23be91c 100644 --- a/server/src/main/java/org/opensearch/cluster/health/ClusterIndexHealth.java +++ b/server/src/main/java/org/opensearch/cluster/health/ClusterIndexHealth.java @@ -58,6 +58,11 @@ import static org.opensearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +/** + * Cluster Index Health Information + * + * @opensearch.internal + */ public final class ClusterIndexHealth implements Iterable, Writeable, ToXContentFragment { private static final String STATUS = "status"; private static final String NUMBER_OF_SHARDS = "number_of_shards"; diff --git a/server/src/main/java/org/opensearch/cluster/health/ClusterShardHealth.java b/server/src/main/java/org/opensearch/cluster/health/ClusterShardHealth.java index fc6c6eb4f9bdc..ba6035abbb42f 100644 --- a/server/src/main/java/org/opensearch/cluster/health/ClusterShardHealth.java +++ b/server/src/main/java/org/opensearch/cluster/health/ClusterShardHealth.java @@ -54,6 +54,11 @@ import static org.opensearch.common.xcontent.ConstructingObjectParser.constructorArg; import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +/** + * Cluster shard health information + * + * @opensearch.internal + */ public final class ClusterShardHealth implements Writeable, ToXContentFragment { private static final String STATUS = "status"; private static final String ACTIVE_SHARDS = "active_shards"; diff --git a/server/src/main/java/org/opensearch/cluster/health/ClusterStateHealth.java b/server/src/main/java/org/opensearch/cluster/health/ClusterStateHealth.java index c6b214d31707e..4c8be0f2d73f0 100644 --- a/server/src/main/java/org/opensearch/cluster/health/ClusterStateHealth.java +++ b/server/src/main/java/org/opensearch/cluster/health/ClusterStateHealth.java @@ -49,6 +49,11 @@ import java.util.Map; import java.util.Objects; +/** + * Cluster state health information + * + * @opensearch.internal + */ public final class ClusterStateHealth implements Iterable, Writeable { private final int numberOfNodes; diff --git a/server/src/main/java/org/opensearch/cluster/metadata/AliasAction.java b/server/src/main/java/org/opensearch/cluster/metadata/AliasAction.java index eede77917a2fd..be69090e0c33c 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/AliasAction.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/AliasAction.java @@ -38,6 +38,8 @@ /** * Individual operation to perform on the cluster state as part of an {@link IndicesAliasesRequest}. + * + * @opensearch.internal */ public abstract class AliasAction { private final String index; diff --git a/server/src/main/java/org/opensearch/cluster/metadata/AliasMetadata.java b/server/src/main/java/org/opensearch/cluster/metadata/AliasMetadata.java index e6deb22477bae..375317b32b293 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/AliasMetadata.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/AliasMetadata.java @@ -58,6 +58,11 @@ import static java.util.Collections.emptySet; +/** + * Metadata for index aliases + * + * @opensearch.internal + */ public class AliasMetadata extends AbstractDiffable implements ToXContentFragment { private final String alias; diff --git a/server/src/main/java/org/opensearch/cluster/metadata/AliasValidator.java b/server/src/main/java/org/opensearch/cluster/metadata/AliasValidator.java index c024358c5d1d3..769342dceddc5 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/AliasValidator.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/AliasValidator.java @@ -55,6 +55,8 @@ /** * Validator for an alias, to be used before adding an alias to the index metadata * and make sure the alias is valid + * + * @opensearch.internal */ public class AliasValidator { /** diff --git a/server/src/main/java/org/opensearch/cluster/metadata/AutoExpandReplicas.java b/server/src/main/java/org/opensearch/cluster/metadata/AutoExpandReplicas.java index a7538d0a5b4f8..108c05eb78b79 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/AutoExpandReplicas.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/AutoExpandReplicas.java @@ -52,6 +52,8 @@ * This class acts as a functional wrapper around the {@code index.auto_expand_replicas} setting. * This setting or rather it's value is expanded into a min and max value which requires special handling * based on the number of datanodes in the cluster. This class handles all the parsing and streamlines the access to these values. + * + * @opensearch.internal */ public final class AutoExpandReplicas { // the value we recognize in the "max" position to mean all the nodes diff --git a/server/src/main/java/org/opensearch/cluster/metadata/ClusterNameExpressionResolver.java b/server/src/main/java/org/opensearch/cluster/metadata/ClusterNameExpressionResolver.java index 72f6f142ed290..afa0ec64b72b5 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/ClusterNameExpressionResolver.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/ClusterNameExpressionResolver.java @@ -43,6 +43,8 @@ /** * Resolves cluster names from an expression. The expression must be the exact match of a cluster * name or must be a wildcard expression. + * + * @opensearch.internal */ public final class ClusterNameExpressionResolver { diff --git a/server/src/main/java/org/opensearch/cluster/metadata/ComponentTemplate.java b/server/src/main/java/org/opensearch/cluster/metadata/ComponentTemplate.java index c3ba1a2f7a45b..dccd01eb7b95f 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/ComponentTemplate.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/ComponentTemplate.java @@ -53,6 +53,8 @@ * component template is expected to be valid on its own. For example, if a component template * contains a field "foo", it's expected to contain all the necessary settings/mappings/etc for the * "foo" field. These component templates make up the individual pieces composing an index template. + * + * @opensearch.internal */ public class ComponentTemplate extends AbstractDiffable implements ToXContentObject { private static final ParseField TEMPLATE = new ParseField("template"); diff --git a/server/src/main/java/org/opensearch/cluster/metadata/ComponentTemplateMetadata.java b/server/src/main/java/org/opensearch/cluster/metadata/ComponentTemplateMetadata.java index 0d2496b5812be..4850e212b832f 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/ComponentTemplateMetadata.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/ComponentTemplateMetadata.java @@ -54,6 +54,8 @@ /** * {@link ComponentTemplateMetadata} is a custom {@link Metadata} implementation for storing a map * of component templates and their names. + * + * @opensearch.internal */ public class ComponentTemplateMetadata implements Metadata.Custom { public static final String TYPE = "component_template"; diff --git a/server/src/main/java/org/opensearch/cluster/metadata/ComposableIndexTemplate.java b/server/src/main/java/org/opensearch/cluster/metadata/ComposableIndexTemplate.java index b9d71adc89c1c..5b16733e12fbb 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/ComposableIndexTemplate.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/ComposableIndexTemplate.java @@ -64,6 +64,8 @@ * An index template is comprised of a set of index patterns, an optional template, and a list of * ids corresponding to component templates that should be composed in order when creating a new * index. + * + * @opensearch.internal */ public class ComposableIndexTemplate extends AbstractDiffable implements ToXContentObject { private static final ParseField INDEX_PATTERNS = new ParseField("index_patterns"); diff --git a/server/src/main/java/org/opensearch/cluster/metadata/ComposableIndexTemplateMetadata.java b/server/src/main/java/org/opensearch/cluster/metadata/ComposableIndexTemplateMetadata.java index 46712a3b529b2..a0e228f5d3ea5 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/ComposableIndexTemplateMetadata.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/ComposableIndexTemplateMetadata.java @@ -54,6 +54,8 @@ /** * The {@link ComposableIndexTemplateMetadata} class is a custom {@link Metadata.Custom} implementation that * stores a map of ids to {@link ComposableIndexTemplate} templates. + * + * @opensearch.internal */ public class ComposableIndexTemplateMetadata implements Metadata.Custom { public static final String TYPE = "index_template"; diff --git a/server/src/main/java/org/opensearch/cluster/metadata/DataStream.java b/server/src/main/java/org/opensearch/cluster/metadata/DataStream.java index eaf1b35ca2ce3..dffcb11619be4 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/DataStream.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/DataStream.java @@ -51,6 +51,11 @@ import java.util.Map; import java.util.Objects; +/** + * Primary DataStream class + * + * @opensearch.internal + */ public final class DataStream extends AbstractDiffable implements ToXContentObject { public static final String BACKING_INDEX_PREFIX = ".ds-"; diff --git a/server/src/main/java/org/opensearch/cluster/metadata/DataStreamMetadata.java b/server/src/main/java/org/opensearch/cluster/metadata/DataStreamMetadata.java index d94b6f0c8cffc..6045f745e1584 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/DataStreamMetadata.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/DataStreamMetadata.java @@ -53,6 +53,8 @@ /** * Custom {@link Metadata} implementation for storing a map of {@link DataStream}s and their names. + * + * @opensearch.internal */ public class DataStreamMetadata implements Metadata.Custom { diff --git a/server/src/main/java/org/opensearch/cluster/metadata/DiffableStringMap.java b/server/src/main/java/org/opensearch/cluster/metadata/DiffableStringMap.java index 2c35fbf4ae67e..542af9c54283a 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/DiffableStringMap.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/DiffableStringMap.java @@ -49,6 +49,8 @@ /** * This is a {@code Map} that implements AbstractDiffable so it * can be used for cluster state purposes + * + * @opensearch.internal */ public class DiffableStringMap extends AbstractMap implements Diffable { diff --git a/server/src/main/java/org/opensearch/cluster/metadata/IndexAbstraction.java b/server/src/main/java/org/opensearch/cluster/metadata/IndexAbstraction.java index 653755664cbc0..77c585ca875aa 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/IndexAbstraction.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/IndexAbstraction.java @@ -52,6 +52,8 @@ * An index abstraction is a reference to one or more concrete indices. * An index abstraction has a unique name and encapsulates all the {@link IndexMetadata} instances it is pointing to. * Also depending on type it may refer to a single or many concrete indices and may or may not have a write index. + * + * @opensearch.internal */ public interface IndexAbstraction { diff --git a/server/src/main/java/org/opensearch/cluster/metadata/IndexAbstractionResolver.java b/server/src/main/java/org/opensearch/cluster/metadata/IndexAbstractionResolver.java index 4045ea938e373..a83c778a4b83a 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/IndexAbstractionResolver.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/IndexAbstractionResolver.java @@ -43,6 +43,11 @@ import java.util.List; import java.util.Set; +/** + * Utility class to resolve index abstractions + * + * @opensearch.internal + */ public class IndexAbstractionResolver { private final IndexNameExpressionResolver indexNameExpressionResolver; diff --git a/server/src/main/java/org/opensearch/cluster/metadata/IndexGraveyard.java b/server/src/main/java/org/opensearch/cluster/metadata/IndexGraveyard.java index c0b207158c9bc..de9d616d79b0b 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/IndexGraveyard.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/IndexGraveyard.java @@ -67,6 +67,8 @@ * nodes and a node could be removed from the cluster for a period of time, the * tombstones remain in the cluster state for a fixed period of time, after which * they are purged. + * + * @opensearch.internal */ public final class IndexGraveyard implements Metadata.Custom { diff --git a/server/src/main/java/org/opensearch/cluster/metadata/IndexMetadata.java b/server/src/main/java/org/opensearch/cluster/metadata/IndexMetadata.java index 9139cbac2b0be..0b3b2116f6cee 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/IndexMetadata.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/IndexMetadata.java @@ -96,6 +96,11 @@ import static org.opensearch.common.settings.Settings.readSettingsFromStream; import static org.opensearch.common.settings.Settings.writeSettingsToStream; +/** + * Index metadata information + * + * @opensearch.internal + */ public class IndexMetadata implements Diffable, ToXContentFragment { public static final ClusterBlock INDEX_READ_ONLY_BLOCK = new ClusterBlock( diff --git a/server/src/main/java/org/opensearch/cluster/metadata/IndexNameExpressionResolver.java b/server/src/main/java/org/opensearch/cluster/metadata/IndexNameExpressionResolver.java index bd8535d18c9cb..4a6df1bc0a53c 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/IndexNameExpressionResolver.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/IndexNameExpressionResolver.java @@ -76,6 +76,11 @@ import java.util.stream.Stream; import java.util.stream.StreamSupport; +/** + * Resolves index name from an expression + * + * @opensearch.internal + */ public class IndexNameExpressionResolver { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(IndexNameExpressionResolver.class); diff --git a/server/src/main/java/org/opensearch/cluster/metadata/IndexTemplateMetadata.java b/server/src/main/java/org/opensearch/cluster/metadata/IndexTemplateMetadata.java index 810365589ae1f..367a15560200f 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/IndexTemplateMetadata.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/IndexTemplateMetadata.java @@ -62,6 +62,11 @@ import java.util.Objects; import java.util.Set; +/** + * Metadata for Index Templates + * + * @opensearch.internal + */ public class IndexTemplateMetadata extends AbstractDiffable { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(IndexTemplateMetadata.class); diff --git a/server/src/main/java/org/opensearch/cluster/metadata/Manifest.java b/server/src/main/java/org/opensearch/cluster/metadata/Manifest.java index 8205886cf9df6..b14e970360dce 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/Manifest.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/Manifest.java @@ -55,6 +55,8 @@ * When new version of metadata is written it's assigned some generation long value. * Global metadata generation could be obtained by calling {@link #getGlobalGeneration()}. * Index metadata generation could be obtained by calling {@link #getIndexGenerations()}. + * + * @opensearch.internal */ public class Manifest implements ToXContentFragment { // TODO revisit missing and unknown constants once Zen2 BWC is ready diff --git a/server/src/main/java/org/opensearch/cluster/metadata/MappingMetadata.java b/server/src/main/java/org/opensearch/cluster/metadata/MappingMetadata.java index 620542f8f1bde..35ee222541771 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/MappingMetadata.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/MappingMetadata.java @@ -56,6 +56,8 @@ /** * Mapping configuration for a type. + * + * @opensearch.internal */ public class MappingMetadata extends AbstractDiffable { public static final MappingMetadata EMPTY_MAPPINGS = new MappingMetadata(MapperService.SINGLE_MAPPING_NAME, Collections.emptyMap()); diff --git a/server/src/main/java/org/opensearch/cluster/metadata/Metadata.java b/server/src/main/java/org/opensearch/cluster/metadata/Metadata.java index 7cf3700402b6b..bec72b696acdd 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/Metadata.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/Metadata.java @@ -99,6 +99,11 @@ import static org.opensearch.common.settings.Settings.readSettingsFromStream; import static org.opensearch.common.settings.Settings.writeSettingsToStream; +/** + * Metadata information + * + * @opensearch.internal + */ public class Metadata implements Iterable, Diffable, ToXContentFragment { private static final Logger logger = LogManager.getLogger(Metadata.class); diff --git a/server/src/main/java/org/opensearch/cluster/metadata/MetadataCreateDataStreamService.java b/server/src/main/java/org/opensearch/cluster/metadata/MetadataCreateDataStreamService.java index 13e470eed617d..66fe3c5ce61dd 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/MetadataCreateDataStreamService.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/MetadataCreateDataStreamService.java @@ -62,6 +62,11 @@ import java.util.Map; import java.util.concurrent.atomic.AtomicReference; +/** + * Creates a data stream of metadata + * + * @opensearch.internal + */ public class MetadataCreateDataStreamService { private static final Logger logger = LogManager.getLogger(MetadataCreateDataStreamService.class); diff --git a/server/src/main/java/org/opensearch/cluster/metadata/MetadataCreateIndexService.java b/server/src/main/java/org/opensearch/cluster/metadata/MetadataCreateIndexService.java index 024024754484a..c63e0a498ef6f 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/MetadataCreateIndexService.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/MetadataCreateIndexService.java @@ -123,6 +123,8 @@ /** * Service responsible for submitting create index requests + * + * @opensearch.internal */ public class MetadataCreateIndexService { private static final Logger logger = LogManager.getLogger(MetadataCreateIndexService.class); diff --git a/server/src/main/java/org/opensearch/cluster/metadata/MetadataDeleteIndexService.java b/server/src/main/java/org/opensearch/cluster/metadata/MetadataDeleteIndexService.java index 4805cb215fc09..66f5edf3da129 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/MetadataDeleteIndexService.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/MetadataDeleteIndexService.java @@ -62,6 +62,8 @@ /** * Deletes indices. + * + * @opensearch.internal */ public class MetadataDeleteIndexService { diff --git a/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexAliasesService.java b/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexAliasesService.java index a490bae65ca00..8d6939a57240c 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexAliasesService.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexAliasesService.java @@ -64,6 +64,8 @@ /** * Service responsible for submitting add and remove aliases requests + * + * @opensearch.internal */ public class MetadataIndexAliasesService { diff --git a/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexStateService.java b/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexStateService.java index 25071a60bdfb5..d8715d07a31a3 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexStateService.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexStateService.java @@ -112,6 +112,8 @@ /** * Service responsible for submitting open/close index requests as well as for adding index blocks + * + * @opensearch.internal */ public class MetadataIndexStateService { private static final Logger logger = LogManager.getLogger(MetadataIndexStateService.class); diff --git a/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexTemplateService.java b/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexTemplateService.java index 896679206aec5..c14170e358f4c 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexTemplateService.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexTemplateService.java @@ -97,6 +97,8 @@ /** * Service responsible for submitting index templates updates + * + * @opensearch.internal */ public class MetadataIndexTemplateService { diff --git a/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexUpgradeService.java b/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexUpgradeService.java index 49743678bb168..5ecc1ceebbac5 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexUpgradeService.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/MetadataIndexUpgradeService.java @@ -65,6 +65,8 @@ * to upgrade the existing index metadata to the latest version of the cluster. It typically * occurs during cluster upgrade, when dangling indices are imported into the cluster or indices * are restored from a repository. + * + * @opensearch.internal */ public class MetadataIndexUpgradeService { diff --git a/server/src/main/java/org/opensearch/cluster/metadata/MetadataMappingService.java b/server/src/main/java/org/opensearch/cluster/metadata/MetadataMappingService.java index 3795961d39143..7f67c45fc80e5 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/MetadataMappingService.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/MetadataMappingService.java @@ -69,6 +69,8 @@ /** * Service responsible for submitting mapping changes + * + * @opensearch.internal */ public class MetadataMappingService { diff --git a/server/src/main/java/org/opensearch/cluster/metadata/MetadataUpdateSettingsService.java b/server/src/main/java/org/opensearch/cluster/metadata/MetadataUpdateSettingsService.java index 1b7aee48e3232..1390860271577 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/MetadataUpdateSettingsService.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/MetadataUpdateSettingsService.java @@ -74,6 +74,8 @@ /** * Service responsible for submitting update index settings requests + * + * @opensearch.internal */ public class MetadataUpdateSettingsService { private static final Logger logger = LogManager.getLogger(MetadataUpdateSettingsService.class); diff --git a/server/src/main/java/org/opensearch/cluster/metadata/ProcessClusterEventTimeoutException.java b/server/src/main/java/org/opensearch/cluster/metadata/ProcessClusterEventTimeoutException.java index 079c4c680e42d..cda032aa4628f 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/ProcessClusterEventTimeoutException.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/ProcessClusterEventTimeoutException.java @@ -39,6 +39,11 @@ import java.io.IOException; +/** + * Exception thrown when there is a timeout processing cluster events + * + * @opensearch.internal + */ public class ProcessClusterEventTimeoutException extends OpenSearchException { public ProcessClusterEventTimeoutException(TimeValue timeValue, String source) { diff --git a/server/src/main/java/org/opensearch/cluster/metadata/RepositoriesMetadata.java b/server/src/main/java/org/opensearch/cluster/metadata/RepositoriesMetadata.java index 3076ede7ced14..2dc3015376a72 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/RepositoriesMetadata.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/RepositoriesMetadata.java @@ -55,6 +55,8 @@ /** * Contains metadata about registered snapshot repositories + * + * @opensearch.internal */ public class RepositoriesMetadata extends AbstractNamedDiffable implements Custom { diff --git a/server/src/main/java/org/opensearch/cluster/metadata/RepositoryMetadata.java b/server/src/main/java/org/opensearch/cluster/metadata/RepositoryMetadata.java index d839e4bafade7..5cfdfe075c74f 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/RepositoryMetadata.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/RepositoryMetadata.java @@ -44,6 +44,8 @@ /** * Metadata about registered repository + * + * @opensearch.internal */ public class RepositoryMetadata implements Writeable { diff --git a/server/src/main/java/org/opensearch/cluster/metadata/SystemIndexMetadataUpgradeService.java b/server/src/main/java/org/opensearch/cluster/metadata/SystemIndexMetadataUpgradeService.java index f07b74575950c..85568d69639cb 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/SystemIndexMetadataUpgradeService.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/SystemIndexMetadataUpgradeService.java @@ -48,6 +48,8 @@ /** * A service responsible for updating the metadata used by system indices. + * + * @opensearch.internal */ public class SystemIndexMetadataUpgradeService implements ClusterStateListener { diff --git a/server/src/main/java/org/opensearch/cluster/metadata/Template.java b/server/src/main/java/org/opensearch/cluster/metadata/Template.java index 0a070ced198c6..0b134cad7b8b2 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/Template.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/Template.java @@ -58,6 +58,8 @@ * A template consists of optional settings, mappings, or alias configuration for an index, however, * it is entirely independent from an index. It's a building block forming part of a regular index * template and a {@link ComponentTemplate}. + * + * @opensearch.internal */ public class Template extends AbstractDiffable