[Rename] Fix imports in the client module. (#380)

Signed-off-by: Rabi Panda <adnapibar@gmail.com>
This commit is contained in:
Rabi Panda 2021-03-18 06:35:09 -07:00 committed by Nick Knize
parent 1bdfbb4ef1
commit d099a79fd5
55 changed files with 144 additions and 170 deletions

View File

@ -28,7 +28,7 @@ import org.opensearch.action.update.UpdateResponse;
import org.opensearch.client.Requests; import org.opensearch.client.Requests;
import org.opensearch.client.node.NodeClient; import org.opensearch.client.node.NodeClient;
import org.opensearch.common.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentBuilder;
import org.elasticsearch.index.shard.ShardId; import org.opensearch.index.shard.ShardId;
import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.BaseRestHandler;
import org.opensearch.rest.BytesRestResponse; import org.opensearch.rest.BytesRestResponse;
import org.opensearch.rest.RestChannel; import org.opensearch.rest.RestChannel;

View File

@ -28,7 +28,7 @@ import org.opensearch.action.support.ActionFilters;
import org.opensearch.action.support.HandledTransportAction; import org.opensearch.action.support.HandledTransportAction;
import org.opensearch.action.update.UpdateResponse; import org.opensearch.action.update.UpdateResponse;
import org.opensearch.common.inject.Inject; import org.opensearch.common.inject.Inject;
import org.elasticsearch.index.shard.ShardId; import org.opensearch.index.shard.ShardId;
import org.opensearch.tasks.Task; import org.opensearch.tasks.Task;
import org.opensearch.transport.TransportService; import org.opensearch.transport.TransportService;

View File

@ -19,8 +19,6 @@
package org.opensearch.client; package org.opensearch.client;
import org.elasticsearch.client.Cancellable;
import org.elasticsearch.client.RequestOptions;
import org.opensearch.action.ActionListener; import org.opensearch.action.ActionListener;
import org.opensearch.action.admin.cluster.health.ClusterHealthRequest; import org.opensearch.action.admin.cluster.health.ClusterHealthRequest;
import org.opensearch.action.admin.cluster.health.ClusterHealthResponse; import org.opensearch.action.admin.cluster.health.ClusterHealthResponse;

View File

@ -23,7 +23,6 @@ import org.apache.http.client.methods.HttpDelete;
import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpHead; import org.apache.http.client.methods.HttpHead;
import org.apache.http.client.methods.HttpPut; import org.apache.http.client.methods.HttpPut;
import org.elasticsearch.client.Request;
import org.opensearch.action.admin.cluster.health.ClusterHealthRequest; import org.opensearch.action.admin.cluster.health.ClusterHealthRequest;
import org.opensearch.action.admin.cluster.settings.ClusterGetSettingsRequest; import org.opensearch.action.admin.cluster.settings.ClusterGetSettingsRequest;
import org.opensearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest; import org.opensearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest;

View File

@ -42,7 +42,7 @@ import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedT
* The format is pretty horrible as it holds aliases, but at the same time errors can come back through the status and error fields. * The format is pretty horrible as it holds aliases, but at the same time errors can come back through the status and error fields.
* Such errors are mostly 404 - NOT FOUND for aliases that were specified but not found. In such case the client won't throw exception * Such errors are mostly 404 - NOT FOUND for aliases that were specified but not found. In such case the client won't throw exception
* so it allows to retrieve the returned aliases, while at the same time checking if errors were returned. * so it allows to retrieve the returned aliases, while at the same time checking if errors were returned.
* There's also the case where an exception is returned, like for instance an {@link org.elasticsearch.index.IndexNotFoundException}. * There's also the case where an exception is returned, like for instance an {@link org.opensearch.index.IndexNotFoundException}.
* We would usually throw such exception, but we configure the client to not throw for 404 to support the case above, hence we also not * We would usually throw such exception, but we configure the client to not throw for 404 to support the case above, hence we also not
* throw in case an index is not found, although it is a hard error that doesn't come back with aliases. * throw in case an index is not found, although it is a hard error that doesn't come back with aliases.
*/ */

View File

@ -19,8 +19,8 @@
package org.opensearch.client; package org.opensearch.client;
import org.elasticsearch.client.Cancellable; import org.opensearch.client.Cancellable;
import org.elasticsearch.client.RequestOptions; import org.opensearch.client.RequestOptions;
import org.opensearch.action.ActionListener; import org.opensearch.action.ActionListener;
import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest; import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest;
import org.opensearch.action.admin.indices.alias.get.GetAliasesRequest; import org.opensearch.action.admin.indices.alias.get.GetAliasesRequest;
@ -1790,10 +1790,10 @@ public final class IndicesClient {
* @param request the request * @param request the request
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
*/ */
public org.elasticsearch.client.core.AcknowledgedResponse deleteAlias(DeleteAliasRequest request, public org.opensearch.client.core.AcknowledgedResponse deleteAlias(DeleteAliasRequest request,
RequestOptions options) throws IOException { RequestOptions options) throws IOException {
return restHighLevelClient.performRequestAndParseEntity(request, IndicesRequestConverters::deleteAlias, options, return restHighLevelClient.performRequestAndParseEntity(request, IndicesRequestConverters::deleteAlias, options,
org.elasticsearch.client.core.AcknowledgedResponse::fromXContent, emptySet()); org.opensearch.client.core.AcknowledgedResponse::fromXContent, emptySet());
} }
/** /**
@ -1804,8 +1804,8 @@ public final class IndicesClient {
* @return cancellable that may be used to cancel the request * @return cancellable that may be used to cancel the request
*/ */
public Cancellable deleteAliasAsync(DeleteAliasRequest request, RequestOptions options, public Cancellable deleteAliasAsync(DeleteAliasRequest request, RequestOptions options,
ActionListener<org.elasticsearch.client.core.AcknowledgedResponse> listener) { ActionListener<org.opensearch.client.core.AcknowledgedResponse> listener) {
return restHighLevelClient.performRequestAsyncAndParseEntity(request, IndicesRequestConverters::deleteAlias, options, return restHighLevelClient.performRequestAsyncAndParseEntity(request, IndicesRequestConverters::deleteAlias, options,
org.elasticsearch.client.core.AcknowledgedResponse::fromXContent, listener, emptySet()); org.opensearch.client.core.AcknowledgedResponse::fromXContent, listener, emptySet());
} }
} }

View File

@ -24,7 +24,7 @@ import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpHead; import org.apache.http.client.methods.HttpHead;
import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut; import org.apache.http.client.methods.HttpPut;
import org.elasticsearch.client.Request; import org.opensearch.client.Request;
import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest; import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest;
import org.opensearch.action.admin.indices.alias.get.GetAliasesRequest; import org.opensearch.action.admin.indices.alias.get.GetAliasesRequest;
import org.opensearch.action.admin.indices.cache.clear.ClearIndicesCacheRequest; import org.opensearch.action.admin.indices.cache.clear.ClearIndicesCacheRequest;

View File

@ -19,8 +19,8 @@
package org.opensearch.client; package org.opensearch.client;
import org.elasticsearch.client.Cancellable; import org.opensearch.client.Cancellable;
import org.elasticsearch.client.RequestOptions; import org.opensearch.client.RequestOptions;
import org.opensearch.action.ActionListener; import org.opensearch.action.ActionListener;
import org.opensearch.action.ingest.DeletePipelineRequest; import org.opensearch.action.ingest.DeletePipelineRequest;
import org.opensearch.action.ingest.GetPipelineRequest; import org.opensearch.action.ingest.GetPipelineRequest;

View File

@ -27,7 +27,7 @@ import org.opensearch.action.ingest.DeletePipelineRequest;
import org.opensearch.action.ingest.GetPipelineRequest; import org.opensearch.action.ingest.GetPipelineRequest;
import org.opensearch.action.ingest.PutPipelineRequest; import org.opensearch.action.ingest.PutPipelineRequest;
import org.opensearch.action.ingest.SimulatePipelineRequest; import org.opensearch.action.ingest.SimulatePipelineRequest;
import org.elasticsearch.client.Request; import org.opensearch.client.Request;
import java.io.IOException; import java.io.IOException;

View File

@ -19,8 +19,8 @@
package org.opensearch.client; package org.opensearch.client;
import org.elasticsearch.client.Cancellable; import org.opensearch.client.Cancellable;
import org.elasticsearch.client.RequestOptions; import org.opensearch.client.RequestOptions;
import org.opensearch.action.ActionListener; import org.opensearch.action.ActionListener;
import org.opensearch.action.admin.cluster.repositories.cleanup.CleanupRepositoryRequest; import org.opensearch.action.admin.cluster.repositories.cleanup.CleanupRepositoryRequest;
import org.opensearch.action.admin.cluster.repositories.cleanup.CleanupRepositoryResponse; import org.opensearch.action.admin.cluster.repositories.cleanup.CleanupRepositoryResponse;

View File

@ -23,7 +23,7 @@ import org.apache.http.client.methods.HttpDelete;
import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut; import org.apache.http.client.methods.HttpPut;
import org.elasticsearch.client.Request; import org.opensearch.client.Request;
import org.opensearch.action.admin.cluster.repositories.cleanup.CleanupRepositoryRequest; import org.opensearch.action.admin.cluster.repositories.cleanup.CleanupRepositoryRequest;
import org.opensearch.action.admin.cluster.repositories.delete.DeleteRepositoryRequest; import org.opensearch.action.admin.cluster.repositories.delete.DeleteRepositoryRequest;
import org.opensearch.action.admin.cluster.repositories.get.GetRepositoriesRequest; import org.opensearch.action.admin.cluster.repositories.get.GetRepositoriesRequest;

View File

@ -19,8 +19,6 @@
package org.opensearch.client; package org.opensearch.client;
import org.elasticsearch.client.Cancellable;
import org.elasticsearch.client.RequestOptions;
import org.opensearch.action.ActionListener; import org.opensearch.action.ActionListener;
import org.opensearch.action.admin.cluster.node.tasks.list.ListTasksRequest; import org.opensearch.action.admin.cluster.node.tasks.list.ListTasksRequest;
import org.opensearch.action.admin.cluster.node.tasks.list.ListTasksResponse; import org.opensearch.action.admin.cluster.node.tasks.list.ListTasksResponse;

View File

@ -21,7 +21,6 @@ package org.opensearch.client;
import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPost;
import org.elasticsearch.client.Request;
import org.opensearch.action.admin.cluster.node.tasks.list.ListTasksRequest; import org.opensearch.action.admin.cluster.node.tasks.list.ListTasksRequest;
import org.opensearch.client.RequestConverters.EndpointBuilder; import org.opensearch.client.RequestConverters.EndpointBuilder;
import org.opensearch.client.tasks.CancelTasksRequest; import org.opensearch.client.tasks.CancelTasksRequest;

View File

@ -78,7 +78,7 @@ public final class RemoteConnectionInfo {
private final ModeInfo modeInfo; private final ModeInfo modeInfo;
// TODO: deprecate and remove this field in favor of initialConnectionTimeout field that is of type TimeValue. // TODO: deprecate and remove this field in favor of initialConnectionTimeout field that is of type TimeValue.
// When rest api versioning exists then change org.elasticsearch.transport.RemoteConnectionInfo to properly serialize // When rest api versioning exists then change org.opensearch.transport.RemoteConnectionInfo to properly serialize
// the initialConnectionTimeout field so that we can properly parse initialConnectionTimeout as TimeValue // the initialConnectionTimeout field so that we can properly parse initialConnectionTimeout as TimeValue
private final String initialConnectionTimeoutString; private final String initialConnectionTimeoutString;
private final String clusterAlias; private final String clusterAlias;

View File

@ -26,7 +26,7 @@ import org.opensearch.action.support.IndicesOptions;
import org.opensearch.common.Strings; import org.opensearch.common.Strings;
import org.opensearch.common.xcontent.ToXContentObject; import org.opensearch.common.xcontent.ToXContentObject;
import org.opensearch.common.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentBuilder;
import org.elasticsearch.index.query.QueryBuilder; import org.opensearch.index.query.QueryBuilder;
import org.opensearch.search.builder.SearchSourceBuilder; import org.opensearch.search.builder.SearchSourceBuilder;
import org.opensearch.search.internal.SearchContext; import org.opensearch.search.internal.SearchContext;

View File

@ -27,7 +27,7 @@ import org.opensearch.common.xcontent.XContentBuilder;
import org.opensearch.common.xcontent.XContentHelper; import org.opensearch.common.xcontent.XContentHelper;
import org.opensearch.common.xcontent.XContentParser; import org.opensearch.common.xcontent.XContentParser;
import org.opensearch.common.xcontent.XContentType; import org.opensearch.common.xcontent.XContentType;
import org.elasticsearch.index.mapper.Mapper; import org.opensearch.index.mapper.Mapper;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;

View File

@ -25,7 +25,7 @@ import org.opensearch.cluster.metadata.MappingMetadata;
import org.opensearch.common.settings.Settings; import org.opensearch.common.settings.Settings;
import org.opensearch.common.xcontent.XContentParser; import org.opensearch.common.xcontent.XContentParser;
import org.opensearch.common.xcontent.XContentParser.Token; import org.opensearch.common.xcontent.XContentParser.Token;
import org.elasticsearch.index.mapper.MapperService; import org.opensearch.index.mapper.MapperService;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -23,7 +23,7 @@ import org.opensearch.cluster.metadata.MappingMetadata;
import org.opensearch.common.ParseField; import org.opensearch.common.ParseField;
import org.opensearch.common.xcontent.XContentParser; import org.opensearch.common.xcontent.XContentParser;
import org.opensearch.common.xcontent.XContentParserUtils; import org.opensearch.common.xcontent.XContentParserUtils;
import org.elasticsearch.index.mapper.MapperService; import org.opensearch.index.mapper.MapperService;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;

View File

@ -27,7 +27,7 @@ import org.opensearch.common.collect.ImmutableOpenMap;
import org.opensearch.common.settings.Settings; import org.opensearch.common.settings.Settings;
import org.opensearch.common.xcontent.ConstructingObjectParser; import org.opensearch.common.xcontent.ConstructingObjectParser;
import org.opensearch.common.xcontent.XContentParser; import org.opensearch.common.xcontent.XContentParser;
import org.elasticsearch.index.mapper.MapperService; import org.opensearch.index.mapper.MapperService;
import java.io.IOException; import java.io.IOException;
import java.util.AbstractMap; import java.util.AbstractMap;

View File

@ -18,7 +18,7 @@
*/ */
package org.opensearch.client; package org.opensearch.client;
import org.elasticsearch.client.RequestOptions; import org.opensearch.client.RequestOptions;
import org.opensearch.action.admin.indices.refresh.RefreshRequest; import org.opensearch.action.admin.indices.refresh.RefreshRequest;
import org.opensearch.action.bulk.BackoffPolicy; import org.opensearch.action.bulk.BackoffPolicy;
import org.opensearch.action.bulk.BulkItemResponse; import org.opensearch.action.bulk.BulkItemResponse;

View File

@ -20,8 +20,8 @@
package org.opensearch.client; package org.opensearch.client;
import org.apache.http.util.EntityUtils; import org.apache.http.util.EntityUtils;
import org.elasticsearch.client.Request; import org.opensearch.client.Request;
import org.elasticsearch.client.RequestOptions; import org.opensearch.client.RequestOptions;
import org.opensearch.OpenSearchException; import org.opensearch.OpenSearchException;
import org.opensearch.OpenSearchStatusException; import org.opensearch.OpenSearchStatusException;
import org.opensearch.action.admin.cluster.health.ClusterHealthRequest; import org.opensearch.action.admin.cluster.health.ClusterHealthRequest;
@ -53,7 +53,7 @@ import org.opensearch.common.unit.ByteSizeUnit;
import org.opensearch.common.unit.TimeValue; import org.opensearch.common.unit.TimeValue;
import org.opensearch.common.xcontent.XContentType; import org.opensearch.common.xcontent.XContentType;
import org.opensearch.common.xcontent.support.XContentMapValues; import org.opensearch.common.xcontent.support.XContentMapValues;
import org.elasticsearch.indices.recovery.RecoverySettings; import org.opensearch.indices.recovery.RecoverySettings;
import org.opensearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.opensearch.transport.RemoteClusterService; import org.opensearch.transport.RemoteClusterService;
import org.opensearch.transport.SniffConnectionStrategy; import org.opensearch.transport.SniffConnectionStrategy;

View File

@ -21,7 +21,7 @@ package org.opensearch.client;
import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPut; import org.apache.http.client.methods.HttpPut;
import org.elasticsearch.client.Request; import org.opensearch.client.Request;
import org.opensearch.action.admin.cluster.health.ClusterHealthRequest; import org.opensearch.action.admin.cluster.health.ClusterHealthRequest;
import org.opensearch.action.admin.cluster.settings.ClusterGetSettingsRequest; import org.opensearch.action.admin.cluster.settings.ClusterGetSettingsRequest;
import org.opensearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest; import org.opensearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest;

View File

@ -19,7 +19,7 @@
package org.opensearch.client; package org.opensearch.client;
import org.elasticsearch.client.RequestOptions; import org.opensearch.client.RequestOptions;
import org.opensearch.OpenSearchException; import org.opensearch.OpenSearchException;
import org.opensearch.OpenSearchStatusException; import org.opensearch.OpenSearchStatusException;
import org.opensearch.action.DocWriteRequest; import org.opensearch.action.DocWriteRequest;
@ -54,8 +54,8 @@ import org.opensearch.common.unit.ByteSizeValue;
import org.opensearch.common.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentBuilder;
import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentFactory;
import org.opensearch.common.xcontent.XContentType; import org.opensearch.common.xcontent.XContentType;
import org.elasticsearch.index.VersionType; import org.opensearch.index.VersionType;
import org.elasticsearch.index.get.GetResult; import org.opensearch.index.get.GetResult;
import org.opensearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.opensearch.rest.action.document.RestBulkAction; import org.opensearch.rest.action.document.RestBulkAction;
import org.opensearch.rest.action.document.RestDeleteAction; import org.opensearch.rest.action.document.RestDeleteAction;

View File

@ -30,11 +30,11 @@ import org.apache.http.message.BasicStatusLine;
import org.apache.http.nio.entity.NByteArrayEntity; import org.apache.http.nio.entity.NByteArrayEntity;
import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRef;
import org.opensearch.Build; import org.opensearch.Build;
import org.elasticsearch.client.Request; import org.opensearch.client.Request;
import org.elasticsearch.client.RequestOptions; import org.opensearch.client.RequestOptions;
import org.elasticsearch.client.Response; import org.opensearch.client.Response;
import org.elasticsearch.client.ResponseListener; import org.opensearch.client.ResponseListener;
import org.elasticsearch.client.RestClient; import org.opensearch.client.RestClient;
import org.opensearch.Version; import org.opensearch.Version;
import org.opensearch.action.ActionListener; import org.opensearch.action.ActionListener;
import org.opensearch.action.main.MainRequest; import org.opensearch.action.main.MainRequest;

View File

@ -23,8 +23,6 @@ import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut; import org.apache.http.client.methods.HttpPut;
import org.opensearch.action.search.SearchRequest; import org.opensearch.action.search.SearchRequest;
import org.opensearch.action.search.SearchResponse; import org.opensearch.action.search.SearchResponse;
import org.elasticsearch.client.Request;
import org.elasticsearch.client.RequestOptions;
import java.io.IOException; import java.io.IOException;

View File

@ -22,10 +22,6 @@ package org.opensearch.client;
import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut; import org.apache.http.client.methods.HttpPut;
import org.elasticsearch.client.Request;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.Response;
import org.elasticsearch.client.ResponseException;
import org.opensearch.OpenSearchException; import org.opensearch.OpenSearchException;
import org.opensearch.OpenSearchStatusException; import org.opensearch.OpenSearchStatusException;
import org.opensearch.action.admin.indices.alias.Alias; import org.opensearch.action.admin.indices.alias.Alias;
@ -113,11 +109,11 @@ import org.opensearch.common.xcontent.XContentFactory;
import org.opensearch.common.xcontent.XContentType; import org.opensearch.common.xcontent.XContentType;
import org.opensearch.common.xcontent.json.JsonXContent; import org.opensearch.common.xcontent.json.JsonXContent;
import org.opensearch.common.xcontent.support.XContentMapValues; import org.opensearch.common.xcontent.support.XContentMapValues;
import org.elasticsearch.index.IndexSettings; import org.opensearch.index.IndexSettings;
import org.elasticsearch.index.mapper.MapperService; import org.opensearch.index.mapper.MapperService;
import org.elasticsearch.index.query.QueryBuilder; import org.opensearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryBuilders; import org.opensearch.index.query.QueryBuilders;
import org.elasticsearch.indices.flush.SyncedFlushService; import org.opensearch.indices.flush.SyncedFlushService;
import org.opensearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.opensearch.rest.action.admin.indices.RestCreateIndexAction; import org.opensearch.rest.action.admin.indices.RestCreateIndexAction;
import org.opensearch.rest.action.admin.indices.RestGetFieldMappingAction; import org.opensearch.rest.action.admin.indices.RestGetFieldMappingAction;
@ -136,10 +132,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_REPLICAS;
import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_SHARDS;
import static org.opensearch.common.xcontent.support.XContentMapValues.extractRawValues;
import static org.opensearch.common.xcontent.support.XContentMapValues.extractValue;
import static org.hamcrest.CoreMatchers.hasItem; import static org.hamcrest.CoreMatchers.hasItem;
import static org.hamcrest.Matchers.arrayContainingInAnyOrder; import static org.hamcrest.Matchers.arrayContainingInAnyOrder;
import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.contains;
@ -155,6 +147,10 @@ import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.Matchers.startsWith; import static org.hamcrest.Matchers.startsWith;
import static org.hamcrest.core.IsInstanceOf.instanceOf; import static org.hamcrest.core.IsInstanceOf.instanceOf;
import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_REPLICAS;
import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_SHARDS;
import static org.opensearch.common.xcontent.support.XContentMapValues.extractRawValues;
import static org.opensearch.common.xcontent.support.XContentMapValues.extractValue;
public class IndicesClientIT extends OpenSearchRestHighLevelClientTestCase { public class IndicesClientIT extends OpenSearchRestHighLevelClientTestCase {
@ -933,7 +929,7 @@ public class IndicesClientIT extends OpenSearchRestHighLevelClientTestCase {
public void testCloseEmptyOrNullIndex() { public void testCloseEmptyOrNullIndex() {
String[] indices = randomBoolean() ? Strings.EMPTY_ARRAY : null; String[] indices = randomBoolean() ? Strings.EMPTY_ARRAY : null;
CloseIndexRequest closeIndexRequest = new CloseIndexRequest(indices); CloseIndexRequest closeIndexRequest = new CloseIndexRequest(indices);
org.elasticsearch.client.ValidationException exception = expectThrows(org.elasticsearch.client.ValidationException.class, org.opensearch.client.ValidationException exception = expectThrows(org.opensearch.client.ValidationException.class,
() -> execute(closeIndexRequest, highLevelClient().indices()::close, highLevelClient().indices()::closeAsync)); () -> execute(closeIndexRequest, highLevelClient().indices()::close, highLevelClient().indices()::closeAsync));
assertThat(exception.validationErrors().get(0), equalTo("index is missing")); assertThat(exception.validationErrors().get(0), equalTo("index is missing"));
} }
@ -1998,7 +1994,7 @@ public class IndicesClientIT extends OpenSearchRestHighLevelClientTestCase {
assertThat(aliasExists(index, alias2), equalTo(true)); assertThat(aliasExists(index, alias2), equalTo(true));
DeleteAliasRequest request = new DeleteAliasRequest(index, alias); DeleteAliasRequest request = new DeleteAliasRequest(index, alias);
org.elasticsearch.client.core.AcknowledgedResponse aliasDeleteResponse = execute(request, org.opensearch.client.core.AcknowledgedResponse aliasDeleteResponse = execute(request,
highLevelClient().indices()::deleteAlias, highLevelClient().indices()::deleteAlias,
highLevelClient().indices()::deleteAliasAsync); highLevelClient().indices()::deleteAliasAsync);

View File

@ -25,7 +25,7 @@ import org.apache.http.client.methods.HttpHead;
import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut; import org.apache.http.client.methods.HttpPut;
import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.LuceneTestCase;
import org.elasticsearch.client.Request; import org.opensearch.client.Request;
import org.opensearch.action.ActionRequestValidationException; import org.opensearch.action.ActionRequestValidationException;
import org.opensearch.action.admin.indices.alias.Alias; import org.opensearch.action.admin.indices.alias.Alias;
import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest; import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest;

View File

@ -32,7 +32,7 @@ import org.opensearch.action.support.master.AcknowledgedResponse;
import org.opensearch.common.bytes.BytesReference; import org.opensearch.common.bytes.BytesReference;
import org.opensearch.common.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentBuilder;
import org.opensearch.common.xcontent.XContentType; import org.opensearch.common.xcontent.XContentType;
import org.elasticsearch.ingest.PipelineConfiguration; import org.opensearch.ingest.PipelineConfiguration;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;

View File

@ -27,7 +27,6 @@ import org.opensearch.action.ingest.DeletePipelineRequest;
import org.opensearch.action.ingest.GetPipelineRequest; import org.opensearch.action.ingest.GetPipelineRequest;
import org.opensearch.action.ingest.PutPipelineRequest; import org.opensearch.action.ingest.PutPipelineRequest;
import org.opensearch.action.ingest.SimulatePipelineRequest; import org.opensearch.action.ingest.SimulatePipelineRequest;
import org.elasticsearch.client.Request;
import org.opensearch.action.support.master.AcknowledgedRequest; import org.opensearch.action.support.master.AcknowledgedRequest;
import org.opensearch.common.bytes.BytesArray; import org.opensearch.common.bytes.BytesArray;
import org.opensearch.common.xcontent.XContentType; import org.opensearch.common.xcontent.XContentType;

View File

@ -25,10 +25,6 @@ import org.apache.http.RequestLine;
import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpGet;
import org.apache.http.message.BasicRequestLine; import org.apache.http.message.BasicRequestLine;
import org.apache.http.message.BasicStatusLine; import org.apache.http.message.BasicStatusLine;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.Response;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.WarningFailureException;
import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.OpenSearchTestCase;
import org.junit.Before; import org.junit.Before;

View File

@ -20,8 +20,6 @@
package org.opensearch.client; package org.opensearch.client;
import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpGet;
import org.elasticsearch.client.Request;
import org.elasticsearch.client.RequestOptions;
import org.opensearch.client.core.MainResponse; import org.opensearch.client.core.MainResponse;
import java.io.IOException; import java.io.IOException;

View File

@ -19,25 +19,24 @@
package org.opensearch.client; package org.opensearch.client;
import org.junit.Before;
import org.opensearch.action.search.SearchRequest; import org.opensearch.action.search.SearchRequest;
import org.elasticsearch.client.Request;
import org.opensearch.action.support.IndicesOptions; import org.opensearch.action.support.IndicesOptions;
import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.opensearch.index.query.MatchAllQueryBuilder;
import org.opensearch.index.rankeval.DiscountedCumulativeGain; import org.opensearch.index.rankeval.DiscountedCumulativeGain;
import org.opensearch.index.rankeval.EvalQueryQuality; import org.opensearch.index.rankeval.EvalQueryQuality;
import org.opensearch.index.rankeval.EvaluationMetric; import org.opensearch.index.rankeval.EvaluationMetric;
import org.opensearch.index.rankeval.ExpectedReciprocalRank; import org.opensearch.index.rankeval.ExpectedReciprocalRank;
import org.opensearch.index.rankeval.MeanReciprocalRank; import org.opensearch.index.rankeval.MeanReciprocalRank;
import org.opensearch.index.rankeval.PrecisionAtK; import org.opensearch.index.rankeval.PrecisionAtK;
import org.opensearch.index.rankeval.RecallAtK;
import org.opensearch.index.rankeval.RankEvalRequest; import org.opensearch.index.rankeval.RankEvalRequest;
import org.opensearch.index.rankeval.RankEvalResponse; import org.opensearch.index.rankeval.RankEvalResponse;
import org.opensearch.index.rankeval.RankEvalSpec; 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.opensearch.index.rankeval.RecallAtK;
import org.opensearch.search.builder.SearchSourceBuilder; import org.opensearch.search.builder.SearchSourceBuilder;
import org.junit.Before;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -22,12 +22,11 @@ package org.opensearch.client;
import org.apache.http.HttpEntity; import org.apache.http.HttpEntity;
import org.apache.http.entity.ContentType; import org.apache.http.entity.ContentType;
import org.apache.http.nio.entity.NStringEntity; import org.apache.http.nio.entity.NStringEntity;
import org.elasticsearch.client.RestClient; import org.junit.Before;
import org.opensearch.common.ParseField; import org.opensearch.common.ParseField;
import org.opensearch.common.xcontent.NamedXContentRegistry; import org.opensearch.common.xcontent.NamedXContentRegistry;
import org.opensearch.common.xcontent.XContentParser; import org.opensearch.common.xcontent.XContentParser;
import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.OpenSearchTestCase;
import org.junit.Before;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -23,7 +23,6 @@ import org.apache.http.client.methods.HttpDelete;
import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut; import org.apache.http.client.methods.HttpPut;
import org.elasticsearch.client.Request;
import org.opensearch.action.admin.cluster.repositories.delete.DeleteRepositoryRequest; import org.opensearch.action.admin.cluster.repositories.delete.DeleteRepositoryRequest;
import org.opensearch.action.admin.cluster.repositories.get.GetRepositoriesRequest; import org.opensearch.action.admin.cluster.repositories.get.GetRepositoriesRequest;
import org.opensearch.action.admin.cluster.repositories.put.PutRepositoryRequest; import org.opensearch.action.admin.cluster.repositories.put.PutRepositoryRequest;

View File

@ -29,9 +29,9 @@ import org.opensearch.common.xcontent.ToXContent;
import org.opensearch.common.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentBuilder;
import org.opensearch.common.xcontent.XContentParser; import org.opensearch.common.xcontent.XContentParser;
import org.opensearch.common.xcontent.XContentType; import org.opensearch.common.xcontent.XContentType;
import org.elasticsearch.index.shard.ShardId; import org.opensearch.index.shard.ShardId;
import org.elasticsearch.indices.flush.ShardsSyncedFlushResult; import org.opensearch.indices.flush.ShardsSyncedFlushResult;
import org.elasticsearch.indices.flush.SyncedFlushService; import org.opensearch.indices.flush.SyncedFlushService;
import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.OpenSearchTestCase;
import java.io.IOException; import java.io.IOException;

View File

@ -19,7 +19,7 @@
package org.opensearch.client; package org.opensearch.client;
import org.elasticsearch.client.RequestOptions; import org.opensearch.index.reindex.ReindexRequest;
import org.opensearch.action.admin.cluster.node.tasks.list.ListTasksRequest; import org.opensearch.action.admin.cluster.node.tasks.list.ListTasksRequest;
import org.opensearch.action.admin.cluster.node.tasks.list.ListTasksResponse; import org.opensearch.action.admin.cluster.node.tasks.list.ListTasksResponse;
import org.opensearch.action.admin.cluster.node.tasks.list.TaskGroup; import org.opensearch.action.admin.cluster.node.tasks.list.TaskGroup;
@ -34,7 +34,6 @@ import org.opensearch.client.tasks.TaskId;
import org.opensearch.client.tasks.TaskSubmissionResponse; import org.opensearch.client.tasks.TaskSubmissionResponse;
import org.opensearch.common.settings.Settings; import org.opensearch.common.settings.Settings;
import org.opensearch.common.xcontent.XContentType; import org.opensearch.common.xcontent.XContentType;
import org.elasticsearch.index.reindex.ReindexRequest;
import org.opensearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import java.io.IOException; import java.io.IOException;

View File

@ -21,7 +21,6 @@ package org.opensearch.client;
import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPost;
import org.elasticsearch.client.Request;
import org.opensearch.action.admin.cluster.node.tasks.list.ListTasksRequest; import org.opensearch.action.admin.cluster.node.tasks.list.ListTasksRequest;
import org.opensearch.client.tasks.CancelTasksRequest; import org.opensearch.client.tasks.CancelTasksRequest;
import org.opensearch.tasks.TaskId; import org.opensearch.tasks.TaskId;

View File

@ -19,7 +19,6 @@
package org.opensearch.client; package org.opensearch.client;
import org.elasticsearch.client.RequestOptions;
import org.opensearch.action.ActionListener; import org.opensearch.action.ActionListener;
import org.opensearch.action.admin.cluster.node.tasks.list.ListTasksResponse; import org.opensearch.action.admin.cluster.node.tasks.list.ListTasksResponse;
import org.opensearch.action.bulk.BulkItemResponse; import org.opensearch.action.bulk.BulkItemResponse;
@ -30,10 +29,10 @@ import org.opensearch.action.support.WriteRequest;
import org.opensearch.client.tasks.TaskSubmissionResponse; import org.opensearch.client.tasks.TaskSubmissionResponse;
import org.opensearch.common.settings.Settings; import org.opensearch.common.settings.Settings;
import org.opensearch.common.xcontent.XContentType; import org.opensearch.common.xcontent.XContentType;
import org.elasticsearch.index.query.IdsQueryBuilder; import org.opensearch.index.query.IdsQueryBuilder;
import org.elasticsearch.index.reindex.BulkByScrollResponse; import org.opensearch.index.reindex.BulkByScrollResponse;
import org.elasticsearch.index.reindex.UpdateByQueryAction; import org.opensearch.index.reindex.UpdateByQueryAction;
import org.elasticsearch.index.reindex.UpdateByQueryRequest; import org.opensearch.index.reindex.UpdateByQueryRequest;
import org.opensearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.opensearch.script.Script; import org.opensearch.script.Script;
import org.opensearch.tasks.RawTaskStatus; import org.opensearch.tasks.RawTaskStatus;

View File

@ -60,7 +60,7 @@ public class RemoteInfoResponseTests extends AbstractResponseTestCase<org.opense
assertThat(clientInstance.getInfos().size(), equalTo(serverTestInstance.getInfos().size())); assertThat(clientInstance.getInfos().size(), equalTo(serverTestInstance.getInfos().size()));
Map<String, RemoteConnectionInfo> serverInfos = serverTestInstance.getInfos().stream() Map<String, RemoteConnectionInfo> serverInfos = serverTestInstance.getInfos().stream()
.collect(toMap(RemoteConnectionInfo::getClusterAlias, identity())); .collect(toMap(RemoteConnectionInfo::getClusterAlias, identity()));
for (org.elasticsearch.client.cluster.RemoteConnectionInfo clientRemoteInfo : clientInstance.getInfos()) { for (org.opensearch.client.cluster.RemoteConnectionInfo clientRemoteInfo : clientInstance.getInfos()) {
RemoteConnectionInfo serverRemoteInfo = serverInfos.get(clientRemoteInfo.getClusterAlias()); RemoteConnectionInfo serverRemoteInfo = serverInfos.get(clientRemoteInfo.getClusterAlias());
assertThat(clientRemoteInfo.getClusterAlias(), equalTo(serverRemoteInfo.getClusterAlias())); assertThat(clientRemoteInfo.getClusterAlias(), equalTo(serverRemoteInfo.getClusterAlias()));
assertThat(clientRemoteInfo.getInitialConnectionTimeoutString(), assertThat(clientRemoteInfo.getInitialConnectionTimeoutString(),

View File

@ -23,7 +23,7 @@ import org.opensearch.action.support.DefaultShardOperationFailedException;
import org.opensearch.client.AbstractResponseTestCase; import org.opensearch.client.AbstractResponseTestCase;
import org.opensearch.common.xcontent.XContentParser; import org.opensearch.common.xcontent.XContentParser;
import org.opensearch.common.xcontent.XContentType; import org.opensearch.common.xcontent.XContentType;
import org.elasticsearch.index.seqno.RetentionLeaseNotFoundException; import org.opensearch.index.seqno.RetentionLeaseNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -21,7 +21,7 @@ package org.opensearch.client.core;
import org.opensearch.action.support.IndicesOptions; import org.opensearch.action.support.IndicesOptions;
import org.opensearch.client.AbstractRequestTestCase; import org.opensearch.client.AbstractRequestTestCase;
import org.elasticsearch.common.settings.Settings; import org.opensearch.common.settings.Settings;
import org.opensearch.common.util.ArrayUtils; import org.opensearch.common.util.ArrayUtils;
import org.opensearch.common.xcontent.NamedXContentRegistry; import org.opensearch.common.xcontent.NamedXContentRegistry;
import org.opensearch.common.xcontent.XContentParser; import org.opensearch.common.xcontent.XContentParser;

View File

@ -71,16 +71,16 @@ import org.opensearch.common.xcontent.XContentBuilder;
import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentFactory;
import org.opensearch.common.xcontent.XContentType; import org.opensearch.common.xcontent.XContentType;
import org.opensearch.common.xcontent.json.JsonXContent; import org.opensearch.common.xcontent.json.JsonXContent;
import org.elasticsearch.index.VersionType; import org.opensearch.index.VersionType;
import org.elasticsearch.index.get.GetResult; import org.opensearch.index.get.GetResult;
import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.opensearch.index.query.MatchAllQueryBuilder;
import org.elasticsearch.index.query.TermQueryBuilder; import org.opensearch.index.query.TermQueryBuilder;
import org.elasticsearch.index.reindex.BulkByScrollResponse; import org.opensearch.index.reindex.BulkByScrollResponse;
import org.elasticsearch.index.reindex.DeleteByQueryRequest; import org.opensearch.index.reindex.DeleteByQueryRequest;
import org.elasticsearch.index.reindex.ReindexRequest; import org.opensearch.index.reindex.ReindexRequest;
import org.elasticsearch.index.reindex.RemoteInfo; import org.opensearch.index.reindex.RemoteInfo;
import org.elasticsearch.index.reindex.ScrollableHitSource; import org.opensearch.index.reindex.ScrollableHitSource;
import org.elasticsearch.index.reindex.UpdateByQueryRequest; import org.opensearch.index.reindex.UpdateByQueryRequest;
import org.opensearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import org.opensearch.script.Script; import org.opensearch.script.Script;
import org.opensearch.script.ScriptType; import org.opensearch.script.ScriptType;

View File

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

View File

@ -99,9 +99,9 @@ import org.opensearch.common.unit.TimeValue;
import org.opensearch.common.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentBuilder;
import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentFactory;
import org.opensearch.common.xcontent.XContentType; import org.opensearch.common.xcontent.XContentType;
import org.elasticsearch.index.IndexSettings; import org.opensearch.index.IndexSettings;
import org.elasticsearch.index.query.QueryBuilder; import org.opensearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.QueryBuilders; import org.opensearch.index.query.QueryBuilders;
import org.opensearch.rest.RestStatus; import org.opensearch.rest.RestStatus;
import java.io.IOException; import java.io.IOException;
@ -3052,7 +3052,7 @@ public class IndicesClientDocumentationIT extends OpenSearchRestHighLevelClientT
// end::delete-alias-request-masterTimeout // end::delete-alias-request-masterTimeout
// tag::delete-alias-execute // tag::delete-alias-execute
org.elasticsearch.client.core.AcknowledgedResponse deleteAliasResponse = org.opensearch.client.core.AcknowledgedResponse deleteAliasResponse =
client.indices().deleteAlias(request, RequestOptions.DEFAULT); client.indices().deleteAlias(request, RequestOptions.DEFAULT);
// end::delete-alias-execute // end::delete-alias-execute
@ -3066,10 +3066,10 @@ public class IndicesClientDocumentationIT extends OpenSearchRestHighLevelClientT
DeleteAliasRequest request = new DeleteAliasRequest("index1", "alias2"); // <1> DeleteAliasRequest request = new DeleteAliasRequest("index1", "alias2"); // <1>
// tag::delete-alias-execute-listener // tag::delete-alias-execute-listener
ActionListener<org.elasticsearch.client.core.AcknowledgedResponse> listener = ActionListener<org.opensearch.client.core.AcknowledgedResponse> listener =
new ActionListener<org.elasticsearch.client.core.AcknowledgedResponse>() { new ActionListener<org.opensearch.client.core.AcknowledgedResponse>() {
@Override @Override
public void onResponse(org.elasticsearch.client.core.AcknowledgedResponse deleteAliasResponse) { public void onResponse(org.opensearch.client.core.AcknowledgedResponse deleteAliasResponse) {
// <1> // <1>
} }

View File

@ -38,7 +38,7 @@ import org.opensearch.client.RestHighLevelClient;
import org.opensearch.common.bytes.BytesArray; import org.opensearch.common.bytes.BytesArray;
import org.opensearch.common.unit.TimeValue; import org.opensearch.common.unit.TimeValue;
import org.opensearch.common.xcontent.XContentType; import org.opensearch.common.xcontent.XContentType;
import org.elasticsearch.ingest.PipelineConfiguration; import org.opensearch.ingest.PipelineConfiguration;
import java.io.IOException; import java.io.IOException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;

View File

@ -25,11 +25,11 @@ import org.opensearch.common.geo.ShapeRelation;
import org.opensearch.common.geo.builders.CoordinatesBuilder; import org.opensearch.common.geo.builders.CoordinatesBuilder;
import org.opensearch.common.geo.builders.MultiPointBuilder; import org.opensearch.common.geo.builders.MultiPointBuilder;
import org.opensearch.common.unit.DistanceUnit; import org.opensearch.common.unit.DistanceUnit;
import org.elasticsearch.index.query.GeoShapeQueryBuilder; import org.opensearch.index.query.GeoShapeQueryBuilder;
import org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder; import org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder;
import org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder; import org.opensearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder;
import org.opensearch.join.query.JoinQueryBuilders; import org.opensearch.join.query.JoinQueryBuilders;
import org.elasticsearch.index.query.RankFeatureQueryBuilders; import org.opensearch.index.query.RankFeatureQueryBuilders;
import org.opensearch.script.Script; import org.opensearch.script.Script;
import org.opensearch.script.ScriptType; import org.opensearch.script.ScriptType;
import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.OpenSearchTestCase;
@ -41,45 +41,45 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import static java.util.Collections.singletonMap; import static java.util.Collections.singletonMap;
import static org.elasticsearch.index.query.QueryBuilders.boolQuery; import static org.opensearch.index.query.QueryBuilders.boolQuery;
import static org.elasticsearch.index.query.QueryBuilders.boostingQuery; import static org.opensearch.index.query.QueryBuilders.boostingQuery;
import static org.elasticsearch.index.query.QueryBuilders.commonTermsQuery; import static org.opensearch.index.query.QueryBuilders.commonTermsQuery;
import static org.elasticsearch.index.query.QueryBuilders.constantScoreQuery; import static org.opensearch.index.query.QueryBuilders.constantScoreQuery;
import static org.elasticsearch.index.query.QueryBuilders.disMaxQuery; import static org.opensearch.index.query.QueryBuilders.disMaxQuery;
import static org.elasticsearch.index.query.QueryBuilders.existsQuery; import static org.opensearch.index.query.QueryBuilders.existsQuery;
import static org.elasticsearch.index.query.QueryBuilders.functionScoreQuery; import static org.opensearch.index.query.QueryBuilders.functionScoreQuery;
import static org.elasticsearch.index.query.QueryBuilders.fuzzyQuery; import static org.opensearch.index.query.QueryBuilders.fuzzyQuery;
import static org.elasticsearch.index.query.QueryBuilders.geoBoundingBoxQuery; import static org.opensearch.index.query.QueryBuilders.geoBoundingBoxQuery;
import static org.elasticsearch.index.query.QueryBuilders.geoDistanceQuery; import static org.opensearch.index.query.QueryBuilders.geoDistanceQuery;
import static org.elasticsearch.index.query.QueryBuilders.geoPolygonQuery; import static org.opensearch.index.query.QueryBuilders.geoPolygonQuery;
import static org.elasticsearch.index.query.QueryBuilders.geoShapeQuery; import static org.opensearch.index.query.QueryBuilders.geoShapeQuery;
import static org.elasticsearch.index.query.QueryBuilders.idsQuery; import static org.opensearch.index.query.QueryBuilders.idsQuery;
import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.opensearch.index.query.QueryBuilders.matchAllQuery;
import static org.elasticsearch.index.query.QueryBuilders.matchQuery; import static org.opensearch.index.query.QueryBuilders.matchQuery;
import static org.elasticsearch.index.query.QueryBuilders.moreLikeThisQuery; import static org.opensearch.index.query.QueryBuilders.moreLikeThisQuery;
import static org.elasticsearch.index.query.QueryBuilders.multiMatchQuery; import static org.opensearch.index.query.QueryBuilders.multiMatchQuery;
import static org.elasticsearch.index.query.QueryBuilders.nestedQuery; import static org.opensearch.index.query.QueryBuilders.nestedQuery;
import static org.elasticsearch.index.query.QueryBuilders.prefixQuery; import static org.opensearch.index.query.QueryBuilders.prefixQuery;
import static org.elasticsearch.index.query.QueryBuilders.queryStringQuery; import static org.opensearch.index.query.QueryBuilders.queryStringQuery;
import static org.elasticsearch.index.query.QueryBuilders.rangeQuery; import static org.opensearch.index.query.QueryBuilders.rangeQuery;
import static org.elasticsearch.index.query.QueryBuilders.regexpQuery; import static org.opensearch.index.query.QueryBuilders.regexpQuery;
import static org.elasticsearch.index.query.QueryBuilders.scriptQuery; import static org.opensearch.index.query.QueryBuilders.scriptQuery;
import static org.elasticsearch.index.query.QueryBuilders.simpleQueryStringQuery; import static org.opensearch.index.query.QueryBuilders.simpleQueryStringQuery;
import static org.elasticsearch.index.query.QueryBuilders.spanContainingQuery; import static org.opensearch.index.query.QueryBuilders.spanContainingQuery;
import static org.elasticsearch.index.query.QueryBuilders.spanFirstQuery; import static org.opensearch.index.query.QueryBuilders.spanFirstQuery;
import static org.elasticsearch.index.query.QueryBuilders.spanMultiTermQueryBuilder; import static org.opensearch.index.query.QueryBuilders.spanMultiTermQueryBuilder;
import static org.elasticsearch.index.query.QueryBuilders.spanNearQuery; import static org.opensearch.index.query.QueryBuilders.spanNearQuery;
import static org.elasticsearch.index.query.QueryBuilders.spanNotQuery; import static org.opensearch.index.query.QueryBuilders.spanNotQuery;
import static org.elasticsearch.index.query.QueryBuilders.spanOrQuery; import static org.opensearch.index.query.QueryBuilders.spanOrQuery;
import static org.elasticsearch.index.query.QueryBuilders.spanTermQuery; import static org.opensearch.index.query.QueryBuilders.spanTermQuery;
import static org.elasticsearch.index.query.QueryBuilders.spanWithinQuery; import static org.opensearch.index.query.QueryBuilders.spanWithinQuery;
import static org.elasticsearch.index.query.QueryBuilders.termQuery; import static org.opensearch.index.query.QueryBuilders.termQuery;
import static org.elasticsearch.index.query.QueryBuilders.termsQuery; import static org.opensearch.index.query.QueryBuilders.termsQuery;
import static org.elasticsearch.index.query.QueryBuilders.typeQuery; import static org.opensearch.index.query.QueryBuilders.typeQuery;
import static org.elasticsearch.index.query.QueryBuilders.wildcardQuery; import static org.opensearch.index.query.QueryBuilders.wildcardQuery;
import static org.elasticsearch.index.query.QueryBuilders.wrapperQuery; import static org.opensearch.index.query.QueryBuilders.wrapperQuery;
import static org.elasticsearch.index.query.functionscore.ScoreFunctionBuilders.exponentialDecayFunction; import static org.opensearch.index.query.functionscore.ScoreFunctionBuilders.exponentialDecayFunction;
import static org.elasticsearch.index.query.functionscore.ScoreFunctionBuilders.randomFunction; import static org.opensearch.index.query.functionscore.ScoreFunctionBuilders.randomFunction;
/** /**
* Examples of using the transport client that are imported into the transport client documentation. * Examples of using the transport client that are imported into the transport client documentation.

View File

@ -27,7 +27,7 @@ import org.opensearch.cluster.metadata.DataStream;
import org.opensearch.common.UUIDs; import org.opensearch.common.UUIDs;
import org.opensearch.common.xcontent.XContentParser; import org.opensearch.common.xcontent.XContentParser;
import org.opensearch.common.xcontent.XContentType; import org.opensearch.common.xcontent.XContentType;
import org.elasticsearch.index.Index; import org.opensearch.index.Index;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -30,7 +30,7 @@ import org.opensearch.common.xcontent.ToXContent;
import org.opensearch.common.xcontent.ToXContent.Params; import org.opensearch.common.xcontent.ToXContent.Params;
import org.opensearch.common.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentBuilder;
import org.opensearch.index.RandomCreateIndexGenerator; import org.opensearch.index.RandomCreateIndexGenerator;
import org.elasticsearch.index.mapper.MapperService; import org.opensearch.index.mapper.MapperService;
import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.BaseRestHandler;
import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.OpenSearchTestCase;

View File

@ -33,7 +33,7 @@ import org.opensearch.common.xcontent.XContentFactory;
import org.opensearch.common.xcontent.XContentHelper; import org.opensearch.common.xcontent.XContentHelper;
import org.opensearch.common.xcontent.XContentParser; import org.opensearch.common.xcontent.XContentParser;
import org.opensearch.common.xcontent.XContentType; import org.opensearch.common.xcontent.XContentType;
import org.elasticsearch.index.mapper.MapperService; import org.opensearch.index.mapper.MapperService;
import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.OpenSearchTestCase;
import java.io.IOException; import java.io.IOException;

View File

@ -24,7 +24,7 @@ import org.opensearch.common.collect.ImmutableOpenMap;
import org.opensearch.common.xcontent.ToXContent; import org.opensearch.common.xcontent.ToXContent;
import org.opensearch.common.xcontent.ToXContent.Params; import org.opensearch.common.xcontent.ToXContent.Params;
import org.opensearch.common.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentBuilder;
import org.elasticsearch.index.mapper.MapperService; import org.opensearch.index.mapper.MapperService;
import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.BaseRestHandler;
import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.OpenSearchTestCase;

View File

@ -50,7 +50,7 @@ import static java.util.Collections.emptyMap;
import static java.util.Collections.emptySet; import static java.util.Collections.emptySet;
public class CancelTasksResponseTests extends AbstractResponseTestCase<CancelTasksResponseTests.ByNodeCancelTasksResponse, public class CancelTasksResponseTests extends AbstractResponseTestCase<CancelTasksResponseTests.ByNodeCancelTasksResponse,
org.elasticsearch.client.tasks.CancelTasksResponse> { org.opensearch.client.tasks.CancelTasksResponse> {
private static String NODE_ID = "node_id"; private static String NODE_ID = "node_id";
@ -86,13 +86,13 @@ public class CancelTasksResponseTests extends AbstractResponseTestCase<CancelTas
} }
@Override @Override
protected org.elasticsearch.client.tasks.CancelTasksResponse doParseToClientInstance(XContentParser parser) throws IOException { protected org.opensearch.client.tasks.CancelTasksResponse doParseToClientInstance(XContentParser parser) throws IOException {
return org.elasticsearch.client.tasks.CancelTasksResponse.fromXContent(parser); return org.opensearch.client.tasks.CancelTasksResponse.fromXContent(parser);
} }
@Override @Override
protected void assertInstances(ByNodeCancelTasksResponse serverTestInstance, protected void assertInstances(ByNodeCancelTasksResponse serverTestInstance,
org.elasticsearch.client.tasks.CancelTasksResponse clientInstance) { org.opensearch.client.tasks.CancelTasksResponse clientInstance) {
// checking tasks // checking tasks
List<TaskInfo> sTasks = serverTestInstance.getTasks(); List<TaskInfo> sTasks = serverTestInstance.getTasks();

View File

@ -18,22 +18,21 @@
*/ */
package org.opensearch.client.tasks; package org.opensearch.client.tasks;
import org.opensearch.OpenSearchException; import org.opensearch.client.AbstractResponseTestCase;
import org.elasticsearch.client.AbstractResponseTestCase;
import org.opensearch.common.xcontent.XContentParser; import org.opensearch.common.xcontent.XContentParser;
import org.opensearch.common.xcontent.XContentType; import org.opensearch.common.xcontent.XContentType;
import java.io.IOException; import java.io.IOException;
import java.util.Collections; import java.util.Collections;
public class OpenSearchExceptionTests extends AbstractResponseTestCase<OpenSearchException, public class OpenSearchExceptionTests extends AbstractResponseTestCase<org.opensearch.OpenSearchException,
org.opensearch.client.tasks.OpenSearchException> { org.opensearch.client.tasks.OpenSearchException> {
@Override @Override
protected OpenSearchException createServerTestInstance(XContentType xContentType) { protected org.opensearch.OpenSearchException createServerTestInstance(XContentType xContentType) {
IllegalStateException ies = new IllegalStateException("illegal_state"); IllegalStateException ies = new IllegalStateException("illegal_state");
IllegalArgumentException iae = new IllegalArgumentException("argument", ies); IllegalArgumentException iae = new IllegalArgumentException("argument", ies);
OpenSearchException exception = new OpenSearchException("elastic_exception", iae); org.opensearch.OpenSearchException exception = new org.opensearch.OpenSearchException("elastic_exception", iae);
exception.addHeader("key","value"); exception.addHeader("key","value");
exception.addMetadata("es.meta","data"); exception.addMetadata("es.meta","data");
exception.addSuppressed(new NumberFormatException("3/0")); exception.addSuppressed(new NumberFormatException("3/0"));
@ -47,16 +46,16 @@ public class OpenSearchExceptionTests extends AbstractResponseTestCase<OpenSearc
} }
@Override @Override
protected void assertInstances(OpenSearchException serverTestInstance, ElasticsearchException clientInstance) { protected void assertInstances(org.opensearch.OpenSearchException serverTestInstance, OpenSearchException clientInstance) {
IllegalArgumentException sCauseLevel1 = (IllegalArgumentException) serverTestInstance.getCause(); IllegalArgumentException sCauseLevel1 = (IllegalArgumentException) serverTestInstance.getCause();
ElasticsearchException cCauseLevel1 = clientInstance.getCause(); OpenSearchException cCauseLevel1 = clientInstance.getCause();
assertTrue(sCauseLevel1 !=null); assertTrue(sCauseLevel1 !=null);
assertTrue(cCauseLevel1 !=null); assertTrue(cCauseLevel1 !=null);
IllegalStateException causeLevel2 = (IllegalStateException) serverTestInstance.getCause().getCause(); IllegalStateException causeLevel2 = (IllegalStateException) serverTestInstance.getCause().getCause();
ElasticsearchException cCauseLevel2 = clientInstance.getCause().getCause(); OpenSearchException cCauseLevel2 = clientInstance.getCause().getCause();
assertTrue(causeLevel2 !=null); assertTrue(causeLevel2 !=null);
assertTrue(cCauseLevel2 !=null); assertTrue(cCauseLevel2 !=null);

View File

@ -145,7 +145,7 @@ public class Response {
} }
/** /**
* Refer to org.elasticsearch.common.logging.DeprecationLogger * Refer to org.opensearch.common.logging.DeprecationLogger
*/ */
private static String extractWarningValueFromWarningHeader(final String s) { private static String extractWarningValueFromWarningHeader(final String s) {
String warningHeader = s; String warningHeader = s;

View File

@ -26,7 +26,7 @@ import java.util.Objects;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
/** /**
* {@link org.elasticsearch.client.RestClient.FailureListener} implementation that allows to perform * {@link org.opensearch.client.RestClient.FailureListener} implementation that allows to perform
* sniffing on failure. Gets notified whenever a failure happens and uses a {@link Sniffer} instance * sniffing on failure. Gets notified whenever a failure happens and uses a {@link Sniffer} instance
* to manually reload hosts and sets them back to the {@link RestClient}. The {@link Sniffer} instance * to manually reload hosts and sets them back to the {@link RestClient}. The {@link Sniffer} instance
* needs to be lazily set through {@link #setSniffer(Sniffer)}. * needs to be lazily set through {@link #setSniffer(Sniffer)}.

View File

@ -28,8 +28,8 @@ import org.opensearch.common.io.stream.StreamInput;
import org.opensearch.common.io.stream.StreamOutput; import org.opensearch.common.io.stream.StreamOutput;
import org.opensearch.common.xcontent.ToXContentObject; import org.opensearch.common.xcontent.ToXContentObject;
import org.opensearch.common.xcontent.XContentBuilder; import org.opensearch.common.xcontent.XContentBuilder;
import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.opensearch.index.query.MatchAllQueryBuilder;
import org.elasticsearch.index.query.QueryBuilder; import org.opensearch.index.query.QueryBuilder;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays; import java.util.Arrays;