Skip to content

Commit

Permalink
Merge branch 'createpit' of github.com:bharath-techie/OpenSearch into…
Browse files Browse the repository at this point in the history
… deletepit
  • Loading branch information
bharath-techie committed May 17, 2022
2 parents fe4e41a + 47bb3e7 commit 1dd62b4
Show file tree
Hide file tree
Showing 1,042 changed files with 7,754 additions and 1,866 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ plugins {
id 'opensearch.docker-support'
id 'opensearch.global-build-info'
id "com.diffplug.spotless" version "6.5.2" apply false
id "org.gradle.test-retry" version "1.3.2" apply false
id "org.gradle.test-retry" version "1.4.0" apply false
id "test-report-aggregation"
id 'jacoco-report-aggregation'
}
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/java/org/opensearch/gradle/Jdk.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class Jdk implements Buildable, Iterable<File> {
Arrays.asList("darwin", "freebsd", "linux", "mac", "windows")
);
private static final Pattern VERSION_PATTERN = Pattern.compile("(\\d+)(\\.\\d+\\.\\d+)?\\+(\\d+(?:\\.\\d+)?)(@([a-f0-9]{32}))?");
private static final Pattern LEGACY_VERSION_PATTERN = Pattern.compile("(\\d)(u\\d+)\\+(b\\d+?)(@([a-f0-9]{32}))?");
private static final Pattern LEGACY_VERSION_PATTERN = Pattern.compile("(\\d)(u\\d+)(?:\\+|\\-)(b\\d+?)(@([a-f0-9]{32}))?");

private final String name;
private final Configuration configuration;
Expand Down
48 changes: 32 additions & 16 deletions buildSrc/src/main/java/org/opensearch/gradle/JdkDownloadPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,22 +110,38 @@ private void setupRepository(Project project, Jdk jdk) {

if (jdk.getVendor().equals(VENDOR_ADOPTIUM)) {
repoUrl = "https://github.com/adoptium/temurin" + jdk.getMajor() + "-binaries/releases/download/";
// JDK updates are suffixed with 'U' (fe OpenJDK17U), whereas GA releases are not (fe OpenJDK17).
// To distinguish between those, the GA releases have only major version component (fe 17+32),
// the updates always have minor/patch components (fe 17.0.1+12), checking for the presence of
// version separator '.' should be enough.
artifactPattern = "jdk-"
+ jdk.getBaseVersion()
+ "+"
+ jdk.getBuild()
+ "/OpenJDK"
+ jdk.getMajor()
+ (jdk.getBaseVersion().contains(".") ? "U" : "")
+ "-jdk_[classifier]_[module]_hotspot_"
+ jdk.getBaseVersion()
+ "_"
+ jdk.getBuild()
+ ".[ext]";

if (jdk.getMajor().equals("8")) {
// JDK-8 updates are always suffixed with 'U' (fe OpenJDK8U).
artifactPattern = "jdk"
+ jdk.getBaseVersion()
+ "-"
+ jdk.getBuild()
+ "/OpenJDK"
+ jdk.getMajor()
+ "U"
+ "-jdk_[classifier]_[module]_hotspot_"
+ jdk.getBaseVersion()
+ jdk.getBuild()
+ ".[ext]";
} else {
// JDK updates are suffixed with 'U' (fe OpenJDK17U), whereas GA releases are not (fe OpenJDK17).
// To distinguish between those, the GA releases have only major version component (fe 17+32),
// the updates always have minor/patch components (fe 17.0.1+12), checking for the presence of
// version separator '.' should be enough.
artifactPattern = "jdk-"
+ jdk.getBaseVersion()
+ "+"
+ jdk.getBuild()
+ "/OpenJDK"
+ jdk.getMajor()
+ (jdk.getBaseVersion().contains(".") ? "U" : "")
+ "-jdk_[classifier]_[module]_hotspot_"
+ jdk.getBaseVersion()
+ "_"
+ jdk.getBuild()
+ ".[ext]";
}
} else if (jdk.getVendor().equals(VENDOR_ADOPTOPENJDK)) {
repoUrl = "https://api.adoptopenjdk.net/v3/binary/version/";
if (jdk.getMajor().equals("8")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
import java.util.stream.Stream;

public class DistroTestPlugin implements Plugin<Project> {
private static final String SYSTEM_JDK_VERSION = "8u242+b08";
private static final String SYSTEM_JDK_VENDOR = "adoptopenjdk";
private static final String SYSTEM_JDK_VERSION = "11.0.15+10";
private static final String SYSTEM_JDK_VENDOR = "adoptium";
private static final String GRADLE_JDK_VERSION = "17.0.3+7";
private static final String GRADLE_JDK_VENDOR = "adoptium";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,21 @@ public class PitIT extends OpenSearchRestHighLevelClientTestCase {

@Before
public void indexDocuments() throws IOException {
{
Request doc1 = new Request(HttpPut.METHOD_NAME, "/index/_doc/1");
doc1.setJsonEntity("{\"type\":\"type1\", \"id\":1, \"num\":10, \"num2\":50}");
client().performRequest(doc1);
Request doc2 = new Request(HttpPut.METHOD_NAME, "/index/_doc/2");
doc2.setJsonEntity("{\"type\":\"type1\", \"id\":2, \"num\":20, \"num2\":40}");
client().performRequest(doc2);
Request doc3 = new Request(HttpPut.METHOD_NAME, "/index/_doc/3");
doc3.setJsonEntity("{\"type\":\"type1\", \"id\":3, \"num\":50, \"num2\":35}");
client().performRequest(doc3);
Request doc4 = new Request(HttpPut.METHOD_NAME, "/index/_doc/4");
doc4.setJsonEntity("{\"type\":\"type2\", \"id\":4, \"num\":100, \"num2\":10}");
client().performRequest(doc4);
Request doc5 = new Request(HttpPut.METHOD_NAME, "/index/_doc/5");
doc5.setJsonEntity("{\"type\":\"type2\", \"id\":5, \"num\":100, \"num2\":10}");
client().performRequest(doc5);
}

Request doc1 = new Request(HttpPut.METHOD_NAME, "/index/_doc/1");
doc1.setJsonEntity("{\"type\":\"type1\", \"id\":1, \"num\":10, \"num2\":50}");
client().performRequest(doc1);
Request doc2 = new Request(HttpPut.METHOD_NAME, "/index/_doc/2");
doc2.setJsonEntity("{\"type\":\"type1\", \"id\":2, \"num\":20, \"num2\":40}");
client().performRequest(doc2);
Request doc3 = new Request(HttpPut.METHOD_NAME, "/index/_doc/3");
doc3.setJsonEntity("{\"type\":\"type1\", \"id\":3, \"num\":50, \"num2\":35}");
client().performRequest(doc3);
Request doc4 = new Request(HttpPut.METHOD_NAME, "/index/_doc/4");
doc4.setJsonEntity("{\"type\":\"type2\", \"id\":4, \"num\":100, \"num2\":10}");
client().performRequest(doc4);
Request doc5 = new Request(HttpPut.METHOD_NAME, "/index/_doc/5");
doc5.setJsonEntity("{\"type\":\"type2\", \"id\":5, \"num\":100, \"num2\":10}");
client().performRequest(doc5);
client().performRequest(new Request(HttpPost.METHOD_NAME, "/_refresh"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# when we do rebuild the files they don't jump around too much. That
# way the diffs are smaller.

set -e
set -e -o pipefail

script_path="$( cd "$(dirname "$0")" ; pwd -P )"
work=$(mktemp -d)
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/atomic_push.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -e
set -e -o pipefail

if [ "$#" -eq 0 ]; then
printf 'Usage: %s <origin> <branch> <branch> ...\n' "$(basename "$0")"
Expand Down
4 changes: 3 additions & 1 deletion dev-tools/signoff-check.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh
#!/usr/bin/env bash

set -e -o pipefail

### Script to check for signoff presents on commits

Expand Down
2 changes: 2 additions & 0 deletions distribution/docker/docker-test-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set -e -o pipefail

cd /usr/share/opensearch/bin/

/usr/local/bin/docker-entrypoint.sh | tee > /usr/share/opensearch/logs/console.log
2 changes: 1 addition & 1 deletion distribution/docker/src/docker/bin/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -e
set -e -o pipefail

# Files created by Elasticsearch should always be group writable too
umask 0002
Expand Down
2 changes: 2 additions & 0 deletions distribution/packages/src/common/scripts/preinst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
# $1=1 : indicates an new install
# $1=2 : indicates an upgrade

set -e -o pipefail

err_exit() {
echo "$@" >&2
exit 1
Expand Down
2 changes: 2 additions & 0 deletions distribution/packages/src/common/systemd/systemd-entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# This wrapper script allows SystemD to feed a file containing a passphrase into
# the main OpenSearch startup script

set -e -o pipefail

if [ -n "$OPENSEARCH_KEYSTORE_PASSPHRASE_FILE" ] ; then
exec /usr/share/opensearch/bin/opensearch "$@" < "$OPENSEARCH_KEYSTORE_PASSPHRASE_FILE"
else
Expand Down
2 changes: 2 additions & 0 deletions distribution/packages/src/deb/init.d/opensearch
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# Description: Starts opensearch using start-stop-daemon
### END INIT INFO

set -e -o pipefail

PATH=/bin:/usr/bin:/sbin:/usr/sbin
NAME=opensearch
DESC="OpenSearch Server"
Expand Down
2 changes: 2 additions & 0 deletions distribution/packages/src/rpm/init.d/opensearch
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
# Description: OpenSearch is a very scalable, schema-free and high-performance search solution supporting multi-tenancy and near realtime search.
### END INIT INFO

set -e -o pipefail

#
# init.d / servicectl compatibility (openSUSE)
#
Expand Down
2 changes: 2 additions & 0 deletions distribution/src/bin/opensearch
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#
# OPENSEARCH_JAVA_OPTS="-Xms8g -Xmx8g" ./bin/opensearch

set -e -o pipefail

source "`dirname "$0"`"/opensearch-env

CHECK_KEYSTORE=true
Expand Down
2 changes: 2 additions & 0 deletions distribution/src/bin/opensearch-keystore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

set -e -o pipefail

OPENSEARCH_MAIN_CLASS=org.opensearch.common.settings.KeyStoreCli \
OPENSEARCH_ADDITIONAL_CLASSPATH_DIRECTORIES=lib/tools/keystore-cli \
"`dirname "$0"`"/opensearch-cli \
Expand Down
1 change: 1 addition & 0 deletions distribution/src/bin/opensearch-node
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -e -o pipefail

OPENSEARCH_MAIN_CLASS=org.opensearch.cluster.coordination.NodeToolCli \
"`dirname "$0"`"/opensearch-cli \
Expand Down
2 changes: 2 additions & 0 deletions distribution/src/bin/opensearch-plugin
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

set -e -o pipefail

OPENSEARCH_MAIN_CLASS=org.opensearch.plugins.PluginCli \
OPENSEARCH_ADDITIONAL_CLASSPATH_DIRECTORIES=lib/tools/plugin-cli \
"`dirname "$0"`"/opensearch-cli \
Expand Down
2 changes: 2 additions & 0 deletions distribution/src/bin/opensearch-shard
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

set -e -o pipefail

OPENSEARCH_MAIN_CLASS=org.opensearch.index.shard.ShardToolCli \
"`dirname "$0"`"/opensearch-cli \
"$@"
1 change: 1 addition & 0 deletions distribution/src/bin/opensearch-upgrade
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -e -o pipefail

OPENSEARCH_MAIN_CLASS=org.opensearch.upgrade.UpgradeCli \
OPENSEARCH_ADDITIONAL_CLASSPATH_DIRECTORIES=lib/tools/upgrade-cli \
Expand Down
3 changes: 1 addition & 2 deletions gradle/missing-javadoc.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,7 @@ configure([

configure(project(":server")) {
project.tasks.withType(MissingJavadocTask) {
isExcluded = true
// TODO: reenable after fixing missing javadocs
// TODO: bump to variable missing level after increasing javadoc coverage
javadocMissingLevel = "class"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
- do:
cluster.state: {}

# Get master node id
- set: { master_node: master }
# Get cluster-manager node id
- set: { cluster_manager_node: cluster_manager }

- do:
nodes.info: {}

- contains: { nodes.$master.modules: { name: aggs-matrix-stats } }
- contains: { nodes.$cluster_manager.modules: { name: aggs-matrix-stats } }
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
- do:
cluster.state: {}

# Get master node id
- set: { master_node: master }
# Get cluster-manager node id
- set: { cluster_manager_node: cluster_manager }

- do:
nodes.info: {}

- contains: { nodes.$master.modules: { name: analysis-common } }
- contains: { nodes.$cluster_manager.modules: { name: analysis-common } }
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ protected Map<String, Function<Map<String, Object>, Object>> pluginScripts() {

public void testFailureInConditionalProcessor() {
internalCluster().ensureAtLeastNumDataNodes(1);
internalCluster().startMasterOnlyNode();
internalCluster().startClusterManagerOnlyNode();
final String pipelineId = "foo";
client().admin()
.cluster()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,34 @@
- do:
cluster.state: {}

# Get master node id
- set: { master_node: master }
# Get cluster-manager node id
- set: { cluster_manager_node: cluster_manager }

- do:
nodes.info: {}

- contains: { nodes.$master.modules: { name: ingest-common } }
- contains: { nodes.$master.ingest.processors: { type: append } }
- contains: { nodes.$master.ingest.processors: { type: bytes } }
- contains: { nodes.$master.ingest.processors: { type: convert } }
- contains: { nodes.$master.ingest.processors: { type: date } }
- contains: { nodes.$master.ingest.processors: { type: date_index_name } }
- contains: { nodes.$master.ingest.processors: { type: dissect } }
- contains: { nodes.$master.ingest.processors: { type: dot_expander } }
- contains: { nodes.$master.ingest.processors: { type: fail } }
- contains: { nodes.$master.ingest.processors: { type: foreach } }
- contains: { nodes.$master.ingest.processors: { type: grok } }
- contains: { nodes.$master.ingest.processors: { type: gsub } }
- contains: { nodes.$master.ingest.processors: { type: html_strip } }
- contains: { nodes.$master.ingest.processors: { type: join } }
- contains: { nodes.$master.ingest.processors: { type: json } }
- contains: { nodes.$master.ingest.processors: { type: kv } }
- contains: { nodes.$master.ingest.processors: { type: lowercase } }
- contains: { nodes.$master.ingest.processors: { type: remove } }
- contains: { nodes.$master.ingest.processors: { type: rename } }
- contains: { nodes.$master.ingest.processors: { type: script } }
- contains: { nodes.$master.ingest.processors: { type: set } }
- contains: { nodes.$master.ingest.processors: { type: sort } }
- contains: { nodes.$master.ingest.processors: { type: split } }
- contains: { nodes.$master.ingest.processors: { type: trim } }
- contains: { nodes.$master.ingest.processors: { type: uppercase } }
- contains: { nodes.$cluster_manager.modules: { name: ingest-common } }
- contains: { nodes.$cluster_manager.ingest.processors: { type: append } }
- contains: { nodes.$cluster_manager.ingest.processors: { type: bytes } }
- contains: { nodes.$cluster_manager.ingest.processors: { type: convert } }
- contains: { nodes.$cluster_manager.ingest.processors: { type: date } }
- contains: { nodes.$cluster_manager.ingest.processors: { type: date_index_name } }
- contains: { nodes.$cluster_manager.ingest.processors: { type: dissect } }
- contains: { nodes.$cluster_manager.ingest.processors: { type: dot_expander } }
- contains: { nodes.$cluster_manager.ingest.processors: { type: fail } }
- contains: { nodes.$cluster_manager.ingest.processors: { type: foreach } }
- contains: { nodes.$cluster_manager.ingest.processors: { type: grok } }
- contains: { nodes.$cluster_manager.ingest.processors: { type: gsub } }
- contains: { nodes.$cluster_manager.ingest.processors: { type: html_strip } }
- contains: { nodes.$cluster_manager.ingest.processors: { type: join } }
- contains: { nodes.$cluster_manager.ingest.processors: { type: json } }
- contains: { nodes.$cluster_manager.ingest.processors: { type: kv } }
- contains: { nodes.$cluster_manager.ingest.processors: { type: lowercase } }
- contains: { nodes.$cluster_manager.ingest.processors: { type: remove } }
- contains: { nodes.$cluster_manager.ingest.processors: { type: rename } }
- contains: { nodes.$cluster_manager.ingest.processors: { type: script } }
- contains: { nodes.$cluster_manager.ingest.processors: { type: set } }
- contains: { nodes.$cluster_manager.ingest.processors: { type: sort } }
- contains: { nodes.$cluster_manager.ingest.processors: { type: split } }
- contains: { nodes.$cluster_manager.ingest.processors: { type: trim } }
- contains: { nodes.$cluster_manager.ingest.processors: { type: uppercase } }
Loading

0 comments on commit 1dd62b4

Please sign in to comment.