diff --git a/buildSrc/src/integTest/groovy/org/opensearch/gradle/TestClustersPluginFuncTest.groovy b/buildSrc/src/integTest/groovy/org/opensearch/gradle/TestClustersPluginFuncTest.groovy index 7003bce3c9d49..5f7b7990bcd7e 100644 --- a/buildSrc/src/integTest/groovy/org/opensearch/gradle/TestClustersPluginFuncTest.groovy +++ b/buildSrc/src/integTest/groovy/org/opensearch/gradle/TestClustersPluginFuncTest.groovy @@ -20,10 +20,7 @@ package org.opensearch.gradle import org.opensearch.gradle.fixtures.AbstractGradleFuncTest -import org.gradle.testkit.runner.GradleRunner import spock.lang.IgnoreIf -import spock.lang.Requires -import spock.util.environment.OperatingSystem import static org.opensearch.gradle.fixtures.DistributionDownloadFixture.withMockedDistributionDownload @@ -70,8 +67,8 @@ class TestClustersPluginFuncTest extends AbstractGradleFuncTest { then: result.output.contains("opensearch-keystore script executed!") - assertEsStdoutContains("myCluster", "Starting OpenSearch process") - assertEsStdoutContains("myCluster", "Stopping node") + assertOpenSearchStdoutContains("myCluster", "Starting OpenSearch process") + assertOpenSearchStdoutContains("myCluster", "Stopping node") assertNoCustomDistro('myCluster') } @@ -97,12 +94,12 @@ class TestClustersPluginFuncTest extends AbstractGradleFuncTest { then: result.output.contains("opensearch-keystore script executed!") - assertEsStdoutContains("myCluster", "Starting OpenSearch process") - assertEsStdoutContains("myCluster", "Stopping node") + assertOpenSearchStdoutContains("myCluster", "Starting OpenSearch process") + assertOpenSearchStdoutContains("myCluster", "Stopping node") assertCustomDistro('myCluster') } - boolean assertEsStdoutContains(String testCluster, String expectedOutput) { + boolean assertOpenSearchStdoutContains(String testCluster, String expectedOutput) { assert new File(testProjectDir.root, "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 8d387cba91649..3c8033692ecee 100644 --- a/buildSrc/src/main/groovy/org/opensearch/gradle/test/NodeInfo.groovy +++ b/buildSrc/src/main/groovy/org/opensearch/gradle/test/NodeInfo.groovy @@ -98,7 +98,7 @@ class NodeInfo { String executable /** Path to the opensearch start script */ - private Object esScript + private Object opensearchScript /** script to run when running in the background */ private File wrapperScript @@ -154,11 +154,11 @@ class NodeInfo { * We have to delay building the string as the path will not exist during configuration which will fail on Windows due to * getting the short name requiring the path to already exist. */ - esScript = "${-> binPath().resolve('opensearch.bat').toString()}" + opensearchScript = "${-> binPath().resolve('opensearch.bat').toString()}" } else { executable = 'bash' wrapperScript = new File(cwd, "run") - esScript = binPath().resolve('opensearch') + opensearchScript = binPath().resolve('opensearch') } if (config.daemonize) { if (Os.isFamily(Os.FAMILY_WINDOWS)) { @@ -171,7 +171,7 @@ class NodeInfo { args.add("${wrapperScript}") } } else { - args.add("${esScript}") + args.add("${opensearchScript}") } @@ -270,7 +270,7 @@ class NodeInfo { argsPasser = '%*' exitMarker = "\r\n if \"%errorlevel%\" neq \"0\" ( type nul >> run.failed )" } - wrapperScript.setText("\"${esScript}\" ${argsPasser} > run.log 2>&1 ${exitMarker}", 'UTF-8') + wrapperScript.setText("\"${opensearchScript}\" ${argsPasser} > run.log 2>&1 ${exitMarker}", 'UTF-8') } /** Returns an address and port suitable for a uri to connect to this node over http */ diff --git a/buildSrc/src/main/java/org/opensearch/gradle/precommit/ForbiddenApisPrecommitPlugin.java b/buildSrc/src/main/java/org/opensearch/gradle/precommit/ForbiddenApisPrecommitPlugin.java index a42dcf09cbbab..e422884ad3e4b 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/precommit/ForbiddenApisPrecommitPlugin.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/precommit/ForbiddenApisPrecommitPlugin.java @@ -49,10 +49,10 @@ public TaskProvider createTask(Project project) { resourcesTask.configure(t -> { t.setOutputDir(resourcesDir.toFile()); t.copy("forbidden/jdk-signatures.txt"); - t.copy("forbidden/es-all-signatures.txt"); - t.copy("forbidden/es-test-signatures.txt"); + t.copy("forbidden/opensearch-all-signatures.txt"); + t.copy("forbidden/opensearch-test-signatures.txt"); t.copy("forbidden/http-signatures.txt"); - t.copy("forbidden/es-server-signatures.txt"); + t.copy("forbidden/opensearch-server-signatures.txt"); }); project.getTasks().withType(CheckForbiddenApis.class).configureEach(t -> { t.dependsOn(resourcesTask); @@ -79,7 +79,10 @@ public TaskProvider createTask(Project project) { } t.setBundledSignatures(Set.of("jdk-unsafe", "jdk-deprecated", "jdk-non-portable", "jdk-system-out")); t.setSignaturesFiles( - project.files(resourcesDir.resolve("forbidden/jdk-signatures.txt"), resourcesDir.resolve("forbidden/es-all-signatures.txt")) + project.files( + resourcesDir.resolve("forbidden/jdk-signatures.txt"), + resourcesDir.resolve("forbidden/opensearch-all-signatures.txt") + ) ); t.setSuppressAnnotations(Set.of("**.SuppressForbidden")); if (t.getName().endsWith("Test")) { @@ -87,14 +90,14 @@ public TaskProvider createTask(Project project) { t.getSignaturesFiles() .plus( project.files( - resourcesDir.resolve("forbidden/es-test-signatures.txt"), + resourcesDir.resolve("forbidden/opensearch-test-signatures.txt"), resourcesDir.resolve("forbidden/http-signatures.txt") ) ) ); } else { t.setSignaturesFiles( - t.getSignaturesFiles().plus(project.files(resourcesDir.resolve("forbidden/es-server-signatures.txt"))) + t.getSignaturesFiles().plus(project.files(resourcesDir.resolve("forbidden/opensearch-server-signatures.txt"))) ); } ExtraPropertiesExtension ext = t.getExtensions().getExtraProperties(); 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 531edfc03940d..49ace25647289 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/testclusters/OpenSearchNode.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/testclusters/OpenSearchNode.java @@ -150,15 +150,15 @@ public class OpenSearchNode implements TestClusterConfiguration { private final Path confPathLogs; private final Path transportPortFile; private final Path httpPortsFile; - private final Path esStdoutFile; - private final Path esStderrFile; - private final Path esStdinFile; + private final Path opensearchStdoutFile; + private final Path opensearchStderrFile; + private final Path opensearchStdinFile; private final Path tmpDir; private int currentDistro = 0; private TestDistribution testDistribution; private List distributions = new ArrayList<>(); - private volatile Process esProcess; + private volatile Process opensearchProcess; private Function nameCustomization = Function.identity(); private boolean isWorkingDirConfigured = false; private String httpPort = "0"; @@ -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("opensearch.stdout.log"); - esStderrFile = confPathLogs.resolve("opensearch.stderr.log"); - esStdinFile = workingDir.resolve("opensearch.stdin"); + opensearchStdoutFile = confPathLogs.resolve("opensearch.stdout.log"); + opensearchStderrFile = confPathLogs.resolve("opensearch.stderr.log"); + opensearchStdinFile = workingDir.resolve("opensearch.stdin"); tmpDir = workingDir.resolve("tmp"); waitConditions.put("ports files", this::checkPortsFilesExistWithDelay); @@ -438,7 +438,7 @@ public void freeze() { * @return stream of log lines */ public Stream logLines() throws IOException { - return Files.lines(esStdoutFile, StandardCharsets.UTF_8); + return Files.lines(opensearchStdoutFile, StandardCharsets.UTF_8); } @Override @@ -540,11 +540,11 @@ private boolean canUseSharedDistribution() { private void logToProcessStdout(String message) { try { - if (Files.exists(esStdoutFile.getParent()) == false) { - Files.createDirectories(esStdoutFile.getParent()); + if (Files.exists(opensearchStdoutFile.getParent()) == false) { + Files.createDirectories(opensearchStdoutFile.getParent()); } Files.write( - esStdoutFile, + opensearchStdoutFile, ("[" + Instant.now().toString() + "] [BUILD] " + message + "\n").getBytes(StandardCharsets.UTF_8), StandardOpenOption.CREATE, StandardOpenOption.APPEND @@ -784,24 +784,24 @@ private void startOpenSearchProcess() { environment.putAll(getESEnvironment()); // don't buffer all in memory, make sure we don't block on the default pipes - processBuilder.redirectError(ProcessBuilder.Redirect.appendTo(esStderrFile.toFile())); - processBuilder.redirectOutput(ProcessBuilder.Redirect.appendTo(esStdoutFile.toFile())); + processBuilder.redirectError(ProcessBuilder.Redirect.appendTo(opensearchStderrFile.toFile())); + processBuilder.redirectOutput(ProcessBuilder.Redirect.appendTo(opensearchStdoutFile.toFile())); if (keystorePassword != null && keystorePassword.length() > 0) { try { - Files.write(esStdinFile, (keystorePassword + "\n").getBytes(StandardCharsets.UTF_8), StandardOpenOption.CREATE); - processBuilder.redirectInput(esStdinFile.toFile()); + Files.write(opensearchStdinFile, (keystorePassword + "\n").getBytes(StandardCharsets.UTF_8), StandardOpenOption.CREATE); + processBuilder.redirectInput(opensearchStdinFile.toFile()); } catch (IOException e) { throw new TestClustersException("Failed to set the keystore password for " + this, e); } } LOGGER.info("Running `{}` in `{}` for {} env: {}", command, workingDir, this, environment); try { - esProcess = processBuilder.start(); + opensearchProcess = processBuilder.start(); } catch (IOException e) { throw new TestClustersException("Failed to start ES process for " + this, e); } - reaper.registerPid(toString(), esProcess.pid()); + reaper.registerPid(toString(), opensearchProcess.pid()); } @Internal @@ -860,21 +860,21 @@ public synchronized void stop(boolean tailLogs) { } catch (IOException e) { throw new UncheckedIOException(e); } - if (esProcess == null && tailLogs) { + if (opensearchProcess == null && tailLogs) { // This is a special case. If start() throws an exception the plugin will still call stop // Another exception here would eat the orriginal. return; } LOGGER.info("Stopping `{}`, tailLogs: {}", this, tailLogs); - requireNonNull(esProcess, "Can't stop `" + this + "` as it was not started or already stopped."); + requireNonNull(opensearchProcess, "Can't stop `" + this + "` as it was not started or already stopped."); // Test clusters are not reused, don't spend time on a graceful shutdown - stopHandle(esProcess.toHandle(), true); + stopHandle(opensearchProcess.toHandle(), true); reaper.unregister(toString()); if (tailLogs) { - logFileContents("Standard output of node", esStdoutFile); - logFileContents("Standard error of node", esStderrFile); + logFileContents("Standard output of node", opensearchStdoutFile); + logFileContents("Standard error of node", opensearchStderrFile); } - esProcess = null; + opensearchProcess = null; // Clean up the ports file in case this is started again. try { if (Files.exists(httpPortsFile)) { @@ -1348,8 +1348,8 @@ public List getExtraConfigFiles() { @Override @Internal public boolean isProcessAlive() { - requireNonNull(esProcess, "Can't wait for `" + this + "` as it's not started. Does the task have `useCluster` ?"); - return esProcess.isAlive(); + requireNonNull(opensearchProcess, "Can't wait for `" + this + "` as it's not started. Does the task have `useCluster` ?"); + return opensearchProcess.isAlive(); } void waitForAllConditions() { @@ -1414,13 +1414,13 @@ void setDataPath(Path dataPath) { } @Internal - Path getEsStdoutFile() { - return esStdoutFile; + Path getOpensearchStdoutFile() { + return opensearchStdoutFile; } @Internal - Path getEsStderrFile() { - return esStderrFile; + Path getOpensearchStderrFile() { + return opensearchStderrFile; } private static class FileEntry implements Named { 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 96430c94ce8b0..9431330867d94 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/testclusters/RunTask.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/testclusters/RunTask.java @@ -150,7 +150,7 @@ public void runAndWait() throws IOException { try { for (OpenSearchCluster cluster : getClusters()) { for (OpenSearchNode node : cluster.getNodes()) { - BufferedReader reader = Files.newBufferedReader(node.getEsStdoutFile()); + BufferedReader reader = Files.newBufferedReader(node.getOpensearchStdoutFile()); toRead.add(reader); aliveChecks.add(node::isProcessAlive); } diff --git a/buildSrc/src/main/resources/forbidden/es-all-signatures.txt b/buildSrc/src/main/resources/forbidden/opensearch-all-signatures.txt similarity index 100% rename from buildSrc/src/main/resources/forbidden/es-all-signatures.txt rename to buildSrc/src/main/resources/forbidden/opensearch-all-signatures.txt diff --git a/buildSrc/src/main/resources/forbidden/es-server-signatures.txt b/buildSrc/src/main/resources/forbidden/opensearch-server-signatures.txt similarity index 100% rename from buildSrc/src/main/resources/forbidden/es-server-signatures.txt rename to buildSrc/src/main/resources/forbidden/opensearch-server-signatures.txt diff --git a/buildSrc/src/main/resources/forbidden/es-test-signatures.txt b/buildSrc/src/main/resources/forbidden/opensearch-test-signatures.txt similarity index 100% rename from buildSrc/src/main/resources/forbidden/es-test-signatures.txt rename to buildSrc/src/main/resources/forbidden/opensearch-test-signatures.txt diff --git a/client/rest-high-level/src/test/java/org/opensearch/client/documentation/SearchDocumentationIT.java b/client/rest-high-level/src/test/java/org/opensearch/client/documentation/SearchDocumentationIT.java index 19ea882b71ce2..70fa82dfc3f90 100644 --- a/client/rest-high-level/src/test/java/org/opensearch/client/documentation/SearchDocumentationIT.java +++ b/client/rest-high-level/src/test/java/org/opensearch/client/documentation/SearchDocumentationIT.java @@ -307,11 +307,11 @@ public void testSearchRequestAggregations() throws IOException { { BulkRequest request = new BulkRequest(); request.add(new IndexRequest("posts").id("1") - .source(XContentType.JSON, "company", "Elastic", "age", 20)); + .source(XContentType.JSON, "company", "OpenSearch", "age", 20)); request.add(new IndexRequest("posts").id("2") - .source(XContentType.JSON, "company", "Elastic", "age", 30)); + .source(XContentType.JSON, "company", "OpenSearch", "age", 30)); request.add(new IndexRequest("posts").id("3") - .source(XContentType.JSON, "company", "Elastic", "age", 40)); + .source(XContentType.JSON, "company", "OpenSearch", "age", 40)); request.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE); BulkResponse bulkResponse = client.bulk(request, RequestOptions.DEFAULT); assertSame(RestStatus.OK, bulkResponse.status()); @@ -334,7 +334,7 @@ public void testSearchRequestAggregations() throws IOException { // tag::search-request-aggregations-get Aggregations aggregations = searchResponse.getAggregations(); Terms byCompanyAggregation = aggregations.get("by_company"); // <1> - Bucket elasticBucket = byCompanyAggregation.getBucketByKey("Elastic"); // <2> + Bucket elasticBucket = byCompanyAggregation.getBucketByKey("OpenSearch"); // <2> Avg averageAge = elasticBucket.getAggregations().get("average_age"); // <3> double avg = averageAge.getValue(); // end::search-request-aggregations-get @@ -368,7 +368,7 @@ public void testSearchRequestAggregations() throws IOException { for (Aggregation agg : aggregations) { String type = agg.getType(); if (type.equals(TermsAggregationBuilder.NAME)) { - Bucket elasticBucket = ((Terms) agg).getBucketByKey("Elastic"); + Bucket elasticBucket = ((Terms) agg).getBucketByKey("OpenSearch"); long numberOfDocs = elasticBucket.getDocCount(); } } @@ -1404,7 +1404,7 @@ private static void indexCountTestData() throws IOException { .source(XContentType.JSON, "title", "Doubling Down on Open?", "user", Collections.singletonList("foobar"), "innerObject", Collections.singletonMap("key", "value"))); bulkRequest.add(new IndexRequest("blog").id("2") - .source(XContentType.JSON, "title", "Swiftype Joins Forces with Elastic", "user", + .source(XContentType.JSON, "title", "XYZ Joins Forces with OpenSearch", "user", Arrays.asList("foobar", "matt"), "innerObject", Collections.singletonMap("key", "value"))); bulkRequest.add(new IndexRequest("blog").id("3") .source(XContentType.JSON, "title", "On Net Neutrality", "user", diff --git a/client/transport/build.gradle b/client/transport/build.gradle index 97a13fa53b8d2..7ae02b2d0e781 100644 --- a/client/transport/build.gradle +++ b/client/transport/build.gradle @@ -37,7 +37,7 @@ dependencies { forbiddenApisTest { // we don't use the core test-framework, no lucene classes present so we don't want the es-test-signatures to // be pulled in - replaceSignatureFiles 'jdk-signatures', 'es-all-signatures' + replaceSignatureFiles 'jdk-signatures', 'opensearch-all-signatures' } testingConventions { diff --git a/modules/parent-join/src/main/java/org/opensearch/join/query/ParentChildInnerHitContextBuilder.java b/modules/parent-join/src/main/java/org/opensearch/join/query/ParentChildInnerHitContextBuilder.java index b3750ee84d3ac..263f73a48b98a 100644 --- a/modules/parent-join/src/main/java/org/opensearch/join/query/ParentChildInnerHitContextBuilder.java +++ b/modules/parent-join/src/main/java/org/opensearch/join/query/ParentChildInnerHitContextBuilder.java @@ -177,7 +177,7 @@ private String getSortedDocValue(String field, SearchContext context, int docId) BytesRef joinName = docValues.lookupOrd(ord); return joinName.utf8ToString(); } catch (IOException e) { - throw ExceptionsHelper.convertToElastic(e); + throw ExceptionsHelper.convertToOpenSearchException(e); } } diff --git a/server/src/main/java/org/opensearch/ExceptionsHelper.java b/server/src/main/java/org/opensearch/ExceptionsHelper.java index 1ad24dd228eab..17cb6acb85111 100644 --- a/server/src/main/java/org/opensearch/ExceptionsHelper.java +++ b/server/src/main/java/org/opensearch/ExceptionsHelper.java @@ -59,7 +59,7 @@ public static RuntimeException convertToRuntime(Exception e) { return new OpenSearchException(e); } - public static OpenSearchException convertToElastic(Exception e) { + public static OpenSearchException convertToOpenSearchException(Exception e) { if (e instanceof OpenSearchException) { return (OpenSearchException) e; } diff --git a/server/src/main/java/org/opensearch/cluster/metadata/MetadataUpdateSettingsService.java b/server/src/main/java/org/opensearch/cluster/metadata/MetadataUpdateSettingsService.java index 53e72295678fd..9890a9796ba27 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/MetadataUpdateSettingsService.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/MetadataUpdateSettingsService.java @@ -282,7 +282,7 @@ public ClusterState execute(ClusterState currentState) { indicesService.verifyIndexMetadata(updatedMetadata, updatedMetadata); } } catch (IOException ex) { - throw ExceptionsHelper.convertToElastic(ex); + throw ExceptionsHelper.convertToOpenSearchException(ex); } return updatedState; } diff --git a/server/src/main/java/org/opensearch/index/cache/bitset/BitsetFilterCache.java b/server/src/main/java/org/opensearch/index/cache/bitset/BitsetFilterCache.java index 101efaf6efa47..ae2605c059f34 100644 --- a/server/src/main/java/org/opensearch/index/cache/bitset/BitsetFilterCache.java +++ b/server/src/main/java/org/opensearch/index/cache/bitset/BitsetFilterCache.java @@ -194,7 +194,7 @@ public BitSet getBitSet(LeafReaderContext context) throws IOException { try { return getAndLoadIfNotPresent(query, context); } catch (ExecutionException e) { - throw ExceptionsHelper.convertToElastic(e); + throw ExceptionsHelper.convertToOpenSearchException(e); } } diff --git a/server/src/main/java/org/opensearch/ingest/ConfigurationUtils.java b/server/src/main/java/org/opensearch/ingest/ConfigurationUtils.java index ec2370d76a940..757005d1ef856 100644 --- a/server/src/main/java/org/opensearch/ingest/ConfigurationUtils.java +++ b/server/src/main/java/org/opensearch/ingest/ConfigurationUtils.java @@ -320,7 +320,7 @@ public static OpenSearchException newConfigurationException(String processorType public static OpenSearchException newConfigurationException(String processorType, String processorTag, String propertyName, Exception cause) { - OpenSearchException exception = ExceptionsHelper.convertToElastic(cause); + OpenSearchException exception = ExceptionsHelper.convertToOpenSearchException(cause); addMetadataToException(exception, processorType, processorTag, propertyName); return exception; } diff --git a/server/src/main/java/org/opensearch/rest/RestController.java b/server/src/main/java/org/opensearch/rest/RestController.java index 5b436cb828b63..20d8b9e8f2c0f 100644 --- a/server/src/main/java/org/opensearch/rest/RestController.java +++ b/server/src/main/java/org/opensearch/rest/RestController.java @@ -66,7 +66,7 @@ public class RestController implements HttpServerTransport.Dispatcher { private static final Logger logger = LogManager.getLogger(RestController.class); private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestController.class); - private static final String ELASTIC_PRODUCT_ORIGIN_HTTP_HEADER = "X-elastic-product-origin"; + private static final String OPENSEARCH_PRODUCT_ORIGIN_HTTP_HEADER = "X-opensearch-product-origin"; private static final BytesReference FAVICON_RESPONSE; @@ -248,8 +248,8 @@ private void dispatchRequest(RestRequest request, RestChannel channel, RestHandl if (handler.allowsUnsafeBuffers() == false) { request.ensureSafeBuffers(); } - if (handler.allowSystemIndexAccessByDefault() == false && request.header(ELASTIC_PRODUCT_ORIGIN_HTTP_HEADER) == null) { - // The ELASTIC_PRODUCT_ORIGIN_HTTP_HEADER indicates that the request is coming from an Elastic product with a plan + if (handler.allowSystemIndexAccessByDefault() == false && request.header(OPENSEARCH_PRODUCT_ORIGIN_HTTP_HEADER) == null) { + // The OPENSEARCH_PRODUCT_ORIGIN_HTTP_HEADER indicates that the request is coming from an OpenSearch product with a plan // to move away from direct access to system indices, and thus deprecation warnings should not be emitted. // This header is intended for internal use only. client.threadPool().getThreadContext().putHeader(SYSTEM_INDEX_ACCESS_CONTROL_HEADER_KEY, Boolean.FALSE.toString()); diff --git a/server/src/main/java/org/opensearch/script/ScoreScriptUtils.java b/server/src/main/java/org/opensearch/script/ScoreScriptUtils.java index ac9e400d886ae..037a669b9e052 100644 --- a/server/src/main/java/org/opensearch/script/ScoreScriptUtils.java +++ b/server/src/main/java/org/opensearch/script/ScoreScriptUtils.java @@ -73,7 +73,7 @@ public double randomScore() { int hash = StringHelper.murmurhash3_x86_32(new BytesRef(seedValue), saltedSeed); return (hash & 0x00FFFFFF) / (float)(1 << 24); // only use the lower 24 bits to construct a float from 0.0-1.0 } catch (Exception e) { - throw ExceptionsHelper.convertToElastic(e); + throw ExceptionsHelper.convertToOpenSearchException(e); } } } diff --git a/server/src/main/java/org/opensearch/search/lookup/LeafDocLookup.java b/server/src/main/java/org/opensearch/search/lookup/LeafDocLookup.java index 689f0c705999c..91e60ee34ff47 100644 --- a/server/src/main/java/org/opensearch/search/lookup/LeafDocLookup.java +++ b/server/src/main/java/org/opensearch/search/lookup/LeafDocLookup.java @@ -100,7 +100,7 @@ public ScriptDocValues run() { try { scriptValues.setNextDocId(docId); } catch (IOException e) { - throw ExceptionsHelper.convertToElastic(e); + throw ExceptionsHelper.convertToOpenSearchException(e); } return scriptValues; } diff --git a/server/src/test/java/org/opensearch/index/analysis/PreConfiguredTokenFilterTests.java b/server/src/test/java/org/opensearch/index/analysis/PreConfiguredTokenFilterTests.java index dafc4b716d748..09cbc3e6b93b7 100644 --- a/server/src/test/java/org/opensearch/index/analysis/PreConfiguredTokenFilterTests.java +++ b/server/src/test/java/org/opensearch/index/analysis/PreConfiguredTokenFilterTests.java @@ -67,7 +67,7 @@ public boolean incrementToken() { assertSame(tff_v1_1, tff_v2); } - public void testCachingWithElasticsearchVersion() throws IOException { + public void testCachingWithOpenSearchVersion() throws IOException { PreConfiguredTokenFilter pctf = PreConfiguredTokenFilter.openSearchVersion("opensearch_version", randomBoolean(), (tokenStream, esVersion) -> new TokenFilter(tokenStream) { diff --git a/server/src/test/java/org/opensearch/indices/flush/SyncedFlushUtil.java b/server/src/test/java/org/opensearch/indices/flush/SyncedFlushUtil.java index e35034ca9615b..96088266bff8c 100644 --- a/server/src/test/java/org/opensearch/indices/flush/SyncedFlushUtil.java +++ b/server/src/test/java/org/opensearch/indices/flush/SyncedFlushUtil.java @@ -65,7 +65,7 @@ public static ShardsSyncedFlushResult attemptSyncedFlush(Logger logger, Internal } }); if (listenerHolder.get().error != null) { - throw ExceptionsHelper.convertToElastic(listenerHolder.get().error); + throw ExceptionsHelper.convertToOpenSearchException(listenerHolder.get().error); } return listenerHolder.get().result; } @@ -103,7 +103,7 @@ public static Map sendPreSync Thread.currentThread().interrupt(); } if (listener.error != null) { - throw ExceptionsHelper.convertToElastic(listener.error); + throw ExceptionsHelper.convertToOpenSearchException(listener.error); } return listener.result; } diff --git a/server/src/test/java/org/opensearch/search/internal/ContextIndexSearcherTests.java b/server/src/test/java/org/opensearch/search/internal/ContextIndexSearcherTests.java index 165be8d8acc05..ee1a7b047d38a 100644 --- a/server/src/test/java/org/opensearch/search/internal/ContextIndexSearcherTests.java +++ b/server/src/test/java/org/opensearch/search/internal/ContextIndexSearcherTests.java @@ -298,7 +298,7 @@ public LeafReader wrap(LeafReader reader) { try { return new DocumentSubsetReader(reader, bitsetFilterCache, roleQuery); } catch (Exception e) { - throw ExceptionsHelper.convertToElastic(e); + throw ExceptionsHelper.convertToOpenSearchException(e); } } }); diff --git a/test/framework/build.gradle b/test/framework/build.gradle index 799f32e9a1982..6b83e33e997e9 100644 --- a/test/framework/build.gradle +++ b/test/framework/build.gradle @@ -43,7 +43,7 @@ compileTestJava.options.compilerArgs << '-Xlint:-rawtypes' // the main files are actually test files, so use the appropriate forbidden api sigs tasks.named('forbiddenApisMain').configure { - replaceSignatureFiles 'jdk-signatures', 'es-all-signatures', 'es-test-signatures' + replaceSignatureFiles 'jdk-signatures', 'opensearch-all-signatures', 'opensearch-test-signatures' } // TODO: should we have licenses for our test deps?