diff --git a/buildSrc/src/integTest/groovy/org/opensearch/gradle/TestClustersPluginFuncTest.groovy b/buildSrc/src/integTest/groovy/org/opensearch/gradle/TestClustersPluginFuncTest.groovy index d7edeaf93e0aa..e1d3f0281851b 100644 --- a/buildSrc/src/integTest/groovy/org/opensearch/gradle/TestClustersPluginFuncTest.groovy +++ b/buildSrc/src/integTest/groovy/org/opensearch/gradle/TestClustersPluginFuncTest.groovy @@ -104,7 +104,7 @@ class TestClustersPluginFuncTest extends AbstractGradleFuncTest { boolean assertEsStdoutContains(String testCluster, String expectedOutput) { assert new File(testProjectDir.root, - "build/testclusters/${testCluster}-0/logs/es.stdout.log").text.contains(expectedOutput) + "build/testclusters/${testCluster}-0/logs/opensearch.stdout.log").text.contains(expectedOutput) true } diff --git a/buildSrc/src/main/groovy/org/opensearch/gradle/test/NodeInfo.groovy b/buildSrc/src/main/groovy/org/opensearch/gradle/test/NodeInfo.groovy index c898c29255ccc..e39a25e2c593f 100644 --- a/buildSrc/src/main/groovy/org/opensearch/gradle/test/NodeInfo.groovy +++ b/buildSrc/src/main/groovy/org/opensearch/gradle/test/NodeInfo.groovy @@ -124,7 +124,7 @@ class NodeInfo { clusterName = project.path.replace(':', '_').substring(1) + '_' + prefix } baseDir = new File(project.buildDir, "cluster/${prefix} node${nodeNum}") - pidFile = new File(baseDir, 'es.pid') + pidFile = new File(baseDir, 'opensearch.pid') this.nodeVersion = Version.fromString(nodeVersion) this.isBwcNode = this.nodeVersion.before(VersionProperties.opensearch) homeDir = new File(baseDir, "opensearch-${nodeVersion}") @@ -187,9 +187,9 @@ class NodeInfo { env = [:] env.putAll(config.environmentVariables) for (Map.Entry property : System.properties.entrySet()) { - if (property.key.startsWith('tests.es.')) { + if (property.key.startsWith('tests.opensearch.')) { args.add("-E") - args.add("${property.key.substring('tests.es.'.size())}=${property.value}") + args.add("${property.key.substring('tests.opensearch.'.size())}=${property.value}") } } if (Os.isFamily(Os.FAMILY_WINDOWS)) { @@ -202,7 +202,7 @@ class NodeInfo { else { env.put('ES_PATH_CONF', pathConf) } - if (!System.properties.containsKey("tests.es.path.data")) { + if (!System.properties.containsKey("tests.opensearch.path.data")) { if (Os.isFamily(Os.FAMILY_WINDOWS)) { /* * We have to delay building the string as the path will not exist during configuration which will fail on Windows due to diff --git a/buildSrc/src/main/java/org/opensearch/gradle/OpenSearchTestBasePlugin.java b/buildSrc/src/main/java/org/opensearch/gradle/OpenSearchTestBasePlugin.java index 86951c480d8aa..885d9a665d733 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/OpenSearchTestBasePlugin.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/OpenSearchTestBasePlugin.java @@ -162,19 +162,19 @@ public void execute(Task t) { // TODO: remove setting logging level via system property test.systemProperty("tests.logger.level", "WARN"); System.getProperties().entrySet().forEach(entry -> { - if ((entry.getKey().toString().startsWith("tests.") || entry.getKey().toString().startsWith("es."))) { + if ((entry.getKey().toString().startsWith("tests.") || entry.getKey().toString().startsWith("opensearch."))) { test.systemProperty(entry.getKey().toString(), entry.getValue()); } }); // TODO: remove this once ctx isn't added to update script params in 7.0 - test.systemProperty("es.scripting.update.ctx_in_params", "false"); + test.systemProperty("opensearch.scripting.update.ctx_in_params", "false"); // TODO: remove this property in 8.0 - test.systemProperty("es.search.rewrite_sort", "true"); + test.systemProperty("opensearch.search.rewrite_sort", "true"); // TODO: remove this once cname is prepended to transport.publish_address by default in 8.0 - test.systemProperty("es.transport.cname_in_publish_address", "true"); + test.systemProperty("opensearch.transport.cname_in_publish_address", "true"); // Set netty system properties to the properties we configure in jvm.options test.systemProperty("io.netty.noUnsafe", "true"); diff --git a/buildSrc/src/main/java/org/opensearch/gradle/testclusters/OpenSearchNode.java b/buildSrc/src/main/java/org/opensearch/gradle/testclusters/OpenSearchNode.java index 8fa2bbb80d2c7..68c7995d6e222 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/testclusters/OpenSearchNode.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/testclusters/OpenSearchNode.java @@ -191,9 +191,9 @@ public class OpenSearchNode implements TestClusterConfiguration { confPathLogs = workingDir.resolve("logs"); transportPortFile = confPathLogs.resolve("transport.ports"); httpPortsFile = confPathLogs.resolve("http.ports"); - esStdoutFile = confPathLogs.resolve("es.stdout.log"); - esStderrFile = confPathLogs.resolve("es.stderr.log"); - esStdinFile = workingDir.resolve("es.stdin"); + esStdoutFile = confPathLogs.resolve("opensearch.stdout.log"); + esStderrFile = confPathLogs.resolve("opensearch.stderr.log"); + esStdinFile = workingDir.resolve("opensearch.stdin"); tmpDir = workingDir.resolve("tmp"); waitConditions.put("ports files", this::checkPortsFilesExistWithDelay); diff --git a/buildSrc/src/main/java/org/opensearch/gradle/testclusters/RunTask.java b/buildSrc/src/main/java/org/opensearch/gradle/testclusters/RunTask.java index b4336ffce160a..96430c94ce8b0 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/testclusters/RunTask.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/testclusters/RunTask.java @@ -42,7 +42,7 @@ public class RunTask extends DefaultTestClustersTask { private static final Logger logger = Logging.getLogger(RunTask.class); - public static final String CUSTOM_SETTINGS_PREFIX = "tests.es."; + public static final String CUSTOM_SETTINGS_PREFIX = "tests.opensearch."; private Boolean debug = false; diff --git a/client/rest-high-level/build.gradle b/client/rest-high-level/build.gradle index 97122718ebd16..8506e35351d4d 100644 --- a/client/rest-high-level/build.gradle +++ b/client/rest-high-level/build.gradle @@ -79,7 +79,7 @@ check.dependsOn(asyncIntegTest) testClusters.all { testDistribution = 'DEFAULT' - systemProperty 'es.scripting.update.ctx_in_params', 'false' + systemProperty 'opensearch.scripting.update.ctx_in_params', 'false' setting 'reindex.remote.whitelist', '[ "[::1]:*", "127.0.0.1:*" ]' extraConfigFile 'roles.yml', file('roles.yml') diff --git a/client/rest-high-level/src/test/java/org/opensearch/client/CrudIT.java b/client/rest-high-level/src/test/java/org/opensearch/client/CrudIT.java index 6130bf1503343..046332efd5337 100644 --- a/client/rest-high-level/src/test/java/org/opensearch/client/CrudIT.java +++ b/client/rest-high-level/src/test/java/org/opensearch/client/CrudIT.java @@ -126,7 +126,7 @@ public void testDelete() throws IOException { assertEquals("OpenSearch exception [type=version_conflict_engine_exception, reason=[" + docId + "]: " + "version conflict, required seqNo [2], primary term [2]. current document has seqNo [3] and primary term [1]]", exception.getMessage()); - assertEquals("index", exception.getMetadata("es.index").get(0)); + assertEquals("index", exception.getMetadata("opensearch.index").get(0)); } { // Testing version type @@ -154,7 +154,7 @@ public void testDelete() throws IOException { assertEquals(RestStatus.CONFLICT, exception.status()); assertEquals("OpenSearch exception [type=version_conflict_engine_exception, reason=[" + docId + "]: version conflict, current version [12] is higher or equal to the one provided [10]]", exception.getMessage()); - assertEquals("index", exception.getMetadata("es.index").get(0)); + assertEquals("index", exception.getMetadata("opensearch.index").get(0)); } { // Testing routing @@ -300,7 +300,7 @@ public void testGet() throws IOException { () -> execute(getRequest, highLevelClient()::get, highLevelClient()::getAsync)); assertEquals(RestStatus.NOT_FOUND, exception.status()); assertEquals("OpenSearch exception [type=index_not_found_exception, reason=no such index [index]]", exception.getMessage()); - assertEquals("index", exception.getMetadata("es.index").get(0)); + assertEquals("index", exception.getMetadata("opensearch.index").get(0)); } IndexRequest index = new IndexRequest("index").id("id"); String document = "{\"field1\":\"value1\",\"field2\":\"value2\"}"; @@ -314,7 +314,7 @@ public void testGet() throws IOException { assertEquals(RestStatus.CONFLICT, exception.status()); assertEquals("OpenSearch exception [type=version_conflict_engine_exception, " + "reason=[id]: " + "version conflict, current version [1] is different than the one provided [2]]", exception.getMessage()); - assertEquals("index", exception.getMetadata("es.index").get(0)); + assertEquals("index", exception.getMetadata("opensearch.index").get(0)); } { GetRequest getRequest = new GetRequest("index", "id"); @@ -493,7 +493,7 @@ public void testGetSource() throws IOException { () -> execute(getRequest, highLevelClient()::getSource, highLevelClient()::getSourceAsync)); assertEquals(RestStatus.NOT_FOUND, exception.status()); assertEquals("OpenSearch exception [type=index_not_found_exception, reason=no such index [index]]", exception.getMessage()); - assertEquals("index", exception.getMetadata("es.index").get(0)); + assertEquals("index", exception.getMetadata("opensearch.index").get(0)); } IndexRequest index = new IndexRequest("index").id("id"); String document = "{\"field1\":\"value1\",\"field2\":\"value2\"}"; @@ -606,7 +606,7 @@ public void testIndex() throws IOException { assertEquals("OpenSearch exception [type=version_conflict_engine_exception, reason=[id]: " + "version conflict, required seqNo [1], primary term [5]. current document has seqNo [2] and primary term [1]]", exception.getMessage()); - assertEquals("index", exception.getMetadata("es.index").get(0)); + assertEquals("index", exception.getMetadata("opensearch.index").get(0)); } { OpenSearchStatusException exception = expectThrows(OpenSearchStatusException.class, () -> { diff --git a/client/rest-high-level/src/test/java/org/opensearch/client/IndicesClientIT.java b/client/rest-high-level/src/test/java/org/opensearch/client/IndicesClientIT.java index 5f43c652c2be6..4c4f95ef6718a 100644 --- a/client/rest-high-level/src/test/java/org/opensearch/client/IndicesClientIT.java +++ b/client/rest-high-level/src/test/java/org/opensearch/client/IndicesClientIT.java @@ -820,7 +820,7 @@ public void testAliasesNonExistentIndex() throws IOException { assertThat(exception.status(), equalTo(RestStatus.NOT_FOUND)); assertThat(exception.getMessage(), equalTo("OpenSearch exception [type=index_not_found_exception, reason=no such index [non_existent_index]]")); - assertThat(exception.getMetadata("es.index"), hasItem(nonExistentIndex)); + assertThat(exception.getMetadata("opensearch.index"), hasItem(nonExistentIndex)); createIndex(index, Settings.EMPTY); IndicesAliasesRequest mixedRequest = new IndicesAliasesRequest(); @@ -831,8 +831,8 @@ public void testAliasesNonExistentIndex() throws IOException { assertThat(exception.status(), equalTo(RestStatus.NOT_FOUND)); assertThat(exception.getMessage(), equalTo("OpenSearch exception [type=index_not_found_exception, reason=no such index [non_existent_index]]")); - assertThat(exception.getMetadata("es.index"), hasItem(nonExistentIndex)); - assertThat(exception.getMetadata("es.index"), not(hasItem(index))); + assertThat(exception.getMetadata("opensearch.index"), hasItem(nonExistentIndex)); + assertThat(exception.getMetadata("opensearch.index"), not(hasItem(index))); assertThat(aliasExists(index, alias), equalTo(false)); assertThat(aliasExists(alias), equalTo(false)); @@ -844,8 +844,8 @@ public void testAliasesNonExistentIndex() throws IOException { assertThat(exception.status(), equalTo(RestStatus.NOT_FOUND)); assertThat(exception.getMessage(), equalTo("OpenSearch exception [type=index_not_found_exception, reason=no such index [non_existent_index]]")); - assertThat(exception.getMetadata("es.index"), hasItem(nonExistentIndex)); - assertThat(exception.getMetadata("es.index"), not(hasItem(index))); + assertThat(exception.getMetadata("opensearch.index"), hasItem(nonExistentIndex)); + assertThat(exception.getMetadata("opensearch.index"), not(hasItem(index))); assertThat(aliasExists(index, alias), equalTo(false)); assertThat(aliasExists(alias), equalTo(false)); } diff --git a/client/rest-high-level/src/test/java/org/opensearch/client/tasks/OpenSearchExceptionTests.java b/client/rest-high-level/src/test/java/org/opensearch/client/tasks/OpenSearchExceptionTests.java index 7013f9778c0f4..485b435407c47 100644 --- a/client/rest-high-level/src/test/java/org/opensearch/client/tasks/OpenSearchExceptionTests.java +++ b/client/rest-high-level/src/test/java/org/opensearch/client/tasks/OpenSearchExceptionTests.java @@ -34,7 +34,7 @@ protected org.opensearch.OpenSearchException createServerTestInstance(XContentTy IllegalArgumentException iae = new IllegalArgumentException("argument", ies); org.opensearch.OpenSearchException exception = new org.opensearch.OpenSearchException("elastic_exception", iae); exception.addHeader("key","value"); - exception.addMetadata("es.meta","data"); + exception.addMetadata("opensearch.meta","data"); exception.addSuppressed(new NumberFormatException("3/0")); return exception; } diff --git a/modules/ingest-common/src/test/java/org/opensearch/ingest/common/AppendProcessorFactoryTests.java b/modules/ingest-common/src/test/java/org/opensearch/ingest/common/AppendProcessorFactoryTests.java index 1fe8975f73d32..dcca47e837d19 100644 --- a/modules/ingest-common/src/test/java/org/opensearch/ingest/common/AppendProcessorFactoryTests.java +++ b/modules/ingest-common/src/test/java/org/opensearch/ingest/common/AppendProcessorFactoryTests.java @@ -101,6 +101,6 @@ public void testInvalidMustacheTemplate() throws Exception { OpenSearchException exception = expectThrows(OpenSearchException.class, () -> factory.create(null, processorTag, null, config)); assertThat(exception.getMessage(), equalTo("java.lang.RuntimeException: could not compile script")); - assertThat(exception.getMetadata("es.processor_tag").get(0), equalTo(processorTag)); + assertThat(exception.getMetadata("opensearch.processor_tag").get(0), equalTo(processorTag)); } } diff --git a/modules/ingest-common/src/test/java/org/opensearch/ingest/common/ConvertProcessorFactoryTests.java b/modules/ingest-common/src/test/java/org/opensearch/ingest/common/ConvertProcessorFactoryTests.java index 34025b544745f..54c9a18519fe3 100644 --- a/modules/ingest-common/src/test/java/org/opensearch/ingest/common/ConvertProcessorFactoryTests.java +++ b/modules/ingest-common/src/test/java/org/opensearch/ingest/common/ConvertProcessorFactoryTests.java @@ -58,9 +58,9 @@ public void testCreateUnsupportedType() throws Exception { fail("factory create should have failed"); } catch (OpenSearchParseException e) { assertThat(e.getMessage(), Matchers.equalTo("[type] type [" + type + "] not supported, cannot convert field.")); - assertThat(e.getMetadata("es.processor_type").get(0), equalTo(ConvertProcessor.TYPE)); - assertThat(e.getMetadata("es.property_name").get(0), equalTo("type")); - assertThat(e.getMetadata("es.processor_tag"), nullValue()); + assertThat(e.getMetadata("opensearch.processor_type").get(0), equalTo(ConvertProcessor.TYPE)); + assertThat(e.getMetadata("opensearch.property_name").get(0), equalTo("type")); + assertThat(e.getMetadata("opensearch.processor_tag"), nullValue()); } } diff --git a/modules/ingest-common/src/test/java/org/opensearch/ingest/common/FailProcessorFactoryTests.java b/modules/ingest-common/src/test/java/org/opensearch/ingest/common/FailProcessorFactoryTests.java index d2aebda0be2bf..1ac9bdbbd60f8 100644 --- a/modules/ingest-common/src/test/java/org/opensearch/ingest/common/FailProcessorFactoryTests.java +++ b/modules/ingest-common/src/test/java/org/opensearch/ingest/common/FailProcessorFactoryTests.java @@ -67,6 +67,6 @@ public void testInvalidMustacheTemplate() throws Exception { OpenSearchException exception = expectThrows(OpenSearchException.class, () -> factory.create(null, processorTag, null, config)); assertThat(exception.getMessage(), equalTo("java.lang.RuntimeException: could not compile script")); - assertThat(exception.getMetadata("es.processor_tag").get(0), equalTo(processorTag)); + assertThat(exception.getMetadata("opensearch.processor_tag").get(0), equalTo(processorTag)); } } diff --git a/modules/ingest-common/src/test/java/org/opensearch/ingest/common/RemoveProcessorFactoryTests.java b/modules/ingest-common/src/test/java/org/opensearch/ingest/common/RemoveProcessorFactoryTests.java index 3d076373ebd20..c7cd484d27146 100644 --- a/modules/ingest-common/src/test/java/org/opensearch/ingest/common/RemoveProcessorFactoryTests.java +++ b/modules/ingest-common/src/test/java/org/opensearch/ingest/common/RemoveProcessorFactoryTests.java @@ -80,6 +80,6 @@ public void testInvalidMustacheTemplate() throws Exception { OpenSearchException exception = expectThrows(OpenSearchException.class, () -> factory.create(null, processorTag, null, config)); assertThat(exception.getMessage(), equalTo("java.lang.RuntimeException: could not compile script")); - assertThat(exception.getMetadata("es.processor_tag").get(0), equalTo(processorTag)); + assertThat(exception.getMetadata("opensearch.processor_tag").get(0), equalTo(processorTag)); } } diff --git a/modules/ingest-common/src/test/java/org/opensearch/ingest/common/SetProcessorFactoryTests.java b/modules/ingest-common/src/test/java/org/opensearch/ingest/common/SetProcessorFactoryTests.java index 0e87a3c2bd8fd..7bf413f180920 100644 --- a/modules/ingest-common/src/test/java/org/opensearch/ingest/common/SetProcessorFactoryTests.java +++ b/modules/ingest-common/src/test/java/org/opensearch/ingest/common/SetProcessorFactoryTests.java @@ -109,7 +109,7 @@ public void testInvalidMustacheTemplate() throws Exception { OpenSearchException exception = expectThrows(OpenSearchException.class, () -> factory.create(null, processorTag, null, config)); assertThat(exception.getMessage(), equalTo("java.lang.RuntimeException: could not compile script")); - assertThat(exception.getMetadata("es.processor_tag").get(0), equalTo(processorTag)); + assertThat(exception.getMetadata("opensearch.processor_tag").get(0), equalTo(processorTag)); } } diff --git a/modules/ingest-geoip/build.gradle b/modules/ingest-geoip/build.gradle index 79eda9ff90c7f..fcc870062edad 100644 --- a/modules/ingest-geoip/build.gradle +++ b/modules/ingest-geoip/build.gradle @@ -80,6 +80,6 @@ if (Os.isFamily(Os.FAMILY_WINDOWS)) { tasks.named("test").configure { // Windows cannot cleanup database files properly unless it loads everything on heap. // See https://github.com/maxmind/MaxMind-DB-Reader-java#file-lock-on-windows for more information - systemProperty 'es.geoip.load_db_on_heap', 'true' + systemProperty 'opensearch.geoip.load_db_on_heap', 'true' } } diff --git a/modules/ingest-geoip/src/main/java/org/opensearch/ingest/geoip/IngestGeoIpPlugin.java b/modules/ingest-geoip/src/main/java/org/opensearch/ingest/geoip/IngestGeoIpPlugin.java index 78327f6d20f4a..f220adae535ff 100644 --- a/modules/ingest-geoip/src/main/java/org/opensearch/ingest/geoip/IngestGeoIpPlugin.java +++ b/modules/ingest-geoip/src/main/java/org/opensearch/ingest/geoip/IngestGeoIpPlugin.java @@ -100,7 +100,7 @@ private Path getGeoIpDirectory(Processor.Parameters parameters) { static Map loadDatabaseReaders(Path geoIpDirectory, Path geoIpConfigDirectory) throws IOException { assertDatabaseExistence(geoIpDirectory, true); assertDatabaseExistence(geoIpConfigDirectory, false); - final boolean loadDatabaseOnHeap = Booleans.parseBoolean(System.getProperty("es.geoip.load_db_on_heap", "false")); + final boolean loadDatabaseOnHeap = Booleans.parseBoolean(System.getProperty("opensearch.geoip.load_db_on_heap", "false")); final Map databaseReaders = new HashMap<>(); // load the default databases diff --git a/modules/lang-painless/build.gradle b/modules/lang-painless/build.gradle index 0a70d7ced6390..26fbeffd6c8f7 100644 --- a/modules/lang-painless/build.gradle +++ b/modules/lang-painless/build.gradle @@ -28,9 +28,9 @@ esplugin { testClusters.all { module ':modules:mapper-extras' - systemProperty 'es.scripting.update.ctx_in_params', 'false' + systemProperty 'opensearch.scripting.update.ctx_in_params', 'false' // TODO: remove this once cname is prepended to transport.publish_address by default in 8.0 - systemProperty 'es.transport.cname_in_publish_address', 'true' + systemProperty 'opensearch.transport.cname_in_publish_address', 'true' } dependencies { diff --git a/modules/lang-painless/src/main/java/org/opensearch/painless/PainlessExplainError.java b/modules/lang-painless/src/main/java/org/opensearch/painless/PainlessExplainError.java index c8222eb994a29..8dc907066b203 100644 --- a/modules/lang-painless/src/main/java/org/opensearch/painless/PainlessExplainError.java +++ b/modules/lang-painless/src/main/java/org/opensearch/painless/PainlessExplainError.java @@ -63,12 +63,12 @@ public Map> getHeaders(PainlessLookup painlessLookup) { } } - headers.put("es.to_string", singletonList(toString)); + headers.put("opensearch.to_string", singletonList(toString)); if (painlessClassName != null) { - headers.put("es.painless_class", singletonList(painlessClassName)); + headers.put("opensearch.painless_class", singletonList(painlessClassName)); } if (javaClassName != null) { - headers.put("es.java_class", singletonList(javaClassName)); + headers.put("opensearch.java_class", singletonList(javaClassName)); } return headers; } diff --git a/modules/lang-painless/src/test/java/org/opensearch/painless/DebugTests.java b/modules/lang-painless/src/test/java/org/opensearch/painless/DebugTests.java index fa3acb5558881..a1d90369521a6 100644 --- a/modules/lang-painless/src/test/java/org/opensearch/painless/DebugTests.java +++ b/modules/lang-painless/src/test/java/org/opensearch/painless/DebugTests.java @@ -45,16 +45,16 @@ public void testExplain() { PainlessExplainError e = expectScriptThrows(PainlessExplainError.class, () -> exec( "Debug.explain(params.a)", singletonMap("a", dummy), true)); assertSame(dummy, e.getObjectToExplain()); - assertThat(e.getHeaders(painlessLookup), hasEntry("es.to_string", singletonList(dummy.toString()))); - assertThat(e.getHeaders(painlessLookup), hasEntry("es.java_class", singletonList("java.lang.Object"))); - assertThat(e.getHeaders(painlessLookup), hasEntry("es.painless_class", singletonList("java.lang.Object"))); + assertThat(e.getHeaders(painlessLookup), hasEntry("opensearch.to_string", singletonList(dummy.toString()))); + assertThat(e.getHeaders(painlessLookup), hasEntry("opensearch.java_class", singletonList("java.lang.Object"))); + assertThat(e.getHeaders(painlessLookup), hasEntry("opensearch.painless_class", singletonList("java.lang.Object"))); // Null should be ok e = expectScriptThrows(PainlessExplainError.class, () -> exec("Debug.explain(null)")); assertNull(e.getObjectToExplain()); - assertThat(e.getHeaders(painlessLookup), hasEntry("es.to_string", singletonList("null"))); - assertThat(e.getHeaders(painlessLookup), not(hasKey("es.java_class"))); - assertThat(e.getHeaders(painlessLookup), not(hasKey("es.painless_class"))); + assertThat(e.getHeaders(painlessLookup), hasEntry("opensearch.to_string", singletonList("null"))); + assertThat(e.getHeaders(painlessLookup), not(hasKey("opensearch.java_class"))); + assertThat(e.getHeaders(painlessLookup), not(hasKey("opensearch.painless_class"))); // You can't catch the explain exception e = expectScriptThrows(PainlessExplainError.class, () -> exec( @@ -72,17 +72,17 @@ public void testExplain() { public void testPainlessExplainErrorSerialization() throws IOException { Map params = singletonMap("a", "jumped over the moon"); ScriptException e = expectThrows(ScriptException.class, () -> exec("Debug.explain(params.a)", params, true)); - assertEquals(singletonList("jumped over the moon"), e.getMetadata("es.to_string")); - assertEquals(singletonList("java.lang.String"), e.getMetadata("es.java_class")); - assertEquals(singletonList("java.lang.String"), e.getMetadata("es.painless_class")); + assertEquals(singletonList("jumped over the moon"), e.getMetadata("opensearch.to_string")); + assertEquals(singletonList("java.lang.String"), e.getMetadata("opensearch.java_class")); + assertEquals(singletonList("java.lang.String"), e.getMetadata("opensearch.painless_class")); try (BytesStreamOutput out = new BytesStreamOutput()) { out.writeException(e); try (StreamInput in = out.bytes().streamInput()) { OpenSearchException read = (ScriptException) in.readException(); - assertEquals(singletonList("jumped over the moon"), read.getMetadata("es.to_string")); - assertEquals(singletonList("java.lang.String"), read.getMetadata("es.java_class")); - assertEquals(singletonList("java.lang.String"), read.getMetadata("es.painless_class")); + assertEquals(singletonList("jumped over the moon"), read.getMetadata("opensearch.to_string")); + assertEquals(singletonList("java.lang.String"), read.getMetadata("opensearch.java_class")); + assertEquals(singletonList("java.lang.String"), read.getMetadata("opensearch.painless_class")); } } } diff --git a/modules/reindex/build.gradle b/modules/reindex/build.gradle index 7e1c4a485c4c9..973bfdc4da6cc 100644 --- a/modules/reindex/build.gradle +++ b/modules/reindex/build.gradle @@ -48,7 +48,7 @@ test { * same JVM randomize processors and will step on each other if we allow them to * set the number of available processors as it's set-once in Netty. */ - systemProperty 'es.set.netty.runtime.available.processors', 'false' + systemProperty 'opensearch.set.netty.runtime.available.processors', 'false' } dependencies { diff --git a/modules/transport-netty4/build.gradle b/modules/transport-netty4/build.gradle index 8036e4ed898b1..b4e69b39d78be 100644 --- a/modules/transport-netty4/build.gradle +++ b/modules/transport-netty4/build.gradle @@ -65,27 +65,27 @@ test { * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each * other if we allow them to set the number of available processors as it's set-once in Netty. */ - systemProperty 'es.set.netty.runtime.available.processors', 'false' + systemProperty 'opensearch.set.netty.runtime.available.processors', 'false' } internalClusterTest { - systemProperty 'es.set.netty.runtime.available.processors', 'false' + systemProperty 'opensearch.set.netty.runtime.available.processors', 'false' } javaRestTest { - systemProperty 'es.set.netty.runtime.available.processors', 'false' + systemProperty 'opensearch.set.netty.runtime.available.processors', 'false' } TaskProvider pooledTest = tasks.register("pooledTest", Test) { include '**/*Tests.class' - systemProperty 'es.set.netty.runtime.available.processors', 'false' - systemProperty 'es.use_unpooled_allocator', 'false' + systemProperty 'opensearch.set.netty.runtime.available.processors', 'false' + systemProperty 'opensearch.use_unpooled_allocator', 'false' } TaskProvider pooledInternalClusterTest = tasks.register("pooledInternalClusterTest", Test) { include '**/*IT.class' - systemProperty 'es.set.netty.runtime.available.processors', 'false' - systemProperty 'es.use_unpooled_allocator', 'false' + systemProperty 'opensearch.set.netty.runtime.available.processors', 'false' + systemProperty 'opensearch.use_unpooled_allocator', 'false' SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); SourceSet internalTestSourceSet = sourceSets.getByName(InternalClusterTestPlugin.SOURCE_SET_NAME) setTestClassesDirs(internalTestSourceSet.getOutput().getClassesDirs()) @@ -93,14 +93,14 @@ TaskProvider pooledInternalClusterTest = tasks.register("pooledInternalClu } RestIntegTestTask pooledJavaRestTest = tasks.create("pooledJavaRestTest", RestIntegTestTask) { - systemProperty 'es.set.netty.runtime.available.processors', 'false' + systemProperty 'opensearch.set.netty.runtime.available.processors', 'false' SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class); SourceSet javaRestTestSourceSet = sourceSets.getByName(JavaRestTestPlugin.SOURCE_SET_NAME) setTestClassesDirs(javaRestTestSourceSet.getOutput().getClassesDirs()) setClasspath(javaRestTestSourceSet.getRuntimeClasspath()) } testClusters.pooledJavaRestTest { - systemProperty 'es.use_unpooled_allocator', 'false' + systemProperty 'opensearch.use_unpooled_allocator', 'false' } check.dependsOn(pooledTest, pooledJavaRestTest, pooledInternalClusterTest) diff --git a/modules/transport-netty4/src/main/java/org/opensearch/http/netty4/Netty4HttpResponseCreator.java b/modules/transport-netty4/src/main/java/org/opensearch/http/netty4/Netty4HttpResponseCreator.java index c494c515a7fd1..bbbc550193402 100644 --- a/modules/transport-netty4/src/main/java/org/opensearch/http/netty4/Netty4HttpResponseCreator.java +++ b/modules/transport-netty4/src/main/java/org/opensearch/http/netty4/Netty4HttpResponseCreator.java @@ -39,7 +39,7 @@ @ChannelHandler.Sharable class Netty4HttpResponseCreator extends MessageToMessageEncoder { - private static final String DO_NOT_SPLIT = "es.unsafe.do_not_split_http_responses"; + private static final String DO_NOT_SPLIT = "opensearch.unsafe.do_not_split_http_responses"; private static final boolean DO_NOT_SPLIT_HTTP_RESPONSES; private static final int SPLIT_THRESHOLD; diff --git a/modules/transport-netty4/src/main/java/org/opensearch/http/netty4/Netty4HttpServerTransport.java b/modules/transport-netty4/src/main/java/org/opensearch/http/netty4/Netty4HttpServerTransport.java index d772847c4d5d7..7921dec4ff364 100644 --- a/modules/transport-netty4/src/main/java/org/opensearch/http/netty4/Netty4HttpServerTransport.java +++ b/modules/transport-netty4/src/main/java/org/opensearch/http/netty4/Netty4HttpServerTransport.java @@ -94,7 +94,7 @@ public class Netty4HttpServerTransport extends AbstractHttpServerTransport { * * By default we assume the Ethernet MTU (1500 bytes) but users can override it with a system property. */ - private static final ByteSizeValue MTU = new ByteSizeValue(Long.parseLong(System.getProperty("es.net.mtu", "1500"))); + private static final ByteSizeValue MTU = new ByteSizeValue(Long.parseLong(System.getProperty("opensearch.net.mtu", "1500"))); private static final String SETTING_KEY_HTTP_NETTY_MAX_COMPOSITE_BUFFER_COMPONENTS = "http.netty.max_composite_buffer_components"; diff --git a/modules/transport-netty4/src/main/java/org/opensearch/transport/CopyBytesSocketChannel.java b/modules/transport-netty4/src/main/java/org/opensearch/transport/CopyBytesSocketChannel.java index 3b37eb2d3a27a..6c4c61192a787 100644 --- a/modules/transport-netty4/src/main/java/org/opensearch/transport/CopyBytesSocketChannel.java +++ b/modules/transport-netty4/src/main/java/org/opensearch/transport/CopyBytesSocketChannel.java @@ -62,7 +62,7 @@ public class CopyBytesSocketChannel extends Netty4NioSocketChannel { private static final int MAX_BYTES_PER_WRITE = StrictMath.toIntExact(ByteSizeValue.parseBytesSizeValue( - System.getProperty("es.transport.buffer.size", "1m"), "es.transport.buffer.size").getBytes()); + System.getProperty("opensearch.transport.buffer.size", "1m"), "opensearch.transport.buffer.size").getBytes()); private static final ThreadLocal ioBuffer = ThreadLocal.withInitial(() -> ByteBuffer.allocateDirect(MAX_BYTES_PER_WRITE)); private final WriteConfig writeConfig = new WriteConfig(); diff --git a/modules/transport-netty4/src/main/java/org/opensearch/transport/NettyAllocator.java b/modules/transport-netty4/src/main/java/org/opensearch/transport/NettyAllocator.java index 82ec7abf44215..58f3c34823b37 100644 --- a/modules/transport-netty4/src/main/java/org/opensearch/transport/NettyAllocator.java +++ b/modules/transport-netty4/src/main/java/org/opensearch/transport/NettyAllocator.java @@ -44,16 +44,16 @@ public class NettyAllocator { private static final ByteBufAllocator ALLOCATOR; private static final String DESCRIPTION; - private static final String USE_UNPOOLED = "es.use_unpooled_allocator"; - private static final String USE_NETTY_DEFAULT = "es.unsafe.use_netty_default_allocator"; - private static final String USE_NETTY_DEFAULT_CHUNK = "es.unsafe.use_netty_default_chunk_and_page_size"; + private static final String USE_UNPOOLED = "opensearch.use_unpooled_allocator"; + private static final String USE_NETTY_DEFAULT = "opensearch.unsafe.use_netty_default_allocator"; + private static final String USE_NETTY_DEFAULT_CHUNK = "opensearch.unsafe.use_netty_default_chunk_and_page_size"; static { if (Booleans.parseBoolean(System.getProperty(USE_NETTY_DEFAULT), false)) { ALLOCATOR = ByteBufAllocator.DEFAULT; SUGGESTED_MAX_ALLOCATION_SIZE = 1024 * 1024; DESCRIPTION = "[name=netty_default, suggested_max_allocation_size=" + new ByteSizeValue(SUGGESTED_MAX_ALLOCATION_SIZE) - + ", factors={es.unsafe.use_netty_default_allocator=true}]"; + + ", factors={opensearch.unsafe.use_netty_default_allocator=true}]"; } else { final long heapSizeInBytes = JvmInfo.jvmInfo().getMem().getHeapMax().getBytes(); final boolean g1gcEnabled = Boolean.parseBoolean(JvmInfo.jvmInfo().useG1GC()); @@ -73,7 +73,7 @@ public class NettyAllocator { SUGGESTED_MAX_ALLOCATION_SIZE = 1024 * 1024; } DESCRIPTION = "[name=unpooled, suggested_max_allocation_size=" + new ByteSizeValue(SUGGESTED_MAX_ALLOCATION_SIZE) - + ", factors={es.unsafe.use_unpooled_allocator=" + System.getProperty(USE_UNPOOLED) + + ", factors={opensearch.unsafe.use_unpooled_allocator=" + System.getProperty(USE_UNPOOLED) + ", g1gc_enabled=" + g1gcEnabled + ", g1gc_region_size=" + g1gcRegionSize + ", heap_size=" + heapSize + "}]"; @@ -108,7 +108,7 @@ public class NettyAllocator { SUGGESTED_MAX_ALLOCATION_SIZE = chunkSizeInBytes; DESCRIPTION = "[name=opensearch_configured, chunk_size=" + chunkSize + ", suggested_max_allocation_size=" + new ByteSizeValue(SUGGESTED_MAX_ALLOCATION_SIZE) - + ", factors={es.unsafe.use_netty_default_chunk_and_page_size=" + useDefaultChunkAndPageSize() + + ", factors={opensearch.unsafe.use_netty_default_chunk_and_page_size=" + useDefaultChunkAndPageSize() + ", g1gc_enabled=" + g1gcEnabled + ", g1gc_region_size=" + g1gcRegionSize + "}]"; } diff --git a/modules/transport-netty4/src/main/java/org/opensearch/transport/netty4/Netty4Utils.java b/modules/transport-netty4/src/main/java/org/opensearch/transport/netty4/Netty4Utils.java index 844623441575d..63ff40e18b345 100644 --- a/modules/transport-netty4/src/main/java/org/opensearch/transport/netty4/Netty4Utils.java +++ b/modules/transport-netty4/src/main/java/org/opensearch/transport/netty4/Netty4Utils.java @@ -48,7 +48,7 @@ public class Netty4Utils { */ public static void setAvailableProcessors(final int availableProcessors) { // we set this to false in tests to avoid tests that randomly set processors from stepping on each other - final boolean set = Booleans.parseBoolean(System.getProperty("es.set.netty.runtime.available.processors", "true")); + final boolean set = Booleans.parseBoolean(System.getProperty("opensearch.set.netty.runtime.available.processors", "true")); if (!set) { return; } diff --git a/plugins/discovery-gce/qa/gce/build.gradle b/plugins/discovery-gce/qa/gce/build.gradle index 0f8f15e29d76b..1f7d8e10c78ff 100644 --- a/plugins/discovery-gce/qa/gce/build.gradle +++ b/plugins/discovery-gce/qa/gce/build.gradle @@ -65,7 +65,7 @@ testClusters.yamlRestTest { // use gce fixture for Auth calls instead of http://metadata.google.internal environment 'GCE_METADATA_HOST', { "http://${gceFixture.addressAndPort}" }, IGNORE_VALUE // allows to configure hidden settings (`cloud.gce.host` and `cloud.gce.root_url`) - systemProperty 'es.allow_reroute_gce_settings', 'true' + systemProperty 'opensearch.allow_reroute_gce_settings', 'true' setting 'discovery.seed_providers', 'gce' // use gce fixture for metadata server calls instead of http://metadata.google.internal diff --git a/plugins/discovery-gce/src/main/java/org/opensearch/plugin/discovery/gce/GceDiscoveryPlugin.java b/plugins/discovery-gce/src/main/java/org/opensearch/plugin/discovery/gce/GceDiscoveryPlugin.java index 97c4b56b2c5fb..6f83e67603450 100644 --- a/plugins/discovery-gce/src/main/java/org/opensearch/plugin/discovery/gce/GceDiscoveryPlugin.java +++ b/plugins/discovery-gce/src/main/java/org/opensearch/plugin/discovery/gce/GceDiscoveryPlugin.java @@ -53,7 +53,7 @@ public class GceDiscoveryPlugin extends Plugin implements DiscoveryPlugin, Close /** Determines whether settings those reroutes GCE call should be allowed (for testing purposes only). */ private static final boolean ALLOW_REROUTE_GCE_SETTINGS = - Booleans.parseBoolean(System.getProperty("es.allow_reroute_gce_settings", "false")); + Booleans.parseBoolean(System.getProperty("opensearch.allow_reroute_gce_settings", "false")); public static final String GCE = "gce"; protected final Settings settings; diff --git a/plugins/repository-gcs/build.gradle b/plugins/repository-gcs/build.gradle index 292013153cc18..f700632ab40c8 100644 --- a/plugins/repository-gcs/build.gradle +++ b/plugins/repository-gcs/build.gradle @@ -311,7 +311,7 @@ testClusters { plugin bundlePlugin.archiveFile // force large blob uploads by setting the threshold small, forcing this code path to be tested - systemProperty 'es.repository_gcs.large_blob_threshold_byte_size', '256' + systemProperty 'opensearch.repository_gcs.large_blob_threshold_byte_size', '256' } } diff --git a/plugins/repository-gcs/src/main/java/org/opensearch/repositories/gcs/GoogleCloudStorageBlobStore.java b/plugins/repository-gcs/src/main/java/org/opensearch/repositories/gcs/GoogleCloudStorageBlobStore.java index 8c9434cc4cc48..d015a9d33c9dd 100644 --- a/plugins/repository-gcs/src/main/java/org/opensearch/repositories/gcs/GoogleCloudStorageBlobStore.java +++ b/plugins/repository-gcs/src/main/java/org/opensearch/repositories/gcs/GoogleCloudStorageBlobStore.java @@ -76,7 +76,7 @@ class GoogleCloudStorageBlobStore implements BlobStore { public static final int LARGE_BLOB_THRESHOLD_BYTE_SIZE; static { - final String key = "es.repository_gcs.large_blob_threshold_byte_size"; + final String key = "opensearch.repository_gcs.large_blob_threshold_byte_size"; final String largeBlobThresholdByteSizeProperty = System.getProperty(key); if (largeBlobThresholdByteSizeProperty == null) { LARGE_BLOB_THRESHOLD_BYTE_SIZE = Math.toIntExact(new ByteSizeValue(5, ByteSizeUnit.MB).getBytes()); diff --git a/plugins/repository-s3/build.gradle b/plugins/repository-s3/build.gradle index 14784407d5cdb..eb87e5093d717 100644 --- a/plugins/repository-s3/build.gradle +++ b/plugins/repository-s3/build.gradle @@ -79,7 +79,7 @@ bundlePlugin { task testRepositoryCreds(type: Test) { include '**/RepositoryCredentialsTests.class' - systemProperty 'es.allow_insecure_settings', 'true' + systemProperty 'opensearch.allow_insecure_settings', 'true' } check.dependsOn(testRepositoryCreds) diff --git a/plugins/repository-s3/src/test/java/org/opensearch/repositories/s3/RepositoryCredentialsTests.java b/plugins/repository-s3/src/test/java/org/opensearch/repositories/s3/RepositoryCredentialsTests.java index b5e2f46918e6a..22fc74e2d646e 100644 --- a/plugins/repository-s3/src/test/java/org/opensearch/repositories/s3/RepositoryCredentialsTests.java +++ b/plugins/repository-s3/src/test/java/org/opensearch/repositories/s3/RepositoryCredentialsTests.java @@ -66,7 +66,7 @@ public class RepositoryCredentialsTests extends OpenSearchSingleNodeTestCase { static { AccessController.doPrivileged((PrivilegedAction) () -> { // required for client settings overwriting when running in IDE - System.setProperty("es.allow_insecure_settings", "true"); + System.setProperty("opensearch.allow_insecure_settings", "true"); return null; }); } diff --git a/plugins/transport-nio/src/main/java/org/opensearch/http/nio/NioHttpResponseCreator.java b/plugins/transport-nio/src/main/java/org/opensearch/http/nio/NioHttpResponseCreator.java index 20b94f9711d18..7640d123132fa 100644 --- a/plugins/transport-nio/src/main/java/org/opensearch/http/nio/NioHttpResponseCreator.java +++ b/plugins/transport-nio/src/main/java/org/opensearch/http/nio/NioHttpResponseCreator.java @@ -38,7 +38,7 @@ @ChannelHandler.Sharable public class NioHttpResponseCreator extends MessageToMessageEncoder { - private static final String DO_NOT_SPLIT = "es.unsafe.do_not_split_http_responses"; + private static final String DO_NOT_SPLIT = "opensearch.unsafe.do_not_split_http_responses"; private static final boolean DO_NOT_SPLIT_HTTP_RESPONSES; private static final int SPLIT_THRESHOLD; diff --git a/qa/evil-tests/src/test/java/org/opensearch/bootstrap/EvilBootstrapChecksTests.java b/qa/evil-tests/src/test/java/org/opensearch/bootstrap/EvilBootstrapChecksTests.java index 0b58116fbc36c..b3db63e4fd66a 100644 --- a/qa/evil-tests/src/test/java/org/opensearch/bootstrap/EvilBootstrapChecksTests.java +++ b/qa/evil-tests/src/test/java/org/opensearch/bootstrap/EvilBootstrapChecksTests.java @@ -31,7 +31,7 @@ import java.util.List; import static java.util.Collections.emptyList; -import static org.opensearch.bootstrap.BootstrapChecks.ES_ENFORCE_BOOTSTRAP_CHECKS; +import static org.opensearch.bootstrap.BootstrapChecks.OPENSEARCH_ENFORCE_BOOTSTRAP_CHECKS; import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.hasToString; @@ -41,7 +41,7 @@ public class EvilBootstrapChecksTests extends AbstractBootstrapCheckTestCase { - private String esEnforceBootstrapChecks = System.getProperty(ES_ENFORCE_BOOTSTRAP_CHECKS); + private String esEnforceBootstrapChecks = System.getProperty(OPENSEARCH_ENFORCE_BOOTSTRAP_CHECKS); @Override @Before @@ -88,16 +88,16 @@ public void testInvalidValue() { IllegalArgumentException.class, () -> BootstrapChecks.check(emptyContext, enforceLimits, emptyList())); final Matcher matcher = containsString( - "[es.enforce.bootstrap.checks] must be [true] but was [" + value + "]"); + "[opensearch.enforce.bootstrap.checks] must be [true] but was [" + value + "]"); assertThat(e, hasToString(matcher)); } - @SuppressForbidden(reason = "set or clear system property es.enforce.bootstrap.checks") + @SuppressForbidden(reason = "set or clear system property opensearch.enforce.bootstrap.checks") public void setEsEnforceBootstrapChecks(final String value) { if (value == null) { - System.clearProperty(ES_ENFORCE_BOOTSTRAP_CHECKS); + System.clearProperty(OPENSEARCH_ENFORCE_BOOTSTRAP_CHECKS); } else { - System.setProperty(ES_ENFORCE_BOOTSTRAP_CHECKS, value); + System.setProperty(OPENSEARCH_ENFORCE_BOOTSTRAP_CHECKS, value); } } diff --git a/qa/evil-tests/src/test/java/org/opensearch/bootstrap/EvilOpenSearchCliTests.java b/qa/evil-tests/src/test/java/org/opensearch/bootstrap/EvilOpenSearchCliTests.java index 1fafc1a4b79d2..0a6aaee15ace6 100644 --- a/qa/evil-tests/src/test/java/org/opensearch/bootstrap/EvilOpenSearchCliTests.java +++ b/qa/evil-tests/src/test/java/org/opensearch/bootstrap/EvilOpenSearchCliTests.java @@ -33,9 +33,9 @@ public class EvilOpenSearchCliTests extends BaseOpenSearchCliTestCase { @SuppressForbidden(reason = "manipulates system properties for testing") public void testPathHome() throws Exception { - final String pathHome = System.getProperty("es.path.home"); + final String pathHome = System.getProperty("opensearch.path.home"); final String value = randomAlphaOfLength(16); - System.setProperty("es.path.home", value); + System.setProperty("opensearch.path.home", value); runTest( ExitCodes.OK, @@ -50,7 +50,7 @@ public void testPathHome() throws Exception { assertThat(settings.keySet(), hasItem("path.logs")); // added by env initialization }); - System.clearProperty("es.path.home"); + System.clearProperty("opensearch.path.home"); final String commandLineValue = randomAlphaOfLength(16); runTest( ExitCodes.OK, @@ -66,8 +66,8 @@ public void testPathHome() throws Exception { }, "-Epath.home=" + commandLineValue); - if (pathHome != null) System.setProperty("es.path.home", pathHome); - else System.clearProperty("es.path.home"); + if (pathHome != null) System.setProperty("opensearch.path.home", pathHome); + else System.clearProperty("opensearch.path.home"); } } diff --git a/qa/evil-tests/src/test/java/org/opensearch/cli/EvilEnvironmentAwareCommandTests.java b/qa/evil-tests/src/test/java/org/opensearch/cli/EvilEnvironmentAwareCommandTests.java index fbff082be0e20..443064943271d 100644 --- a/qa/evil-tests/src/test/java/org/opensearch/cli/EvilEnvironmentAwareCommandTests.java +++ b/qa/evil-tests/src/test/java/org/opensearch/cli/EvilEnvironmentAwareCommandTests.java @@ -33,7 +33,7 @@ public class EvilEnvironmentAwareCommandTests extends OpenSearchTestCase { @Rule - public TestRule restoreSystemProperties = new TestRuleRestoreSystemProperties("es.path.conf"); + public TestRule restoreSystemProperties = new TestRuleRestoreSystemProperties("opensearch.path.conf"); public void testEsPathConfNotSet() throws Exception { clearEsPathConf(); @@ -54,12 +54,12 @@ protected void execute(Terminal terminal, OptionSet options, Environment env) th final TestEnvironmentAwareCommand command = new TestEnvironmentAwareCommand("test"); final UserException e = expectThrows(UserException.class, () -> command.mainWithoutErrorHandling(new String[0], new MockTerminal())); - assertThat(e, hasToString(containsString("the system property [es.path.conf] must be set"))); + assertThat(e, hasToString(containsString("the system property [opensearch.path.conf] must be set"))); } - @SuppressForbidden(reason = "clears system property es.path.conf as part of test setup") + @SuppressForbidden(reason = "clears system property opensearch.path.conf as part of test setup") private void clearEsPathConf() { - System.clearProperty("es.path.conf"); + System.clearProperty("opensearch.path.conf"); } } diff --git a/qa/evil-tests/src/test/java/org/opensearch/cluster/metadata/EvilSystemPropertyTests.java b/qa/evil-tests/src/test/java/org/opensearch/cluster/metadata/EvilSystemPropertyTests.java index 8756ea7e262aa..3283a9ef0ee8c 100644 --- a/qa/evil-tests/src/test/java/org/opensearch/cluster/metadata/EvilSystemPropertyTests.java +++ b/qa/evil-tests/src/test/java/org/opensearch/cluster/metadata/EvilSystemPropertyTests.java @@ -34,14 +34,14 @@ public void testMaxNumShards() { Integer numShards = IndexMetadata.INDEX_NUMBER_OF_SHARDS_SETTING.get(Settings.builder().put("index.number_of_shards", 100).build()); assertEquals(100, numShards.intValue()); int limit = randomIntBetween(1, 10); - System.setProperty("es.index.max_number_of_shards", Integer.toString(limit)); + System.setProperty("opensearch.index.max_number_of_shards", Integer.toString(limit)); try { IllegalArgumentException e = expectThrows(IllegalArgumentException.class, () -> IndexMetadata.buildNumberOfShardsSetting() .get(Settings.builder().put("index.number_of_shards", 11).build())); assertEquals("Failed to parse value [11] for setting [index.number_of_shards] must be <= " + limit, e.getMessage()); } finally { - System.clearProperty("es.index.max_number_of_shards"); + System.clearProperty("opensearch.index.max_number_of_shards"); } } } diff --git a/qa/evil-tests/src/test/java/org/opensearch/cluster/routing/EvilSystemPropertyTests.java b/qa/evil-tests/src/test/java/org/opensearch/cluster/routing/EvilSystemPropertyTests.java index 62c8feb69acd8..4db9d6330c80b 100644 --- a/qa/evil-tests/src/test/java/org/opensearch/cluster/routing/EvilSystemPropertyTests.java +++ b/qa/evil-tests/src/test/java/org/opensearch/cluster/routing/EvilSystemPropertyTests.java @@ -37,13 +37,13 @@ public void testDisableSearchAllocationAwareness() { assertWarnings(OperationRouting.IGNORE_AWARENESS_ATTRIBUTES_DEPRECATION_MESSAGE); assertThat(routing.getAwarenessAttributes().size(), equalTo(1)); assertThat(routing.getAwarenessAttributes().get(0), equalTo("test")); - System.setProperty("es.search.ignore_awareness_attributes", "true"); + System.setProperty("opensearch.search.ignore_awareness_attributes", "true"); try { routing = new OperationRouting(indexSettings, new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS)); assertTrue(routing.getAwarenessAttributes().isEmpty()); } finally { - System.clearProperty("es.search.ignore_awareness_attributes"); + System.clearProperty("opensearch.search.ignore_awareness_attributes"); } } diff --git a/qa/evil-tests/src/test/java/org/opensearch/common/logging/EvilLoggerTests.java b/qa/evil-tests/src/test/java/org/opensearch/common/logging/EvilLoggerTests.java index 019438c8ee677..2a8056b7dbf0b 100644 --- a/qa/evil-tests/src/test/java/org/opensearch/common/logging/EvilLoggerTests.java +++ b/qa/evil-tests/src/test/java/org/opensearch/common/logging/EvilLoggerTests.java @@ -91,9 +91,9 @@ public void testLocationInfoTest() throws IOException, UserException { testLogger.debug("This is a debug message"); testLogger.trace("This is a trace message"); final String path = - System.getProperty("es.logs.base_path") + + System.getProperty("opensearch.logs.base_path") + System.getProperty("file.separator") + - System.getProperty("es.logs.cluster_name") + + System.getProperty("opensearch.logs.cluster_name") + ".log"; final List events = Files.readAllLines(PathUtils.get(path)); assertThat(events.size(), equalTo(5)); @@ -164,9 +164,9 @@ public void testConcurrentDeprecationLogger() throws IOException, UserException, barrier.await(); final String deprecationPath = - System.getProperty("es.logs.base_path") + + System.getProperty("opensearch.logs.base_path") + System.getProperty("file.separator") + - System.getProperty("es.logs.cluster_name") + + System.getProperty("opensearch.logs.cluster_name") + "_deprecation.log"; final List deprecationEvents = Files.readAllLines(PathUtils.get(deprecationPath)); // we appended an integer to each log message, use that for sorting @@ -200,9 +200,9 @@ public void testDeprecatedSettings() throws IOException, UserException { } final String deprecationPath = - System.getProperty("es.logs.base_path") + + System.getProperty("opensearch.logs.base_path") + System.getProperty("file.separator") + - System.getProperty("es.logs.cluster_name") + + System.getProperty("opensearch.logs.cluster_name") + "_deprecation.log"; final List deprecationEvents = Files.readAllLines(PathUtils.get(deprecationPath)); if (iterations > 0) { @@ -241,9 +241,9 @@ public void testPrefixLogger() throws IOException, IllegalAccessException, UserE logger.info(new ParameterizedMessage("{}", "test"), e); final String path = - System.getProperty("es.logs.base_path") + + System.getProperty("opensearch.logs.base_path") + System.getProperty("file.separator") + - System.getProperty("es.logs.cluster_name") + + System.getProperty("opensearch.logs.cluster_name") + ".log"; final List events = Files.readAllLines(PathUtils.get(path)); @@ -279,10 +279,10 @@ public void testProperties() throws IOException, UserException { .build(); setupLogging("minimal", settings); - assertNotNull(System.getProperty("es.logs.base_path")); + assertNotNull(System.getProperty("opensearch.logs.base_path")); - assertThat(System.getProperty("es.logs.cluster_name"), equalTo(ClusterName.CLUSTER_NAME_SETTING.get(settings).value())); - assertThat(System.getProperty("es.logs.node_name"), equalTo(Node.NODE_NAME_SETTING.get(settings))); + assertThat(System.getProperty("opensearch.logs.cluster_name"), equalTo(ClusterName.CLUSTER_NAME_SETTING.get(settings).value())); + assertThat(System.getProperty("opensearch.logs.node_name"), equalTo(Node.NODE_NAME_SETTING.get(settings))); } public void testNoNodeNameInPatternWarning() throws IOException, UserException { @@ -290,9 +290,9 @@ public void testNoNodeNameInPatternWarning() throws IOException, UserException { LogConfigurator.setNodeName(nodeName); setupLogging("no_node_name"); final String path = - System.getProperty("es.logs.base_path") + + System.getProperty("opensearch.logs.base_path") + System.getProperty("file.separator") + - System.getProperty("es.logs.cluster_name") + ".log"; + System.getProperty("opensearch.logs.cluster_name") + ".log"; final List events = Files.readAllLines(PathUtils.get(path)); assertThat(events.size(), equalTo(2)); final String location = "org.opensearch.common.logging.LogConfigurator"; diff --git a/qa/evil-tests/src/test/resources/org/opensearch/common/logging/config/log4j2.properties b/qa/evil-tests/src/test/resources/org/opensearch/common/logging/config/log4j2.properties index 255c53a8d7dd8..95449bbcdf846 100644 --- a/qa/evil-tests/src/test/resources/org/opensearch/common/logging/config/log4j2.properties +++ b/qa/evil-tests/src/test/resources/org/opensearch/common/logging/config/log4j2.properties @@ -5,7 +5,7 @@ appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c] [%test_thread_info] appender.file.type = File appender.file.name = file -appender.file.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}.log +appender.file.fileName = ${sys:opensearch.logs.base_path}${sys:file.separator}${sys:opensearch.logs.cluster_name}.log appender.file.layout.type = PatternLayout appender.file.layout.pattern = [%p][%l] [%test_thread_info]%marker %m%n @@ -21,7 +21,7 @@ logger.test.additivity = false appender.deprecation_file.type = File appender.deprecation_file.name = deprecation_file -appender.deprecation_file.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_deprecation.log +appender.deprecation_file.fileName = ${sys:opensearch.logs.base_path}${sys:file.separator}${sys:opensearch.logs.cluster_name}_deprecation.log appender.deprecation_file.layout.type = PatternLayout appender.deprecation_file.layout.pattern = [%p][%l] [%test_thread_info]%marker %m%n appender.deprecation_file.filter.rate_limit.type = RateLimitingFilter diff --git a/qa/evil-tests/src/test/resources/org/opensearch/common/logging/deprecation/log4j2.properties b/qa/evil-tests/src/test/resources/org/opensearch/common/logging/deprecation/log4j2.properties index e488da2f95f58..2f743114395bb 100644 --- a/qa/evil-tests/src/test/resources/org/opensearch/common/logging/deprecation/log4j2.properties +++ b/qa/evil-tests/src/test/resources/org/opensearch/common/logging/deprecation/log4j2.properties @@ -5,7 +5,7 @@ appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c] [%test_thread_info] appender.file.type = File appender.file.name = file -appender.file.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}.log +appender.file.fileName = ${sys:opensearch.logs.base_path}${sys:file.separator}${sys:opensearch.logs.cluster_name}.log appender.file.layout.type = PatternLayout appender.file.layout.pattern = [%p][%l] [%test_thread_info]%marker %m%n @@ -15,7 +15,7 @@ rootLogger.appenderRef.file.ref = file appender.deprecation_file.type = File appender.deprecation_file.name = deprecation_file -appender.deprecation_file.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_deprecation.log +appender.deprecation_file.fileName = ${sys:opensearch.logs.base_path}${sys:file.separator}${sys:opensearch.logs.cluster_name}_deprecation.log appender.deprecation_file.layout.type = PatternLayout appender.deprecation_file.layout.pattern = [%p][%l] [%test_thread_info]%marker %m%n appender.deprecation_file.filter.rate_limit.type = RateLimitingFilter diff --git a/qa/evil-tests/src/test/resources/org/opensearch/common/logging/location_info/log4j2.properties b/qa/evil-tests/src/test/resources/org/opensearch/common/logging/location_info/log4j2.properties index ee59755a2d784..580496252e74d 100644 --- a/qa/evil-tests/src/test/resources/org/opensearch/common/logging/location_info/log4j2.properties +++ b/qa/evil-tests/src/test/resources/org/opensearch/common/logging/location_info/log4j2.properties @@ -5,7 +5,7 @@ appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c] [%test_thread_info] appender.file.type = File appender.file.name = file -appender.file.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}.log +appender.file.fileName = ${sys:opensearch.logs.base_path}${sys:file.separator}${sys:opensearch.logs.cluster_name}.log appender.file.layout.type = PatternLayout appender.file.layout.pattern = [%p][%l] [%test_thread_info]%marker %m%n diff --git a/qa/evil-tests/src/test/resources/org/opensearch/common/logging/no_node_name/log4j2.properties b/qa/evil-tests/src/test/resources/org/opensearch/common/logging/no_node_name/log4j2.properties index 1a1f70c7a2657..370648555677d 100644 --- a/qa/evil-tests/src/test/resources/org/opensearch/common/logging/no_node_name/log4j2.properties +++ b/qa/evil-tests/src/test/resources/org/opensearch/common/logging/no_node_name/log4j2.properties @@ -5,7 +5,7 @@ appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c] %marker%m%n appender.file.type = File appender.file.name = file -appender.file.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}.log +appender.file.fileName = ${sys:opensearch.logs.base_path}${sys:file.separator}${sys:opensearch.logs.cluster_name}.log appender.file.layout.type = PatternLayout appender.file.layout.pattern = [%p][%l] %marker%m%n @@ -15,7 +15,7 @@ rootLogger.appenderRef.file.ref = file appender.deprecation_file.type = File appender.deprecation_file.name = deprecation_file -appender.deprecation_file.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_deprecation.log +appender.deprecation_file.fileName = ${sys:opensearch.logs.base_path}${sys:file.separator}${sys:opensearch.logs.cluster_name}_deprecation.log appender.deprecation_file.layout.type = PatternLayout appender.deprecation_file.layout.pattern = [%p][%l] %marker%m%n appender.deprecation_file.filter.rate_limit.type = RateLimitingFilter diff --git a/qa/evil-tests/src/test/resources/org/opensearch/common/logging/prefix/log4j2.properties b/qa/evil-tests/src/test/resources/org/opensearch/common/logging/prefix/log4j2.properties index 199fddc31c681..04c9012eeec43 100644 --- a/qa/evil-tests/src/test/resources/org/opensearch/common/logging/prefix/log4j2.properties +++ b/qa/evil-tests/src/test/resources/org/opensearch/common/logging/prefix/log4j2.properties @@ -5,7 +5,7 @@ appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c] [%test_thread_info] appender.file.type = File appender.file.name = file -appender.file.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}.log +appender.file.fileName = ${sys:opensearch.logs.base_path}${sys:file.separator}${sys:opensearch.logs.cluster_name}.log appender.file.layout.type = PatternLayout appender.file.layout.pattern = [%test_thread_info]%marker %m%n diff --git a/qa/evil-tests/src/test/resources/org/opensearch/common/logging/settings/log4j2.properties b/qa/evil-tests/src/test/resources/org/opensearch/common/logging/settings/log4j2.properties index 1805c3cafa06e..b140c06296a10 100644 --- a/qa/evil-tests/src/test/resources/org/opensearch/common/logging/settings/log4j2.properties +++ b/qa/evil-tests/src/test/resources/org/opensearch/common/logging/settings/log4j2.properties @@ -5,7 +5,7 @@ appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c] [%test_thread_info] appender.file.type = File appender.file.name = file -appender.file.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}.log +appender.file.fileName = ${sys:opensearch.logs.base_path}${sys:file.separator}${sys:opensearch.logs.cluster_name}.log appender.file.layout.type = PatternLayout appender.file.layout.pattern = [%p][%l] [%test_thread_info]%marker %m%n @@ -15,7 +15,7 @@ rootLogger.appenderRef.file.ref = file appender.deprecation_file.type = File appender.deprecation_file.name = deprecation_file -appender.deprecation_file.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_deprecation.log +appender.deprecation_file.fileName = ${sys:opensearch.logs.base_path}${sys:file.separator}${sys:opensearch.logs.cluster_name}_deprecation.log appender.deprecation_file.layout.type = PatternLayout appender.deprecation_file.layout.pattern = [%p][%l] [%test_thread_info]%marker %m%n appender.deprecation_file.filter.rate_limit.type = RateLimitingFilter diff --git a/qa/logging-config/custom-log4j2.properties b/qa/logging-config/custom-log4j2.properties index aa9b61c7606ff..15af6efaff60d 100644 --- a/qa/logging-config/custom-log4j2.properties +++ b/qa/logging-config/custom-log4j2.properties @@ -7,11 +7,11 @@ logger.action.level = debug appender.rolling.type = RollingFile appender.rolling.name = rolling -appender.rolling.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_server.log +appender.rolling.fileName = ${sys:opensearch.logs.base_path}${sys:file.separator}${sys:opensearch.logs.cluster_name}_server.log appender.rolling.layout.type = PatternLayout -appender.rolling.layout.pattern =%notEmpty{%node_name} %notEmpty{%node_and_cluster_id} %notEmpty{${sys:es.logs.cluster_name}} %m%n +appender.rolling.layout.pattern =%notEmpty{%node_name} %notEmpty{%node_and_cluster_id} %notEmpty{${sys:opensearch.logs.cluster_name}} %m%n -appender.rolling.filePattern = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}-%d{yyyy-MM-dd}-%i.log.gz +appender.rolling.filePattern = ${sys:opensearch.logs.base_path}${sys:file.separator}${sys:opensearch.logs.cluster_name}-%d{yyyy-MM-dd}-%i.log.gz appender.rolling.policies.type = Policies appender.rolling.policies.time.type = TimeBasedTriggeringPolicy appender.rolling.policies.time.interval = 1 @@ -21,9 +21,9 @@ appender.rolling.policies.size.size = 128MB appender.rolling.strategy.type = DefaultRolloverStrategy appender.rolling.strategy.fileIndex = nomax appender.rolling.strategy.action.type = Delete -appender.rolling.strategy.action.basepath = ${sys:es.logs.base_path} +appender.rolling.strategy.action.basepath = ${sys:opensearch.logs.base_path} appender.rolling.strategy.action.condition.type = IfFileName -appender.rolling.strategy.action.condition.glob = ${sys:es.logs.cluster_name}-* +appender.rolling.strategy.action.condition.glob = ${sys:opensearch.logs.cluster_name}-* appender.rolling.strategy.action.condition.nested_condition.type = IfAccumulatedFileSize appender.rolling.strategy.action.condition.nested_condition.exceeds = 2GB diff --git a/qa/logging-config/src/test/java/org/opensearch/common/logging/ESJsonLayoutTests.java b/qa/logging-config/src/test/java/org/opensearch/common/logging/ESJsonLayoutTests.java index a141cb1880da2..cad8314dcc43a 100644 --- a/qa/logging-config/src/test/java/org/opensearch/common/logging/ESJsonLayoutTests.java +++ b/qa/logging-config/src/test/java/org/opensearch/common/logging/ESJsonLayoutTests.java @@ -46,7 +46,7 @@ public void testLayout() { "\"timestamp\": \"%d{yyyy-MM-dd'T'HH:mm:ss,SSSZZ}\", " + "\"level\": \"%p\", " + "\"component\": \"%c{1.}\", " + - "\"cluster.name\": \"${sys:es.logs.cluster_name}\", " + + "\"cluster.name\": \"${sys:opensearch.logs.cluster_name}\", " + "\"node.name\": \"%node_name\", " + "\"message\": \"%notEmpty{%enc{%marker}{JSON} }%enc{%.-10000m}{JSON}\"" + "%notEmpty{, %node_and_cluster_id }" + @@ -66,7 +66,7 @@ public void testLayoutWithAdditionalFields() { "\"timestamp\": \"%d{yyyy-MM-dd'T'HH:mm:ss,SSSZZ}\", " + "\"level\": \"%p\", " + "\"component\": \"%c{1.}\", " + - "\"cluster.name\": \"${sys:es.logs.cluster_name}\", " + + "\"cluster.name\": \"${sys:opensearch.logs.cluster_name}\", " + "\"node.name\": \"%node_name\", " + "\"message\": \"%notEmpty{%enc{%marker}{JSON} }%enc{%.-10000m}{JSON}\"" + "%notEmpty{, \"x-opaque-id\": \"%ESMessageField{x-opaque-id}\"}" + @@ -88,7 +88,7 @@ public void testLayoutWithAdditionalFieldOverride() { "\"timestamp\": \"%d{yyyy-MM-dd'T'HH:mm:ss,SSSZZ}\", " + "\"level\": \"%p\", " + "\"component\": \"%c{1.}\", " + - "\"cluster.name\": \"${sys:es.logs.cluster_name}\", " + + "\"cluster.name\": \"${sys:opensearch.logs.cluster_name}\", " + "\"node.name\": \"%node_name\"" + "%notEmpty{, \"message\": \"%ESMessageField{message}\"}" + "%notEmpty{, %node_and_cluster_id }" + diff --git a/qa/logging-config/src/test/java/org/opensearch/common/logging/JsonLoggerTests.java b/qa/logging-config/src/test/java/org/opensearch/common/logging/JsonLoggerTests.java index 1efdadbdc679a..afadc6418da05 100644 --- a/qa/logging-config/src/test/java/org/opensearch/common/logging/JsonLoggerTests.java +++ b/qa/logging-config/src/test/java/org/opensearch/common/logging/JsonLoggerTests.java @@ -86,8 +86,8 @@ public void testDeprecatedMessage() throws Exception { testLogger.deprecate("someKey", "deprecated message1"); final Path path = PathUtils.get( - System.getProperty("es.logs.base_path"), - System.getProperty("es.logs.cluster_name") + "_deprecated.json" + System.getProperty("opensearch.logs.base_path"), + System.getProperty("opensearch.logs.cluster_name") + "_deprecated.json" ); try (Stream> stream = JsonLogsStream.mapStreamFrom(path)) { @@ -122,8 +122,8 @@ public void testDeprecatedMessageWithoutXOpaqueId() throws IOException { testLogger.info(new DeprecatedMessage("key", null, "deprecated message3")); testLogger.info("deprecated message4"); - final Path path = PathUtils.get(System.getProperty("es.logs.base_path"), - System.getProperty("es.logs.cluster_name") + "_deprecated.json"); + final Path path = PathUtils.get(System.getProperty("opensearch.logs.base_path"), + System.getProperty("opensearch.logs.cluster_name") + "_deprecated.json"); try (Stream> stream = JsonLogsStream.mapStreamFrom(path)) { List> jsonLogs = stream .collect(Collectors.toList()); @@ -283,8 +283,8 @@ public void testDuplicateLogMessages() throws Exception { deprecationLogger.deprecate("key", "message2"); assertWarnings("message1", "message2"); - final Path path = PathUtils.get(System.getProperty("es.logs.base_path"), - System.getProperty("es.logs.cluster_name") + "_deprecated.json"); + final Path path = PathUtils.get(System.getProperty("opensearch.logs.base_path"), + System.getProperty("opensearch.logs.cluster_name") + "_deprecated.json"); try (Stream> stream = JsonLogsStream.mapStreamFrom(path)) { List> jsonLogs = stream .collect(Collectors.toList()); @@ -312,8 +312,8 @@ public void testDuplicateLogMessages() throws Exception { assertWarnings("message1", "message2"); final Path path = PathUtils.get( - System.getProperty("es.logs.base_path"), - System.getProperty("es.logs.cluster_name") + "_deprecated.json" + System.getProperty("opensearch.logs.base_path"), + System.getProperty("opensearch.logs.cluster_name") + "_deprecated.json" ); try (Stream> stream = JsonLogsStream.mapStreamFrom(path)) { List> jsonLogs = stream.collect(Collectors.toList()); @@ -352,7 +352,7 @@ private List collectLines(Stream stream) { } private Path clusterLogsPath() { - return PathUtils.get(System.getProperty("es.logs.base_path"), System.getProperty("es.logs.cluster_name") + ".log"); + return PathUtils.get(System.getProperty("opensearch.logs.base_path"), System.getProperty("opensearch.logs.cluster_name") + ".log"); } private void setupLogging(final String config) throws IOException, UserException { diff --git a/qa/logging-config/src/test/resources/org/opensearch/common/logging/json_layout/log4j2.properties b/qa/logging-config/src/test/resources/org/opensearch/common/logging/json_layout/log4j2.properties index 708d39247491e..d38f5e0bd0755 100644 --- a/qa/logging-config/src/test/resources/org/opensearch/common/logging/json_layout/log4j2.properties +++ b/qa/logging-config/src/test/resources/org/opensearch/common/logging/json_layout/log4j2.properties @@ -5,13 +5,13 @@ appender.console.layout.type_name = console appender.file.type = File appender.file.name = file -appender.file.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}.log +appender.file.fileName = ${sys:opensearch.logs.base_path}${sys:file.separator}${sys:opensearch.logs.cluster_name}.log appender.file.layout.type = ESJsonLayout appender.file.layout.type_name = file appender.deprecated.type = File appender.deprecated.name = deprecated -appender.deprecated.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_deprecated.json +appender.deprecated.fileName = ${sys:opensearch.logs.base_path}${sys:file.separator}${sys:opensearch.logs.cluster_name}_deprecated.json appender.deprecated.layout.type = ESJsonLayout appender.deprecated.layout.type_name = deprecation appender.deprecated.layout.esmessagefields = x-opaque-id @@ -26,7 +26,7 @@ appender.deprecatedconsole.filter.rate_limit.type = RateLimitingFilter appender.index_search_slowlog_rolling.type = File appender.index_search_slowlog_rolling.name = index_search_slowlog_rolling -appender.index_search_slowlog_rolling.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs\ +appender.index_search_slowlog_rolling.fileName = ${sys:opensearch.logs.base_path}${sys:file.separator}${sys:opensearch.logs\ .cluster_name}_index_search_slowlog.json appender.index_search_slowlog_rolling.layout.type = ESJsonLayout appender.index_search_slowlog_rolling.layout.type_name = index_search_slowlog diff --git a/qa/os/src/test/resources/log4j2-test.properties b/qa/os/src/test/resources/log4j2-test.properties index 842c9c79d7963..3285a92952438 100644 --- a/qa/os/src/test/resources/log4j2-test.properties +++ b/qa/os/src/test/resources/log4j2-test.properties @@ -3,5 +3,5 @@ appender.console.name = console appender.console.layout.type = PatternLayout appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] [%test_thread_info]%marker %m%n -rootLogger.level = ${sys:tests.es.logger.level:-info} +rootLogger.level = ${sys:tests.opensearch.logger.level:-info} rootLogger.appenderRef.console.ref = console diff --git a/qa/smoke-test-http/build.gradle b/qa/smoke-test-http/build.gradle index 8aaaea03c2070..89365e18e5f5a 100644 --- a/qa/smoke-test-http/build.gradle +++ b/qa/smoke-test-http/build.gradle @@ -32,5 +32,5 @@ integTest { * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each * other if we allow them to set the number of available processors as it's set-once in Netty. */ - systemProperty 'es.set.netty.runtime.available.processors', 'false' + systemProperty 'opensearch.set.netty.runtime.available.processors', 'false' } diff --git a/server/src/main/java/org/apache/lucene/index/ShuffleForcedMergePolicy.java b/server/src/main/java/org/apache/lucene/index/ShuffleForcedMergePolicy.java index 277c35e40cc9f..92c602b9806b9 100644 --- a/server/src/main/java/org/apache/lucene/index/ShuffleForcedMergePolicy.java +++ b/server/src/main/java/org/apache/lucene/index/ShuffleForcedMergePolicy.java @@ -35,7 +35,7 @@ * first, to be efficient at finding the most recent documents too. */ public class ShuffleForcedMergePolicy extends FilterMergePolicy { - private static final String SHUFFLE_MERGE_KEY = "es.shuffle_merge"; + private static final String SHUFFLE_MERGE_KEY = "opensearch.shuffle_merge"; public ShuffleForcedMergePolicy(MergePolicy in) { super(in); diff --git a/server/src/main/java/org/opensearch/Build.java b/server/src/main/java/org/opensearch/Build.java index fa34efb3544a3..fe1eab818d97e 100644 --- a/server/src/main/java/org/opensearch/Build.java +++ b/server/src/main/java/org/opensearch/Build.java @@ -93,7 +93,7 @@ public static Type fromDisplayName(final String displayName, final boolean stric final String version; // these are parsed at startup, and we require that we are able to recognize the values passed in by the startup scripts - type = Type.fromDisplayName(System.getProperty("es.distribution.type", "unknown"), true); + type = Type.fromDisplayName(System.getProperty("opensearch.distribution.type", "unknown"), true); final String opensearchPrefix = "opensearch-" + Version.CURRENT; final URL url = getOpenSearchCodeSourceLocation(); diff --git a/server/src/main/java/org/opensearch/OpenSearchException.java b/server/src/main/java/org/opensearch/OpenSearchException.java index 55f3a7ee32fa6..83420cb11666d 100644 --- a/server/src/main/java/org/opensearch/OpenSearchException.java +++ b/server/src/main/java/org/opensearch/OpenSearchException.java @@ -78,11 +78,11 @@ public class OpenSearchException extends RuntimeException implements ToXContentF public static final String REST_EXCEPTION_SKIP_STACK_TRACE = "rest.exception.stacktrace.skip"; public static final boolean REST_EXCEPTION_SKIP_STACK_TRACE_DEFAULT = true; private static final boolean REST_EXCEPTION_SKIP_CAUSE_DEFAULT = false; - private static final String INDEX_METADATA_KEY = "es.index"; - private static final String INDEX_METADATA_KEY_UUID = "es.index_uuid"; - private static final String SHARD_METADATA_KEY = "es.shard"; - private static final String RESOURCE_METADATA_TYPE_KEY = "es.resource.type"; - private static final String RESOURCE_METADATA_ID_KEY = "es.resource.id"; + private static final String INDEX_METADATA_KEY = "opensearch.index"; + private static final String INDEX_METADATA_KEY_UUID = "opensearch.index_uuid"; + private static final String SHARD_METADATA_KEY = "opensearch.shard"; + private static final String RESOURCE_METADATA_TYPE_KEY = "opensearch.resource.type"; + private static final String RESOURCE_METADATA_ID_KEY = "opensearch.resource.id"; private static final String TYPE = "type"; private static final String REASON = "reason"; @@ -153,9 +153,9 @@ public void addMetadata(String key, String... values) { * If the provided key is already present, the corresponding metadata will be replaced */ public void addMetadata(String key, List values) { - //we need to enforce this otherwise bw comp doesn't work properly, as "es." was the previous criteria to split headers in two sets - if (key.startsWith("es.") == false) { - throw new IllegalArgumentException("exception metadata must start with [es.], found [" + key + "] instead"); + //we need to enforce this otherwise bw comp doesn't work properly, as "opensearch." was the previous criteria to split headers in two sets + if (key.startsWith("opensearch.") == false) { + throw new IllegalArgumentException("exception metadata must start with [opensearch.], found [" + key + "] instead"); } this.metadata.put(key, values); } @@ -184,9 +184,9 @@ protected Map> getMetadata() { * This method will replace existing header if a header with the same key already exists */ public void addHeader(String key, List value) { - //we need to enforce this otherwise bw comp doesn't work properly, as "es." was the previous criteria to split headers in two sets - if (key.startsWith("es.")) { - throw new IllegalArgumentException("exception headers must not start with [es.], found [" + key + "] instead"); + //we need to enforce this otherwise bw comp doesn't work properly, as "opensearch." was the previous criteria to split headers in two sets + if (key.startsWith("opensearch.")) { + throw new IllegalArgumentException("exception headers must not start with [opensearch.], found [" + key + "] instead"); } this.headers.put(key, value); } @@ -333,7 +333,7 @@ protected static void innerToXContent(XContentBuilder builder, Params params, builder.field(REASON, message); for (Map.Entry> entry : metadata.entrySet()) { - headerToXContent(builder, entry.getKey().substring("es.".length()), entry.getValue()); + headerToXContent(builder, entry.getKey().substring("opensearch.".length()), entry.getValue()); } if (throwable instanceof OpenSearchException) { @@ -497,11 +497,11 @@ public static OpenSearchException innerFromXContent(XContentParser parser, boole for (Map.Entry> entry : metadata.entrySet()) { //subclasses can print out additional metadata through the metadataToXContent method. Simple key-value pairs will be //parsed back and become part of this metadata set, while objects and arrays are not supported when parsing back. - //Those key-value pairs become part of the metadata set and inherit the "es." prefix as that is currently required + //Those key-value pairs become part of the metadata set and inherit the "opensearch." prefix as that is currently required //by addMetadata. The prefix will get stripped out when printing metadata out so it will be effectively invisible. //TODO move subclasses that print out simple metadata to using addMetadata directly and support also numbers and booleans. //TODO rename metadataToXContent and have only SearchPhaseExecutionException use it, which prints out complex objects - e.addMetadata("es." + entry.getKey(), entry.getValue()); + e.addMetadata("opensearch." + entry.getKey(), entry.getValue()); } for (Map.Entry> header : headers.entrySet()) { e.addHeader(header.getKey(), header.getValue()); 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 57d298715934c..b88ab00af4f3a 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 @@ -50,9 +50,9 @@ public class TransportClusterStateAction extends TransportMasterNodeReadAction errors = new ArrayList<>(); final List ignoredErrors = new ArrayList<>(); - final String esEnforceBootstrapChecks = System.getProperty(ES_ENFORCE_BOOTSTRAP_CHECKS); + final String esEnforceBootstrapChecks = System.getProperty(OPENSEARCH_ENFORCE_BOOTSTRAP_CHECKS); final boolean enforceBootstrapChecks; if (esEnforceBootstrapChecks == null) { enforceBootstrapChecks = false; @@ -130,7 +130,7 @@ static void check( String.format( Locale.ROOT, "[%s] must be [true] but was [%s]", - ES_ENFORCE_BOOTSTRAP_CHECKS, + OPENSEARCH_ENFORCE_BOOTSTRAP_CHECKS, esEnforceBootstrapChecks); throw new IllegalArgumentException(message); } diff --git a/server/src/main/java/org/opensearch/bootstrap/StartupException.java b/server/src/main/java/org/opensearch/bootstrap/StartupException.java index c565eb3ec5cf5..f70fc02373985 100644 --- a/server/src/main/java/org/opensearch/bootstrap/StartupException.java +++ b/server/src/main/java/org/opensearch/bootstrap/StartupException.java @@ -111,13 +111,13 @@ private void printStackTrace(Consumer consumer) { // if its a guice exception, the whole thing really will not be in the log, its megabytes. // refer to the hack in bootstrap, where we don't log it if (originalCause instanceof CreationException == false) { - final String basePath = System.getProperty("es.logs.base_path"); + final String basePath = System.getProperty("opensearch.logs.base_path"); // It's possible to fail before logging has been configured, in which case there's no point // suggested that the user look in the log file. if (basePath != null) { - final String logPath = System.getProperty("es.logs.base_path") + final String logPath = System.getProperty("opensearch.logs.base_path") + System.getProperty("file.separator") - + System.getProperty("es.logs.cluster_name") + + System.getProperty("opensearch.logs.cluster_name") + ".log"; consumer.accept("For complete error details, refer to the log at " + logPath); diff --git a/server/src/main/java/org/opensearch/cli/CommandLoggingConfigurator.java b/server/src/main/java/org/opensearch/cli/CommandLoggingConfigurator.java index 259660ccab0d3..4b40e56358458 100644 --- a/server/src/main/java/org/opensearch/cli/CommandLoggingConfigurator.java +++ b/server/src/main/java/org/opensearch/cli/CommandLoggingConfigurator.java @@ -24,18 +24,18 @@ import org.opensearch.common.settings.Settings; /** - * Holder class for method to configure logging without Elasticsearch configuration files for use in CLI tools that will not read such + * Holder class for method to configure logging without OpenSearch configuration files for use in CLI tools that will not read such * files. */ public final class CommandLoggingConfigurator { /** - * Configures logging without Elasticsearch configuration files based on the system property "es.logger.level" only. As such, any + * Configures logging without OpenSearch configuration files based on the system property "opensearch.logger.level" only. As such, any * logging will be written to the console. */ public static void configureLoggingWithoutConfig() { // initialize default for es.logger.level because we will not read the log4j2.properties - final String loggerLevel = System.getProperty("es.logger.level", Level.INFO.name()); + final String loggerLevel = System.getProperty("opensearch.logger.level", Level.INFO.name()); final Settings settings = Settings.builder().put("logger.level", loggerLevel).build(); LogConfigurator.configureWithoutConfig(settings); } diff --git a/server/src/main/java/org/opensearch/cli/EnvironmentAwareCommand.java b/server/src/main/java/org/opensearch/cli/EnvironmentAwareCommand.java index 3db6d38da2ac8..5abafd211059f 100644 --- a/server/src/main/java/org/opensearch/cli/EnvironmentAwareCommand.java +++ b/server/src/main/java/org/opensearch/cli/EnvironmentAwareCommand.java @@ -79,9 +79,9 @@ protected void execute(Terminal terminal, OptionSet options) throws Exception { settings.put(kvp.key, kvp.value); } - putSystemPropertyIfSettingIsMissing(settings, "path.data", "es.path.data"); - putSystemPropertyIfSettingIsMissing(settings, "path.home", "es.path.home"); - putSystemPropertyIfSettingIsMissing(settings, "path.logs", "es.path.logs"); + putSystemPropertyIfSettingIsMissing(settings, "path.data", "opensearch.path.data"); + putSystemPropertyIfSettingIsMissing(settings, "path.home", "opensearch.path.home"); + putSystemPropertyIfSettingIsMissing(settings, "path.logs", "opensearch.path.logs"); execute(terminal, options, createEnv(settings)); } @@ -93,9 +93,9 @@ protected Environment createEnv(final Map settings) throws UserE /** Create an {@link Environment} for the command to use. Overrideable for tests. */ protected final Environment createEnv(final Settings baseSettings, final Map settings) throws UserException { - final String esPathConf = System.getProperty("es.path.conf"); + final String esPathConf = System.getProperty("opensearch.path.conf"); if (esPathConf == null) { - throw new UserException(ExitCodes.CONFIG, "the system property [es.path.conf] must be set"); + throw new UserException(ExitCodes.CONFIG, "the system property [opensearch.path.conf] must be set"); } return InternalSettingsPreparer.prepareEnvironment(baseSettings, settings, getConfigPath(esPathConf), 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 4f4f08e270375..77510576c3e56 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/IndexMetadata.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/IndexMetadata.java @@ -138,9 +138,9 @@ static Setting buildNumberOfShardsSetting() { * if a cluster should allow to create more than 1024 shards per index. NOTE: this does not limit the number of shards * per cluster. this also prevents creating stuff like a new index with millions of shards by accident which essentially * kills the entire cluster with OOM on the spot.*/ - final int maxNumShards = Integer.parseInt(System.getProperty("es.index.max_number_of_shards", "1024")); + final int maxNumShards = Integer.parseInt(System.getProperty("opensearch.index.max_number_of_shards", "1024")); if (maxNumShards < 1) { - throw new IllegalArgumentException("es.index.max_number_of_shards must be > 0"); + throw new IllegalArgumentException("opensearch.index.max_number_of_shards must be > 0"); } return Setting.intSetting(SETTING_NUMBER_OF_SHARDS, 1, 1, maxNumShards, Property.IndexScope, Property.Final); } 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 bdc08c4fcd33b..179a91b3a986c 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/IndexNameExpressionResolver.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/IndexNameExpressionResolver.java @@ -65,7 +65,7 @@ public class IndexNameExpressionResolver { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(IndexNameExpressionResolver.class); - public static final String EXCLUDED_DATA_STREAMS_KEY = "es.excluded_ds"; + public static final String EXCLUDED_DATA_STREAMS_KEY = "opensearch.excluded_ds"; public static final String SYSTEM_INDEX_ACCESS_CONTROL_HEADER_KEY = "_system_index_access_allowed"; public static final Version SYSTEM_INDEX_ENFORCEMENT_VERSION = Version.V_7_10_0; diff --git a/server/src/main/java/org/opensearch/cluster/routing/OperationRouting.java b/server/src/main/java/org/opensearch/cluster/routing/OperationRouting.java index 6a390fcafa925..2bf52716ee15e 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/OperationRouting.java +++ b/server/src/main/java/org/opensearch/cluster/routing/OperationRouting.java @@ -52,7 +52,7 @@ public class OperationRouting { Setting.Property.Dynamic, Setting.Property.NodeScope); private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(OperationRouting.class); - private static final String IGNORE_AWARENESS_ATTRIBUTES_PROPERTY = "es.search.ignore_awareness_attributes"; + private static final String IGNORE_AWARENESS_ATTRIBUTES_PROPERTY = "opensearch.search.ignore_awareness_attributes"; static final String IGNORE_AWARENESS_ATTRIBUTES_DEPRECATION_MESSAGE = "searches will not be routed based on awareness attributes starting in version 8.0.0; " + "to opt into this behaviour now please set the system property [" + IGNORE_AWARENESS_ATTRIBUTES_PROPERTY + "] to [true]"; diff --git a/server/src/main/java/org/opensearch/cluster/routing/allocation/DiskThresholdSettings.java b/server/src/main/java/org/opensearch/cluster/routing/allocation/DiskThresholdSettings.java index b69280e0c49cc..c70c9d7e11954 100644 --- a/server/src/main/java/org/opensearch/cluster/routing/allocation/DiskThresholdSettings.java +++ b/server/src/main/java/org/opensearch/cluster/routing/allocation/DiskThresholdSettings.java @@ -75,7 +75,7 @@ public class DiskThresholdSettings { private volatile Double freeDiskThresholdFloodStage; private volatile ByteSizeValue freeBytesThresholdFloodStage; private static final boolean autoReleaseIndexEnabled; - public static final String AUTO_RELEASE_INDEX_ENABLED_KEY = "es.disk.auto_release_flood_stage_block"; + public static final String AUTO_RELEASE_INDEX_ENABLED_KEY = "opensearch.disk.auto_release_flood_stage_block"; static { final String property = System.getProperty(AUTO_RELEASE_INDEX_ENABLED_KEY); diff --git a/server/src/main/java/org/opensearch/common/io/DiskIoBufferPool.java b/server/src/main/java/org/opensearch/common/io/DiskIoBufferPool.java index 93ef8b95206bb..2ab76d780ab38 100644 --- a/server/src/main/java/org/opensearch/common/io/DiskIoBufferPool.java +++ b/server/src/main/java/org/opensearch/common/io/DiskIoBufferPool.java @@ -28,7 +28,7 @@ public class DiskIoBufferPool { public static final int BUFFER_SIZE = StrictMath.toIntExact(ByteSizeValue.parseBytesSizeValue( - System.getProperty("es.disk_io.direct.buffer.size", "64KB"), "es.disk_io.direct.buffer.size").getBytes()); + System.getProperty("opensearch.disk_io.direct.buffer.size", "64KB"), "opensearch.disk_io.direct.buffer.size").getBytes()); public static final int HEAP_BUFFER_SIZE = 8 * 1024; private static final ThreadLocal ioBufferPool = ThreadLocal.withInitial(() -> { diff --git a/server/src/main/java/org/opensearch/common/logging/ESJsonLayout.java b/server/src/main/java/org/opensearch/common/logging/ESJsonLayout.java index 191d92b5d96b3..ddb172975553d 100644 --- a/server/src/main/java/org/opensearch/common/logging/ESJsonLayout.java +++ b/server/src/main/java/org/opensearch/common/logging/ESJsonLayout.java @@ -50,8 +50,8 @@ *
  • timestamp - ISO8601 with additional timezone ID
  • *
  • level - INFO, WARN etc
  • *
  • component - logger name, most of the times class name
  • - *
  • cluster.name - taken from sys:es.logs.cluster_name system property because it is always set
  • - *
  • node.name - taken from NodeNamePatternConverter, as it can be set in runtime as hostname when not set in opensearch.yml
  • + *
  • cluster.name - taken from sys:opensearch.logs.cluster_name system property because it is always set
  • + *
  • node.name - taken from NodeNamePatternConverter, as it can be set in runtime as hostname when not set in elasticsearch.yml
  • *
  • node_and_cluster_id - in json as node.id and cluster.uuid - taken from NodeAndClusterIdConverter and present * once clusterStateUpdate is first received
  • *
  • message - a json escaped message. Multiline messages will be converted to single line with new line explicitly @@ -91,7 +91,7 @@ private String pattern(String type, String[] esMessageFields) { map.put("timestamp", inQuotes("%d{yyyy-MM-dd'T'HH:mm:ss,SSSZZ}")); map.put("level", inQuotes("%p")); map.put("component", inQuotes("%c{1.}")); - map.put("cluster.name", inQuotes("${sys:es.logs.cluster_name}")); + map.put("cluster.name", inQuotes("${sys:opensearch.logs.cluster_name}")); map.put("node.name", inQuotes("%node_name")); map.put("message", inQuotes("%notEmpty{%enc{%marker}{JSON} }%enc{%.-10000m}{JSON}")); diff --git a/server/src/main/java/org/opensearch/common/logging/LogConfigurator.java b/server/src/main/java/org/opensearch/common/logging/LogConfigurator.java index b55878f3dee65..17f83665caef1 100644 --- a/server/src/main/java/org/opensearch/common/logging/LogConfigurator.java +++ b/server/src/main/java/org/opensearch/common/logging/LogConfigurator.java @@ -282,13 +282,13 @@ private static void configureLoggerLevels(final Settings settings) { * properties here: *
      *
    • - * {@code es.logs.base_path} the base path containing the log files + * {@code opensearch.logs.base_path} the base path containing the log files *
    • *
    • - * {@code es.logs.cluster_name} the cluster name, used as the prefix of log filenames in the default configuration + * {@code opensearch.logs.cluster_name} the cluster name, used as the prefix of log filenames in the default configuration *
    • *
    • - * {@code es.logs.node_name} the node name, can be used as part of log filenames + * {@code opensearch.logs.node_name} the node name, can be used as part of log filenames *
    • *
    * @@ -297,9 +297,9 @@ private static void configureLoggerLevels(final Settings settings) { */ @SuppressForbidden(reason = "sets system property for logging configuration") private static void setLogConfigurationSystemProperty(final Path logsPath, final Settings settings) { - System.setProperty("es.logs.base_path", logsPath.toString()); - System.setProperty("es.logs.cluster_name", ClusterName.CLUSTER_NAME_SETTING.get(settings).value()); - System.setProperty("es.logs.node_name", Node.NODE_NAME_SETTING.get(settings)); + System.setProperty("opensearch.logs.base_path", logsPath.toString()); + System.setProperty("opensearch.logs.cluster_name", ClusterName.CLUSTER_NAME_SETTING.get(settings).value()); + System.setProperty("opensearch.logs.node_name", Node.NODE_NAME_SETTING.get(settings)); } } diff --git a/server/src/main/java/org/opensearch/common/settings/SecureSetting.java b/server/src/main/java/org/opensearch/common/settings/SecureSetting.java index bc9c5601511e6..fd8bcfe025c21 100644 --- a/server/src/main/java/org/opensearch/common/settings/SecureSetting.java +++ b/server/src/main/java/org/opensearch/common/settings/SecureSetting.java @@ -35,7 +35,7 @@ public abstract class SecureSetting extends Setting { /** Determines whether legacy settings with sensitive values should be allowed. */ - private static final boolean ALLOW_INSECURE_SETTINGS = Booleans.parseBoolean(System.getProperty("es.allow_insecure_settings", "false")); + private static final boolean ALLOW_INSECURE_SETTINGS = Booleans.parseBoolean(System.getProperty("opensearch.allow_insecure_settings", "false")); private static final Set ALLOWED_PROPERTIES = EnumSet.of(Property.Deprecated, Property.Consistent); diff --git a/server/src/main/java/org/opensearch/http/HttpInfo.java b/server/src/main/java/org/opensearch/http/HttpInfo.java index 8773ea25244e3..561d4b5d032a3 100644 --- a/server/src/main/java/org/opensearch/http/HttpInfo.java +++ b/server/src/main/java/org/opensearch/http/HttpInfo.java @@ -36,7 +36,7 @@ public class HttpInfo implements ReportingService.Info { private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(HttpInfo.class); /** Deprecated property, just here for deprecation logging in 7.x. */ - private static final boolean CNAME_IN_PUBLISH_HOST = System.getProperty("es.http.cname_in_publish_address") != null; + private static final boolean CNAME_IN_PUBLISH_HOST = System.getProperty("opensearch.http.cname_in_publish_address") != null; private final BoundTransportAddress address; private final long maxContentLength; @@ -74,7 +74,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws if (CNAME_IN_PUBLISH_HOST) { deprecationLogger.deprecate( "cname_in_publish_address", - "es.http.cname_in_publish_address system property is deprecated and no longer affects http.publish_address " + + "opensearch.http.cname_in_publish_address system property is deprecated and no longer affects http.publish_address " + "formatting. Remove this property to get rid of this deprecation warning." ); } 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 2c9d300e97264..e7a9696cadf81 100644 --- a/server/src/main/java/org/opensearch/index/engine/EngineConfig.java +++ b/server/src/main/java/org/opensearch/index/engine/EngineConfig.java @@ -160,7 +160,7 @@ public EngineConfig(ShardId shardId, ThreadPool threadPool, // Add an escape hatch in case this change proves problematic - it used // to be a fixed amound of RAM: 256 MB. // TODO: Remove this escape hatch in 8.x - final String escapeHatchProperty = "es.index.memory.max_index_buffer_size"; + final String escapeHatchProperty = "opensearch.index.memory.max_index_buffer_size"; String maxBufferSize = System.getProperty(escapeHatchProperty); if (maxBufferSize != null) { indexingBufferSize = MemorySizeValue.parseBytesSizeValueOrHeapRatio(maxBufferSize, escapeHatchProperty); 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 a77d032f9af52..8528397a95ec4 100644 --- a/server/src/main/java/org/opensearch/index/engine/InternalEngine.java +++ b/server/src/main/java/org/opensearch/index/engine/InternalEngine.java @@ -2312,7 +2312,7 @@ private IndexWriterConfig getIndexWriterConfig() { new SoftDeletesRetentionMergePolicy(Lucene.SOFT_DELETES_FIELD, softDeletesPolicy::getRetentionQuery, new PrunePostingsMergePolicy(mergePolicy, IdFieldMapper.NAME))); } - boolean shuffleForcedMerge = Booleans.parseBoolean(System.getProperty("es.shuffle_forced_merge", Boolean.TRUE.toString())); + boolean shuffleForcedMerge = Booleans.parseBoolean(System.getProperty("opensearch.shuffle_forced_merge", Boolean.TRUE.toString())); if (shuffleForcedMerge) { // We wrap the merge policy for all indices even though it is mostly useful for time-based indices // but there should be no overhead for other type of indices so it's simpler than adding a setting 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 b5519427f3d42..ff9c3797b18b2 100644 --- a/server/src/main/java/org/opensearch/index/similarity/NonNegativeScoresSimilarity.java +++ b/server/src/main/java/org/opensearch/index/similarity/NonNegativeScoresSimilarity.java @@ -34,16 +34,16 @@ public final class NonNegativeScoresSimilarity extends Similarity { // Escape hatch - private static final String ES_ENFORCE_POSITIVE_SCORES = "es.enforce.positive.scores"; + private static final String OPENSEARCH_ENFORCE_POSITIVE_SCORES = "opensearch.enforce.positive.scores"; private static final boolean ENFORCE_POSITIVE_SCORES; static { - String enforcePositiveScores = System.getProperty(ES_ENFORCE_POSITIVE_SCORES); + String enforcePositiveScores = System.getProperty(OPENSEARCH_ENFORCE_POSITIVE_SCORES); if (enforcePositiveScores == null) { ENFORCE_POSITIVE_SCORES = true; } else if ("false".equals(enforcePositiveScores)) { ENFORCE_POSITIVE_SCORES = false; } else { - throw new IllegalArgumentException(ES_ENFORCE_POSITIVE_SCORES + " may only be unset or set to [false], but got [" + + throw new IllegalArgumentException(OPENSEARCH_ENFORCE_POSITIVE_SCORES + " may only be unset or set to [false], but got [" + enforcePositiveScores + "]"); } } 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 715f4a7f5e3ce..cbfa0faa61b5a 100644 --- a/server/src/main/java/org/opensearch/indices/breaker/HierarchyCircuitBreakerService.java +++ b/server/src/main/java/org/opensearch/indices/breaker/HierarchyCircuitBreakerService.java @@ -362,9 +362,9 @@ static OverLimitStrategy createOverLimitStrategy(boolean trackRealMemoryUsage) { JvmInfo jvmInfo = JvmInfo.jvmInfo(); if (trackRealMemoryUsage && jvmInfo.useG1GC().equals("true") // messing with GC is "dangerous" so we apply an escape hatch. Not intended to be used. - && Booleans.parseBoolean(System.getProperty("es.real_memory_circuit_breaker.g1_over_limit_strategy.enabled"), true)) { + && Booleans.parseBoolean(System.getProperty("opensearch.real_memory_circuit_breaker.g1_over_limit_strategy.enabled"), true)) { TimeValue lockTimeout = TimeValue.timeValueMillis( - Integer.parseInt(System.getProperty("es.real_memory_circuit_breaker.g1_over_limit_strategy.lock_timeout_ms", "500")) + Integer.parseInt(System.getProperty("opensearch.real_memory_circuit_breaker.g1_over_limit_strategy.lock_timeout_ms", "500")) ); // hardcode interval, do not want any tuning of it outside code changes. return new G1OverLimitStrategy(jvmInfo, HierarchyCircuitBreakerService::realMemoryUsage, createYoungGcCountSupplier(), diff --git a/server/src/main/java/org/opensearch/ingest/ConfigurationUtils.java b/server/src/main/java/org/opensearch/ingest/ConfigurationUtils.java index 02dc922b94fa3..ec2370d76a940 100644 --- a/server/src/main/java/org/opensearch/ingest/ConfigurationUtils.java +++ b/server/src/main/java/org/opensearch/ingest/ConfigurationUtils.java @@ -381,13 +381,13 @@ public String execute() { private static void addMetadataToException(OpenSearchException exception, String processorType, String processorTag, String propertyName) { if (processorType != null) { - exception.addMetadata("es.processor_type", processorType); + exception.addMetadata("opensearch.processor_type", processorType); } if (processorTag != null) { - exception.addMetadata("es.processor_tag", processorTag); + exception.addMetadata("opensearch.processor_tag", processorTag); } if (propertyName != null) { - exception.addMetadata("es.property_name", propertyName); + exception.addMetadata("opensearch.property_name", propertyName); } } 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 50c391564541c..97f0794531375 100644 --- a/server/src/main/java/org/opensearch/monitor/jvm/JvmInfo.java +++ b/server/src/main/java/org/opensearch/monitor/jvm/JvmInfo.java @@ -158,7 +158,7 @@ public class JvmInfo implements ReportingService.Info { } - final boolean bundledJdk = Booleans.parseBoolean(System.getProperty("es.bundled_jdk", Boolean.FALSE.toString())); + final boolean bundledJdk = Booleans.parseBoolean(System.getProperty("opensearch.bundled_jdk", Boolean.FALSE.toString())); final Boolean usingBundledJdk = bundledJdk ? usingBundledJdk() : null; INSTANCE = new JvmInfo(JvmPid.getPid(), System.getProperty("java.version"), runtimeMXBean.getVmName(), runtimeMXBean.getVmVersion(), 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 680e5e3435dff..fe005a145d520 100644 --- a/server/src/main/java/org/opensearch/monitor/os/OsProbe.java +++ b/server/src/main/java/org/opensearch/monitor/os/OsProbe.java @@ -239,7 +239,7 @@ private String readSingleLine(final Path path) throws IOException { // this property is to support a hack to workaround an issue with Docker containers mounting the cgroups hierarchy inconsistently with // respect to /proc/self/cgroup; for Docker containers this should be set to "/" - private static final String CONTROL_GROUPS_HIERARCHY_OVERRIDE = System.getProperty("es.cgroups.hierarchy.override"); + private static final String CONTROL_GROUPS_HIERARCHY_OVERRIDE = System.getProperty("opensearch.cgroups.hierarchy.override"); /** * A map of the control groups to which the OpenSearch process belongs. Note that this is a map because the control groups can vary diff --git a/server/src/main/java/org/opensearch/rest/RestUtils.java b/server/src/main/java/org/opensearch/rest/RestUtils.java index 9a75d37702977..1e4bf5810eabe 100644 --- a/server/src/main/java/org/opensearch/rest/RestUtils.java +++ b/server/src/main/java/org/opensearch/rest/RestUtils.java @@ -34,7 +34,7 @@ public class RestUtils { /** * Sets whether we decode a '+' in an url as a space or not. */ - private static final boolean DECODE_PLUS_AS_SPACE = Booleans.parseBoolean(System.getProperty("es.rest.url_plus_as_space", "false")); + private static final boolean DECODE_PLUS_AS_SPACE = Booleans.parseBoolean(System.getProperty("opensearch.rest.url_plus_as_space", "false")); public static final PathTrie.Decoder REST_DECODER = new PathTrie.Decoder() { @Override 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 b1c5bae36db3e..37f04d3a1301d 100644 --- a/server/src/main/java/org/opensearch/search/query/QueryPhase.java +++ b/server/src/main/java/org/opensearch/search/query/QueryPhase.java @@ -95,7 +95,7 @@ public class QueryPhase { private static final Logger LOGGER = LogManager.getLogger(QueryPhase.class); // TODO: remove this property - public static final boolean SYS_PROP_REWRITE_SORT = Booleans.parseBoolean(System.getProperty("es.search.rewrite_sort", "true")); + public static final boolean SYS_PROP_REWRITE_SORT = Booleans.parseBoolean(System.getProperty("opensearch.search.rewrite_sort", "true")); private final AggregationPhase aggregationPhase; private final SuggestPhase suggestPhase; diff --git a/server/src/main/java/org/opensearch/transport/TransportInfo.java b/server/src/main/java/org/opensearch/transport/TransportInfo.java index 7075fe7fcc31a..2c3985c01bf0c 100644 --- a/server/src/main/java/org/opensearch/transport/TransportInfo.java +++ b/server/src/main/java/org/opensearch/transport/TransportInfo.java @@ -41,7 +41,7 @@ public class TransportInfo implements ReportingService.Info { /** Whether to add hostname to publish host field when serializing. */ private static final boolean CNAME_IN_PUBLISH_ADDRESS = - parseBoolean(System.getProperty("es.transport.cname_in_publish_address"), false); + parseBoolean(System.getProperty("opensearch.transport.cname_in_publish_address"), false); private final BoundTransportAddress address; private Map profileAddresses; diff --git a/server/src/test/java/org/opensearch/action/search/SearchPhaseExecutionExceptionTests.java b/server/src/test/java/org/opensearch/action/search/SearchPhaseExecutionExceptionTests.java index ac3d508a4ddec..9831843774ebc 100644 --- a/server/src/test/java/org/opensearch/action/search/SearchPhaseExecutionExceptionTests.java +++ b/server/src/test/java/org/opensearch/action/search/SearchPhaseExecutionExceptionTests.java @@ -124,7 +124,7 @@ public void testToAndFromXContent() throws IOException { assertNotNull(parsedException); assertThat(parsedException.getHeaderKeys(), hasSize(0)); assertThat(parsedException.getMetadataKeys(), hasSize(1)); - assertThat(parsedException.getMetadata("es.phase"), hasItem(phase)); + assertThat(parsedException.getMetadata("opensearch.phase"), hasItem(phase)); // SearchPhaseExecutionException has no cause field assertNull(parsedException.getCause()); } diff --git a/server/src/test/java/org/opensearch/ingest/ConfigurationUtilsTests.java b/server/src/test/java/org/opensearch/ingest/ConfigurationUtilsTests.java index b9b290357b2e0..154f14f0ed0af 100644 --- a/server/src/test/java/org/opensearch/ingest/ConfigurationUtilsTests.java +++ b/server/src/test/java/org/opensearch/ingest/ConfigurationUtilsTests.java @@ -138,10 +138,10 @@ public void testReadProcessors() throws Exception { OpenSearchParseException e = expectThrows(OpenSearchParseException.class, () -> ConfigurationUtils.readProcessorConfigs(config, scriptService, registry)); assertThat(e.getMessage(), equalTo("No processor type exists with name [unknown_processor]")); - assertThat(e.getMetadata("es.processor_tag"), equalTo(Collections.singletonList("my_unknown"))); - assertThat(e.getMetadata("es.processor_type"), equalTo(Collections.singletonList("unknown_processor"))); - assertThat(e.getMetadata("es.property_name"), is(nullValue())); - assertThat(e.getMetadata("es.processor_description"), is(nullValue())); + assertThat(e.getMetadata("opensearch.processor_tag"), equalTo(Collections.singletonList("my_unknown"))); + assertThat(e.getMetadata("opensearch.processor_type"), equalTo(Collections.singletonList("unknown_processor"))); + assertThat(e.getMetadata("opensearch.property_name"), is(nullValue())); + assertThat(e.getMetadata("opensearch.processor_description"), is(nullValue())); List> config2 = new ArrayList<>(); unknownTaggedConfig = new HashMap<>(); @@ -155,17 +155,17 @@ public void testReadProcessors() throws Exception { () -> ConfigurationUtils.readProcessorConfigs(config2, scriptService, registry) ); assertThat(e.getMessage(), equalTo("No processor type exists with name [unknown_processor]")); - assertThat(e.getMetadata("es.processor_tag"), equalTo(Collections.singletonList("my_unknown"))); - assertThat(e.getMetadata("es.processor_type"), equalTo(Collections.singletonList("unknown_processor"))); - assertThat(e.getMetadata("es.property_name"), is(nullValue())); + assertThat(e.getMetadata("opensearch.processor_tag"), equalTo(Collections.singletonList("my_unknown"))); + assertThat(e.getMetadata("opensearch.processor_type"), equalTo(Collections.singletonList("unknown_processor"))); + assertThat(e.getMetadata("opensearch.property_name"), is(nullValue())); assertThat(e.getSuppressed().length, equalTo(1)); assertThat(e.getSuppressed()[0], instanceOf(OpenSearchParseException.class)); OpenSearchParseException e2 = (OpenSearchParseException) e.getSuppressed()[0]; assertThat(e2.getMessage(), equalTo("No processor type exists with name [second_unknown_processor]")); - assertThat(e2.getMetadata("es.processor_tag"), equalTo(Collections.singletonList("my_second_unknown"))); - assertThat(e2.getMetadata("es.processor_type"), equalTo(Collections.singletonList("second_unknown_processor"))); - assertThat(e2.getMetadata("es.property_name"), is(nullValue())); + assertThat(e2.getMetadata("opensearch.processor_tag"), equalTo(Collections.singletonList("my_second_unknown"))); + assertThat(e2.getMetadata("opensearch.processor_type"), equalTo(Collections.singletonList("second_unknown_processor"))); + assertThat(e2.getMetadata("opensearch.property_name"), is(nullValue())); } public void testReadProcessorNullDescription() throws Exception { diff --git a/server/src/test/java/org/opensearch/ingest/IngestServiceTests.java b/server/src/test/java/org/opensearch/ingest/IngestServiceTests.java index 4c3ff44bbd118..31f98c0589267 100644 --- a/server/src/test/java/org/opensearch/ingest/IngestServiceTests.java +++ b/server/src/test/java/org/opensearch/ingest/IngestServiceTests.java @@ -628,8 +628,8 @@ public void testValidate() throws Exception { OpenSearchParseException e = expectThrows(OpenSearchParseException.class, () -> ingestService.validatePipeline(ingestInfos, putRequest)); assertEquals("Processor type [remove] is not installed on node [" + node2 + "]", e.getMessage()); - assertEquals("remove", e.getMetadata("es.processor_type").get(0)); - assertEquals("tag2", e.getMetadata("es.processor_tag").get(0)); + assertEquals("remove", e.getMetadata("opensearch.processor_type").get(0)); + assertEquals("tag2", e.getMetadata("opensearch.processor_tag").get(0)); ingestInfos.put(node2, new IngestInfo(Arrays.asList(new ProcessorInfo("set"), new ProcessorInfo("remove")))); ingestService.validatePipeline(ingestInfos, putRequest); diff --git a/server/src/test/java/org/opensearch/rest/BytesRestResponseTests.java b/server/src/test/java/org/opensearch/rest/BytesRestResponseTests.java index 7bb61a8d486ec..10f95bc000a69 100644 --- a/server/src/test/java/org/opensearch/rest/BytesRestResponseTests.java +++ b/server/src/test/java/org/opensearch/rest/BytesRestResponseTests.java @@ -282,8 +282,8 @@ public void testErrorToAndFromXContent() throws IOException { expected.addHeader("foo", "bar", "baz"); } if (randomBoolean()) { - originalException.addMetadata("es.metadata_0", "0"); - expected.addMetadata("es.metadata_0", "0"); + originalException.addMetadata("opensearch.metadata_0", "0"); + expected.addMetadata("opensearch.metadata_0", "0"); } if (randomBoolean()) { String resourceType = randomAlphaOfLength(5); @@ -336,7 +336,7 @@ public static class WithHeadersException extends OpenSearchException { super(""); this.addHeader("n1", "v11", "v12"); this.addHeader("n2", "v21", "v22"); - this.addMetadata("es.test", "value1", "value2"); + this.addMetadata("opensearch.test", "value1", "value2"); } } diff --git a/server/src/test/java/org/opensearch/tasks/ListTasksResponseTests.java b/server/src/test/java/org/opensearch/tasks/ListTasksResponseTests.java index a00d3c39bea27..7a8e22d75eef5 100644 --- a/server/src/test/java/org/opensearch/tasks/ListTasksResponseTests.java +++ b/server/src/test/java/org/opensearch/tasks/ListTasksResponseTests.java @@ -120,7 +120,7 @@ protected static void assertOnNodeFailures(List nodeFailure for (int i = 0; i < nodeFailures.size(); i++) { OpenSearchException newException = nodeFailures.get(i); OpenSearchException expectedException = expectedFailures.get(i); - assertThat(newException.getMetadata("es.node_id").get(0), equalTo(((FailedNodeException)expectedException).nodeId())); + assertThat(newException.getMetadata("opensearch.node_id").get(0), equalTo(((FailedNodeException)expectedException).nodeId())); assertThat(newException.getMessage(), equalTo("Elasticsearch exception [type=failed_node_exception, reason=error message]")); assertThat(newException.getCause(), instanceOf(OpenSearchException.class)); OpenSearchException cause = (OpenSearchException) newException.getCause(); 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 d87919a8ba826..0a31047634c48 100644 --- a/test/framework/src/main/java/org/opensearch/test/InternalTestCluster.java +++ b/test/framework/src/main/java/org/opensearch/test/InternalTestCluster.java @@ -378,11 +378,11 @@ public InternalTestCluster( builder.put(Environment.PATH_REPO_SETTING.getKey(), baseDir.resolve("repos")); builder.put(TransportSettings.PORT.getKey(), 0); builder.put("http.port", 0); - if (Strings.hasLength(System.getProperty("tests.es.logger.level"))) { - builder.put("logger.level", System.getProperty("tests.es.logger.level")); + if (Strings.hasLength(System.getProperty("tests.opensearch.logger.level"))) { + builder.put("logger.level", System.getProperty("tests.opensearch.logger.level")); } - if (Strings.hasLength(System.getProperty("es.logger.prefix"))) { - builder.put("logger.prefix", System.getProperty("es.logger.prefix")); + if (Strings.hasLength(System.getProperty("opensearch.logger.prefix"))) { + builder.put("logger.prefix", System.getProperty("opensearch.logger.prefix")); } // Default the watermarks to absurdly low to prevent the tests // from failing on nodes without enough disk space diff --git a/test/framework/src/main/java/org/opensearch/test/MockLogAppender.java b/test/framework/src/main/java/org/opensearch/test/MockLogAppender.java index 02cf4df8528fa..33b33e1fc32dc 100644 --- a/test/framework/src/main/java/org/opensearch/test/MockLogAppender.java +++ b/test/framework/src/main/java/org/opensearch/test/MockLogAppender.java @@ -36,7 +36,7 @@ */ public class MockLogAppender extends AbstractAppender { - private static final String COMMON_PREFIX = System.getProperty("es.logger.prefix", "org.elasticsearch."); + private static final String COMMON_PREFIX = System.getProperty("opensearch.logger.prefix", "org.elasticsearch."); private List expectations; 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 f4e724d72b229..9c1c8736160aa 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 @@ -158,7 +158,7 @@ public ReproduceErrorMessageBuilder appendOpt(String sysPropName, String value) } private ReproduceErrorMessageBuilder appendESProperties() { - appendProperties("tests.es.logger.level"); + appendProperties("tests.opensearch.logger.level"); if (inVerifyPhase()) { // these properties only make sense for integration tests appendProperties(OpenSearchIntegTestCase.TESTS_ENABLE_MOCK_MODULES);