[Rename] server/rest (#229)

This commit refactors the `server/rest` package as part of the Elasticsearch to OpenSearch renaming.

Signed-off-by: Rabi Panda <adnapibar@gmail.com>
This commit is contained in:
Rabi Panda 2021-03-09 16:46:55 -08:00 committed by Nick Knize
parent 046d877358
commit 3eee5183d1
514 changed files with 1775 additions and 1792 deletions

View File

@ -35,7 +35,7 @@ import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.plugin.noop.NoopPlugin; import org.elasticsearch.plugin.noop.NoopPlugin;
import org.elasticsearch.plugin.noop.action.bulk.NoopBulkAction; import org.elasticsearch.plugin.noop.action.bulk.NoopBulkAction;
import org.elasticsearch.plugin.noop.action.search.NoopSearchAction; import org.elasticsearch.plugin.noop.action.search.NoopSearchAction;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.opensearch.transport.client.PreBuiltTransportClient; import org.opensearch.transport.client.PreBuiltTransportClient;

View File

@ -34,8 +34,8 @@ import org.elasticsearch.plugin.noop.action.search.RestNoopSearchAction;
import org.elasticsearch.plugin.noop.action.search.TransportNoopSearchAction; import org.elasticsearch.plugin.noop.action.search.TransportNoopSearchAction;
import org.elasticsearch.plugins.ActionPlugin; import org.elasticsearch.plugins.ActionPlugin;
import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.rest.RestController; import org.opensearch.rest.RestController;
import org.elasticsearch.rest.RestHandler; import org.opensearch.rest.RestHandler;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;

View File

@ -29,21 +29,21 @@ import org.elasticsearch.client.Requests;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.index.shard.ShardId;
import org.elasticsearch.rest.BaseRestHandler; import org.opensearch.rest.BaseRestHandler;
import org.elasticsearch.rest.BytesRestResponse; import org.opensearch.rest.BytesRestResponse;
import org.elasticsearch.rest.RestChannel; import org.opensearch.rest.RestChannel;
import org.elasticsearch.rest.RestRequest; import org.opensearch.rest.RestRequest;
import org.elasticsearch.rest.RestResponse; import org.opensearch.rest.RestResponse;
import org.elasticsearch.rest.action.RestBuilderListener; import org.opensearch.rest.action.RestBuilderListener;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
import static java.util.Arrays.asList; import static java.util.Arrays.asList;
import static java.util.Collections.unmodifiableList; import static java.util.Collections.unmodifiableList;
import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.opensearch.rest.RestRequest.Method.POST;
import static org.elasticsearch.rest.RestRequest.Method.PUT; import static org.opensearch.rest.RestRequest.Method.PUT;
import static org.elasticsearch.rest.RestStatus.OK; import static org.opensearch.rest.RestStatus.OK;
public class RestNoopBulkAction extends BaseRestHandler { public class RestNoopBulkAction extends BaseRestHandler {

View File

@ -20,16 +20,16 @@ package org.elasticsearch.plugin.noop.action.search;
import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.rest.BaseRestHandler; import org.opensearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestRequest; import org.opensearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestStatusToXContentListener; import org.opensearch.rest.action.RestStatusToXContentListener;
import java.util.List; import java.util.List;
import static java.util.Arrays.asList; import static java.util.Arrays.asList;
import static java.util.Collections.unmodifiableList; import static java.util.Collections.unmodifiableList;
import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.opensearch.rest.RestRequest.Method.GET;
import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.opensearch.rest.RestRequest.Method.POST;
public class RestNoopSearchAction extends BaseRestHandler { public class RestNoopSearchAction extends BaseRestHandler {

View File

@ -34,7 +34,7 @@ import org.elasticsearch.client.indices.DeleteComponentTemplateRequest;
import org.elasticsearch.client.indices.GetComponentTemplatesRequest; import org.elasticsearch.client.indices.GetComponentTemplatesRequest;
import org.elasticsearch.client.indices.GetComponentTemplatesResponse; import org.elasticsearch.client.indices.GetComponentTemplatesResponse;
import org.elasticsearch.client.indices.PutComponentTemplateRequest; import org.elasticsearch.client.indices.PutComponentTemplateRequest;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import java.io.IOException; import java.io.IOException;

View File

@ -26,7 +26,7 @@ import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.XContentParser.Token; import org.elasticsearch.common.xcontent.XContentParser.Token;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import java.io.IOException; import java.io.IOException;
import java.util.Collections; import java.util.Collections;

View File

@ -76,7 +76,7 @@ import org.elasticsearch.client.indices.SimulateIndexTemplateRequest;
import org.elasticsearch.client.indices.SimulateIndexTemplateResponse; import org.elasticsearch.client.indices.SimulateIndexTemplateResponse;
import org.elasticsearch.client.indices.rollover.RolloverRequest; import org.elasticsearch.client.indices.rollover.RolloverRequest;
import org.elasticsearch.client.indices.rollover.RolloverResponse; import org.elasticsearch.client.indices.rollover.RolloverResponse;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import java.io.IOException; import java.io.IOException;
import java.util.Collections; import java.util.Collections;

View File

@ -66,7 +66,7 @@ import org.elasticsearch.common.Strings;
import java.io.IOException; import java.io.IOException;
import java.util.Locale; import java.util.Locale;
import static org.elasticsearch.rest.BaseRestHandler.INCLUDE_TYPE_NAME_PARAMETER; import static org.opensearch.rest.BaseRestHandler.INCLUDE_TYPE_NAME_PARAMETER;
final class IndicesRequestConverters { final class IndicesRequestConverters {

View File

@ -26,7 +26,7 @@ import org.elasticsearch.common.xcontent.ConstructingObjectParser;
import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.rest.action.RestActions; import org.opensearch.rest.action.RestActions;
import java.io.IOException; import java.io.IOException;
import java.util.Collections; import java.util.Collections;

View File

@ -79,7 +79,7 @@ import org.elasticsearch.index.reindex.DeleteByQueryRequest;
import org.elasticsearch.index.reindex.ReindexRequest; import org.elasticsearch.index.reindex.ReindexRequest;
import org.elasticsearch.index.reindex.UpdateByQueryRequest; import org.elasticsearch.index.reindex.UpdateByQueryRequest;
import org.elasticsearch.index.seqno.SequenceNumbers; import org.elasticsearch.index.seqno.SequenceNumbers;
import org.elasticsearch.rest.action.search.RestSearchAction; import org.opensearch.rest.action.search.RestSearchAction;
import org.opensearch.script.mustache.MultiSearchTemplateRequest; import org.opensearch.script.mustache.MultiSearchTemplateRequest;
import org.opensearch.script.mustache.SearchTemplateRequest; import org.opensearch.script.mustache.SearchTemplateRequest;
import org.elasticsearch.search.fetch.subphase.FetchSourceContext; import org.elasticsearch.search.fetch.subphase.FetchSourceContext;

View File

@ -80,8 +80,8 @@ import org.elasticsearch.index.reindex.DeleteByQueryRequest;
import org.elasticsearch.index.reindex.ReindexRequest; import org.elasticsearch.index.reindex.ReindexRequest;
import org.elasticsearch.index.reindex.UpdateByQueryRequest; import org.elasticsearch.index.reindex.UpdateByQueryRequest;
import org.elasticsearch.plugins.spi.NamedXContentProvider; import org.elasticsearch.plugins.spi.NamedXContentProvider;
import org.elasticsearch.rest.BytesRestResponse; import org.opensearch.rest.BytesRestResponse;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.opensearch.script.mustache.MultiSearchTemplateRequest; import org.opensearch.script.mustache.MultiSearchTemplateRequest;
import org.opensearch.script.mustache.MultiSearchTemplateResponse; import org.opensearch.script.mustache.MultiSearchTemplateResponse;
import org.opensearch.script.mustache.SearchTemplateRequest; import org.opensearch.script.mustache.SearchTemplateRequest;

View File

@ -22,7 +22,7 @@ package org.elasticsearch.client.core;
import org.elasticsearch.action.search.ShardSearchFailure; import org.elasticsearch.action.search.ShardSearchFailure;
import org.elasticsearch.common.ParseField; import org.elasticsearch.common.ParseField;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -37,7 +37,7 @@ import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.mapper.MapperService;
import org.elasticsearch.rest.action.document.RestBulkAction; import org.opensearch.rest.action.document.RestBulkAction;
import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHit;
import org.hamcrest.Matcher; import org.hamcrest.Matcher;
import org.hamcrest.Matchers; import org.hamcrest.Matchers;
@ -484,11 +484,11 @@ public class BulkProcessorIT extends ESRestHighLevelClientTestCase {
private MultiGetRequest indexDocs(BulkProcessor processor, int numDocs) throws Exception { private MultiGetRequest indexDocs(BulkProcessor processor, int numDocs) throws Exception {
return indexDocs(processor, numDocs, "test", null, null, null, null); return indexDocs(processor, numDocs, "test", null, null, null, null);
} }
private static void assertResponseItems(List<BulkItemResponse> bulkItemResponses, int numDocs) { private static void assertResponseItems(List<BulkItemResponse> bulkItemResponses, int numDocs) {
assertResponseItems(bulkItemResponses, numDocs, MapperService.SINGLE_MAPPING_NAME); assertResponseItems(bulkItemResponses, numDocs, MapperService.SINGLE_MAPPING_NAME);
} }
private static void assertResponseItems(List<BulkItemResponse> bulkItemResponses, int numDocs, String expectedType) { private static void assertResponseItems(List<BulkItemResponse> bulkItemResponses, int numDocs, String expectedType) {
assertThat(bulkItemResponses.size(), is(numDocs)); assertThat(bulkItemResponses.size(), is(numDocs));
int i = 1; int i = 1;

View File

@ -28,7 +28,7 @@ import org.elasticsearch.action.get.MultiGetRequest;
import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.transport.RemoteTransportException; import org.elasticsearch.transport.RemoteTransportException;
import java.util.Collections; import java.util.Collections;

View File

@ -24,7 +24,7 @@ import org.elasticsearch.action.bulk.BulkResponse;
import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.rest.action.document.RestBulkAction; import org.opensearch.rest.action.document.RestBulkAction;
import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHit;
import java.io.IOException; import java.io.IOException;
@ -177,7 +177,7 @@ public class BulkRequestWithGlobalParametersIT extends ESRestHighLevelClientTest
.source(XContentType.JSON, "field", "bulk1")); .source(XContentType.JSON, "field", "bulk1"));
request.routing("1"); request.routing("1");
bulk(request); bulk(request);
Iterable<SearchHit> emptyHits = searchAll(new SearchRequest("index").routing("xxx")); Iterable<SearchHit> emptyHits = searchAll(new SearchRequest("index").routing("xxx"));
assertThat(emptyHits, is(emptyIterable())); assertThat(emptyHits, is(emptyIterable()));
@ -199,7 +199,7 @@ public class BulkRequestWithGlobalParametersIT extends ESRestHighLevelClientTest
Iterable<SearchHit> hits = searchAll(new SearchRequest("index").routing("globalRouting", "localRouting")); Iterable<SearchHit> hits = searchAll(new SearchRequest("index").routing("globalRouting", "localRouting"));
assertThat(hits, containsInAnyOrder(hasId("1"), hasId("2"))); assertThat(hits, containsInAnyOrder(hasId("1"), hasId("2")));
} }
public void testGlobalIndexNoTypes() throws IOException { public void testGlobalIndexNoTypes() throws IOException {
BulkRequest request = new BulkRequest("global_index"); BulkRequest request = new BulkRequest("global_index");
request.add(new IndexRequest().id("1") request.add(new IndexRequest().id("1")
@ -211,20 +211,20 @@ public class BulkRequestWithGlobalParametersIT extends ESRestHighLevelClientTest
Iterable<SearchHit> hits = searchAll("global_index"); Iterable<SearchHit> hits = searchAll("global_index");
assertThat(hits, everyItem(hasIndex("global_index"))); assertThat(hits, everyItem(hasIndex("global_index")));
} }
private BulkResponse bulkWithTypes(BulkRequest request) throws IOException { private BulkResponse bulkWithTypes(BulkRequest request) throws IOException {
BulkResponse bulkResponse = execute(request, highLevelClient()::bulk, highLevelClient()::bulkAsync, BulkResponse bulkResponse = execute(request, highLevelClient()::bulk, highLevelClient()::bulkAsync,
expectWarnings(RestBulkAction.TYPES_DEPRECATION_MESSAGE)); expectWarnings(RestBulkAction.TYPES_DEPRECATION_MESSAGE));
assertFalse(bulkResponse.hasFailures()); assertFalse(bulkResponse.hasFailures());
return bulkResponse; return bulkResponse;
} }
private BulkResponse bulk(BulkRequest request) throws IOException { private BulkResponse bulk(BulkRequest request) throws IOException {
BulkResponse bulkResponse = execute(request, highLevelClient()::bulk, highLevelClient()::bulkAsync, RequestOptions.DEFAULT); BulkResponse bulkResponse = execute(request, highLevelClient()::bulk, highLevelClient()::bulkAsync, RequestOptions.DEFAULT);
assertFalse(bulkResponse.hasFailures()); assertFalse(bulkResponse.hasFailures());
return bulkResponse; return bulkResponse;
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private static <T> Function<SearchHit, T> fieldFromSource(String fieldName) { private static <T> Function<SearchHit, T> fieldFromSource(String fieldName) {

View File

@ -52,7 +52,7 @@ import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.common.xcontent.support.XContentMapValues;
import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.indices.recovery.RecoverySettings;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.transport.RemoteClusterService; import org.elasticsearch.transport.RemoteClusterService;
import org.elasticsearch.transport.SniffConnectionStrategy; import org.elasticsearch.transport.SniffConnectionStrategy;
@ -133,7 +133,7 @@ public class ClusterClientIT extends ESRestHighLevelClientTestCase {
highLevelClient().cluster()::putSettings, highLevelClient().cluster()::putSettingsAsync)); highLevelClient().cluster()::putSettings, highLevelClient().cluster()::putSettingsAsync));
assertThat(exception.status(), equalTo(RestStatus.BAD_REQUEST)); assertThat(exception.status(), equalTo(RestStatus.BAD_REQUEST));
assertThat(exception.getMessage(), equalTo( assertThat(exception.getMessage(), equalTo(
"Elasticsearch exception [type=illegal_argument_exception, reason=transient setting [" + setting + "], not recognized]")); "OpenSearch exception [type=illegal_argument_exception, reason=transient setting [" + setting + "], not recognized]"));
} }
public void testClusterGetSettings() throws IOException { public void testClusterGetSettings() throws IOException {

View File

@ -55,13 +55,13 @@ import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.index.VersionType; import org.elasticsearch.index.VersionType;
import org.elasticsearch.index.get.GetResult; import org.elasticsearch.index.get.GetResult;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.rest.action.document.RestBulkAction; import org.opensearch.rest.action.document.RestBulkAction;
import org.elasticsearch.rest.action.document.RestDeleteAction; import org.opensearch.rest.action.document.RestDeleteAction;
import org.elasticsearch.rest.action.document.RestGetAction; import org.opensearch.rest.action.document.RestGetAction;
import org.elasticsearch.rest.action.document.RestIndexAction; import org.opensearch.rest.action.document.RestIndexAction;
import org.elasticsearch.rest.action.document.RestMultiGetAction; import org.opensearch.rest.action.document.RestMultiGetAction;
import org.elasticsearch.rest.action.document.RestUpdateAction; import org.opensearch.rest.action.document.RestUpdateAction;
import org.elasticsearch.script.Script; import org.elasticsearch.script.Script;
import org.elasticsearch.script.ScriptType; import org.elasticsearch.script.ScriptType;
import org.elasticsearch.search.fetch.subphase.FetchSourceContext; import org.elasticsearch.search.fetch.subphase.FetchSourceContext;
@ -122,7 +122,7 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
OpenSearchException exception = expectThrows(OpenSearchException.class, OpenSearchException exception = expectThrows(OpenSearchException.class,
() -> execute(deleteRequest, highLevelClient()::delete, highLevelClient()::deleteAsync)); () -> execute(deleteRequest, highLevelClient()::delete, highLevelClient()::deleteAsync));
assertEquals(RestStatus.CONFLICT, exception.status()); assertEquals(RestStatus.CONFLICT, exception.status());
assertEquals("Elasticsearch exception [type=version_conflict_engine_exception, reason=[" + docId + "]: " + 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]]", "version conflict, required seqNo [2], primary term [2]. current document has seqNo [3] and primary term [1]]",
exception.getMessage()); exception.getMessage());
assertEquals("index", exception.getMetadata("es.index").get(0)); assertEquals("index", exception.getMetadata("es.index").get(0));
@ -151,7 +151,7 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
execute(deleteRequest, highLevelClient()::delete, highLevelClient()::deleteAsync); execute(deleteRequest, highLevelClient()::delete, highLevelClient()::deleteAsync);
}); });
assertEquals(RestStatus.CONFLICT, exception.status()); assertEquals(RestStatus.CONFLICT, exception.status());
assertEquals("Elasticsearch exception [type=version_conflict_engine_exception, reason=[" + 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()); 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("es.index").get(0));
} }
@ -298,7 +298,7 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
OpenSearchException exception = expectThrows(OpenSearchException.class, OpenSearchException exception = expectThrows(OpenSearchException.class,
() -> execute(getRequest, highLevelClient()::get, highLevelClient()::getAsync)); () -> execute(getRequest, highLevelClient()::get, highLevelClient()::getAsync));
assertEquals(RestStatus.NOT_FOUND, exception.status()); assertEquals(RestStatus.NOT_FOUND, exception.status());
assertEquals("Elasticsearch exception [type=index_not_found_exception, reason=no such index [index]]", exception.getMessage()); 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("es.index").get(0));
} }
IndexRequest index = new IndexRequest("index").id("id"); IndexRequest index = new IndexRequest("index").id("id");
@ -311,7 +311,7 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
OpenSearchException exception = expectThrows(OpenSearchException.class, OpenSearchException exception = expectThrows(OpenSearchException.class,
() -> execute(getRequest, highLevelClient()::get, highLevelClient()::getAsync)); () -> execute(getRequest, highLevelClient()::get, highLevelClient()::getAsync));
assertEquals(RestStatus.CONFLICT, exception.status()); assertEquals(RestStatus.CONFLICT, exception.status());
assertEquals("Elasticsearch exception [type=version_conflict_engine_exception, " + "reason=[id]: " + assertEquals("OpenSearch exception [type=version_conflict_engine_exception, " + "reason=[id]: " +
"version conflict, current version [1] is different than the one provided [2]]", exception.getMessage()); "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("es.index").get(0));
} }
@ -412,7 +412,7 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
assertEquals("id1", response.getResponses()[0].getFailure().getId()); assertEquals("id1", response.getResponses()[0].getFailure().getId());
assertNull(response.getResponses()[0].getFailure().getType()); assertNull(response.getResponses()[0].getFailure().getType());
assertEquals("index", response.getResponses()[0].getFailure().getIndex()); assertEquals("index", response.getResponses()[0].getFailure().getIndex());
assertEquals("Elasticsearch exception [type=index_not_found_exception, reason=no such index [index]]", assertEquals("OpenSearch exception [type=index_not_found_exception, reason=no such index [index]]",
response.getResponses()[0].getFailure().getFailure().getMessage()); response.getResponses()[0].getFailure().getFailure().getMessage());
assertTrue(response.getResponses()[1].isFailed()); assertTrue(response.getResponses()[1].isFailed());
@ -420,7 +420,7 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
assertEquals("id2", response.getResponses()[1].getId()); assertEquals("id2", response.getResponses()[1].getId());
assertNull(response.getResponses()[1].getType()); assertNull(response.getResponses()[1].getType());
assertEquals("index", response.getResponses()[1].getIndex()); assertEquals("index", response.getResponses()[1].getIndex());
assertEquals("Elasticsearch exception [type=index_not_found_exception, reason=no such index [index]]", assertEquals("OpenSearch exception [type=index_not_found_exception, reason=no such index [index]]",
response.getResponses()[1].getFailure().getFailure().getMessage()); response.getResponses()[1].getFailure().getFailure().getMessage());
} }
BulkRequest bulk = new BulkRequest(); BulkRequest bulk = new BulkRequest();
@ -491,7 +491,7 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
OpenSearchException exception = expectThrows(OpenSearchException.class, OpenSearchException exception = expectThrows(OpenSearchException.class,
() -> execute(getRequest, highLevelClient()::getSource, highLevelClient()::getSourceAsync)); () -> execute(getRequest, highLevelClient()::getSource, highLevelClient()::getSourceAsync));
assertEquals(RestStatus.NOT_FOUND, exception.status()); assertEquals(RestStatus.NOT_FOUND, exception.status());
assertEquals("Elasticsearch exception [type=index_not_found_exception, reason=no such index [index]]", exception.getMessage()); 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("es.index").get(0));
} }
IndexRequest index = new IndexRequest("index").id("id"); IndexRequest index = new IndexRequest("index").id("id");
@ -512,7 +512,7 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
OpenSearchException exception = expectThrows(OpenSearchException.class, OpenSearchException exception = expectThrows(OpenSearchException.class,
() -> execute(getRequest, highLevelClient()::getSource, highLevelClient()::getSourceAsync)); () -> execute(getRequest, highLevelClient()::getSource, highLevelClient()::getSourceAsync));
assertEquals(RestStatus.NOT_FOUND, exception.status()); assertEquals(RestStatus.NOT_FOUND, exception.status());
assertEquals("Elasticsearch exception [type=resource_not_found_exception, " + assertEquals("OpenSearch exception [type=resource_not_found_exception, " +
"reason=Document not found [index]/[_doc]/[does_not_exist]]", exception.getMessage()); "reason=Document not found [index]/[_doc]/[does_not_exist]]", exception.getMessage());
} }
{ {
@ -545,7 +545,7 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
getRequest.fetchSourceContext(new FetchSourceContext(false)); getRequest.fetchSourceContext(new FetchSourceContext(false));
OpenSearchException exception = expectThrows(OpenSearchException.class, OpenSearchException exception = expectThrows(OpenSearchException.class,
() -> execute(getRequest, highLevelClient()::getSource, highLevelClient()::getSourceAsync)); () -> execute(getRequest, highLevelClient()::getSource, highLevelClient()::getSourceAsync));
assertEquals("Elasticsearch exception [type=action_request_validation_exception, " + assertEquals("OpenSearch exception [type=action_request_validation_exception, " +
"reason=Validation Failed: 1: fetching source can not be disabled;]", exception.getMessage()); "reason=Validation Failed: 1: fetching source can not be disabled;]", exception.getMessage());
} }
} }
@ -602,7 +602,7 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
execute(wrongRequest, highLevelClient()::index, highLevelClient()::indexAsync); execute(wrongRequest, highLevelClient()::index, highLevelClient()::indexAsync);
}); });
assertEquals(RestStatus.CONFLICT, exception.status()); assertEquals(RestStatus.CONFLICT, exception.status());
assertEquals("Elasticsearch exception [type=version_conflict_engine_exception, reason=[id]: " + 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]]", "version conflict, required seqNo [1], primary term [5]. current document has seqNo [2] and primary term [1]]",
exception.getMessage()); exception.getMessage());
assertEquals("index", exception.getMetadata("es.index").get(0)); assertEquals("index", exception.getMetadata("es.index").get(0));
@ -617,7 +617,7 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
}); });
assertEquals(RestStatus.BAD_REQUEST, exception.status()); assertEquals(RestStatus.BAD_REQUEST, exception.status());
assertEquals("Elasticsearch exception [type=illegal_argument_exception, " + assertEquals("OpenSearch exception [type=illegal_argument_exception, " +
"reason=pipeline with id [missing] does not exist]", exception.getMessage()); "reason=pipeline with id [missing] does not exist]", exception.getMessage());
} }
{ {
@ -649,7 +649,7 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
}); });
assertEquals(RestStatus.CONFLICT, exception.status()); assertEquals(RestStatus.CONFLICT, exception.status());
assertEquals("Elasticsearch exception [type=version_conflict_engine_exception, reason=[with_create_op_type]: " + assertEquals("OpenSearch exception [type=version_conflict_engine_exception, reason=[with_create_op_type]: " +
"version conflict, document already exists (current version [1])]", exception.getMessage()); "version conflict, document already exists (current version [1])]", exception.getMessage());
} }
} }
@ -678,7 +678,7 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
OpenSearchStatusException exception = expectThrows(OpenSearchStatusException.class, () -> OpenSearchStatusException exception = expectThrows(OpenSearchStatusException.class, () ->
execute(updateRequest, highLevelClient()::update, highLevelClient()::updateAsync)); execute(updateRequest, highLevelClient()::update, highLevelClient()::updateAsync));
assertEquals(RestStatus.NOT_FOUND, exception.status()); assertEquals(RestStatus.NOT_FOUND, exception.status());
assertEquals("Elasticsearch exception [type=document_missing_exception, reason=[_doc][does_not_exist]: document missing]", assertEquals("OpenSearch exception [type=document_missing_exception, reason=[_doc][does_not_exist]: document missing]",
exception.getMessage()); exception.getMessage());
} }
{ {
@ -715,7 +715,7 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
OpenSearchStatusException exception = expectThrows(OpenSearchStatusException.class, () -> OpenSearchStatusException exception = expectThrows(OpenSearchStatusException.class, () ->
execute(updateRequest, highLevelClient()::update, highLevelClient()::updateAsync)); execute(updateRequest, highLevelClient()::update, highLevelClient()::updateAsync));
assertEquals(exception.toString(),RestStatus.CONFLICT, exception.status()); assertEquals(exception.toString(),RestStatus.CONFLICT, exception.status());
assertThat(exception.getMessage(), containsString("Elasticsearch exception [type=version_conflict_engine_exception")); assertThat(exception.getMessage(), containsString("OpenSearch exception [type=version_conflict_engine_exception"));
} }
{ {
final UpdateRequest updateRequest = new UpdateRequest("index", "id"); final UpdateRequest updateRequest = new UpdateRequest("index", "id");

View File

@ -22,7 +22,7 @@ package org.elasticsearch.client;
import org.elasticsearch.cluster.metadata.AliasMetadata; import org.elasticsearch.cluster.metadata.AliasMetadata;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.common.xcontent.json.JsonXContent;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.test.AbstractXContentTestCase; import org.elasticsearch.test.AbstractXContentTestCase;
import java.io.IOException; import java.io.IOException;
@ -131,7 +131,7 @@ public class GetAliasesResponseTests extends AbstractXContentTestCase<GetAliases
assertThat(getAliasesResponse.getError(), nullValue()); assertThat(getAliasesResponse.getError(), nullValue());
assertThat(getAliasesResponse.status(), equalTo(RestStatus.NOT_FOUND)); assertThat(getAliasesResponse.status(), equalTo(RestStatus.NOT_FOUND));
assertThat(getAliasesResponse.getException().getMessage(), assertThat(getAliasesResponse.getException().getMessage(),
equalTo("Elasticsearch exception [type=index_not_found_exception, reason=no such index [index]]")); equalTo("OpenSearch exception [type=index_not_found_exception, reason=no such index [index]]"));
} }
} }

View File

@ -114,15 +114,15 @@ import org.elasticsearch.index.mapper.MapperService;
import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.indices.flush.SyncedFlushService; import org.elasticsearch.indices.flush.SyncedFlushService;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.rest.action.admin.indices.RestCreateIndexAction; import org.opensearch.rest.action.admin.indices.RestCreateIndexAction;
import org.elasticsearch.rest.action.admin.indices.RestGetFieldMappingAction; import org.opensearch.rest.action.admin.indices.RestGetFieldMappingAction;
import org.elasticsearch.rest.action.admin.indices.RestGetIndexTemplateAction; import org.opensearch.rest.action.admin.indices.RestGetIndexTemplateAction;
import org.elasticsearch.rest.action.admin.indices.RestGetIndicesAction; import org.opensearch.rest.action.admin.indices.RestGetIndicesAction;
import org.elasticsearch.rest.action.admin.indices.RestGetMappingAction; import org.opensearch.rest.action.admin.indices.RestGetMappingAction;
import org.elasticsearch.rest.action.admin.indices.RestPutIndexTemplateAction; import org.opensearch.rest.action.admin.indices.RestPutIndexTemplateAction;
import org.elasticsearch.rest.action.admin.indices.RestPutMappingAction; import org.opensearch.rest.action.admin.indices.RestPutMappingAction;
import org.elasticsearch.rest.action.admin.indices.RestRolloverIndexAction; import org.opensearch.rest.action.admin.indices.RestRolloverIndexAction;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays; import java.util.Arrays;
@ -819,7 +819,7 @@ public class IndicesClientIT extends ESRestHighLevelClientTestCase {
highLevelClient().indices()::updateAliases, highLevelClient().indices()::updateAliasesAsync)); highLevelClient().indices()::updateAliases, highLevelClient().indices()::updateAliasesAsync));
assertThat(exception.status(), equalTo(RestStatus.NOT_FOUND)); assertThat(exception.status(), equalTo(RestStatus.NOT_FOUND));
assertThat(exception.getMessage(), assertThat(exception.getMessage(),
equalTo("Elasticsearch exception [type=index_not_found_exception, reason=no such index [non_existent_index]]")); 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"), hasItem(nonExistentIndex));
createIndex(index, Settings.EMPTY); createIndex(index, Settings.EMPTY);
@ -830,7 +830,7 @@ public class IndicesClientIT extends ESRestHighLevelClientTestCase {
() -> execute(mixedRequest, highLevelClient().indices()::updateAliases, highLevelClient().indices()::updateAliasesAsync)); () -> execute(mixedRequest, highLevelClient().indices()::updateAliases, highLevelClient().indices()::updateAliasesAsync));
assertThat(exception.status(), equalTo(RestStatus.NOT_FOUND)); assertThat(exception.status(), equalTo(RestStatus.NOT_FOUND));
assertThat(exception.getMessage(), assertThat(exception.getMessage(),
equalTo("Elasticsearch exception [type=index_not_found_exception, reason=no such index [non_existent_index]]")); 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"), hasItem(nonExistentIndex));
assertThat(exception.getMetadata("es.index"), not(hasItem(index))); assertThat(exception.getMetadata("es.index"), not(hasItem(index)));
assertThat(aliasExists(index, alias), equalTo(false)); assertThat(aliasExists(index, alias), equalTo(false));
@ -843,7 +843,7 @@ public class IndicesClientIT extends ESRestHighLevelClientTestCase {
highLevelClient().indices()::updateAliasesAsync)); highLevelClient().indices()::updateAliasesAsync));
assertThat(exception.status(), equalTo(RestStatus.NOT_FOUND)); assertThat(exception.status(), equalTo(RestStatus.NOT_FOUND));
assertThat(exception.getMessage(), assertThat(exception.getMessage(),
equalTo("Elasticsearch exception [type=index_not_found_exception, reason=no such index [non_existent_index]]")); 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"), hasItem(nonExistentIndex));
assertThat(exception.getMetadata("es.index"), not(hasItem(index))); assertThat(exception.getMetadata("es.index"), not(hasItem(index)));
assertThat(aliasExists(index, alias), equalTo(false)); assertThat(aliasExists(index, alias), equalTo(false));
@ -1387,7 +1387,7 @@ public class IndicesClientIT extends ESRestHighLevelClientTestCase {
highLevelClient().indices()::getAliasAsync); highLevelClient().indices()::getAliasAsync);
assertThat(getAliasesResponse.status(), equalTo(RestStatus.NOT_FOUND)); assertThat(getAliasesResponse.status(), equalTo(RestStatus.NOT_FOUND));
assertThat(getAliasesResponse.getException().getMessage(), assertThat(getAliasesResponse.getException().getMessage(),
equalTo("Elasticsearch exception [type=index_not_found_exception, reason=no such index [index]]")); equalTo("OpenSearch exception [type=index_not_found_exception, reason=no such index [index]]"));
} }
{ {
GetAliasesRequest getAliasesRequest = new GetAliasesRequest(alias); GetAliasesRequest getAliasesRequest = new GetAliasesRequest(alias);
@ -1407,7 +1407,7 @@ public class IndicesClientIT extends ESRestHighLevelClientTestCase {
assertThat(getAliasesResponse.status(), equalTo(RestStatus.NOT_FOUND)); assertThat(getAliasesResponse.status(), equalTo(RestStatus.NOT_FOUND));
assertThat(getAliasesResponse.getError(), nullValue()); assertThat(getAliasesResponse.getError(), nullValue());
assertThat(getAliasesResponse.getException().getMessage(), assertThat(getAliasesResponse.getException().getMessage(),
equalTo("Elasticsearch exception [type=index_not_found_exception, reason=no such index [non_existent_index]]")); equalTo("OpenSearch exception [type=index_not_found_exception, reason=no such index [non_existent_index]]"));
} }
{ {
GetAliasesRequest getAliasesRequest = new GetAliasesRequest().indices(index, "non_existent_index").aliases(alias); GetAliasesRequest getAliasesRequest = new GetAliasesRequest().indices(index, "non_existent_index").aliases(alias);
@ -1416,7 +1416,7 @@ public class IndicesClientIT extends ESRestHighLevelClientTestCase {
assertThat(getAliasesResponse.getAliases().size(), equalTo(0)); assertThat(getAliasesResponse.getAliases().size(), equalTo(0));
assertThat(getAliasesResponse.status(), equalTo(RestStatus.NOT_FOUND)); assertThat(getAliasesResponse.status(), equalTo(RestStatus.NOT_FOUND));
assertThat(getAliasesResponse.getException().getMessage(), assertThat(getAliasesResponse.getException().getMessage(),
equalTo("Elasticsearch exception [type=index_not_found_exception, reason=no such index [non_existent_index]]")); equalTo("OpenSearch exception [type=index_not_found_exception, reason=no such index [non_existent_index]]"));
} }
{ {
GetAliasesRequest getAliasesRequest = new GetAliasesRequest().indices("non_existent_index*"); GetAliasesRequest getAliasesRequest = new GetAliasesRequest().indices("non_existent_index*");
@ -1494,7 +1494,7 @@ public class IndicesClientIT extends ESRestHighLevelClientTestCase {
OpenSearchException exception = expectThrows(OpenSearchException.class, () -> execute(staticSettingRequest, OpenSearchException exception = expectThrows(OpenSearchException.class, () -> execute(staticSettingRequest,
highLevelClient().indices()::putSettings, highLevelClient().indices()::putSettingsAsync)); highLevelClient().indices()::putSettings, highLevelClient().indices()::putSettingsAsync));
assertThat(exception.getMessage(), assertThat(exception.getMessage(),
startsWith("Elasticsearch exception [type=illegal_argument_exception, " startsWith("OpenSearch exception [type=illegal_argument_exception, "
+ "reason=Can't update non dynamic settings [[index.shard.check_on_startup]] for open indices [[index/")); + "reason=Can't update non dynamic settings [[index.shard.check_on_startup]] for open indices [[index/"));
indexSettingsAsMap = getIndexSettingsAsMap(index); indexSettingsAsMap = getIndexSettingsAsMap(index);
@ -1514,13 +1514,13 @@ public class IndicesClientIT extends ESRestHighLevelClientTestCase {
exception = expectThrows(OpenSearchException.class, () -> execute(unmodifiableSettingRequest, exception = expectThrows(OpenSearchException.class, () -> execute(unmodifiableSettingRequest,
highLevelClient().indices()::putSettings, highLevelClient().indices()::putSettingsAsync)); highLevelClient().indices()::putSettings, highLevelClient().indices()::putSettingsAsync));
assertThat(exception.getMessage(), startsWith( assertThat(exception.getMessage(), startsWith(
"Elasticsearch exception [type=illegal_argument_exception, " "OpenSearch exception [type=illegal_argument_exception, "
+ "reason=Can't update non dynamic settings [[index.number_of_shards]] for open indices [[index/")); + "reason=Can't update non dynamic settings [[index.number_of_shards]] for open indices [[index/"));
closeIndex(index); closeIndex(index);
exception = expectThrows(OpenSearchException.class, () -> execute(unmodifiableSettingRequest, exception = expectThrows(OpenSearchException.class, () -> execute(unmodifiableSettingRequest,
highLevelClient().indices()::putSettings, highLevelClient().indices()::putSettingsAsync)); highLevelClient().indices()::putSettings, highLevelClient().indices()::putSettingsAsync));
assertThat(exception.getMessage(), startsWith( assertThat(exception.getMessage(), startsWith(
"Elasticsearch exception [type=illegal_argument_exception, " "OpenSearch exception [type=illegal_argument_exception, "
+ "reason=final index setting [index.number_of_shards], not updateable")); + "reason=final index setting [index.number_of_shards], not updateable"));
} }
@ -1536,14 +1536,14 @@ public class IndicesClientIT extends ESRestHighLevelClientTestCase {
highLevelClient().indices()::putSettings, highLevelClient().indices()::putSettingsAsync)); highLevelClient().indices()::putSettings, highLevelClient().indices()::putSettingsAsync));
assertEquals(RestStatus.NOT_FOUND, exception.status()); assertEquals(RestStatus.NOT_FOUND, exception.status());
assertThat(exception.getMessage(), assertThat(exception.getMessage(),
equalTo("Elasticsearch exception [type=index_not_found_exception, reason=no such index [index]]")); equalTo("OpenSearch exception [type=index_not_found_exception, reason=no such index [index]]"));
createIndex(index, Settings.EMPTY); createIndex(index, Settings.EMPTY);
exception = expectThrows(OpenSearchException.class, () -> execute(indexUpdateSettingsRequest, exception = expectThrows(OpenSearchException.class, () -> execute(indexUpdateSettingsRequest,
highLevelClient().indices()::putSettings, highLevelClient().indices()::putSettingsAsync)); highLevelClient().indices()::putSettings, highLevelClient().indices()::putSettingsAsync));
assertThat(exception.status(), equalTo(RestStatus.BAD_REQUEST)); assertThat(exception.status(), equalTo(RestStatus.BAD_REQUEST));
assertThat(exception.getMessage(), equalTo( assertThat(exception.getMessage(), equalTo(
"Elasticsearch exception [type=illegal_argument_exception, " "OpenSearch exception [type=illegal_argument_exception, "
+ "reason=unknown setting [index.no_idea_what_you_are_talking_about] please check that any required plugins are installed, " + "reason=unknown setting [index.no_idea_what_you_are_talking_about] please check that any required plugins are installed, "
+ "or check the breaking changes documentation for removed settings]")); + "or check the breaking changes documentation for removed settings]"));
} }

View File

@ -84,7 +84,7 @@ import static org.elasticsearch.client.indices.RandomCreateIndexGenerator.random
import static org.elasticsearch.index.RandomCreateIndexGenerator.randomAlias; import static org.elasticsearch.index.RandomCreateIndexGenerator.randomAlias;
import static org.elasticsearch.index.RandomCreateIndexGenerator.randomIndexSettings; import static org.elasticsearch.index.RandomCreateIndexGenerator.randomIndexSettings;
import static org.elasticsearch.index.alias.RandomAliasActionsGenerator.randomAliasAction; import static org.elasticsearch.index.alias.RandomAliasActionsGenerator.randomAliasAction;
import static org.elasticsearch.rest.BaseRestHandler.INCLUDE_TYPE_NAME_PARAMETER; import static org.opensearch.rest.BaseRestHandler.INCLUDE_TYPE_NAME_PARAMETER;
import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.Matchers.nullValue;

View File

@ -34,7 +34,7 @@ import org.elasticsearch.index.reindex.BulkByScrollResponse;
import org.elasticsearch.index.reindex.DeleteByQueryAction; import org.elasticsearch.index.reindex.DeleteByQueryAction;
import org.elasticsearch.index.reindex.DeleteByQueryRequest; import org.elasticsearch.index.reindex.DeleteByQueryRequest;
import org.elasticsearch.index.reindex.ReindexRequest; import org.elasticsearch.index.reindex.ReindexRequest;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.tasks.RawTaskStatus; import org.elasticsearch.tasks.RawTaskStatus;
import org.elasticsearch.tasks.TaskId; import org.elasticsearch.tasks.TaskId;
@ -268,7 +268,7 @@ public class ReindexIT extends ESRestHighLevelClientTestCase {
assertTrue(response.getTasks().isEmpty()); assertTrue(response.getTasks().isEmpty());
assertFalse(response.getNodeFailures().isEmpty()); assertFalse(response.getNodeFailures().isEmpty());
assertEquals(1, response.getNodeFailures().size()); assertEquals(1, response.getNodeFailures().size());
assertEquals("Elasticsearch exception [type=resource_not_found_exception, reason=task [" + taskIdToRethrottle + "] is missing]", assertEquals("OpenSearch exception [type=resource_not_found_exception, reason=task [" + taskIdToRethrottle + "] is missing]",
response.getNodeFailures().get(0).getCause().getMessage()); response.getNodeFailures().get(0).getCause().getMessage());
} }
} }

View File

@ -87,7 +87,7 @@ import org.elasticsearch.index.reindex.DeleteByQueryRequest;
import org.elasticsearch.index.reindex.ReindexRequest; import org.elasticsearch.index.reindex.ReindexRequest;
import org.elasticsearch.index.reindex.RemoteInfo; import org.elasticsearch.index.reindex.RemoteInfo;
import org.elasticsearch.index.reindex.UpdateByQueryRequest; import org.elasticsearch.index.reindex.UpdateByQueryRequest;
import org.elasticsearch.rest.action.search.RestSearchAction; import org.opensearch.rest.action.search.RestSearchAction;
import org.elasticsearch.script.Script; import org.elasticsearch.script.Script;
import org.elasticsearch.script.ScriptType; import org.elasticsearch.script.ScriptType;
import org.opensearch.script.mustache.MultiSearchTemplateRequest; import org.opensearch.script.mustache.MultiSearchTemplateRequest;

View File

@ -64,7 +64,7 @@ import org.opensearch.index.rankeval.MetricDetail;
import org.opensearch.index.rankeval.PrecisionAtK; import org.opensearch.index.rankeval.PrecisionAtK;
import org.opensearch.index.rankeval.RecallAtK; import org.opensearch.index.rankeval.RecallAtK;
import org.opensearch.join.aggregations.ChildrenAggregationBuilder; import org.opensearch.join.aggregations.ChildrenAggregationBuilder;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.search.SearchHits; import org.elasticsearch.search.SearchHits;
import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.Aggregation;
import org.elasticsearch.search.aggregations.InternalAggregations; import org.elasticsearch.search.aggregations.InternalAggregations;
@ -251,7 +251,7 @@ public class RestHighLevelClientTests extends ESTestCase {
{ {
IllegalStateException ise = expectThrows(IllegalStateException.class, IllegalStateException ise = expectThrows(IllegalStateException.class,
() -> restHighLevelClient.parseEntity(new NStringEntity("", (ContentType) null), null)); () -> restHighLevelClient.parseEntity(new NStringEntity("", (ContentType) null), null));
assertEquals("Elasticsearch didn't return the [Content-Type] header, unable to parse response body", ise.getMessage()); assertEquals("OpenSearch didn't return the [Content-Type] header, unable to parse response body", ise.getMessage());
} }
{ {
NStringEntity entity = new NStringEntity("", ContentType.APPLICATION_SVG_XML); NStringEntity entity = new NStringEntity("", ContentType.APPLICATION_SVG_XML);
@ -314,7 +314,7 @@ public class RestHighLevelClientTests extends ESTestCase {
Response response = new Response(REQUEST_LINE, new HttpHost("localhost", 9200), httpResponse); Response response = new Response(REQUEST_LINE, new HttpHost("localhost", 9200), httpResponse);
ResponseException responseException = new ResponseException(response); ResponseException responseException = new ResponseException(response);
OpenSearchException openSearchException = restHighLevelClient.parseResponseException(responseException); OpenSearchException openSearchException = restHighLevelClient.parseResponseException(responseException);
assertEquals("Elasticsearch exception [type=exception, reason=test error message]", openSearchException.getMessage()); assertEquals("OpenSearch exception [type=exception, reason=test error message]", openSearchException.getMessage());
assertEquals(restStatus, openSearchException.status()); assertEquals(restStatus, openSearchException.status());
assertSame(responseException, openSearchException.getSuppressed()[0]); assertSame(responseException, openSearchException.getSuppressed()[0]);
} }
@ -393,7 +393,7 @@ public class RestHighLevelClientTests extends ESTestCase {
OpenSearchException openSearchException = expectThrows(OpenSearchException.class, OpenSearchException openSearchException = expectThrows(OpenSearchException.class,
() -> restHighLevelClient.performRequest(mainRequest, requestConverter, RequestOptions.DEFAULT, () -> restHighLevelClient.performRequest(mainRequest, requestConverter, RequestOptions.DEFAULT,
response -> response.getStatusLine().getStatusCode(), Collections.emptySet())); response -> response.getStatusLine().getStatusCode(), Collections.emptySet()));
assertEquals("Elasticsearch exception [type=exception, reason=test error message]", openSearchException.getMessage()); assertEquals("OpenSearch exception [type=exception, reason=test error message]", openSearchException.getMessage());
assertEquals(restStatus, openSearchException.status()); assertEquals(restStatus, openSearchException.status());
assertSame(responseException, openSearchException.getSuppressed()[0]); assertSame(responseException, openSearchException.getSuppressed()[0]);
} }
@ -475,7 +475,7 @@ public class RestHighLevelClientTests extends ESTestCase {
response -> {throw new IllegalStateException();}, Collections.singleton(404))); response -> {throw new IllegalStateException();}, Collections.singleton(404)));
assertEquals(RestStatus.NOT_FOUND, openSearchException.status()); assertEquals(RestStatus.NOT_FOUND, openSearchException.status());
assertSame(responseException, openSearchException.getSuppressed()[0]); assertSame(responseException, openSearchException.getSuppressed()[0]);
assertEquals("Elasticsearch exception [type=exception, reason=test error message]", openSearchException.getMessage()); assertEquals("OpenSearch exception [type=exception, reason=test error message]", openSearchException.getMessage());
} }
public void testWrapResponseListenerOnSuccess() { public void testWrapResponseListenerOnSuccess() {
@ -542,7 +542,7 @@ public class RestHighLevelClientTests extends ESTestCase {
responseListener.onFailure(responseException); responseListener.onFailure(responseException);
assertThat(trackingActionListener.exception.get(), instanceOf(OpenSearchException.class)); assertThat(trackingActionListener.exception.get(), instanceOf(OpenSearchException.class));
OpenSearchException openSearchException = (OpenSearchException)trackingActionListener.exception.get(); OpenSearchException openSearchException = (OpenSearchException)trackingActionListener.exception.get();
assertEquals("Elasticsearch exception [type=exception, reason=test error message]", openSearchException.getMessage()); assertEquals("OpenSearch exception [type=exception, reason=test error message]", openSearchException.getMessage());
assertEquals(restStatus, openSearchException.status()); assertEquals(restStatus, openSearchException.status());
assertSame(responseException, openSearchException.getSuppressed()[0]); assertSame(responseException, openSearchException.getSuppressed()[0]);
} }
@ -630,7 +630,7 @@ public class RestHighLevelClientTests extends ESTestCase {
OpenSearchException openSearchException = (OpenSearchException)trackingActionListener.exception.get(); OpenSearchException openSearchException = (OpenSearchException)trackingActionListener.exception.get();
assertEquals(RestStatus.NOT_FOUND, openSearchException.status()); assertEquals(RestStatus.NOT_FOUND, openSearchException.status());
assertSame(responseException, openSearchException.getSuppressed()[0]); assertSame(responseException, openSearchException.getSuppressed()[0]);
assertEquals("Elasticsearch exception [type=exception, reason=test error message]", openSearchException.getMessage()); assertEquals("OpenSearch exception [type=exception, reason=test error message]", openSearchException.getMessage());
} }
public void testDefaultNamedXContents() { public void testDefaultNamedXContents() {

View File

@ -50,8 +50,8 @@ import org.elasticsearch.index.query.ScriptQueryBuilder;
import org.elasticsearch.index.query.TermsQueryBuilder; import org.elasticsearch.index.query.TermsQueryBuilder;
import org.opensearch.join.aggregations.Children; import org.opensearch.join.aggregations.Children;
import org.opensearch.join.aggregations.ChildrenAggregationBuilder; import org.opensearch.join.aggregations.ChildrenAggregationBuilder;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.rest.action.document.RestIndexAction; import org.opensearch.rest.action.document.RestIndexAction;
import org.elasticsearch.script.Script; import org.elasticsearch.script.Script;
import org.elasticsearch.script.ScriptType; import org.elasticsearch.script.ScriptType;
import org.opensearch.script.mustache.MultiSearchTemplateRequest; import org.opensearch.script.mustache.MultiSearchTemplateRequest;

View File

@ -43,7 +43,7 @@ import org.elasticsearch.cluster.metadata.IndexMetadata;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.repositories.fs.FsRepository; import org.elasticsearch.repositories.fs.FsRepository;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.snapshots.RestoreInfo; import org.elasticsearch.snapshots.RestoreInfo;
import org.elasticsearch.snapshots.SnapshotInfo; import org.elasticsearch.snapshots.SnapshotInfo;
@ -110,7 +110,7 @@ public class SnapshotIT extends ESRestHighLevelClientTestCase {
assertThat(exception.status(), equalTo(RestStatus.NOT_FOUND)); assertThat(exception.status(), equalTo(RestStatus.NOT_FOUND));
assertThat(exception.getMessage(), equalTo( assertThat(exception.getMessage(), equalTo(
"Elasticsearch exception [type=repository_missing_exception, reason=[" + repository + "] missing]")); "OpenSearch exception [type=repository_missing_exception, reason=[" + repository + "] missing]"));
} }
public void testSnapshotDeleteRepository() throws IOException { public void testSnapshotDeleteRepository() throws IOException {

View File

@ -25,7 +25,7 @@ import org.opensearch.action.admin.cluster.storedscripts.GetStoredScriptResponse
import org.opensearch.action.admin.cluster.storedscripts.PutStoredScriptRequest; import org.opensearch.action.admin.cluster.storedscripts.PutStoredScriptRequest;
import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesArray;
import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.script.Script; import org.elasticsearch.script.Script;
import org.elasticsearch.script.StoredScriptSource; import org.elasticsearch.script.StoredScriptSource;

View File

@ -34,7 +34,7 @@ import org.elasticsearch.client.tasks.TaskSubmissionResponse;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.index.reindex.ReindexRequest; import org.elasticsearch.index.reindex.ReindexRequest;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import java.io.IOException; import java.io.IOException;
import java.util.Collections; import java.util.Collections;

View File

@ -33,7 +33,7 @@ import org.elasticsearch.index.query.IdsQueryBuilder;
import org.elasticsearch.index.reindex.BulkByScrollResponse; import org.elasticsearch.index.reindex.BulkByScrollResponse;
import org.elasticsearch.index.reindex.UpdateByQueryAction; import org.elasticsearch.index.reindex.UpdateByQueryAction;
import org.elasticsearch.index.reindex.UpdateByQueryRequest; import org.elasticsearch.index.reindex.UpdateByQueryRequest;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.script.Script; import org.elasticsearch.script.Script;
import org.elasticsearch.tasks.RawTaskStatus; import org.elasticsearch.tasks.RawTaskStatus;
import org.elasticsearch.tasks.TaskId; import org.elasticsearch.tasks.TaskId;
@ -158,7 +158,7 @@ public class UpdateByQueryIT extends ESRestHighLevelClientTestCase {
assertTrue(response.getTasks().isEmpty()); assertTrue(response.getTasks().isEmpty());
assertFalse(response.getNodeFailures().isEmpty()); assertFalse(response.getNodeFailures().isEmpty());
assertEquals(1, response.getNodeFailures().size()); assertEquals(1, response.getNodeFailures().size());
assertEquals("Elasticsearch exception [type=resource_not_found_exception, reason=task [" + taskIdToRethrottle + "] is missing]", assertEquals("OpenSearch exception [type=resource_not_found_exception, reason=task [" + taskIdToRethrottle + "] is missing]",
response.getNodeFailures().get(0).getCause().getMessage()); response.getNodeFailures().get(0).getCause().getMessage());
} }
} }

View File

@ -28,7 +28,7 @@ import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.MatchAllQueryBuilder;
import org.elasticsearch.index.query.MatchQueryBuilder; import org.elasticsearch.index.query.MatchQueryBuilder;
import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.rest.action.RestActions; import org.opensearch.rest.action.RestActions;
import org.elasticsearch.search.SearchModule; import org.elasticsearch.search.SearchModule;
import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.builder.SearchSourceBuilder;

View File

@ -26,7 +26,7 @@ import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.index.Index; import org.elasticsearch.index.Index;
import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.index.shard.ShardId;
import org.elasticsearch.rest.action.RestActions; import org.opensearch.rest.action.RestActions;
import org.elasticsearch.search.SearchShardTarget; import org.elasticsearch.search.SearchShardTarget;
import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.ESTestCase;
@ -116,11 +116,11 @@ public class CountResponseTests extends ESTestCase {
assertEquals(originalFailure.shard(), parsedFailure.shard()); assertEquals(originalFailure.shard(), parsedFailure.shard());
assertEquals(originalFailure.shardId(), parsedFailure.shardId()); assertEquals(originalFailure.shardId(), parsedFailure.shardId());
String originalMsg = originalFailure.getCause().getMessage(); String originalMsg = originalFailure.getCause().getMessage();
assertEquals(parsedFailure.getCause().getMessage(), "Elasticsearch exception [type=parsing_exception, reason=" + assertEquals(parsedFailure.getCause().getMessage(), "OpenSearch exception [type=parsing_exception, reason=" +
originalMsg + "]"); originalMsg + "]");
String nestedMsg = originalFailure.getCause().getCause().getMessage(); String nestedMsg = originalFailure.getCause().getCause().getMessage();
assertEquals(parsedFailure.getCause().getCause().getMessage(), assertEquals(parsedFailure.getCause().getCause().getMessage(),
"Elasticsearch exception [type=illegal_argument_exception, reason=" + nestedMsg + "]"); "OpenSearch exception [type=illegal_argument_exception, reason=" + nestedMsg + "]");
} }
} }
} }

View File

@ -81,7 +81,7 @@ import org.elasticsearch.index.reindex.ReindexRequest;
import org.elasticsearch.index.reindex.RemoteInfo; import org.elasticsearch.index.reindex.RemoteInfo;
import org.elasticsearch.index.reindex.ScrollableHitSource; import org.elasticsearch.index.reindex.ScrollableHitSource;
import org.elasticsearch.index.reindex.UpdateByQueryRequest; import org.elasticsearch.index.reindex.UpdateByQueryRequest;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.script.Script; import org.elasticsearch.script.Script;
import org.elasticsearch.script.ScriptType; import org.elasticsearch.script.ScriptType;
import org.elasticsearch.search.fetch.subphase.FetchSourceContext; import org.elasticsearch.search.fetch.subphase.FetchSourceContext;
@ -117,7 +117,7 @@ public class CRUDDocumentationIT extends ESRestHighLevelClientTestCase {
Map<String, Object> jsonMap = new HashMap<>(); Map<String, Object> jsonMap = new HashMap<>();
jsonMap.put("user", "kimchy"); jsonMap.put("user", "kimchy");
jsonMap.put("postDate", new Date()); jsonMap.put("postDate", new Date());
jsonMap.put("message", "trying out Elasticsearch"); jsonMap.put("message", "trying out OpenSearch");
IndexRequest indexRequest = new IndexRequest("posts") IndexRequest indexRequest = new IndexRequest("posts")
.id("1").source(jsonMap); // <1> .id("1").source(jsonMap); // <1>
//end::index-request-map //end::index-request-map
@ -131,7 +131,7 @@ public class CRUDDocumentationIT extends ESRestHighLevelClientTestCase {
{ {
builder.field("user", "kimchy"); builder.field("user", "kimchy");
builder.timeField("postDate", new Date()); builder.timeField("postDate", new Date());
builder.field("message", "trying out Elasticsearch"); builder.field("message", "trying out OpenSearch");
} }
builder.endObject(); builder.endObject();
IndexRequest indexRequest = new IndexRequest("posts") IndexRequest indexRequest = new IndexRequest("posts")
@ -146,7 +146,7 @@ public class CRUDDocumentationIT extends ESRestHighLevelClientTestCase {
.id("1") .id("1")
.source("user", "kimchy", .source("user", "kimchy",
"postDate", new Date(), "postDate", new Date(),
"message", "trying out Elasticsearch"); // <1> "message", "trying out OpenSearch"); // <1>
//end::index-request-shortcut //end::index-request-shortcut
IndexResponse indexResponse = client.index(indexRequest, RequestOptions.DEFAULT); IndexResponse indexResponse = client.index(indexRequest, RequestOptions.DEFAULT);
assertEquals(DocWriteResponse.Result.UPDATED, indexResponse.getResult()); assertEquals(DocWriteResponse.Result.UPDATED, indexResponse.getResult());
@ -158,7 +158,7 @@ public class CRUDDocumentationIT extends ESRestHighLevelClientTestCase {
String jsonString = "{" + String jsonString = "{" +
"\"user\":\"kimchy\"," + "\"user\":\"kimchy\"," +
"\"postDate\":\"2013-01-30\"," + "\"postDate\":\"2013-01-30\"," +
"\"message\":\"trying out Elasticsearch\"" + "\"message\":\"trying out OpenSearch\"" +
"}"; "}";
request.source(jsonString, XContentType.JSON); // <3> request.source(jsonString, XContentType.JSON); // <3>
//end::index-request-string //end::index-request-string
@ -1248,7 +1248,7 @@ public class CRUDDocumentationIT extends ESRestHighLevelClientTestCase {
IndexRequest indexRequest = new IndexRequest("posts").id("1") IndexRequest indexRequest = new IndexRequest("posts").id("1")
.source("user", "kimchy", .source("user", "kimchy",
"postDate", new Date(), "postDate", new Date(),
"message", "trying out Elasticsearch"); "message", "trying out OpenSearch");
IndexResponse indexResponse = client.index(indexRequest, RequestOptions.DEFAULT); IndexResponse indexResponse = client.index(indexRequest, RequestOptions.DEFAULT);
assertEquals(DocWriteResponse.Result.CREATED, indexResponse.getResult()); assertEquals(DocWriteResponse.Result.CREATED, indexResponse.getResult());
} }
@ -1297,7 +1297,7 @@ public class CRUDDocumentationIT extends ESRestHighLevelClientTestCase {
GetResponse getResponse = client.get(request, RequestOptions.DEFAULT); GetResponse getResponse = client.get(request, RequestOptions.DEFAULT);
Map<String, Object> sourceAsMap = getResponse.getSourceAsMap(); Map<String, Object> sourceAsMap = getResponse.getSourceAsMap();
assertEquals(2, sourceAsMap.size()); assertEquals(2, sourceAsMap.size());
assertEquals("trying out Elasticsearch", sourceAsMap.get("message")); assertEquals("trying out OpenSearch", sourceAsMap.get("message"));
assertTrue(sourceAsMap.containsKey("postDate")); assertTrue(sourceAsMap.containsKey("postDate"));
} }
{ {
@ -1322,7 +1322,7 @@ public class CRUDDocumentationIT extends ESRestHighLevelClientTestCase {
GetResponse getResponse = client.get(request, RequestOptions.DEFAULT); GetResponse getResponse = client.get(request, RequestOptions.DEFAULT);
String message = getResponse.getField("message").getValue(); // <2> String message = getResponse.getField("message").getValue(); // <2>
//end::get-request-stored //end::get-request-stored
assertEquals("trying out Elasticsearch", message); assertEquals("trying out OpenSearch", message);
assertEquals(1, getResponse.getFields().size()); assertEquals(1, getResponse.getFields().size());
assertNull(getResponse.getSourceInternal()); assertNull(getResponse.getSourceInternal());
} }
@ -1421,7 +1421,7 @@ public class CRUDDocumentationIT extends ESRestHighLevelClientTestCase {
IndexRequest indexRequest = new IndexRequest("posts").id("1") IndexRequest indexRequest = new IndexRequest("posts").id("1")
.source("user", "kimchy", .source("user", "kimchy",
"postDate", new Date(), "postDate", new Date(),
"message", "trying out Elasticsearch"); "message", "trying out OpenSearch");
IndexResponse indexResponse = client.index(indexRequest, RequestOptions.DEFAULT); IndexResponse indexResponse = client.index(indexRequest, RequestOptions.DEFAULT);
assertEquals(DocWriteResponse.Result.CREATED, indexResponse.getResult()); assertEquals(DocWriteResponse.Result.CREATED, indexResponse.getResult());
} }
@ -1463,7 +1463,7 @@ public class CRUDDocumentationIT extends ESRestHighLevelClientTestCase {
Map<String, Object> expectSource = new HashMap<>(); Map<String, Object> expectSource = new HashMap<>();
expectSource.put("user", "kimchy"); expectSource.put("user", "kimchy");
expectSource.put("message", "trying out Elasticsearch"); expectSource.put("message", "trying out OpenSearch");
assertEquals(expectSource, source); assertEquals(expectSource, source);
} }
{ {
@ -1572,13 +1572,13 @@ public class CRUDDocumentationIT extends ESRestHighLevelClientTestCase {
// tag::bulk-processor-add // tag::bulk-processor-add
IndexRequest one = new IndexRequest("posts").id("1") IndexRequest one = new IndexRequest("posts").id("1")
.source(XContentType.JSON, "title", .source(XContentType.JSON, "title",
"In which order are my Elasticsearch queries executed?"); "In which order are my OpenSearch queries executed?");
IndexRequest two = new IndexRequest("posts").id("2") IndexRequest two = new IndexRequest("posts").id("2")
.source(XContentType.JSON, "title", .source(XContentType.JSON, "title",
"Current status and upcoming changes in Elasticsearch"); "Current status and upcoming changes in OpenSearch");
IndexRequest three = new IndexRequest("posts").id("3") IndexRequest three = new IndexRequest("posts").id("3")
.source(XContentType.JSON, "title", .source(XContentType.JSON, "title",
"The Future of Federated Search in Elasticsearch"); "The Future of Federated Search in OpenSearch");
bulkProcessor.add(one); bulkProcessor.add(one);
bulkProcessor.add(two); bulkProcessor.add(two);

View File

@ -54,7 +54,7 @@ import org.elasticsearch.common.unit.ByteSizeUnit;
import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.indices.recovery.RecoverySettings;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;

View File

@ -102,7 +102,7 @@ import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays; import java.util.Arrays;

View File

@ -73,7 +73,7 @@ import org.opensearch.index.rankeval.RankEvalSpec;
import org.opensearch.index.rankeval.RatedDocument; import org.opensearch.index.rankeval.RatedDocument;
import org.opensearch.index.rankeval.RatedRequest; import org.opensearch.index.rankeval.RatedRequest;
import org.opensearch.index.rankeval.RatedSearchHit; import org.opensearch.index.rankeval.RatedSearchHit;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.script.ScriptType; import org.elasticsearch.script.ScriptType;
import org.opensearch.script.mustache.MultiSearchTemplateRequest; import org.opensearch.script.mustache.MultiSearchTemplateRequest;
import org.opensearch.script.mustache.MultiSearchTemplateResponse; import org.opensearch.script.mustache.MultiSearchTemplateResponse;

View File

@ -53,7 +53,7 @@ import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.repositories.fs.FsRepository; import org.elasticsearch.repositories.fs.FsRepository;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.snapshots.RestoreInfo; import org.elasticsearch.snapshots.RestoreInfo;
import org.elasticsearch.snapshots.SnapshotId; import org.elasticsearch.snapshots.SnapshotId;
import org.elasticsearch.snapshots.SnapshotInfo; import org.elasticsearch.snapshots.SnapshotInfo;

View File

@ -31,7 +31,7 @@ import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.index.Index; import org.elasticsearch.index.Index;
import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.IndexNotFoundException;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.transport.ActionNotFoundTransportException; import org.elasticsearch.transport.ActionNotFoundTransportException;
import java.io.IOException; import java.io.IOException;

View File

@ -31,7 +31,7 @@ import org.elasticsearch.common.xcontent.ToXContent.Params;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.index.RandomCreateIndexGenerator; import org.elasticsearch.index.RandomCreateIndexGenerator;
import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.mapper.MapperService;
import org.elasticsearch.rest.BaseRestHandler; import org.opensearch.rest.BaseRestHandler;
import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.ESTestCase;
import java.io.IOException; import java.io.IOException;

View File

@ -25,7 +25,7 @@ import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.ToXContent.Params; import org.elasticsearch.common.xcontent.ToXContent.Params;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.mapper.MapperService;
import org.elasticsearch.rest.BaseRestHandler; import org.opensearch.rest.BaseRestHandler;
import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.ESTestCase;
import java.io.IOException; import java.io.IOException;

View File

@ -28,7 +28,7 @@ import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.rest.BaseRestHandler; import org.opensearch.rest.BaseRestHandler;
import org.elasticsearch.common.xcontent.ToXContent.Params; import org.elasticsearch.common.xcontent.ToXContent.Params;
import java.io.IOException; import java.io.IOException;

View File

@ -33,9 +33,9 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.ToXContentObject;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.grok.Grok; import org.elasticsearch.grok.Grok;
import org.elasticsearch.rest.BaseRestHandler; import org.opensearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestRequest; import org.opensearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener; import org.opensearch.rest.action.RestToXContentListener;
import org.elasticsearch.tasks.Task; import org.elasticsearch.tasks.Task;
import org.elasticsearch.transport.TransportService; import org.elasticsearch.transport.TransportService;
@ -45,7 +45,7 @@ import java.util.Map;
import java.util.TreeMap; import java.util.TreeMap;
import static java.util.Collections.singletonList; import static java.util.Collections.singletonList;
import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.opensearch.rest.RestRequest.Method.GET;
public class GrokProcessorGetAction extends ActionType<GrokProcessorGetAction.Response> { public class GrokProcessorGetAction extends ActionType<GrokProcessorGetAction.Response> {

View File

@ -37,8 +37,8 @@ import org.elasticsearch.ingest.Processor;
import org.elasticsearch.plugins.ActionPlugin; import org.elasticsearch.plugins.ActionPlugin;
import org.elasticsearch.plugins.IngestPlugin; import org.elasticsearch.plugins.IngestPlugin;
import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.rest.RestController; import org.opensearch.rest.RestController;
import org.elasticsearch.rest.RestHandler; import org.opensearch.rest.RestHandler;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;

View File

@ -31,7 +31,7 @@ import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.common.xcontent.json.JsonXContent;
import org.elasticsearch.ingest.IngestService; import org.elasticsearch.ingest.IngestService;
import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.NodeRoles; import org.elasticsearch.test.NodeRoles;
import org.elasticsearch.test.StreamsUtils; import org.elasticsearch.test.StreamsUtils;

View File

@ -31,26 +31,26 @@ import org.opensearch.index.reindex.RestDeleteByQueryAction;
import org.elasticsearch.indices.SystemIndexDescriptor; import org.elasticsearch.indices.SystemIndexDescriptor;
import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.plugins.SystemIndexPlugin; import org.elasticsearch.plugins.SystemIndexPlugin;
import org.elasticsearch.rest.BaseRestHandler; import org.opensearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController; import org.opensearch.rest.RestController;
import org.elasticsearch.rest.RestHandler; import org.opensearch.rest.RestHandler;
import org.elasticsearch.rest.action.admin.indices.RestCreateIndexAction; import org.opensearch.rest.action.admin.indices.RestCreateIndexAction;
import org.elasticsearch.rest.action.admin.indices.RestGetAliasesAction; import org.opensearch.rest.action.admin.indices.RestGetAliasesAction;
import org.elasticsearch.rest.action.admin.indices.RestGetIndicesAction; import org.opensearch.rest.action.admin.indices.RestGetIndicesAction;
import org.elasticsearch.rest.action.admin.indices.RestIndexPutAliasAction; import org.opensearch.rest.action.admin.indices.RestIndexPutAliasAction;
import org.elasticsearch.rest.action.admin.indices.RestRefreshAction; import org.opensearch.rest.action.admin.indices.RestRefreshAction;
import org.elasticsearch.rest.action.admin.indices.RestUpdateSettingsAction; import org.opensearch.rest.action.admin.indices.RestUpdateSettingsAction;
import org.elasticsearch.rest.action.document.RestBulkAction; import org.opensearch.rest.action.document.RestBulkAction;
import org.elasticsearch.rest.action.document.RestDeleteAction; import org.opensearch.rest.action.document.RestDeleteAction;
import org.elasticsearch.rest.action.document.RestGetAction; import org.opensearch.rest.action.document.RestGetAction;
import org.elasticsearch.rest.action.document.RestIndexAction; import org.opensearch.rest.action.document.RestIndexAction;
import org.elasticsearch.rest.action.document.RestIndexAction.AutoIdHandler; import org.opensearch.rest.action.document.RestIndexAction.AutoIdHandler;
import org.elasticsearch.rest.action.document.RestIndexAction.CreateHandler; import org.opensearch.rest.action.document.RestIndexAction.CreateHandler;
import org.elasticsearch.rest.action.document.RestMultiGetAction; import org.opensearch.rest.action.document.RestMultiGetAction;
import org.elasticsearch.rest.action.document.RestUpdateAction; import org.opensearch.rest.action.document.RestUpdateAction;
import org.elasticsearch.rest.action.search.RestClearScrollAction; import org.opensearch.rest.action.search.RestClearScrollAction;
import org.elasticsearch.rest.action.search.RestSearchAction; import org.opensearch.rest.action.search.RestSearchAction;
import org.elasticsearch.rest.action.search.RestSearchScrollAction; import org.opensearch.rest.action.search.RestSearchScrollAction;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;

View File

@ -31,8 +31,8 @@ import org.elasticsearch.plugins.ActionPlugin;
import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.plugins.ScriptPlugin; import org.elasticsearch.plugins.ScriptPlugin;
import org.elasticsearch.plugins.SearchPlugin; import org.elasticsearch.plugins.SearchPlugin;
import org.elasticsearch.rest.RestController; import org.opensearch.rest.RestController;
import org.elasticsearch.rest.RestHandler; import org.opensearch.rest.RestHandler;
import org.elasticsearch.script.ScriptContext; import org.elasticsearch.script.ScriptContext;
import org.elasticsearch.script.ScriptEngine; import org.elasticsearch.script.ScriptEngine;

View File

@ -22,11 +22,11 @@ package org.opensearch.script.mustache;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.opensearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestRequest; import org.opensearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener; import org.opensearch.rest.action.RestToXContentListener;
import org.elasticsearch.rest.action.search.RestMultiSearchAction; import org.opensearch.rest.action.search.RestMultiSearchAction;
import org.elasticsearch.rest.action.search.RestSearchAction; import org.opensearch.rest.action.search.RestSearchAction;
import java.io.IOException; import java.io.IOException;
import java.util.Collections; import java.util.Collections;
@ -36,8 +36,8 @@ import java.util.Set;
import static java.util.Arrays.asList; import static java.util.Arrays.asList;
import static java.util.Collections.unmodifiableList; import static java.util.Collections.unmodifiableList;
import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.opensearch.rest.RestRequest.Method.GET;
import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.opensearch.rest.RestRequest.Method.POST;
public class RestMultiSearchTemplateAction extends BaseRestHandler { public class RestMultiSearchTemplateAction extends BaseRestHandler {
private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestMultiSearchTemplateAction.class); private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestMultiSearchTemplateAction.class);

View File

@ -21,9 +21,9 @@ package org.opensearch.script.mustache;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.rest.BaseRestHandler; import org.opensearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestRequest; import org.opensearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener; import org.opensearch.rest.action.RestToXContentListener;
import org.elasticsearch.script.ScriptType; import org.elasticsearch.script.ScriptType;
import java.io.IOException; import java.io.IOException;
@ -31,8 +31,8 @@ import java.util.List;
import static java.util.Arrays.asList; import static java.util.Arrays.asList;
import static java.util.Collections.unmodifiableList; import static java.util.Collections.unmodifiableList;
import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.opensearch.rest.RestRequest.Method.GET;
import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.opensearch.rest.RestRequest.Method.POST;
public class RestRenderSearchTemplateAction extends BaseRestHandler { public class RestRenderSearchTemplateAction extends BaseRestHandler {

View File

@ -22,10 +22,10 @@ package org.opensearch.script.mustache;
import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.rest.BaseRestHandler; import org.opensearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestRequest; import org.opensearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestStatusToXContentListener; import org.opensearch.rest.action.RestStatusToXContentListener;
import org.elasticsearch.rest.action.search.RestSearchAction; import org.opensearch.rest.action.search.RestSearchAction;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays; import java.util.Arrays;
@ -36,8 +36,8 @@ import java.util.Set;
import static java.util.Arrays.asList; import static java.util.Arrays.asList;
import static java.util.Collections.unmodifiableList; import static java.util.Collections.unmodifiableList;
import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.opensearch.rest.RestRequest.Method.GET;
import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.opensearch.rest.RestRequest.Method.POST;
public class RestSearchTemplateAction extends BaseRestHandler { public class RestSearchTemplateAction extends BaseRestHandler {
public static final String TYPED_KEYS_PARAM = "typed_keys"; public static final String TYPED_KEYS_PARAM = "typed_keys";

View File

@ -30,7 +30,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;

View File

@ -32,7 +32,7 @@ import org.elasticsearch.common.xcontent.NamedXContentRegistry;
import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.rest.action.search.RestSearchAction; import org.opensearch.rest.action.search.RestSearchAction;
import org.elasticsearch.script.Script; import org.elasticsearch.script.Script;
import org.elasticsearch.script.ScriptService; import org.elasticsearch.script.ScriptService;
import org.elasticsearch.script.ScriptType; import org.elasticsearch.script.ScriptType;

View File

@ -22,7 +22,7 @@ package org.opensearch.script.mustache;
import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesArray;
import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.rest.RestRequest; import org.opensearch.rest.RestRequest;
import org.elasticsearch.script.ScriptType; import org.elasticsearch.script.ScriptType;
import org.elasticsearch.search.Scroll; import org.elasticsearch.search.Scroll;
import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.builder.SearchSourceBuilder;

View File

@ -21,7 +21,7 @@ package org.opensearch.script.mustache;
import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesArray;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.rest.RestRequest; import org.opensearch.rest.RestRequest;
import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.FakeRestRequest;
import org.elasticsearch.test.rest.RestActionTestCase; import org.elasticsearch.test.rest.RestActionTestCase;
import org.junit.Before; import org.junit.Before;

View File

@ -18,8 +18,8 @@
*/ */
package org.opensearch.script.mustache; package org.opensearch.script.mustache;
import org.elasticsearch.rest.RestRequest; import org.opensearch.rest.RestRequest;
import org.elasticsearch.rest.action.search.RestSearchAction; import org.opensearch.rest.action.search.RestSearchAction;
import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.FakeRestRequest;
import org.elasticsearch.test.rest.RestActionTestCase; import org.elasticsearch.test.rest.RestActionTestCase;
import org.junit.Before; import org.junit.Before;

View File

@ -46,8 +46,8 @@ import org.elasticsearch.plugins.ExtensiblePlugin;
import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.plugins.ScriptPlugin; import org.elasticsearch.plugins.ScriptPlugin;
import org.elasticsearch.repositories.RepositoriesService; import org.elasticsearch.repositories.RepositoriesService;
import org.elasticsearch.rest.RestController; import org.opensearch.rest.RestController;
import org.elasticsearch.rest.RestHandler; import org.opensearch.rest.RestHandler;
import org.elasticsearch.script.IngestScript; import org.elasticsearch.script.IngestScript;
import org.elasticsearch.script.ScoreScript; import org.elasticsearch.script.ScoreScript;
import org.elasticsearch.script.ScriptContext; import org.elasticsearch.script.ScriptContext;
@ -83,17 +83,17 @@ public final class PainlessPlugin extends Plugin implements ScriptPlugin, Extens
// Moving Function Pipeline Agg // Moving Function Pipeline Agg
List<Whitelist> movFn = new ArrayList<>(Whitelist.BASE_WHITELISTS); List<Whitelist> movFn = new ArrayList<>(Whitelist.BASE_WHITELISTS);
movFn.add(WhitelistLoader.loadFromResourceFiles(Whitelist.class, "org.elasticsearch.aggs.movfn.txt")); movFn.add(WhitelistLoader.loadFromResourceFiles(Whitelist.class, "org.opensearch.aggs.movfn.txt"));
map.put(MovingFunctionScript.CONTEXT, movFn); map.put(MovingFunctionScript.CONTEXT, movFn);
// Functions used for scoring docs // Functions used for scoring docs
List<Whitelist> scoreFn = new ArrayList<>(Whitelist.BASE_WHITELISTS); List<Whitelist> scoreFn = new ArrayList<>(Whitelist.BASE_WHITELISTS);
scoreFn.add(WhitelistLoader.loadFromResourceFiles(Whitelist.class, "org.elasticsearch.score.txt")); scoreFn.add(WhitelistLoader.loadFromResourceFiles(Whitelist.class, "org.opensearch.score.txt"));
map.put(ScoreScript.CONTEXT, scoreFn); map.put(ScoreScript.CONTEXT, scoreFn);
// Functions available to ingest pipelines // Functions available to ingest pipelines
List<Whitelist> ingest = new ArrayList<>(Whitelist.BASE_WHITELISTS); List<Whitelist> ingest = new ArrayList<>(Whitelist.BASE_WHITELISTS);
ingest.add(WhitelistLoader.loadFromResourceFiles(Whitelist.class, "org.elasticsearch.ingest.txt")); ingest.add(WhitelistLoader.loadFromResourceFiles(Whitelist.class, "org.opensearch.ingest.txt"));
map.put(IngestScript.CONTEXT, ingest); map.put(IngestScript.CONTEXT, ingest);
whitelists = map; whitelists = map;

View File

@ -36,9 +36,9 @@ import org.elasticsearch.common.xcontent.ToXContentObject;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.painless.PainlessScriptEngine; import org.elasticsearch.painless.PainlessScriptEngine;
import org.elasticsearch.painless.lookup.PainlessLookup; import org.elasticsearch.painless.lookup.PainlessLookup;
import org.elasticsearch.rest.BaseRestHandler; import org.opensearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestRequest; import org.opensearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener; import org.opensearch.rest.action.RestToXContentListener;
import org.elasticsearch.script.ScriptContext; import org.elasticsearch.script.ScriptContext;
import org.elasticsearch.tasks.Task; import org.elasticsearch.tasks.Task;
import org.elasticsearch.transport.TransportService; import org.elasticsearch.transport.TransportService;
@ -52,7 +52,7 @@ import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static java.util.Collections.singletonList; import static java.util.Collections.singletonList;
import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.opensearch.rest.RestRequest.Method.GET;
/** /**
* Internal REST API for querying context information about Painless whitelists. * Internal REST API for querying context information about Painless whitelists.

View File

@ -69,9 +69,9 @@ import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryShardContext; import org.elasticsearch.index.query.QueryShardContext;
import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.index.shard.ShardId;
import org.elasticsearch.indices.IndicesService; import org.elasticsearch.indices.IndicesService;
import org.elasticsearch.rest.BaseRestHandler; import org.opensearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestRequest; import org.opensearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener; import org.opensearch.rest.action.RestToXContentListener;
import org.elasticsearch.script.FilterScript; import org.elasticsearch.script.FilterScript;
import org.elasticsearch.script.ScoreScript; import org.elasticsearch.script.ScoreScript;
import org.elasticsearch.script.Script; import org.elasticsearch.script.Script;
@ -91,8 +91,8 @@ import java.util.Objects;
import static java.util.Arrays.asList; import static java.util.Arrays.asList;
import static java.util.Collections.unmodifiableList; import static java.util.Collections.unmodifiableList;
import static org.opensearch.action.ValidateActions.addValidationError; import static org.opensearch.action.ValidateActions.addValidationError;
import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.opensearch.rest.RestRequest.Method.GET;
import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.opensearch.rest.RestRequest.Method.POST;
public class PainlessExecuteAction extends ActionType<PainlessExecuteAction.Response> { public class PainlessExecuteAction extends ActionType<PainlessExecuteAction.Response> {

View File

@ -37,7 +37,7 @@ import org.elasticsearch.index.query.MatchQueryBuilder;
import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder; import org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.aggregations.AggregationBuilders; import org.elasticsearch.search.aggregations.AggregationBuilders;
import org.elasticsearch.search.aggregations.bucket.filter.Filter; import org.elasticsearch.search.aggregations.bucket.filter.Filter;

View File

@ -31,8 +31,8 @@ import org.elasticsearch.common.settings.SettingsFilter;
import org.elasticsearch.common.xcontent.NamedXContentRegistry.Entry; import org.elasticsearch.common.xcontent.NamedXContentRegistry.Entry;
import org.elasticsearch.plugins.ActionPlugin; import org.elasticsearch.plugins.ActionPlugin;
import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.rest.RestController; import org.opensearch.rest.RestController;
import org.elasticsearch.rest.RestHandler; import org.opensearch.rest.RestHandler;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;

View File

@ -24,17 +24,17 @@ import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.rest.BaseRestHandler; import org.opensearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestRequest; import org.opensearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener; import org.opensearch.rest.action.RestToXContentListener;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
import static java.util.Arrays.asList; import static java.util.Arrays.asList;
import static java.util.Collections.unmodifiableList; import static java.util.Collections.unmodifiableList;
import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.opensearch.rest.RestRequest.Method.GET;
import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.opensearch.rest.RestRequest.Method.POST;
/** /**
* { * {

View File

@ -83,7 +83,7 @@ import static java.util.Collections.unmodifiableList;
import static org.elasticsearch.action.bulk.BackoffPolicy.exponentialBackoff; import static org.elasticsearch.action.bulk.BackoffPolicy.exponentialBackoff;
import static org.elasticsearch.common.unit.TimeValue.timeValueNanos; import static org.elasticsearch.common.unit.TimeValue.timeValueNanos;
import static org.elasticsearch.index.reindex.AbstractBulkByScrollRequest.MAX_DOCS_ALL_MATCHES; import static org.elasticsearch.index.reindex.AbstractBulkByScrollRequest.MAX_DOCS_ALL_MATCHES;
import static org.elasticsearch.rest.RestStatus.CONFLICT; import static org.opensearch.rest.RestStatus.CONFLICT;
import static org.elasticsearch.search.sort.SortBuilders.fieldSort; import static org.elasticsearch.search.sort.SortBuilders.fieldSort;
/** /**

View File

@ -25,13 +25,10 @@ import org.elasticsearch.action.support.ActiveShardCount;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.index.reindex.AbstractBulkByScrollRequest; import org.opensearch.rest.BaseRestHandler;
import org.elasticsearch.index.reindex.BulkByScrollResponse; import org.opensearch.rest.BytesRestResponse;
import org.elasticsearch.index.reindex.BulkByScrollTask; import org.opensearch.rest.RestRequest;
import org.elasticsearch.rest.BaseRestHandler; import org.opensearch.rest.RestStatus;
import org.elasticsearch.rest.BytesRestResponse;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.RestStatus;
import org.elasticsearch.tasks.LoggingTaskListener; import org.elasticsearch.tasks.LoggingTaskListener;
import org.elasticsearch.tasks.Task; import org.elasticsearch.tasks.Task;

View File

@ -27,10 +27,8 @@ import org.elasticsearch.common.xcontent.LoggingDeprecationHandler;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.index.reindex.AbstractBulkByScrollRequest; import org.opensearch.rest.RestRequest;
import org.elasticsearch.index.reindex.BulkByScrollResponse; import org.opensearch.rest.action.search.RestSearchAction;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.action.search.RestSearchAction;
import java.io.IOException; import java.io.IOException;
import java.util.Map; import java.util.Map;

View File

@ -24,11 +24,11 @@ import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.index.reindex.BulkByScrollResponse; import org.elasticsearch.index.reindex.BulkByScrollResponse;
import org.elasticsearch.index.reindex.ScrollableHitSource.SearchFailure; import org.elasticsearch.index.reindex.ScrollableHitSource.SearchFailure;
import org.elasticsearch.rest.BytesRestResponse; import org.opensearch.rest.BytesRestResponse;
import org.elasticsearch.rest.RestChannel; import org.opensearch.rest.RestChannel;
import org.elasticsearch.rest.RestResponse; import org.opensearch.rest.RestResponse;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.rest.action.RestBuilderListener; import org.opensearch.rest.action.RestBuilderListener;
import java.util.Map; import java.util.Map;

View File

@ -41,8 +41,8 @@ import org.elasticsearch.index.reindex.UpdateByQueryAction;
import org.elasticsearch.plugins.ActionPlugin; import org.elasticsearch.plugins.ActionPlugin;
import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.repositories.RepositoriesService; import org.elasticsearch.repositories.RepositoriesService;
import org.elasticsearch.rest.RestController; import org.opensearch.rest.RestController;
import org.elasticsearch.rest.RestHandler; import org.opensearch.rest.RestHandler;
import org.elasticsearch.script.ScriptService; import org.elasticsearch.script.ScriptService;
import org.elasticsearch.tasks.Task; import org.elasticsearch.tasks.Task;
import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.threadpool.ThreadPool;

View File

@ -21,9 +21,7 @@ package org.opensearch.index.reindex;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
import org.elasticsearch.index.reindex.DeleteByQueryAction; import org.opensearch.rest.RestRequest;
import org.elasticsearch.index.reindex.DeleteByQueryRequest;
import org.elasticsearch.rest.RestRequest;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
@ -33,7 +31,7 @@ import java.util.function.Consumer;
import static java.util.Arrays.asList; import static java.util.Arrays.asList;
import static java.util.Collections.unmodifiableList; import static java.util.Collections.unmodifiableList;
import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.opensearch.rest.RestRequest.Method.POST;
public class RestDeleteByQueryAction extends AbstractBulkByQueryRestHandler<DeleteByQueryRequest, DeleteByQueryAction> { public class RestDeleteByQueryAction extends AbstractBulkByQueryRestHandler<DeleteByQueryRequest, DeleteByQueryAction> {

View File

@ -23,10 +23,8 @@ import org.opensearch.action.DocWriteRequest;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.index.reindex.ReindexAction; import org.opensearch.rest.RestRequest;
import org.elasticsearch.index.reindex.ReindexRequest; import org.opensearch.rest.RestRequestFilter;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.RestRequestFilter;
import java.io.IOException; import java.io.IOException;
import java.util.Collections; import java.util.Collections;
@ -35,7 +33,7 @@ import java.util.Set;
import static java.util.Collections.singletonList; import static java.util.Collections.singletonList;
import static org.elasticsearch.common.unit.TimeValue.parseTimeValue; import static org.elasticsearch.common.unit.TimeValue.parseTimeValue;
import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.opensearch.rest.RestRequest.Method.POST;
/** /**
* Expose reindex over rest. * Expose reindex over rest.

View File

@ -21,8 +21,8 @@ package org.opensearch.index.reindex;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.rest.BaseRestHandler; import org.opensearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestRequest; import org.opensearch.rest.RestRequest;
import org.elasticsearch.tasks.TaskId; import org.elasticsearch.tasks.TaskId;
import java.util.List; import java.util.List;
@ -30,8 +30,8 @@ import java.util.function.Supplier;
import static java.util.Arrays.asList; import static java.util.Arrays.asList;
import static java.util.Collections.unmodifiableList; import static java.util.Collections.unmodifiableList;
import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.opensearch.rest.RestRequest.Method.POST;
import static org.elasticsearch.rest.action.admin.cluster.RestListTasksAction.listTasksResponseListener; import static org.opensearch.rest.action.admin.cluster.RestListTasksAction.listTasksResponseListener;
public class RestRethrottleAction extends BaseRestHandler { public class RestRethrottleAction extends BaseRestHandler {
private final Supplier<DiscoveryNodes> nodesInCluster; private final Supplier<DiscoveryNodes> nodesInCluster;

View File

@ -21,9 +21,7 @@ package org.opensearch.index.reindex;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
import org.elasticsearch.index.reindex.UpdateByQueryAction; import org.opensearch.rest.RestRequest;
import org.elasticsearch.index.reindex.UpdateByQueryRequest;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.script.Script; import org.elasticsearch.script.Script;
import java.io.IOException; import java.io.IOException;
@ -34,7 +32,7 @@ import java.util.function.Consumer;
import static java.util.Arrays.asList; import static java.util.Arrays.asList;
import static java.util.Collections.unmodifiableList; import static java.util.Collections.unmodifiableList;
import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.opensearch.rest.RestRequest.Method.POST;
public class RestUpdateByQueryAction extends AbstractBulkByQueryRestHandler<UpdateByQueryRequest, UpdateByQueryAction> { public class RestUpdateByQueryAction extends AbstractBulkByQueryRestHandler<UpdateByQueryRequest, UpdateByQueryAction> {

View File

@ -47,7 +47,7 @@ import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.index.reindex.RejectAwareActionListener; import org.elasticsearch.index.reindex.RejectAwareActionListener;
import org.elasticsearch.index.reindex.ScrollableHitSource; import org.elasticsearch.index.reindex.ScrollableHitSource;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.threadpool.ThreadPool;
import java.io.IOException; import java.io.IOException;
@ -124,7 +124,7 @@ public class RemoteScrollableHitSource extends ScrollableHitSource {
if (remoteVersion.before(Version.fromId(2000099)) if (remoteVersion.before(Version.fromId(2000099))
&& re.getResponse().getStatusLine().getStatusCode() == 404) { && re.getResponse().getStatusLine().getStatusCode() == 404) {
logger.debug((Supplier<?>) () -> new ParameterizedMessage( logger.debug((Supplier<?>) () -> new ParameterizedMessage(
"Failed to clear scroll [{}] from pre-2.0 Elasticsearch. This is normal if the request terminated " "Failed to clear scroll [{}] from pre-2.0 OpenSearch. This is normal if the request terminated "
+ "normally as the scroll has already been cleared automatically.", scrollId), e); + "normally as the scroll has already been cleared automatically.", scrollId), e);
return; return;
} }

View File

@ -76,7 +76,7 @@ import org.elasticsearch.index.reindex.ScrollableHitSource.Hit;
import org.elasticsearch.index.reindex.ScrollableHitSource.SearchFailure; import org.elasticsearch.index.reindex.ScrollableHitSource.SearchFailure;
import org.elasticsearch.index.reindex.WorkerBulkByScrollTaskState; import org.elasticsearch.index.reindex.WorkerBulkByScrollTaskState;
import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.index.shard.ShardId;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.SearchHits; import org.elasticsearch.search.SearchHits;
import org.elasticsearch.search.internal.InternalSearchResponse; import org.elasticsearch.search.internal.InternalSearchResponse;

View File

@ -49,8 +49,8 @@ import org.elasticsearch.index.reindex.RemoteInfo;
import org.elasticsearch.plugins.ActionPlugin; import org.elasticsearch.plugins.ActionPlugin;
import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.repositories.RepositoriesService; import org.elasticsearch.repositories.RepositoriesService;
import org.elasticsearch.rest.RestHeaderDefinition; import org.opensearch.rest.RestHeaderDefinition;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.script.ScriptService; import org.elasticsearch.script.ScriptService;
import org.elasticsearch.tasks.Task; import org.elasticsearch.tasks.Task;
import org.elasticsearch.test.ESSingleNodeTestCase; import org.elasticsearch.test.ESSingleNodeTestCase;

View File

@ -20,10 +20,8 @@
package org.opensearch.index.reindex; package org.opensearch.index.reindex;
import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.NamedXContentRegistry;
import org.elasticsearch.index.reindex.AbstractBulkByScrollRequest; import org.opensearch.rest.RestRequest;
import org.elasticsearch.index.reindex.DeleteByQueryRequest; import org.opensearch.rest.action.search.RestSearchAction;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.action.search.RestSearchAction;
import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.FakeRestRequest;
import org.elasticsearch.test.rest.RestActionTestCase; import org.elasticsearch.test.rest.RestActionTestCase;
import org.junit.Before; import org.junit.Before;

View File

@ -25,9 +25,7 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.common.xcontent.json.JsonXContent;
import org.elasticsearch.index.reindex.AbstractBulkByScrollRequest; import org.opensearch.rest.RestRequest.Method;
import org.elasticsearch.index.reindex.ReindexRequest;
import org.elasticsearch.rest.RestRequest.Method;
import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.FakeRestRequest;
import org.elasticsearch.test.rest.RestActionTestCase; import org.elasticsearch.test.rest.RestActionTestCase;
import org.junit.Before; import org.junit.Before;

View File

@ -20,10 +20,8 @@
package org.opensearch.index.reindex; package org.opensearch.index.reindex;
import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.NamedXContentRegistry;
import org.elasticsearch.index.reindex.AbstractBulkByScrollRequest; import org.opensearch.rest.RestRequest;
import org.elasticsearch.index.reindex.UpdateByQueryRequest; import org.opensearch.rest.action.search.RestSearchAction;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.action.search.RestSearchAction;
import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.FakeRestRequest;
import org.elasticsearch.test.rest.RestActionTestCase; import org.elasticsearch.test.rest.RestActionTestCase;
import org.junit.Before; import org.junit.Before;

View File

@ -55,7 +55,7 @@ import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException;
import org.elasticsearch.index.reindex.RejectAwareActionListener; import org.elasticsearch.index.reindex.RejectAwareActionListener;
import org.elasticsearch.index.reindex.ScrollableHitSource; import org.elasticsearch.index.reindex.ScrollableHitSource;
import org.elasticsearch.index.reindex.ScrollableHitSource.Response; import org.elasticsearch.index.reindex.ScrollableHitSource.Response;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.threadpool.TestThreadPool; import org.elasticsearch.threadpool.TestThreadPool;
@ -221,7 +221,7 @@ public class RemoteScrollableHitSourceTests extends ESTestCase {
} }
/** /**
* Versions of Elasticsearch before 2.1.0 don't support sort:_doc and instead need to use search_type=scan. Scan doesn't return * Versions of OpenSearch before 2.1.0 don't support sort:_doc and instead need to use search_type=scan. Scan doesn't return
* documents the first iteration but reindex doesn't like that. So we jump start strait to the next iteration. * documents the first iteration but reindex doesn't like that. So we jump start strait to the next iteration.
*/ */
public void testScanJumpStart() throws Exception { public void testScanJumpStart() throws Exception {
@ -255,8 +255,8 @@ public class RemoteScrollableHitSourceTests extends ESTestCase {
assertEquals((Integer) 0, r.getFailures().get(0).getShardId()); assertEquals((Integer) 0, r.getFailures().get(0).getShardId());
assertEquals("87A7NvevQxSrEwMbtRCecg", r.getFailures().get(0).getNodeId()); assertEquals("87A7NvevQxSrEwMbtRCecg", r.getFailures().get(0).getNodeId());
assertThat(r.getFailures().get(0).getReason(), instanceOf(EsRejectedExecutionException.class)); assertThat(r.getFailures().get(0).getReason(), instanceOf(EsRejectedExecutionException.class));
assertEquals("rejected execution of org.elasticsearch.transport.TransportService$5@52d06af2 on " assertEquals("rejected execution of org.opensearch.transport.TransportService$5@52d06af2 on "
+ "EsThreadPoolExecutor[search, queue capacity = 1000, org.elasticsearch.common.util.concurrent." + "EsThreadPoolExecutor[search, queue capacity = 1000, org.opensearch.common.util.concurrent."
+ "EsThreadPoolExecutor@778ea553[Running, pool size = 7, active threads = 7, queued tasks = 1000, " + "EsThreadPoolExecutor@778ea553[Running, pool size = 7, active threads = 7, queued tasks = 1000, "
+ "completed tasks = 4182]]", r.getFailures().get(0).getReason().getMessage()); + "completed tasks = 4182]]", r.getFailures().get(0).getReason().getMessage());
assertThat(r.getHits(), hasSize(1)); assertThat(r.getHits(), hasSize(1));
@ -462,14 +462,14 @@ public class RemoteScrollableHitSourceTests extends ESTestCase {
public void testInvalidJsonThinksRemoteIsNotES() throws IOException { public void testInvalidJsonThinksRemoteIsNotES() throws IOException {
Exception e = expectThrows(RuntimeException.class, () -> sourceWithMockedRemoteCall("some_text.txt").start()); Exception e = expectThrows(RuntimeException.class, () -> sourceWithMockedRemoteCall("some_text.txt").start());
assertEquals("Error parsing the response, remote is likely not an Elasticsearch instance", assertEquals("Error parsing the response, remote is likely not an OpenSearch instance",
e.getCause().getCause().getCause().getMessage()); e.getCause().getCause().getCause().getMessage());
} }
public void testUnexpectedJsonThinksRemoteIsNotES() throws IOException { public void testUnexpectedJsonThinksRemoteIsNotES() throws IOException {
// Use the response from a main action instead of a proper start response to generate a parse error // Use the response from a main action instead of a proper start response to generate a parse error
Exception e = expectThrows(RuntimeException.class, () -> sourceWithMockedRemoteCall("main/2_3_3.json").start()); Exception e = expectThrows(RuntimeException.class, () -> sourceWithMockedRemoteCall("main/2_3_3.json").start());
assertEquals("Error parsing the response, remote is likely not an Elasticsearch instance", assertEquals("Error parsing the response, remote is likely not an OpenSearch instance",
e.getCause().getCause().getCause().getMessage()); e.getCause().getCause().getCause().getMessage());
} }

View File

@ -20,7 +20,7 @@ package org.opensearch.repositories.url;
import org.elasticsearch.test.fixture.AbstractHttpFixture; import org.elasticsearch.test.fixture.AbstractHttpFixture;
import org.elasticsearch.common.SuppressForbidden; import org.elasticsearch.common.SuppressForbidden;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Files; import java.nio.file.Files;

View File

@ -33,7 +33,7 @@ import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.common.xcontent.support.XContentMapValues;
import org.elasticsearch.repositories.fs.FsRepository; import org.elasticsearch.repositories.fs.FsRepository;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate;
import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase;
import org.junit.Before; import org.junit.Before;

View File

@ -34,7 +34,7 @@ import java.io.IOException;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.util.Map; import java.util.Map;
import static org.elasticsearch.rest.RestStatus.BAD_REQUEST; import static org.opensearch.rest.RestStatus.BAD_REQUEST;
import static org.elasticsearch.test.hamcrest.RegexMatcher.matches; import static org.elasticsearch.test.hamcrest.RegexMatcher.matches;
import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.equalTo;

View File

@ -32,8 +32,8 @@ import java.util.Map;
import static java.util.Collections.emptyMap; import static java.util.Collections.emptyMap;
import static java.util.Collections.singletonMap; import static java.util.Collections.singletonMap;
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
import static org.elasticsearch.rest.RestStatus.NOT_FOUND; import static org.opensearch.rest.RestStatus.NOT_FOUND;
import static org.elasticsearch.rest.RestStatus.OK; import static org.opensearch.rest.RestStatus.OK;
import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.greaterThan;
public class Netty4HeadBodyIsEmptyIT extends ESRestTestCase { public class Netty4HeadBodyIsEmptyIT extends ESRestTestCase {

View File

@ -32,8 +32,8 @@ import io.netty.handler.codec.http.cookie.ServerCookieDecoder;
import io.netty.handler.codec.http.cookie.ServerCookieEncoder; import io.netty.handler.codec.http.cookie.ServerCookieEncoder;
import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.http.HttpRequest; import org.elasticsearch.http.HttpRequest;
import org.elasticsearch.rest.RestRequest; import org.opensearch.rest.RestRequest;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.opensearch.transport.netty4.Netty4Utils; import org.opensearch.transport.netty4.Netty4Utils;
import java.util.AbstractMap; import java.util.AbstractMap;

View File

@ -25,7 +25,7 @@ import io.netty.handler.codec.http.HttpResponseStatus;
import io.netty.handler.codec.http.HttpVersion; import io.netty.handler.codec.http.HttpVersion;
import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.http.HttpResponse; import org.elasticsearch.http.HttpResponse;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.opensearch.transport.netty4.Netty4Utils; import org.opensearch.transport.netty4.Netty4Utils;
public class Netty4HttpResponse extends DefaultFullHttpResponse implements HttpResponse { public class Netty4HttpResponse extends DefaultFullHttpResponse implements HttpResponse {

View File

@ -32,10 +32,10 @@ import org.elasticsearch.common.util.concurrent.ThreadContext;
import org.elasticsearch.http.HttpServerTransport; import org.elasticsearch.http.HttpServerTransport;
import org.elasticsearch.http.HttpTransportSettings; import org.elasticsearch.http.HttpTransportSettings;
import org.elasticsearch.indices.breaker.NoneCircuitBreakerService; import org.elasticsearch.indices.breaker.NoneCircuitBreakerService;
import org.elasticsearch.rest.BytesRestResponse; import org.opensearch.rest.BytesRestResponse;
import org.elasticsearch.rest.RestChannel; import org.opensearch.rest.RestChannel;
import org.elasticsearch.rest.RestRequest; import org.opensearch.rest.RestRequest;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.threadpool.TestThreadPool; import org.elasticsearch.threadpool.TestThreadPool;
import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.threadpool.ThreadPool;

View File

@ -34,7 +34,7 @@ import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.http.HttpPipelinedRequest; import org.elasticsearch.http.HttpPipelinedRequest;
import org.elasticsearch.http.HttpPipelinedResponse; import org.elasticsearch.http.HttpPipelinedResponse;
import org.elasticsearch.http.HttpResponse; import org.elasticsearch.http.HttpResponse;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.ESTestCase;
import org.junit.After; import org.junit.After;

View File

@ -40,7 +40,7 @@ import org.elasticsearch.http.HttpResponse;
import org.elasticsearch.http.HttpServerTransport; import org.elasticsearch.http.HttpServerTransport;
import org.elasticsearch.http.NullDispatcher; import org.elasticsearch.http.NullDispatcher;
import org.elasticsearch.indices.breaker.NoneCircuitBreakerService; import org.elasticsearch.indices.breaker.NoneCircuitBreakerService;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.threadpool.TestThreadPool; import org.elasticsearch.threadpool.TestThreadPool;
import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.threadpool.ThreadPool;

View File

@ -63,9 +63,9 @@ import org.elasticsearch.http.HttpServerTransport;
import org.elasticsearch.http.HttpTransportSettings; import org.elasticsearch.http.HttpTransportSettings;
import org.elasticsearch.http.NullDispatcher; import org.elasticsearch.http.NullDispatcher;
import org.elasticsearch.indices.breaker.NoneCircuitBreakerService; import org.elasticsearch.indices.breaker.NoneCircuitBreakerService;
import org.elasticsearch.rest.BytesRestResponse; import org.opensearch.rest.BytesRestResponse;
import org.elasticsearch.rest.RestChannel; import org.opensearch.rest.RestChannel;
import org.elasticsearch.rest.RestRequest; import org.opensearch.rest.RestRequest;
import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.FakeRestRequest;
import org.elasticsearch.threadpool.TestThreadPool; import org.elasticsearch.threadpool.TestThreadPool;
@ -85,8 +85,8 @@ import java.util.concurrent.atomic.AtomicReference;
import static org.elasticsearch.http.HttpTransportSettings.SETTING_CORS_ALLOW_ORIGIN; import static org.elasticsearch.http.HttpTransportSettings.SETTING_CORS_ALLOW_ORIGIN;
import static org.elasticsearch.http.HttpTransportSettings.SETTING_CORS_ENABLED; import static org.elasticsearch.http.HttpTransportSettings.SETTING_CORS_ENABLED;
import static org.elasticsearch.rest.RestStatus.BAD_REQUEST; import static org.opensearch.rest.RestStatus.BAD_REQUEST;
import static org.elasticsearch.rest.RestStatus.OK; import static org.opensearch.rest.RestStatus.OK;
import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.instanceOf;

View File

@ -26,7 +26,7 @@ import org.apache.http.client.methods.HttpPut;
import org.apache.http.client.utils.URLEncodedUtils; import org.apache.http.client.utils.URLEncodedUtils;
import org.elasticsearch.common.Booleans; import org.elasticsearch.common.Booleans;
import org.elasticsearch.common.SuppressForbidden; import org.elasticsearch.common.SuppressForbidden;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.test.fixture.AbstractHttpFixture; import org.elasticsearch.test.fixture.AbstractHttpFixture;
import javax.xml.XMLConstants; import javax.xml.XMLConstants;

View File

@ -25,7 +25,7 @@ import org.elasticsearch.common.SuppressForbidden;
import org.elasticsearch.common.network.NetworkService; import org.elasticsearch.common.network.NetworkService;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.mocksocket.MockHttpServer; import org.elasticsearch.mocksocket.MockHttpServer;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.ESTestCase;
import org.junit.AfterClass; import org.junit.AfterClass;
import org.junit.Before; import org.junit.Before;

View File

@ -23,8 +23,8 @@ import org.elasticsearch.common.Strings;
import org.elasticsearch.common.SuppressForbidden; import org.elasticsearch.common.SuppressForbidden;
import org.elasticsearch.common.collect.MapBuilder; import org.elasticsearch.common.collect.MapBuilder;
import org.elasticsearch.common.path.PathTrie; import org.elasticsearch.common.path.PathTrie;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.rest.RestUtils; import org.opensearch.rest.RestUtils;
import org.elasticsearch.test.fixture.AbstractHttpFixture; import org.elasticsearch.test.fixture.AbstractHttpFixture;
import java.io.IOException; import java.io.IOException;

View File

@ -20,17 +20,17 @@ package org.elasticsearch.example.resthandler;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Table; import org.elasticsearch.common.Table;
import org.elasticsearch.rest.BytesRestResponse; import org.opensearch.rest.BytesRestResponse;
import org.elasticsearch.rest.RestRequest; import org.opensearch.rest.RestRequest;
import org.elasticsearch.rest.action.cat.AbstractCatAction; import org.opensearch.rest.action.cat.AbstractCatAction;
import org.elasticsearch.rest.action.cat.RestTable; import org.opensearch.rest.action.cat.RestTable;
import java.util.List; import java.util.List;
import static java.util.Arrays.asList; import static java.util.Arrays.asList;
import static java.util.Collections.unmodifiableList; import static java.util.Collections.unmodifiableList;
import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.opensearch.rest.RestRequest.Method.GET;
import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.opensearch.rest.RestRequest.Method.POST;
/** /**
* Example of adding a cat action with a plugin. * Example of adding a cat action with a plugin.

View File

@ -27,8 +27,8 @@ import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsFilter; import org.elasticsearch.common.settings.SettingsFilter;
import org.elasticsearch.plugins.ActionPlugin; import org.elasticsearch.plugins.ActionPlugin;
import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.rest.RestController; import org.opensearch.rest.RestController;
import org.elasticsearch.rest.RestHandler; import org.opensearch.rest.RestHandler;
import java.util.List; import java.util.List;
import java.util.function.Supplier; import java.util.function.Supplier;

View File

@ -33,7 +33,7 @@ import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeUnit;
import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.repositories.blobstore.ESMockAPIBasedRepositoryIntegTestCase; import org.elasticsearch.repositories.blobstore.ESMockAPIBasedRepositoryIntegTestCase;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import java.io.IOException; import java.io.IOException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;

View File

@ -43,8 +43,8 @@ import org.elasticsearch.common.unit.ByteSizeUnit;
import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.util.concurrent.CountDown; import org.elasticsearch.common.util.concurrent.CountDown;
import org.elasticsearch.mocksocket.MockHttpServer; import org.elasticsearch.mocksocket.MockHttpServer;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.rest.RestUtils; import org.opensearch.rest.RestUtils;
import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.threadpool.TestThreadPool; import org.elasticsearch.threadpool.TestThreadPool;
import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.threadpool.ThreadPool;

View File

@ -46,8 +46,8 @@ import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.util.concurrent.CountDown; import org.elasticsearch.common.util.concurrent.CountDown;
import org.elasticsearch.repositories.blobstore.AbstractBlobContainerRetriesTestCase; import org.elasticsearch.repositories.blobstore.AbstractBlobContainerRetriesTestCase;
import org.elasticsearch.repositories.blobstore.ESMockAPIBasedRepositoryIntegTestCase; import org.elasticsearch.repositories.blobstore.ESMockAPIBasedRepositoryIntegTestCase;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.rest.RestUtils; import org.opensearch.rest.RestUtils;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.threeten.bp.Duration; import org.threeten.bp.Duration;

View File

@ -36,10 +36,10 @@ import org.elasticsearch.indices.recovery.RecoverySettings;
import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.plugins.PluginsService; import org.elasticsearch.plugins.PluginsService;
import org.elasticsearch.repositories.RepositoriesService; import org.elasticsearch.repositories.RepositoriesService;
import org.elasticsearch.rest.AbstractRestChannel; import org.opensearch.rest.AbstractRestChannel;
import org.elasticsearch.rest.RestRequest; import org.opensearch.rest.RestRequest;
import org.elasticsearch.rest.RestResponse; import org.opensearch.rest.RestResponse;
import org.elasticsearch.rest.action.admin.cluster.RestGetRepositoriesAction; import org.opensearch.rest.action.admin.cluster.RestGetRepositoriesAction;
import org.elasticsearch.test.ESSingleNodeTestCase; import org.elasticsearch.test.ESSingleNodeTestCase;
import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.FakeRestRequest;
@ -120,11 +120,11 @@ public class RepositoryCredentialsTests extends ESSingleNodeTestCase {
assertThat(credentials.getAWSSecretKey(), is("insecure_aws_secret")); assertThat(credentials.getAWSSecretKey(), is("insecure_aws_secret"));
assertWarnings( assertWarnings(
"[secret_key] setting was deprecated in Elasticsearch and will be removed in a future release!" "[secret_key] setting was deprecated in OpenSearch and will be removed in a future release!"
+ " See the breaking changes documentation for the next major version.", + " See the breaking changes documentation for the next major version.",
"Using s3 access/secret key from repository settings. Instead store these in named clients and" "Using s3 access/secret key from repository settings. Instead store these in named clients and"
+ " the elasticsearch keystore for secure settings.", + " the opensearch keystore for secure settings.",
"[access_key] setting was deprecated in Elasticsearch and will be removed in a future release!" "[access_key] setting was deprecated in OpenSearch and will be removed in a future release!"
+ " See the breaking changes documentation for the next major version."); + " See the breaking changes documentation for the next major version.");
} }
@ -205,11 +205,11 @@ public class RepositoryCredentialsTests extends ESSingleNodeTestCase {
if (hasInsecureSettings) { if (hasInsecureSettings) {
assertWarnings( assertWarnings(
"[secret_key] setting was deprecated in Elasticsearch and will be removed in a future release!" "[secret_key] setting was deprecated in OpenSearch and will be removed in a future release!"
+ " See the breaking changes documentation for the next major version.", + " See the breaking changes documentation for the next major version.",
"Using s3 access/secret key from repository settings. Instead store these in named clients and" "Using s3 access/secret key from repository settings. Instead store these in named clients and"
+ " the elasticsearch keystore for secure settings.", + " the opensearch keystore for secure settings.",
"[access_key] setting was deprecated in Elasticsearch and will be removed in a future release!" "[access_key] setting was deprecated in OpenSearch and will be removed in a future release!"
+ " See the breaking changes documentation for the next major version."); + " See the breaking changes documentation for the next major version.");
} }
} }
@ -248,7 +248,7 @@ public class RepositoryCredentialsTests extends ESSingleNodeTestCase {
assertWarnings( assertWarnings(
"Using s3 access/secret key from repository settings. Instead store these in named clients and" "Using s3 access/secret key from repository settings. Instead store these in named clients and"
+ " the elasticsearch keystore for secure settings."); + " the opensearch keystore for secure settings.");
} }
private void createRepository(final String name, final Settings repositorySettings) { private void createRepository(final String name, final Settings repositorySettings) {

View File

@ -32,8 +32,8 @@ import io.netty.handler.codec.http.cookie.ServerCookieDecoder;
import io.netty.handler.codec.http.cookie.ServerCookieEncoder; import io.netty.handler.codec.http.cookie.ServerCookieEncoder;
import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.http.HttpRequest; import org.elasticsearch.http.HttpRequest;
import org.elasticsearch.rest.RestRequest; import org.opensearch.rest.RestRequest;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import java.util.AbstractMap; import java.util.AbstractMap;
import java.util.Collection; import java.util.Collection;

View File

@ -25,7 +25,7 @@ import io.netty.handler.codec.http.HttpResponseStatus;
import io.netty.handler.codec.http.HttpVersion; import io.netty.handler.codec.http.HttpVersion;
import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.http.HttpResponse; import org.elasticsearch.http.HttpResponse;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
public class NioHttpResponse extends DefaultFullHttpResponse implements HttpResponse { public class NioHttpResponse extends DefaultFullHttpResponse implements HttpResponse {

View File

@ -48,8 +48,8 @@ import org.elasticsearch.nio.FlushOperation;
import org.elasticsearch.nio.InboundChannelBuffer; import org.elasticsearch.nio.InboundChannelBuffer;
import org.elasticsearch.nio.SocketChannelContext; import org.elasticsearch.nio.SocketChannelContext;
import org.elasticsearch.nio.TaskScheduler; import org.elasticsearch.nio.TaskScheduler;
import org.elasticsearch.rest.RestRequest; import org.opensearch.rest.RestRequest;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.ESTestCase;
import org.junit.Before; import org.junit.Before;
import org.mockito.ArgumentCaptor; import org.mockito.ArgumentCaptor;

View File

@ -35,7 +35,7 @@ import org.elasticsearch.http.HttpPipelinedRequest;
import org.elasticsearch.http.HttpPipelinedResponse; import org.elasticsearch.http.HttpPipelinedResponse;
import org.elasticsearch.http.HttpRequest; import org.elasticsearch.http.HttpRequest;
import org.elasticsearch.http.HttpResponse; import org.elasticsearch.http.HttpResponse;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.ESTestCase;
import org.junit.After; import org.junit.After;

View File

@ -52,9 +52,9 @@ import org.elasticsearch.http.HttpTransportSettings;
import org.elasticsearch.http.NullDispatcher; import org.elasticsearch.http.NullDispatcher;
import org.elasticsearch.indices.breaker.NoneCircuitBreakerService; import org.elasticsearch.indices.breaker.NoneCircuitBreakerService;
import org.elasticsearch.nio.NioSocketChannel; import org.elasticsearch.nio.NioSocketChannel;
import org.elasticsearch.rest.BytesRestResponse; import org.opensearch.rest.BytesRestResponse;
import org.elasticsearch.rest.RestChannel; import org.opensearch.rest.RestChannel;
import org.elasticsearch.rest.RestRequest; import org.opensearch.rest.RestRequest;
import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.rest.FakeRestRequest; import org.elasticsearch.test.rest.FakeRestRequest;
import org.elasticsearch.threadpool.TestThreadPool; import org.elasticsearch.threadpool.TestThreadPool;
@ -73,8 +73,8 @@ import java.util.concurrent.atomic.AtomicReference;
import static org.elasticsearch.http.HttpTransportSettings.SETTING_CORS_ALLOW_ORIGIN; import static org.elasticsearch.http.HttpTransportSettings.SETTING_CORS_ALLOW_ORIGIN;
import static org.elasticsearch.http.HttpTransportSettings.SETTING_CORS_ENABLED; import static org.elasticsearch.http.HttpTransportSettings.SETTING_CORS_ENABLED;
import static org.elasticsearch.rest.RestStatus.BAD_REQUEST; import static org.opensearch.rest.RestStatus.BAD_REQUEST;
import static org.elasticsearch.rest.RestStatus.OK; import static org.opensearch.rest.RestStatus.OK;
import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.instanceOf;

View File

@ -25,7 +25,7 @@ import org.opensearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResp
import org.opensearch.action.admin.cluster.snapshots.status.SnapshotsStatusResponse; import org.opensearch.action.admin.cluster.snapshots.status.SnapshotsStatusResponse;
import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.cluster.metadata.Metadata;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
import org.junit.Before; import org.junit.Before;

View File

@ -36,7 +36,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.ingest.IngestTestPlugin; import org.elasticsearch.ingest.IngestTestPlugin;
import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.ESIntegTestCase;
import java.io.IOException; import java.io.IOException;
@ -68,7 +68,7 @@ public class BulkIntegrationIT extends ESIntegTestCase {
} }
public void testBulkIndexCreatesMapping() throws Exception { public void testBulkIndexCreatesMapping() throws Exception {
String bulkAction = copyToStringFromClasspath("/org/elasticsearch/action/bulk/bulk-log.json"); String bulkAction = copyToStringFromClasspath("/org/opensearch/action/bulk/bulk-log.json");
BulkRequestBuilder bulkBuilder = client().prepareBulk(); BulkRequestBuilder bulkBuilder = client().prepareBulk();
bulkBuilder.add(bulkAction.getBytes(StandardCharsets.UTF_8), 0, bulkAction.length(), null, XContentType.JSON); bulkBuilder.add(bulkAction.getBytes(StandardCharsets.UTF_8), 0, bulkAction.length(), null, XContentType.JSON);
bulkBuilder.get(); bulkBuilder.get();
@ -126,7 +126,7 @@ public class BulkIntegrationIT extends ESIntegTestCase {
public void testBulkWithGlobalDefaults() throws Exception { public void testBulkWithGlobalDefaults() throws Exception {
// all requests in the json are missing index and type parameters: "_index" : "test", "_type" : "type1", // all requests in the json are missing index and type parameters: "_index" : "test", "_type" : "type1",
String bulkAction = copyToStringFromClasspath("/org/elasticsearch/action/bulk/simple-bulk-missing-index-type.json"); String bulkAction = copyToStringFromClasspath("/org/opensearch/action/bulk/simple-bulk-missing-index-type.json");
{ {
BulkRequestBuilder bulkBuilder = client().prepareBulk(); BulkRequestBuilder bulkBuilder = client().prepareBulk();
bulkBuilder.add(bulkAction.getBytes(StandardCharsets.UTF_8), 0, bulkAction.length(), null, XContentType.JSON); bulkBuilder.add(bulkAction.getBytes(StandardCharsets.UTF_8), 0, bulkAction.length(), null, XContentType.JSON);

Some files were not shown because too many files have changed in this diff Show More