diff --git a/src/main/java/org/opensearch/search/asynchronous/action/AsynchronousSearchStatsAction.java b/src/main/java/org/opensearch/search/asynchronous/action/AsynchronousSearchStatsAction.java index b968de1d..8a9bc1d0 100644 --- a/src/main/java/org/opensearch/search/asynchronous/action/AsynchronousSearchStatsAction.java +++ b/src/main/java/org/opensearch/search/asynchronous/action/AsynchronousSearchStatsAction.java @@ -7,7 +7,7 @@ import org.opensearch.search.asynchronous.response.AsynchronousSearchStatsResponse; import org.opensearch.action.ActionType; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.Writeable; public class AsynchronousSearchStatsAction extends ActionType { diff --git a/src/main/java/org/opensearch/search/asynchronous/context/AsynchronousSearchContextId.java b/src/main/java/org/opensearch/search/asynchronous/context/AsynchronousSearchContextId.java index 2c64f384..3669f5c3 100644 --- a/src/main/java/org/opensearch/search/asynchronous/context/AsynchronousSearchContextId.java +++ b/src/main/java/org/opensearch/search/asynchronous/context/AsynchronousSearchContextId.java @@ -5,9 +5,9 @@ package org.opensearch.search.asynchronous.context; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import java.io.IOException; import java.util.Objects; diff --git a/src/main/java/org/opensearch/search/asynchronous/context/active/AsynchronousSearchActiveContext.java b/src/main/java/org/opensearch/search/asynchronous/context/active/AsynchronousSearchActiveContext.java index 89189a29..aee08a7b 100644 --- a/src/main/java/org/opensearch/search/asynchronous/context/active/AsynchronousSearchActiveContext.java +++ b/src/main/java/org/opensearch/search/asynchronous/context/active/AsynchronousSearchActiveContext.java @@ -14,7 +14,7 @@ import org.opensearch.search.asynchronous.id.AsynchronousSearchIdConverter; import org.opensearch.search.asynchronous.listener.AsynchronousSearchProgressListener; import org.opensearch.common.SetOnce; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.search.SearchProgressActionListener; import org.opensearch.action.search.SearchResponse; import org.opensearch.action.search.SearchTask; diff --git a/src/main/java/org/opensearch/search/asynchronous/context/active/AsynchronousSearchActiveStore.java b/src/main/java/org/opensearch/search/asynchronous/context/active/AsynchronousSearchActiveStore.java index 7e125707..2d6655de 100644 --- a/src/main/java/org/opensearch/search/asynchronous/context/active/AsynchronousSearchActiveStore.java +++ b/src/main/java/org/opensearch/search/asynchronous/context/active/AsynchronousSearchActiveStore.java @@ -10,7 +10,7 @@ import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.settings.Setting; import org.opensearch.common.settings.Settings; -import org.opensearch.common.util.CollectionUtils; +import org.opensearch.core.common.util.CollectionUtils; import org.opensearch.common.util.concurrent.ConcurrentMapLong; import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.search.asynchronous.context.AsynchronousSearchContextId; diff --git a/src/main/java/org/opensearch/search/asynchronous/context/permits/AsynchronousSearchContextPermits.java b/src/main/java/org/opensearch/search/asynchronous/context/permits/AsynchronousSearchContextPermits.java index 962d946d..66acadc8 100644 --- a/src/main/java/org/opensearch/search/asynchronous/context/permits/AsynchronousSearchContextPermits.java +++ b/src/main/java/org/opensearch/search/asynchronous/context/permits/AsynchronousSearchContextPermits.java @@ -12,7 +12,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.common.lease.Releasable; import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.concurrent.AbstractRunnable; diff --git a/src/main/java/org/opensearch/search/asynchronous/context/permits/NoopAsynchronousSearchContextPermits.java b/src/main/java/org/opensearch/search/asynchronous/context/permits/NoopAsynchronousSearchContextPermits.java index c885d0b5..40c004c4 100644 --- a/src/main/java/org/opensearch/search/asynchronous/context/permits/NoopAsynchronousSearchContextPermits.java +++ b/src/main/java/org/opensearch/search/asynchronous/context/permits/NoopAsynchronousSearchContextPermits.java @@ -7,7 +7,7 @@ import org.opensearch.search.asynchronous.context.AsynchronousSearchContextId; import org.opensearch.search.asynchronous.context.active.AsynchronousSearchContextClosedException; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.common.lease.Releasable; import org.opensearch.common.unit.TimeValue; diff --git a/src/main/java/org/opensearch/search/asynchronous/context/persistence/AsynchronousSearchPersistenceContext.java b/src/main/java/org/opensearch/search/asynchronous/context/persistence/AsynchronousSearchPersistenceContext.java index 749dc5f7..de4ae17d 100644 --- a/src/main/java/org/opensearch/search/asynchronous/context/persistence/AsynchronousSearchPersistenceContext.java +++ b/src/main/java/org/opensearch/search/asynchronous/context/persistence/AsynchronousSearchPersistenceContext.java @@ -13,9 +13,9 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; import org.opensearch.action.search.SearchResponse; -import org.opensearch.common.bytes.BytesReference; -import org.opensearch.common.io.stream.NamedWriteableAwareStreamInput; -import org.opensearch.common.io.stream.NamedWriteableRegistry; +import org.opensearch.core.common.bytes.BytesReference; +import org.opensearch.core.common.io.stream.NamedWriteableAwareStreamInput; +import org.opensearch.core.common.io.stream.NamedWriteableRegistry; import java.io.IOException; import java.nio.ByteBuffer; diff --git a/src/main/java/org/opensearch/search/asynchronous/context/persistence/AsynchronousSearchPersistenceModel.java b/src/main/java/org/opensearch/search/asynchronous/context/persistence/AsynchronousSearchPersistenceModel.java index 3035b5f8..1b4f7158 100644 --- a/src/main/java/org/opensearch/search/asynchronous/context/persistence/AsynchronousSearchPersistenceModel.java +++ b/src/main/java/org/opensearch/search/asynchronous/context/persistence/AsynchronousSearchPersistenceModel.java @@ -9,7 +9,7 @@ import org.opensearch.OpenSearchException; import org.opensearch.Version; import org.opensearch.action.search.SearchResponse; -import org.opensearch.common.bytes.BytesReference; +import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.common.io.stream.BytesStreamOutput; import java.io.IOException; diff --git a/src/main/java/org/opensearch/search/asynchronous/context/state/event/SearchStartedEvent.java b/src/main/java/org/opensearch/search/asynchronous/context/state/event/SearchStartedEvent.java index d0eb952b..eafdeaa0 100644 --- a/src/main/java/org/opensearch/search/asynchronous/context/state/event/SearchStartedEvent.java +++ b/src/main/java/org/opensearch/search/asynchronous/context/state/event/SearchStartedEvent.java @@ -7,7 +7,7 @@ import org.opensearch.search.asynchronous.context.AsynchronousSearchContext; import org.opensearch.search.asynchronous.context.state.AsynchronousSearchContextEvent; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.ActionRequest; import org.opensearch.action.search.SearchTask; diff --git a/src/main/java/org/opensearch/search/asynchronous/id/AsynchronousSearchIdConverter.java b/src/main/java/org/opensearch/search/asynchronous/id/AsynchronousSearchIdConverter.java index 9fe025cc..43a1a1fb 100644 --- a/src/main/java/org/opensearch/search/asynchronous/id/AsynchronousSearchIdConverter.java +++ b/src/main/java/org/opensearch/search/asynchronous/id/AsynchronousSearchIdConverter.java @@ -7,7 +7,7 @@ import org.opensearch.search.asynchronous.context.AsynchronousSearchContextId; import org.apache.lucene.store.ByteArrayDataInput; -import org.opensearch.common.bytes.BytesReference; +import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.common.io.stream.BytesStreamOutput; import java.io.IOException; diff --git a/src/main/java/org/opensearch/search/asynchronous/listener/AsynchronousSearchTimeoutWrapper.java b/src/main/java/org/opensearch/search/asynchronous/listener/AsynchronousSearchTimeoutWrapper.java index 3efe8c20..5efbfaa2 100644 --- a/src/main/java/org/opensearch/search/asynchronous/listener/AsynchronousSearchTimeoutWrapper.java +++ b/src/main/java/org/opensearch/search/asynchronous/listener/AsynchronousSearchTimeoutWrapper.java @@ -7,7 +7,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.common.unit.TimeValue; import org.opensearch.threadpool.Scheduler; import org.opensearch.threadpool.ThreadPool; diff --git a/src/main/java/org/opensearch/search/asynchronous/listener/CompositeSearchProgressActionListener.java b/src/main/java/org/opensearch/search/asynchronous/listener/CompositeSearchProgressActionListener.java index 16450b8e..b4b8ea4e 100644 --- a/src/main/java/org/opensearch/search/asynchronous/listener/CompositeSearchProgressActionListener.java +++ b/src/main/java/org/opensearch/search/asynchronous/listener/CompositeSearchProgressActionListener.java @@ -5,7 +5,7 @@ package org.opensearch.search.asynchronous.listener; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.search.SearchProgressActionListener; import java.util.ArrayList; diff --git a/src/main/java/org/opensearch/search/asynchronous/listener/PrioritizedActionListener.java b/src/main/java/org/opensearch/search/asynchronous/listener/PrioritizedActionListener.java index aba66c5b..2c6954b1 100644 --- a/src/main/java/org/opensearch/search/asynchronous/listener/PrioritizedActionListener.java +++ b/src/main/java/org/opensearch/search/asynchronous/listener/PrioritizedActionListener.java @@ -6,7 +6,7 @@ package org.opensearch.search.asynchronous.listener; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; public interface PrioritizedActionListener extends ActionListener { diff --git a/src/main/java/org/opensearch/search/asynchronous/management/AsynchronousSearchManagementService.java b/src/main/java/org/opensearch/search/asynchronous/management/AsynchronousSearchManagementService.java index 0bbe11c7..1746356a 100644 --- a/src/main/java/org/opensearch/search/asynchronous/management/AsynchronousSearchManagementService.java +++ b/src/main/java/org/opensearch/search/asynchronous/management/AsynchronousSearchManagementService.java @@ -15,7 +15,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.ActionRequest; import org.opensearch.action.ActionRequestValidationException; import org.opensearch.cluster.ClusterChangedEvent; @@ -24,10 +24,10 @@ import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.Randomness; -import org.opensearch.common.component.AbstractLifecycleComponent; +import org.opensearch.common.lifecycle.AbstractLifecycleComponent; import org.opensearch.common.inject.Inject; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.common.settings.Setting; import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; diff --git a/src/main/java/org/opensearch/search/asynchronous/plugin/AsynchronousSearchPlugin.java b/src/main/java/org/opensearch/search/asynchronous/plugin/AsynchronousSearchPlugin.java index b16adddd..925c2622 100644 --- a/src/main/java/org/opensearch/search/asynchronous/plugin/AsynchronousSearchPlugin.java +++ b/src/main/java/org/opensearch/search/asynchronous/plugin/AsynchronousSearchPlugin.java @@ -25,13 +25,13 @@ import org.opensearch.search.asynchronous.transport.TransportGetAsynchronousSearchAction; import org.opensearch.search.asynchronous.transport.TransportSubmitAsynchronousSearchAction; import org.opensearch.action.ActionRequest; -import org.opensearch.action.ActionResponse; +import org.opensearch.core.action.ActionResponse; import org.opensearch.client.Client; import org.opensearch.cluster.metadata.IndexNameExpressionResolver; import org.opensearch.cluster.node.DiscoveryNodes; import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.component.LifecycleComponent; -import org.opensearch.common.io.stream.NamedWriteableRegistry; +import org.opensearch.common.lifecycle.LifecycleComponent; +import org.opensearch.core.common.io.stream.NamedWriteableRegistry; import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.IndexScopedSettings; import org.opensearch.common.settings.Setting; diff --git a/src/main/java/org/opensearch/search/asynchronous/processor/AsynchronousSearchPostProcessor.java b/src/main/java/org/opensearch/search/asynchronous/processor/AsynchronousSearchPostProcessor.java index 534e7cdd..7ac320b4 100644 --- a/src/main/java/org/opensearch/search/asynchronous/processor/AsynchronousSearchPostProcessor.java +++ b/src/main/java/org/opensearch/search/asynchronous/processor/AsynchronousSearchPostProcessor.java @@ -25,7 +25,7 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; import org.opensearch.ExceptionsHelper; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.search.SearchResponse; import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.unit.TimeValue; diff --git a/src/main/java/org/opensearch/search/asynchronous/request/AsynchronousSearchRoutingRequest.java b/src/main/java/org/opensearch/search/asynchronous/request/AsynchronousSearchRoutingRequest.java index 6bd1261e..1c2825a2 100644 --- a/src/main/java/org/opensearch/search/asynchronous/request/AsynchronousSearchRoutingRequest.java +++ b/src/main/java/org/opensearch/search/asynchronous/request/AsynchronousSearchRoutingRequest.java @@ -6,8 +6,8 @@ package org.opensearch.search.asynchronous.request; import org.opensearch.action.ActionRequest; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.IOException; diff --git a/src/main/java/org/opensearch/search/asynchronous/request/AsynchronousSearchStatsRequest.java b/src/main/java/org/opensearch/search/asynchronous/request/AsynchronousSearchStatsRequest.java index 6208ed29..e63ab012 100644 --- a/src/main/java/org/opensearch/search/asynchronous/request/AsynchronousSearchStatsRequest.java +++ b/src/main/java/org/opensearch/search/asynchronous/request/AsynchronousSearchStatsRequest.java @@ -6,8 +6,8 @@ package org.opensearch.search.asynchronous.request; import org.opensearch.action.support.nodes.BaseNodesRequest; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import java.io.IOException; diff --git a/src/main/java/org/opensearch/search/asynchronous/request/DeleteAsynchronousSearchRequest.java b/src/main/java/org/opensearch/search/asynchronous/request/DeleteAsynchronousSearchRequest.java index cfe59384..497780f1 100644 --- a/src/main/java/org/opensearch/search/asynchronous/request/DeleteAsynchronousSearchRequest.java +++ b/src/main/java/org/opensearch/search/asynchronous/request/DeleteAsynchronousSearchRequest.java @@ -6,7 +6,7 @@ package org.opensearch.search.asynchronous.request; import org.opensearch.action.ActionRequestValidationException; -import org.opensearch.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamInput; import java.io.IOException; diff --git a/src/main/java/org/opensearch/search/asynchronous/request/GetAsynchronousSearchRequest.java b/src/main/java/org/opensearch/search/asynchronous/request/GetAsynchronousSearchRequest.java index f4599423..5c352917 100644 --- a/src/main/java/org/opensearch/search/asynchronous/request/GetAsynchronousSearchRequest.java +++ b/src/main/java/org/opensearch/search/asynchronous/request/GetAsynchronousSearchRequest.java @@ -7,8 +7,8 @@ import org.opensearch.action.ActionRequestValidationException; import org.opensearch.common.Nullable; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.common.unit.TimeValue; import java.io.IOException; diff --git a/src/main/java/org/opensearch/search/asynchronous/request/SubmitAsynchronousSearchRequest.java b/src/main/java/org/opensearch/search/asynchronous/request/SubmitAsynchronousSearchRequest.java index 54e1f972..b17d423e 100644 --- a/src/main/java/org/opensearch/search/asynchronous/request/SubmitAsynchronousSearchRequest.java +++ b/src/main/java/org/opensearch/search/asynchronous/request/SubmitAsynchronousSearchRequest.java @@ -11,10 +11,10 @@ import org.opensearch.action.search.SearchRequest; import org.opensearch.common.Nullable; import org.opensearch.core.common.Strings; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.common.unit.TimeValue; -import org.opensearch.tasks.TaskId; +import org.opensearch.core.tasks.TaskId; import java.io.IOException; import java.util.Map; diff --git a/src/main/java/org/opensearch/search/asynchronous/response/AcknowledgedResponse.java b/src/main/java/org/opensearch/search/asynchronous/response/AcknowledgedResponse.java index 141da68e..f2594721 100644 --- a/src/main/java/org/opensearch/search/asynchronous/response/AcknowledgedResponse.java +++ b/src/main/java/org/opensearch/search/asynchronous/response/AcknowledgedResponse.java @@ -5,22 +5,22 @@ package org.opensearch.search.asynchronous.response; -import org.opensearch.action.ActionResponse; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.action.ActionResponse; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.common.xcontent.StatusToXContentObject; import org.opensearch.core.ParseField; import org.opensearch.core.xcontent.ConstructingObjectParser; import org.opensearch.core.xcontent.ObjectParser; import org.opensearch.core.xcontent.XContentBuilder; -import org.opensearch.rest.RestStatus; +import org.opensearch.core.rest.RestStatus; import java.io.IOException; import java.util.Objects; import static org.opensearch.core.xcontent.ConstructingObjectParser.constructorArg; -import static org.opensearch.rest.RestStatus.NOT_FOUND; -import static org.opensearch.rest.RestStatus.OK; +import static org.opensearch.core.rest.RestStatus.NOT_FOUND; +import static org.opensearch.core.rest.RestStatus.OK; /** * A response that indicates that a request has been acknowledged diff --git a/src/main/java/org/opensearch/search/asynchronous/response/AsynchronousSearchResponse.java b/src/main/java/org/opensearch/search/asynchronous/response/AsynchronousSearchResponse.java index 20810a26..60fb8eec 100644 --- a/src/main/java/org/opensearch/search/asynchronous/response/AsynchronousSearchResponse.java +++ b/src/main/java/org/opensearch/search/asynchronous/response/AsynchronousSearchResponse.java @@ -5,27 +5,25 @@ package org.opensearch.search.asynchronous.response; -import org.opensearch.BaseExceptionsHelper; import org.opensearch.core.ParseField; +import org.opensearch.core.xcontent.MediaTypeRegistry; import org.opensearch.core.xcontent.ToXContent; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.search.asynchronous.context.state.AsynchronousSearchState; import org.opensearch.OpenSearchException; import org.opensearch.ExceptionsHelper; -import org.opensearch.action.ActionResponse; +import org.opensearch.core.action.ActionResponse; import org.opensearch.action.search.SearchResponse; import org.opensearch.client.Requests; import org.opensearch.common.Nullable; -import org.opensearch.common.Strings; -import org.opensearch.common.bytes.BytesReference; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.Strings; +import org.opensearch.core.common.bytes.BytesReference; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.common.xcontent.StatusToXContentObject; -import org.opensearch.common.xcontent.XContentFactory; -import org.opensearch.common.xcontent.XContentHelper; import org.opensearch.common.xcontent.XContentType; -import org.opensearch.rest.RestStatus; +import org.opensearch.core.rest.RestStatus; import java.io.IOException; import java.util.Map; @@ -33,7 +31,7 @@ import static java.util.Collections.emptyMap; import static org.opensearch.common.xcontent.XContentHelper.convertToMap; -import static org.opensearch.common.xcontent.XContentParserUtils.ensureExpectedToken; +import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; public class AsynchronousSearchResponse extends ActionResponse implements StatusToXContentObject { @@ -124,7 +122,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws } if (error != null) { builder.startObject(ERROR.getPreferredName()); - BaseExceptionsHelper.generateThrowableXContent(builder, ToXContent.EMPTY_PARAMS, error); + OpenSearchException.generateThrowableXContent(builder, ToXContent.EMPTY_PARAMS, error); builder.endObject(); } builder.endObject(); @@ -205,9 +203,9 @@ public boolean equals(Object o) { private Map getErrorAsMap(OpenSearchException exception) throws IOException { if (exception != null) { BytesReference error; - try (XContentBuilder builder = XContentFactory.contentBuilder(Requests.INDEX_CONTENT_TYPE)) { + try (XContentBuilder builder = MediaTypeRegistry.contentBuilder(Requests.INDEX_CONTENT_TYPE)) { builder.startObject(); - BaseExceptionsHelper.generateThrowableXContent(builder, ToXContent.EMPTY_PARAMS, exception); + OpenSearchException.generateThrowableXContent(builder, ToXContent.EMPTY_PARAMS, exception); builder.endObject(); error = BytesReference.bytes(builder); return convertToMap(error, false, Requests.INDEX_CONTENT_TYPE).v2(); @@ -219,7 +217,8 @@ private Map getErrorAsMap(OpenSearchException exception) throws private Map getResponseAsMap(SearchResponse searchResponse) throws IOException { if (searchResponse != null) { - BytesReference response = XContentHelper.toXContent(searchResponse, Requests.INDEX_CONTENT_TYPE, true); + BytesReference response = org.opensearch.core.xcontent.XContentHelper.toXContent( + searchResponse, Requests.INDEX_CONTENT_TYPE, true); if (response == null) { return emptyMap(); } diff --git a/src/main/java/org/opensearch/search/asynchronous/response/AsynchronousSearchStatsResponse.java b/src/main/java/org/opensearch/search/asynchronous/response/AsynchronousSearchStatsResponse.java index fecd52df..ad054750 100644 --- a/src/main/java/org/opensearch/search/asynchronous/response/AsynchronousSearchStatsResponse.java +++ b/src/main/java/org/opensearch/search/asynchronous/response/AsynchronousSearchStatsResponse.java @@ -11,9 +11,8 @@ import org.opensearch.action.FailedNodeException; import org.opensearch.action.support.nodes.BaseNodesResponse; import org.opensearch.cluster.ClusterName; -import org.opensearch.common.Strings; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.common.xcontent.XContentFactory; import java.io.IOException; @@ -66,7 +65,7 @@ public String toString() { builder.startObject(); toXContent(builder, EMPTY_PARAMS); builder.endObject(); - return Strings.toString(builder); + return builder.toString(); } catch (IOException e) { return "{ \"error\" : \"" + e.getMessage() + "\"}"; } diff --git a/src/main/java/org/opensearch/search/asynchronous/service/AsynchronousSearchPersistenceService.java b/src/main/java/org/opensearch/search/asynchronous/service/AsynchronousSearchPersistenceService.java index 8363b7b2..e1cbbb3b 100644 --- a/src/main/java/org/opensearch/search/asynchronous/service/AsynchronousSearchPersistenceService.java +++ b/src/main/java/org/opensearch/search/asynchronous/service/AsynchronousSearchPersistenceService.java @@ -7,6 +7,7 @@ import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.commons.authuser.User; +import org.opensearch.core.xcontent.MediaTypeRegistry; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.search.asynchronous.context.persistence.AsynchronousSearchPersistenceModel; import org.opensearch.search.asynchronous.response.AcknowledgedResponse; @@ -17,7 +18,7 @@ import org.opensearch.ExceptionsHelper; import org.opensearch.ResourceAlreadyExistsException; import org.opensearch.ResourceNotFoundException; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.DocWriteResponse; import org.opensearch.action.bulk.BackoffPolicy; import org.opensearch.action.delete.DeleteRequest; @@ -28,16 +29,15 @@ import org.opensearch.client.Client; import org.opensearch.cluster.metadata.IndexMetadata; import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.io.stream.NotSerializableExceptionWrapper; +import org.opensearch.core.common.io.stream.NotSerializableExceptionWrapper; import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; -import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; import org.opensearch.index.engine.DocumentMissingException; import org.opensearch.index.query.QueryBuilders; import org.opensearch.index.reindex.DeleteByQueryAction; import org.opensearch.index.reindex.DeleteByQueryRequest; -import org.opensearch.rest.RestStatus; +import org.opensearch.core.rest.RestStatus; import org.opensearch.script.Script; import org.opensearch.script.ScriptType; import org.opensearch.search.fetch.subphase.FetchSourceContext; @@ -391,7 +391,7 @@ private Settings indexSettings() { private XContentBuilder mapping() { try { - XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON); + XContentBuilder builder = MediaTypeRegistry.contentBuilder(XContentType.JSON); builder.startObject() .startObject("properties") .startObject(START_TIME_MILLIS) diff --git a/src/main/java/org/opensearch/search/asynchronous/service/AsynchronousSearchService.java b/src/main/java/org/opensearch/search/asynchronous/service/AsynchronousSearchService.java index 4294209a..516fec3a 100644 --- a/src/main/java/org/opensearch/search/asynchronous/service/AsynchronousSearchService.java +++ b/src/main/java/org/opensearch/search/asynchronous/service/AsynchronousSearchService.java @@ -12,7 +12,7 @@ import org.opensearch.OpenSearchSecurityException; import org.opensearch.OpenSearchTimeoutException; import org.opensearch.ResourceNotFoundException; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.admin.cluster.node.tasks.cancel.CancelTasksRequest; import org.opensearch.action.admin.cluster.node.tasks.cancel.CancelTasksResponse; import org.opensearch.action.search.SearchAction; @@ -23,14 +23,14 @@ import org.opensearch.cluster.ClusterStateListener; import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.UUIDs; -import org.opensearch.common.component.AbstractLifecycleComponent; -import org.opensearch.common.io.stream.NamedWriteableRegistry; +import org.opensearch.common.lifecycle.AbstractLifecycleComponent; +import org.opensearch.core.common.io.stream.NamedWriteableRegistry; import org.opensearch.common.lease.Releasable; import org.opensearch.common.settings.Setting; import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; import org.opensearch.commons.authuser.User; -import org.opensearch.rest.RestStatus; +import org.opensearch.core.rest.RestStatus; import org.opensearch.search.aggregations.InternalAggregation; import org.opensearch.search.asynchronous.context.AsynchronousSearchContext; import org.opensearch.search.asynchronous.context.AsynchronousSearchContextId; @@ -58,7 +58,7 @@ import org.opensearch.search.asynchronous.stats.AsynchronousSearchStats; import org.opensearch.search.asynchronous.stats.InternalAsynchronousSearchStats; import org.opensearch.search.asynchronous.utils.AsynchronousSearchExceptionUtils; -import org.opensearch.tasks.TaskId; +import org.opensearch.core.tasks.TaskId; import org.opensearch.threadpool.ThreadPool; import java.util.Collections; @@ -75,8 +75,8 @@ import java.util.function.Supplier; import java.util.stream.Collectors; -import static org.opensearch.action.ActionListener.runAfter; -import static org.opensearch.action.ActionListener.wrap; +import static org.opensearch.core.action.ActionListener.runAfter; +import static org.opensearch.core.action.ActionListener.wrap; import static org.opensearch.search.asynchronous.context.state.AsynchronousSearchState.CLOSED; import static org.opensearch.search.asynchronous.context.state.AsynchronousSearchState.FAILED; import static org.opensearch.search.asynchronous.context.state.AsynchronousSearchState.INIT; diff --git a/src/main/java/org/opensearch/search/asynchronous/stats/AsynchronousSearchCountStats.java b/src/main/java/org/opensearch/search/asynchronous/stats/AsynchronousSearchCountStats.java index 5ce4ec3a..55047cea 100644 --- a/src/main/java/org/opensearch/search/asynchronous/stats/AsynchronousSearchCountStats.java +++ b/src/main/java/org/opensearch/search/asynchronous/stats/AsynchronousSearchCountStats.java @@ -5,9 +5,9 @@ package org.opensearch.search.asynchronous.stats; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.core.xcontent.ToXContentFragment; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/src/main/java/org/opensearch/search/asynchronous/stats/AsynchronousSearchStats.java b/src/main/java/org/opensearch/search/asynchronous/stats/AsynchronousSearchStats.java index 46ca4c01..a07a0180 100644 --- a/src/main/java/org/opensearch/search/asynchronous/stats/AsynchronousSearchStats.java +++ b/src/main/java/org/opensearch/search/asynchronous/stats/AsynchronousSearchStats.java @@ -8,8 +8,8 @@ import org.opensearch.action.support.nodes.BaseNodeResponse; import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.common.Nullable; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.core.xcontent.ToXContentFragment; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/src/main/java/org/opensearch/search/asynchronous/task/AsynchronousSearchTask.java b/src/main/java/org/opensearch/search/asynchronous/task/AsynchronousSearchTask.java index a8443135..bff9f55b 100644 --- a/src/main/java/org/opensearch/search/asynchronous/task/AsynchronousSearchTask.java +++ b/src/main/java/org/opensearch/search/asynchronous/task/AsynchronousSearchTask.java @@ -12,7 +12,7 @@ import org.apache.logging.log4j.Logger; import org.opensearch.action.search.SearchRequest; import org.opensearch.action.search.SearchTask; -import org.opensearch.tasks.TaskId; +import org.opensearch.core.tasks.TaskId; import java.util.Map; import java.util.Objects; diff --git a/src/main/java/org/opensearch/search/asynchronous/task/SubmitAsynchronousSearchTask.java b/src/main/java/org/opensearch/search/asynchronous/task/SubmitAsynchronousSearchTask.java index cd5dfedd..57daf100 100644 --- a/src/main/java/org/opensearch/search/asynchronous/task/SubmitAsynchronousSearchTask.java +++ b/src/main/java/org/opensearch/search/asynchronous/task/SubmitAsynchronousSearchTask.java @@ -7,7 +7,7 @@ import org.opensearch.search.asynchronous.request.SubmitAsynchronousSearchRequest; import org.opensearch.tasks.CancellableTask; -import org.opensearch.tasks.TaskId; +import org.opensearch.core.tasks.TaskId; import java.util.Map; diff --git a/src/main/java/org/opensearch/search/asynchronous/transport/TransportAsynchronousSearchRoutingAction.java b/src/main/java/org/opensearch/search/asynchronous/transport/TransportAsynchronousSearchRoutingAction.java index c3123110..3aa10379 100644 --- a/src/main/java/org/opensearch/search/asynchronous/transport/TransportAsynchronousSearchRoutingAction.java +++ b/src/main/java/org/opensearch/search/asynchronous/transport/TransportAsynchronousSearchRoutingAction.java @@ -15,17 +15,17 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.ActionListenerResponseHandler; -import org.opensearch.action.ActionResponse; +import org.opensearch.core.action.ActionResponse; import org.opensearch.action.support.ActionFilters; import org.opensearch.action.support.HandledTransportAction; import org.opensearch.client.Client; import org.opensearch.cluster.ClusterState; import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.io.stream.NotSerializableExceptionWrapper; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.io.stream.NotSerializableExceptionWrapper; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.common.util.concurrent.AbstractRunnable; import org.opensearch.common.util.concurrent.ThreadContext; import org.opensearch.node.NodeClosedException; diff --git a/src/main/java/org/opensearch/search/asynchronous/transport/TransportAsynchronousSearchStatsAction.java b/src/main/java/org/opensearch/search/asynchronous/transport/TransportAsynchronousSearchStatsAction.java index 8a83ac46..8c94debb 100644 --- a/src/main/java/org/opensearch/search/asynchronous/transport/TransportAsynchronousSearchStatsAction.java +++ b/src/main/java/org/opensearch/search/asynchronous/transport/TransportAsynchronousSearchStatsAction.java @@ -15,8 +15,8 @@ import org.opensearch.action.support.nodes.TransportNodesAction; import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.inject.Inject; -import org.opensearch.common.io.stream.StreamInput; -import org.opensearch.common.io.stream.StreamOutput; +import org.opensearch.core.common.io.stream.StreamInput; +import org.opensearch.core.common.io.stream.StreamOutput; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportRequest; import org.opensearch.transport.TransportService; diff --git a/src/main/java/org/opensearch/search/asynchronous/transport/TransportDeleteAsynchronousSearchAction.java b/src/main/java/org/opensearch/search/asynchronous/transport/TransportDeleteAsynchronousSearchAction.java index 235d33ce..14e70f69 100644 --- a/src/main/java/org/opensearch/search/asynchronous/transport/TransportDeleteAsynchronousSearchAction.java +++ b/src/main/java/org/opensearch/search/asynchronous/transport/TransportDeleteAsynchronousSearchAction.java @@ -14,7 +14,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.support.ActionFilters; import org.opensearch.client.Client; import org.opensearch.cluster.service.ClusterService; diff --git a/src/main/java/org/opensearch/search/asynchronous/transport/TransportGetAsynchronousSearchAction.java b/src/main/java/org/opensearch/search/asynchronous/transport/TransportGetAsynchronousSearchAction.java index a1e76d2d..3ec7f631 100644 --- a/src/main/java/org/opensearch/search/asynchronous/transport/TransportGetAsynchronousSearchAction.java +++ b/src/main/java/org/opensearch/search/asynchronous/transport/TransportGetAsynchronousSearchAction.java @@ -18,7 +18,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.support.ActionFilters; import org.opensearch.client.Client; import org.opensearch.cluster.service.ClusterService; diff --git a/src/main/java/org/opensearch/search/asynchronous/transport/TransportSubmitAsynchronousSearchAction.java b/src/main/java/org/opensearch/search/asynchronous/transport/TransportSubmitAsynchronousSearchAction.java index 06151805..780157cf 100644 --- a/src/main/java/org/opensearch/search/asynchronous/transport/TransportSubmitAsynchronousSearchAction.java +++ b/src/main/java/org/opensearch/search/asynchronous/transport/TransportSubmitAsynchronousSearchAction.java @@ -21,7 +21,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.search.SearchRequest; import org.opensearch.action.search.SearchTask; import org.opensearch.action.search.TransportSearchAction; @@ -31,7 +31,7 @@ import org.opensearch.common.inject.Inject; import org.opensearch.search.SearchService; import org.opensearch.tasks.Task; -import org.opensearch.tasks.TaskId; +import org.opensearch.core.tasks.TaskId; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -72,7 +72,7 @@ protected void doExecute(Task task, SubmitAsynchronousSearchRequest request, Act try { final long relativeStartTimeInMillis = threadPool.relativeTimeInMillis(); asynchronousSearchContext = asynchronousSearchService.createAndStoreContext(request, relativeStartTimeInMillis, - () -> searchService.aggReduceContextBuilder(request.getSearchRequest()), user); + () -> searchService.aggReduceContextBuilder(request.getSearchRequest().source()), user); assert asynchronousSearchContext.getAsynchronousSearchProgressListener() != null : "missing progress listener for an active context"; AsynchronousSearchProgressListener progressListener = asynchronousSearchContext.getAsynchronousSearchProgressListener(); diff --git a/src/test/java/org/opensearch/search/asynchronous/SecurityEnabledRestTestCase.java b/src/test/java/org/opensearch/search/asynchronous/SecurityEnabledRestTestCase.java index 092b37c6..a40f821f 100644 --- a/src/test/java/org/opensearch/search/asynchronous/SecurityEnabledRestTestCase.java +++ b/src/test/java/org/opensearch/search/asynchronous/SecurityEnabledRestTestCase.java @@ -26,9 +26,9 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.concurrent.ThreadContext; -import org.opensearch.common.xcontent.XContentType; import org.opensearch.commons.rest.SecureRestClientBuilder; import org.opensearch.core.xcontent.DeprecationHandler; +import org.opensearch.core.xcontent.MediaType; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.test.rest.OpenSearchRestTestCase; @@ -117,9 +117,9 @@ protected RestClient buildClient(Settings settings, HttpHost[] hosts) throws IOE @After protected void wipeAllOSIndices() throws IOException { Response response = adminClient().performRequest(new Request("GET", "/_cat/indices?format=json&expand_wildcards=all")); - XContentType xContentType = XContentType.fromMediaType(response.getEntity().getContentType()); + MediaType mediaType = MediaType.fromMediaType(response.getEntity().getContentType()); try ( - XContentParser parser = xContentType + XContentParser parser = mediaType .xContent() .createParser( NamedXContentRegistry.EMPTY, diff --git a/src/test/java/org/opensearch/search/asynchronous/commons/AsynchronousSearchIntegTestCase.java b/src/test/java/org/opensearch/search/asynchronous/commons/AsynchronousSearchIntegTestCase.java index a9397151..30b16e28 100644 --- a/src/test/java/org/opensearch/search/asynchronous/commons/AsynchronousSearchIntegTestCase.java +++ b/src/test/java/org/opensearch/search/asynchronous/commons/AsynchronousSearchIntegTestCase.java @@ -28,7 +28,7 @@ import org.opensearch.plugins.PluginsService; import org.opensearch.script.MockScriptPlugin; import org.opensearch.search.lookup.LeafFieldsLookup; -import org.opensearch.tasks.TaskId; +import org.opensearch.core.tasks.TaskId; import org.opensearch.test.OpenSearchIntegTestCase; import java.util.ArrayList; diff --git a/src/test/java/org/opensearch/search/asynchronous/commons/AsynchronousSearchSingleNodeTestCase.java b/src/test/java/org/opensearch/search/asynchronous/commons/AsynchronousSearchSingleNodeTestCase.java index f9c80fe8..6fc128db 100644 --- a/src/test/java/org/opensearch/search/asynchronous/commons/AsynchronousSearchSingleNodeTestCase.java +++ b/src/test/java/org/opensearch/search/asynchronous/commons/AsynchronousSearchSingleNodeTestCase.java @@ -24,8 +24,8 @@ import org.apache.lucene.search.TotalHits; import org.junit.After; import org.junit.Before; -import org.opensearch.action.ActionFuture; -import org.opensearch.action.ActionListener; +import org.opensearch.common.action.ActionFuture; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.get.GetRequest; import org.opensearch.action.search.SearchResponse; import org.opensearch.action.search.ShardSearchFailure; diff --git a/src/test/java/org/opensearch/search/asynchronous/context/active/AsynchronousSearchActiveContextTests.java b/src/test/java/org/opensearch/search/asynchronous/context/active/AsynchronousSearchActiveContextTests.java index c7b4db18..dbd71023 100644 --- a/src/test/java/org/opensearch/search/asynchronous/context/active/AsynchronousSearchActiveContextTests.java +++ b/src/test/java/org/opensearch/search/asynchronous/context/active/AsynchronousSearchActiveContextTests.java @@ -29,7 +29,7 @@ import org.opensearch.search.internal.InternalSearchResponse; import org.opensearch.search.profile.SearchProfileShardResults; import org.opensearch.search.suggest.Suggest; -import org.opensearch.tasks.TaskId; +import org.opensearch.core.tasks.TaskId; import org.opensearch.threadpool.ScalingExecutorBuilder; import org.opensearch.threadpool.TestThreadPool; import org.opensearch.threadpool.ThreadPool; diff --git a/src/test/java/org/opensearch/search/asynchronous/context/permits/AsynchronousSearchContextPermitsTests.java b/src/test/java/org/opensearch/search/asynchronous/context/permits/AsynchronousSearchContextPermitsTests.java index 05b13cab..2df49e1e 100644 --- a/src/test/java/org/opensearch/search/asynchronous/context/permits/AsynchronousSearchContextPermitsTests.java +++ b/src/test/java/org/opensearch/search/asynchronous/context/permits/AsynchronousSearchContextPermitsTests.java @@ -8,7 +8,7 @@ import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException; import org.opensearch.search.asynchronous.context.AsynchronousSearchContextId; import org.opensearch.search.asynchronous.plugin.AsynchronousSearchPlugin; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.LatchedActionListener; import org.opensearch.action.support.PlainActionFuture; import org.opensearch.common.CheckedRunnable; diff --git a/src/test/java/org/opensearch/search/asynchronous/context/permits/NoopAsynchronousSearchContextPermitsTests.java b/src/test/java/org/opensearch/search/asynchronous/context/permits/NoopAsynchronousSearchContextPermitsTests.java index 5c5d27a3..69db6df8 100644 --- a/src/test/java/org/opensearch/search/asynchronous/context/permits/NoopAsynchronousSearchContextPermitsTests.java +++ b/src/test/java/org/opensearch/search/asynchronous/context/permits/NoopAsynchronousSearchContextPermitsTests.java @@ -7,7 +7,7 @@ import org.opensearch.search.asynchronous.context.AsynchronousSearchContextId; import org.opensearch.search.asynchronous.context.active.AsynchronousSearchContextClosedException; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.LatchedActionListener; import org.opensearch.common.unit.TimeValue; import org.opensearch.test.OpenSearchTestCase; diff --git a/src/test/java/org/opensearch/search/asynchronous/context/persistence/AsynchronousSearchPersistenceContextTests.java b/src/test/java/org/opensearch/search/asynchronous/context/persistence/AsynchronousSearchPersistenceContextTests.java index 99088689..7c82773e 100644 --- a/src/test/java/org/opensearch/search/asynchronous/context/persistence/AsynchronousSearchPersistenceContextTests.java +++ b/src/test/java/org/opensearch/search/asynchronous/context/persistence/AsynchronousSearchPersistenceContextTests.java @@ -16,8 +16,8 @@ import org.opensearch.action.search.SearchPhaseExecutionException; import org.opensearch.action.search.SearchResponse; import org.opensearch.action.search.ShardSearchFailure; -import org.opensearch.common.bytes.BytesReference; -import org.opensearch.common.io.stream.NamedWriteableRegistry; +import org.opensearch.core.common.bytes.BytesReference; +import org.opensearch.core.common.io.stream.NamedWriteableRegistry; import org.opensearch.common.settings.Settings; import org.opensearch.search.SearchHit; import org.opensearch.search.SearchHits; diff --git a/src/test/java/org/opensearch/search/asynchronous/integTests/AsynchronousSearchRejectionIT.java b/src/test/java/org/opensearch/search/asynchronous/integTests/AsynchronousSearchRejectionIT.java index e2981c01..7a613004 100644 --- a/src/test/java/org/opensearch/search/asynchronous/integTests/AsynchronousSearchRejectionIT.java +++ b/src/test/java/org/opensearch/search/asynchronous/integTests/AsynchronousSearchRejectionIT.java @@ -20,7 +20,7 @@ import org.opensearch.OpenSearchTimeoutException; import org.opensearch.ExceptionsHelper; import org.opensearch.ResourceNotFoundException; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.LatchedActionListener; import org.opensearch.action.search.SearchAction; import org.opensearch.action.search.SearchPhaseExecutionException; @@ -34,7 +34,7 @@ import org.opensearch.index.query.QueryBuilders; import org.opensearch.search.SearchService; import org.opensearch.search.aggregations.InternalAggregation; -import org.opensearch.tasks.TaskId; +import org.opensearch.core.tasks.TaskId; import org.opensearch.test.OpenSearchIntegTestCase; import org.opensearch.test.junit.annotations.TestLogging; import org.opensearch.threadpool.TestThreadPool; @@ -189,7 +189,7 @@ public void testSearchFailures() throws Exception { AtomicInteger reduceContextInvocation = new AtomicInteger(); AsynchronousSearchProgressListener listener; SearchService service = internalCluster().getInstance(SearchService.class); - InternalAggregation.ReduceContextBuilder reduceContextBuilder = service.aggReduceContextBuilder(request); + InternalAggregation.ReduceContextBuilder reduceContextBuilder = service.aggReduceContextBuilder(request.source()); AtomicReference exceptionRef = new AtomicReference<>(); Function responseFunction = (r) -> null; diff --git a/src/test/java/org/opensearch/search/asynchronous/integTests/AsynchronousSearchTaskCancellationIT.java b/src/test/java/org/opensearch/search/asynchronous/integTests/AsynchronousSearchTaskCancellationIT.java index 4bc7f4f8..37f30576 100644 --- a/src/test/java/org/opensearch/search/asynchronous/integTests/AsynchronousSearchTaskCancellationIT.java +++ b/src/test/java/org/opensearch/search/asynchronous/integTests/AsynchronousSearchTaskCancellationIT.java @@ -11,7 +11,7 @@ import org.opensearch.search.asynchronous.plugin.AsynchronousSearchPlugin; import org.opensearch.search.asynchronous.request.SubmitAsynchronousSearchRequest; import org.opensearch.search.asynchronous.response.AsynchronousSearchResponse; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.admin.cluster.node.tasks.cancel.CancelTasksResponse; import org.opensearch.action.admin.cluster.node.tasks.list.ListTasksResponse; import org.opensearch.action.bulk.BulkRequestBuilder; @@ -19,7 +19,7 @@ import org.opensearch.action.search.SearchResponse; import org.opensearch.action.support.WriteRequest; import org.opensearch.client.Client; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; import org.opensearch.plugins.Plugin; diff --git a/src/test/java/org/opensearch/search/asynchronous/integTests/DeleteAsynchronousSearchSingleNodeIT.java b/src/test/java/org/opensearch/search/asynchronous/integTests/DeleteAsynchronousSearchSingleNodeIT.java index 5ec3d8c0..a4ed93fd 100644 --- a/src/test/java/org/opensearch/search/asynchronous/integTests/DeleteAsynchronousSearchSingleNodeIT.java +++ b/src/test/java/org/opensearch/search/asynchronous/integTests/DeleteAsynchronousSearchSingleNodeIT.java @@ -11,7 +11,7 @@ import org.opensearch.search.asynchronous.response.AcknowledgedResponse; import org.opensearch.search.asynchronous.response.AsynchronousSearchResponse; import org.opensearch.ResourceNotFoundException; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.LatchedActionListener; import org.opensearch.action.search.SearchRequest; import org.opensearch.common.TriConsumer; diff --git a/src/test/java/org/opensearch/search/asynchronous/integTests/GetAsynchronousSearchSingleNodeIT.java b/src/test/java/org/opensearch/search/asynchronous/integTests/GetAsynchronousSearchSingleNodeIT.java index ebb5eb35..bd64e20e 100644 --- a/src/test/java/org/opensearch/search/asynchronous/integTests/GetAsynchronousSearchSingleNodeIT.java +++ b/src/test/java/org/opensearch/search/asynchronous/integTests/GetAsynchronousSearchSingleNodeIT.java @@ -14,7 +14,7 @@ import org.opensearch.search.asynchronous.utils.QuadConsumer; import org.opensearch.OpenSearchTimeoutException; import org.opensearch.ResourceNotFoundException; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.LatchedActionListener; import org.opensearch.action.search.SearchRequest; import org.opensearch.common.TriConsumer; diff --git a/src/test/java/org/opensearch/search/asynchronous/integTests/MixedOperationSingleNodeIT.java b/src/test/java/org/opensearch/search/asynchronous/integTests/MixedOperationSingleNodeIT.java index 21a90010..d319875f 100644 --- a/src/test/java/org/opensearch/search/asynchronous/integTests/MixedOperationSingleNodeIT.java +++ b/src/test/java/org/opensearch/search/asynchronous/integTests/MixedOperationSingleNodeIT.java @@ -14,7 +14,7 @@ import org.opensearch.search.asynchronous.utils.QuadConsumer; import org.opensearch.OpenSearchTimeoutException; import org.opensearch.ResourceNotFoundException; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.LatchedActionListener; import org.opensearch.action.search.SearchRequest; import org.opensearch.common.unit.TimeValue; diff --git a/src/test/java/org/opensearch/search/asynchronous/integTests/SubmitAsynchronousSearchSingleNodeIT.java b/src/test/java/org/opensearch/search/asynchronous/integTests/SubmitAsynchronousSearchSingleNodeIT.java index 309be4c3..8b387d05 100644 --- a/src/test/java/org/opensearch/search/asynchronous/integTests/SubmitAsynchronousSearchSingleNodeIT.java +++ b/src/test/java/org/opensearch/search/asynchronous/integTests/SubmitAsynchronousSearchSingleNodeIT.java @@ -16,7 +16,7 @@ import org.opensearch.search.asynchronous.response.AsynchronousSearchResponse; import org.opensearch.search.asynchronous.service.AsynchronousSearchService; import org.opensearch.search.asynchronous.utils.AsynchronousSearchAssertions; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.LatchedActionListener; import org.opensearch.action.search.SearchRequest; import org.opensearch.action.search.SearchResponse; diff --git a/src/test/java/org/opensearch/search/asynchronous/listener/AsynchronousSearchCancellationIT.java b/src/test/java/org/opensearch/search/asynchronous/listener/AsynchronousSearchCancellationIT.java index 422d0b78..7a27a854 100644 --- a/src/test/java/org/opensearch/search/asynchronous/listener/AsynchronousSearchCancellationIT.java +++ b/src/test/java/org/opensearch/search/asynchronous/listener/AsynchronousSearchCancellationIT.java @@ -24,7 +24,7 @@ import org.opensearch.script.ScriptType; import org.opensearch.search.SearchService; import org.opensearch.search.aggregations.InternalAggregation; -import org.opensearch.tasks.TaskId; +import org.opensearch.core.tasks.TaskId; import org.opensearch.tasks.TaskInfo; import org.opensearch.test.OpenSearchIntegTestCase; import org.opensearch.threadpool.TestThreadPool; @@ -120,7 +120,7 @@ private void testCase(Client client, SearchRequest request, List exceptionRef = new AtomicReference<>(); CountDownLatch latch = new CountDownLatch(1); Function responseFunction = diff --git a/src/test/java/org/opensearch/search/asynchronous/listener/AsynchronousSearchPartialResponseIT.java b/src/test/java/org/opensearch/search/asynchronous/listener/AsynchronousSearchPartialResponseIT.java index aa91b909..804fa882 100644 --- a/src/test/java/org/opensearch/search/asynchronous/listener/AsynchronousSearchPartialResponseIT.java +++ b/src/test/java/org/opensearch/search/asynchronous/listener/AsynchronousSearchPartialResponseIT.java @@ -21,7 +21,7 @@ import org.opensearch.search.aggregations.InternalAggregation; import org.opensearch.search.aggregations.InternalAggregations; import org.opensearch.search.aggregations.bucket.terms.Terms; -import org.opensearch.tasks.TaskId; +import org.opensearch.core.tasks.TaskId; import org.opensearch.test.OpenSearchIntegTestCase; import org.opensearch.threadpool.TestThreadPool; import org.opensearch.threadpool.ThreadPool; @@ -119,7 +119,7 @@ private void testCase(Client client, SearchRequest request) throws Exception { try { threadPool = new TestThreadPool(AsynchronousSearchProgressListenerIT.class.getName()); SearchService service = internalCluster().getInstance(SearchService.class); - InternalAggregation.ReduceContextBuilder reduceContextBuilder = service.aggReduceContextBuilder(request); + InternalAggregation.ReduceContextBuilder reduceContextBuilder = service.aggReduceContextBuilder(request.source()); AtomicReference exceptionRef = new AtomicReference<>(); CountDownLatch latch = new CountDownLatch(1); Function responseFunction = diff --git a/src/test/java/org/opensearch/search/asynchronous/listener/AsynchronousSearchProgressListenerIT.java b/src/test/java/org/opensearch/search/asynchronous/listener/AsynchronousSearchProgressListenerIT.java index 80ab11a4..74273d89 100644 --- a/src/test/java/org/opensearch/search/asynchronous/listener/AsynchronousSearchProgressListenerIT.java +++ b/src/test/java/org/opensearch/search/asynchronous/listener/AsynchronousSearchProgressListenerIT.java @@ -23,7 +23,7 @@ import org.opensearch.search.builder.SearchSourceBuilder; import org.opensearch.search.sort.FieldSortBuilder; import org.opensearch.search.sort.SortOrder; -import org.opensearch.tasks.TaskId; +import org.opensearch.core.tasks.TaskId; import org.opensearch.test.OpenSearchSingleNodeTestCase; import org.opensearch.threadpool.TestThreadPool; import org.opensearch.threadpool.ThreadPool; @@ -138,7 +138,7 @@ private void testCase(NodeClient client, SearchRequest request) throws Interrupt try { threadPool = new TestThreadPool(AsynchronousSearchProgressListenerIT.class.getName()); SearchService service = getInstanceFromNode(SearchService.class); - InternalAggregation.ReduceContextBuilder reduceContextBuilder = service.aggReduceContextBuilder(request); + InternalAggregation.ReduceContextBuilder reduceContextBuilder = service.aggReduceContextBuilder(request.source()); AtomicReference responseRef = new AtomicReference<>(); AtomicReference exceptionRef = new AtomicReference<>(); CountDownLatch latch = new CountDownLatch(1); diff --git a/src/test/java/org/opensearch/search/asynchronous/listener/AsynchronousSearchTimeoutWrapperTests.java b/src/test/java/org/opensearch/search/asynchronous/listener/AsynchronousSearchTimeoutWrapperTests.java index c4609b2f..5be5a85c 100644 --- a/src/test/java/org/opensearch/search/asynchronous/listener/AsynchronousSearchTimeoutWrapperTests.java +++ b/src/test/java/org/opensearch/search/asynchronous/listener/AsynchronousSearchTimeoutWrapperTests.java @@ -6,7 +6,7 @@ package org.opensearch.search.asynchronous.listener; import org.opensearch.search.asynchronous.plugin.AsynchronousSearchPlugin; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.cluster.coordination.DeterministicTaskQueue; import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; diff --git a/src/test/java/org/opensearch/search/asynchronous/management/AsynchronousSearchManagementServiceIT.java b/src/test/java/org/opensearch/search/asynchronous/management/AsynchronousSearchManagementServiceIT.java index d148235a..ed9cf106 100644 --- a/src/test/java/org/opensearch/search/asynchronous/management/AsynchronousSearchManagementServiceIT.java +++ b/src/test/java/org/opensearch/search/asynchronous/management/AsynchronousSearchManagementServiceIT.java @@ -20,13 +20,13 @@ import org.opensearch.search.asynchronous.response.AcknowledgedResponse; import org.opensearch.search.asynchronous.response.AsynchronousSearchResponse; import org.opensearch.search.asynchronous.task.AsynchronousSearchTask; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.bulk.BulkRequestBuilder; import org.opensearch.action.search.SearchRequest; import org.opensearch.action.support.WriteRequest; import org.opensearch.client.Client; import org.opensearch.cluster.health.ClusterHealthStatus; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; import org.opensearch.index.reindex.ReindexModulePlugin; @@ -34,7 +34,7 @@ import org.opensearch.script.Script; import org.opensearch.script.ScriptType; import org.opensearch.search.SearchService; -import org.opensearch.tasks.TaskId; +import org.opensearch.core.tasks.TaskId; import org.opensearch.test.OpenSearchIntegTestCase; import java.util.Arrays; diff --git a/src/test/java/org/opensearch/search/asynchronous/management/AsynchronousSearchManagementServiceTests.java b/src/test/java/org/opensearch/search/asynchronous/management/AsynchronousSearchManagementServiceTests.java index 15ef0e87..85c33233 100644 --- a/src/test/java/org/opensearch/search/asynchronous/management/AsynchronousSearchManagementServiceTests.java +++ b/src/test/java/org/opensearch/search/asynchronous/management/AsynchronousSearchManagementServiceTests.java @@ -24,7 +24,7 @@ import org.opensearch.common.UUIDs; import org.opensearch.common.settings.Settings; import org.opensearch.common.util.set.Sets; -import org.opensearch.index.Index; +import org.opensearch.core.index.Index; import org.opensearch.test.ClusterServiceUtils; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.transport.MockTransport; diff --git a/src/test/java/org/opensearch/search/asynchronous/request/AsynchronousSearchRequestRoutingIT.java b/src/test/java/org/opensearch/search/asynchronous/request/AsynchronousSearchRequestRoutingIT.java index 7c152d0f..7991cc75 100644 --- a/src/test/java/org/opensearch/search/asynchronous/request/AsynchronousSearchRequestRoutingIT.java +++ b/src/test/java/org/opensearch/search/asynchronous/request/AsynchronousSearchRequestRoutingIT.java @@ -15,7 +15,7 @@ import org.opensearch.search.asynchronous.response.AcknowledgedResponse; import org.opensearch.search.asynchronous.response.AsynchronousSearchResponse; import org.opensearch.search.asynchronous.utils.TestClientUtils; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.LatchedActionListener; import org.opensearch.action.search.SearchRequest; import org.opensearch.cluster.health.ClusterHealthStatus; diff --git a/src/test/java/org/opensearch/search/asynchronous/request/SubmitAsynchronousSearchRequestTests.java b/src/test/java/org/opensearch/search/asynchronous/request/SubmitAsynchronousSearchRequestTests.java index 999485fe..21cd12b3 100644 --- a/src/test/java/org/opensearch/search/asynchronous/request/SubmitAsynchronousSearchRequestTests.java +++ b/src/test/java/org/opensearch/search/asynchronous/request/SubmitAsynchronousSearchRequestTests.java @@ -11,7 +11,7 @@ import org.opensearch.common.unit.TimeValue; import org.opensearch.search.builder.SearchSourceBuilder; import org.opensearch.search.suggest.SuggestBuilder; -import org.opensearch.tasks.TaskId; +import org.opensearch.core.tasks.TaskId; import org.opensearch.test.OpenSearchTestCase; import java.util.HashMap; diff --git a/src/test/java/org/opensearch/search/asynchronous/response/AsynchronousSearchResponseTests.java b/src/test/java/org/opensearch/search/asynchronous/response/AsynchronousSearchResponseTests.java index d4dfa0e7..c7d4544f 100644 --- a/src/test/java/org/opensearch/search/asynchronous/response/AsynchronousSearchResponseTests.java +++ b/src/test/java/org/opensearch/search/asynchronous/response/AsynchronousSearchResponseTests.java @@ -5,6 +5,7 @@ package org.opensearch.search.asynchronous.response; +import org.opensearch.core.xcontent.MediaType; import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.search.asynchronous.context.state.AsynchronousSearchState; @@ -13,11 +14,10 @@ import org.opensearch.action.search.ShardSearchFailure; import org.opensearch.client.Requests; import org.opensearch.common.Randomness; -import org.opensearch.common.bytes.BytesReference; -import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.bytes.BytesReference; +import org.opensearch.core.common.io.stream.Writeable; import org.opensearch.common.xcontent.LoggingDeprecationHandler; import org.opensearch.common.xcontent.XContentHelper; -import org.opensearch.common.xcontent.XContentType; import org.opensearch.search.SearchHit; import org.opensearch.search.SearchHits; import org.opensearch.search.aggregations.InternalAggregations; @@ -30,7 +30,6 @@ import java.util.Collections; import java.util.UUID; -import static org.opensearch.common.xcontent.XContentHelper.toXContent; public class AsynchronousSearchResponseTests extends AbstractSerializingTestCase { @@ -90,8 +89,8 @@ public void testXContentRoundTripForAsynchronousSearchResponseContainingError() randomNonNegativeLong(), randomNonNegativeLong(), null, new RuntimeException("test")); BytesReference serializedResponse; - XContentType xContentType = Requests.INDEX_CONTENT_TYPE; - serializedResponse = toXContent(asResponse, xContentType, true); + MediaType xContentType = Requests.INDEX_CONTENT_TYPE; + serializedResponse = org.opensearch.core.xcontent.XContentHelper.toXContent(asResponse, xContentType, true); try (XContentParser parser = XContentHelper.createParser(NamedXContentRegistry.EMPTY, LoggingDeprecationHandler.INSTANCE, serializedResponse, xContentType)) { AsynchronousSearchResponse asResponse1 = AsynchronousSearchResponse.fromXContent(parser); diff --git a/src/test/java/org/opensearch/search/asynchronous/restIT/AsynchronousSearchRestTestCase.java b/src/test/java/org/opensearch/search/asynchronous/restIT/AsynchronousSearchRestTestCase.java index 2f0cdec4..86326716 100644 --- a/src/test/java/org/opensearch/search/asynchronous/restIT/AsynchronousSearchRestTestCase.java +++ b/src/test/java/org/opensearch/search/asynchronous/restIT/AsynchronousSearchRestTestCase.java @@ -6,10 +6,7 @@ package org.opensearch.search.asynchronous.restIT; import org.opensearch.core.common.Strings; -import org.opensearch.core.xcontent.DeprecationHandler; -import org.opensearch.core.xcontent.NamedXContentRegistry; -import org.opensearch.core.xcontent.XContentBuilder; -import org.opensearch.core.xcontent.XContentParser; +import org.opensearch.core.xcontent.*; import org.opensearch.search.asynchronous.SecurityEnabledRestTestCase; import org.opensearch.search.asynchronous.request.DeleteAsynchronousSearchRequest; import org.opensearch.search.asynchronous.request.GetAsynchronousSearchRequest; @@ -30,8 +27,7 @@ import org.opensearch.common.Nullable; import org.opensearch.common.settings.Settings; import org.opensearch.common.xcontent.XContentFactory; -import org.opensearch.common.xcontent.XContentType; -import org.opensearch.rest.RestStatus; +import org.opensearch.core.rest.RestStatus; import org.opensearch.search.SearchModule; import javax.management.MBeanServerInvocationHandler; @@ -166,7 +162,7 @@ protected final Resp parseEntity(final HttpEntity entity, if (entity.getContentType() == null) { throw new IllegalStateException("Elasticsearch didn't return the [Content-Type] header, unable to parse response body"); } - XContentType xContentType = XContentType.fromMediaType(entity.getContentType()); + MediaType xContentType = MediaType.fromMediaType(entity.getContentType()); if (xContentType == null) { throw new IllegalStateException("Unsupported Content-Type: " + entity.getContentType()); } @@ -222,7 +218,7 @@ protected void updateClusterSettings(String settingKey, Object value) throws Exc .endObject() .endObject(); Request request = new Request("PUT", "_cluster/settings"); - request.setJsonEntity(org.opensearch.common.Strings.toString(builder)); + request.setJsonEntity(builder.toString()); Response response = client().performRequest(request); assertEquals(RestStatus.OK, RestStatus.fromCode(response.getStatusLine().getStatusCode())); } diff --git a/src/test/java/org/opensearch/search/asynchronous/service/AsynchronousSearchPostProcessorTests.java b/src/test/java/org/opensearch/search/asynchronous/service/AsynchronousSearchPostProcessorTests.java index aebc9b8f..7aeedb16 100644 --- a/src/test/java/org/opensearch/search/asynchronous/service/AsynchronousSearchPostProcessorTests.java +++ b/src/test/java/org/opensearch/search/asynchronous/service/AsynchronousSearchPostProcessorTests.java @@ -20,9 +20,9 @@ import org.opensearch.search.asynchronous.utils.AsynchronousSearchAssertions; import org.apache.lucene.search.TotalHits; import org.opensearch.Version; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.ActionRequest; -import org.opensearch.action.ActionResponse; +import org.opensearch.core.action.ActionResponse; import org.opensearch.action.ActionType; import org.opensearch.action.index.IndexAction; import org.opensearch.action.search.SearchPhaseExecutionException; @@ -33,7 +33,7 @@ import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.cluster.node.DiscoveryNodeRole; import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.io.stream.NamedWriteableRegistry; +import org.opensearch.core.common.io.stream.NamedWriteableRegistry; import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Setting; import org.opensearch.common.settings.Settings; diff --git a/src/test/java/org/opensearch/search/asynchronous/service/AsynchronousSearchServiceFreeContextTests.java b/src/test/java/org/opensearch/search/asynchronous/service/AsynchronousSearchServiceFreeContextTests.java index 0c818bfc..f9ed251b 100644 --- a/src/test/java/org/opensearch/search/asynchronous/service/AsynchronousSearchServiceFreeContextTests.java +++ b/src/test/java/org/opensearch/search/asynchronous/service/AsynchronousSearchServiceFreeContextTests.java @@ -20,9 +20,9 @@ import org.opensearch.OpenSearchTimeoutException; import org.opensearch.ResourceNotFoundException; import org.opensearch.Version; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.ActionRequest; -import org.opensearch.action.ActionResponse; +import org.opensearch.core.action.ActionResponse; import org.opensearch.action.ActionType; import org.opensearch.action.DocWriteResponse; import org.opensearch.action.LatchedActionListener; @@ -40,22 +40,22 @@ import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.cluster.node.DiscoveryNodeRole; import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.io.stream.NamedWriteableRegistry; +import org.opensearch.core.common.io.stream.NamedWriteableRegistry; import org.opensearch.common.lease.Releasable; import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Setting; import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.concurrent.OpenSearchExecutors; -import org.opensearch.index.Index; -import org.opensearch.index.shard.ShardId; +import org.opensearch.core.index.Index; +import org.opensearch.core.index.shard.ShardId; import org.opensearch.search.SearchHit; import org.opensearch.search.SearchHits; import org.opensearch.search.aggregations.InternalAggregations; import org.opensearch.search.internal.InternalSearchResponse; import org.opensearch.search.profile.SearchProfileShardResults; import org.opensearch.search.suggest.Suggest; -import org.opensearch.tasks.TaskId; +import org.opensearch.core.tasks.TaskId; import org.opensearch.test.ClusterServiceUtils; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.client.NoOpClient; @@ -82,7 +82,7 @@ import static org.opensearch.search.asynchronous.commons.AsynchronousSearchTestCase.mockAsynchronousSearchProgressListener; import static java.util.Collections.emptyList; import static java.util.Collections.emptyMap; -import static org.opensearch.action.ActionListener.wrap; +import static org.opensearch.core.action.ActionListener.wrap; import static org.opensearch.common.unit.TimeValue.timeValueDays; import static org.opensearch.common.unit.TimeValue.timeValueHours; import static org.mockito.ArgumentMatchers.any; diff --git a/src/test/java/org/opensearch/search/asynchronous/service/AsynchronousSearchServiceTests.java b/src/test/java/org/opensearch/search/asynchronous/service/AsynchronousSearchServiceTests.java index 76dbc779..c37f4eeb 100644 --- a/src/test/java/org/opensearch/search/asynchronous/service/AsynchronousSearchServiceTests.java +++ b/src/test/java/org/opensearch/search/asynchronous/service/AsynchronousSearchServiceTests.java @@ -21,9 +21,9 @@ import org.opensearch.OpenSearchTimeoutException; import org.opensearch.ResourceNotFoundException; import org.opensearch.Version; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.ActionRequest; -import org.opensearch.action.ActionResponse; +import org.opensearch.core.action.ActionResponse; import org.opensearch.action.ActionType; import org.opensearch.action.LatchedActionListener; import org.opensearch.action.index.IndexAction; @@ -34,7 +34,7 @@ import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.cluster.node.DiscoveryNodeRole; import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.io.stream.NamedWriteableRegistry; +import org.opensearch.core.common.io.stream.NamedWriteableRegistry; import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Setting; import org.opensearch.common.settings.Settings; @@ -48,7 +48,7 @@ import org.opensearch.search.internal.InternalSearchResponse; import org.opensearch.search.profile.SearchProfileShardResults; import org.opensearch.search.suggest.Suggest; -import org.opensearch.tasks.TaskId; +import org.opensearch.core.tasks.TaskId; import org.opensearch.test.ClusterServiceUtils; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.client.NoOpClient; @@ -70,7 +70,7 @@ import static java.util.Collections.emptyList; import static java.util.Collections.emptyMap; -import static org.opensearch.action.ActionListener.wrap; +import static org.opensearch.core.action.ActionListener.wrap; import static org.opensearch.common.unit.TimeValue.timeValueHours; import static org.hamcrest.Matchers.greaterThan; diff --git a/src/test/java/org/opensearch/search/asynchronous/service/AsynchronousSearchServiceUpdateContextTests.java b/src/test/java/org/opensearch/search/asynchronous/service/AsynchronousSearchServiceUpdateContextTests.java index dc975ec6..18c517aa 100644 --- a/src/test/java/org/opensearch/search/asynchronous/service/AsynchronousSearchServiceUpdateContextTests.java +++ b/src/test/java/org/opensearch/search/asynchronous/service/AsynchronousSearchServiceUpdateContextTests.java @@ -11,9 +11,9 @@ import org.opensearch.OpenSearchTimeoutException; import org.opensearch.ResourceNotFoundException; import org.opensearch.Version; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.ActionRequest; -import org.opensearch.action.ActionResponse; +import org.opensearch.core.action.ActionResponse; import org.opensearch.action.ActionType; import org.opensearch.action.DocWriteResponse; import org.opensearch.action.LatchedActionListener; @@ -28,20 +28,20 @@ import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.cluster.node.DiscoveryNodeRole; import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.bytes.BytesReference; -import org.opensearch.common.io.stream.NamedWriteableRegistry; +import org.opensearch.core.common.bytes.BytesReference; +import org.opensearch.core.common.io.stream.NamedWriteableRegistry; import org.opensearch.common.lease.Releasable; import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Setting; import org.opensearch.common.settings.Settings; import org.opensearch.common.unit.TimeValue; import org.opensearch.common.util.concurrent.OpenSearchExecutors; -import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; +import org.opensearch.core.xcontent.MediaTypeRegistry; import org.opensearch.core.xcontent.XContentBuilder; -import org.opensearch.index.Index; +import org.opensearch.core.index.Index; import org.opensearch.index.get.GetResult; -import org.opensearch.index.shard.ShardId; +import org.opensearch.core.index.shard.ShardId; import org.opensearch.search.SearchHit; import org.opensearch.search.SearchHits; import org.opensearch.search.aggregations.InternalAggregations; @@ -57,7 +57,7 @@ import org.opensearch.search.internal.InternalSearchResponse; import org.opensearch.search.profile.SearchProfileShardResults; import org.opensearch.search.suggest.Suggest; -import org.opensearch.tasks.TaskId; +import org.opensearch.core.tasks.TaskId; import org.opensearch.test.ClusterServiceUtils; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.client.NoOpClient; @@ -87,7 +87,7 @@ import static org.hamcrest.Matchers.greaterThan; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -import static org.opensearch.action.ActionListener.wrap; +import static org.opensearch.core.action.ActionListener.wrap; import static org.opensearch.common.unit.TimeValue.timeValueHours; import static org.opensearch.search.asynchronous.commons.AsynchronousSearchTestCase.mockAsynchronousSearchProgressListener; import static org.opensearch.search.asynchronous.context.state.AsynchronousSearchState.CLOSED; @@ -586,7 +586,7 @@ protected void Map sourceMap = new HashMap<>(); sourceMap.put(EXPIRATION_TIME_MILLIS, randomNonNegativeLong()); sourceMap.put(START_TIME_MILLIS, randomNonNegativeLong()); - XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON); + XContentBuilder builder = MediaTypeRegistry.contentBuilder(XContentType.JSON); builder.map(sourceMap); BytesReference source = BytesReference.bytes(builder); updateResponse.setGetResult(new GetResult(ASYNC_SEARCH_RESPONSE_INDEX, diff --git a/src/test/java/org/opensearch/search/asynchronous/service/AsynchronousSearchStateMachineTests.java b/src/test/java/org/opensearch/search/asynchronous/service/AsynchronousSearchStateMachineTests.java index df8f3c95..776b7f9c 100644 --- a/src/test/java/org/opensearch/search/asynchronous/service/AsynchronousSearchStateMachineTests.java +++ b/src/test/java/org/opensearch/search/asynchronous/service/AsynchronousSearchStateMachineTests.java @@ -25,9 +25,9 @@ import org.apache.lucene.search.TotalHits; import org.opensearch.OpenSearchException; import org.opensearch.Version; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.ActionRequest; -import org.opensearch.action.ActionResponse; +import org.opensearch.core.action.ActionResponse; import org.opensearch.action.ActionType; import org.opensearch.action.admin.indices.create.CreateIndexAction; import org.opensearch.action.search.SearchAction; @@ -36,7 +36,7 @@ import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.cluster.node.DiscoveryNodeRole; import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.io.stream.NamedWriteableRegistry; +import org.opensearch.core.common.io.stream.NamedWriteableRegistry; import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Setting; import org.opensearch.common.settings.Settings; @@ -48,7 +48,7 @@ import org.opensearch.search.internal.InternalSearchResponse; import org.opensearch.search.profile.SearchProfileShardResults; import org.opensearch.search.suggest.Suggest; -import org.opensearch.tasks.TaskId; +import org.opensearch.core.tasks.TaskId; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.client.NoOpClient; import org.opensearch.threadpool.ExecutorBuilder; diff --git a/src/test/java/org/opensearch/search/asynchronous/service/persistence/AsynchronousSearchPersistenceServiceIT.java b/src/test/java/org/opensearch/search/asynchronous/service/persistence/AsynchronousSearchPersistenceServiceIT.java index 81b7ef82..bef1651e 100644 --- a/src/test/java/org/opensearch/search/asynchronous/service/persistence/AsynchronousSearchPersistenceServiceIT.java +++ b/src/test/java/org/opensearch/search/asynchronous/service/persistence/AsynchronousSearchPersistenceServiceIT.java @@ -24,7 +24,7 @@ import org.opensearch.OpenSearchSecurityException; import org.opensearch.OpenSearchTimeoutException; import org.opensearch.ResourceNotFoundException; -import org.opensearch.action.ActionListener; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.DocWriteResponse; import org.opensearch.action.LatchedActionListener; import org.opensearch.action.index.IndexResponse; diff --git a/src/test/java/org/opensearch/search/asynchronous/utils/RestTestUtils.java b/src/test/java/org/opensearch/search/asynchronous/utils/RestTestUtils.java index 74269f57..86aeb5a0 100644 --- a/src/test/java/org/opensearch/search/asynchronous/utils/RestTestUtils.java +++ b/src/test/java/org/opensearch/search/asynchronous/utils/RestTestUtils.java @@ -28,7 +28,6 @@ import org.opensearch.common.SuppressForbidden; import org.opensearch.common.lucene.uid.Versions; import org.opensearch.common.unit.TimeValue; -import org.opensearch.common.xcontent.XContentHelper; import org.opensearch.common.xcontent.XContentType; import org.opensearch.index.VersionType; import org.opensearch.index.seqno.SequenceNumbers; @@ -449,14 +448,14 @@ Params withActions(List actions) { return this; } - Params withTaskId(org.opensearch.tasks.TaskId taskId) { + Params withTaskId(org.opensearch.core.tasks.TaskId taskId) { if (taskId != null && taskId.isSet()) { return putParam("task_id", taskId.toString()); } return this; } - Params withParentTaskId(org.opensearch.tasks.TaskId parentTaskId) { + Params withParentTaskId(org.opensearch.core.tasks.TaskId parentTaskId) { if (parentTaskId != null && parentTaskId.isSet()) { return putParam("parent_task_id", parentTaskId.toString()); } @@ -506,7 +505,8 @@ static HttpEntity createEntity(ToXContent toXContent, XContentType xContentType) static HttpEntity createEntity(ToXContent toXContent, XContentType xContentType, ToXContent.Params toXContentParams) throws IOException { - BytesRef source = XContentHelper.toXContent(toXContent, xContentType, toXContentParams, false).toBytesRef(); + BytesRef source = org.opensearch.core.xcontent.XContentHelper.toXContent( + toXContent, xContentType, toXContentParams, false).toBytesRef(); return new ByteArrayEntity(source.bytes, source.offset, source.length, createContentType(xContentType)); } diff --git a/src/test/java/org/opensearch/search/asynchronous/utils/TestClientUtils.java b/src/test/java/org/opensearch/search/asynchronous/utils/TestClientUtils.java index 8d6e7280..49fcb548 100644 --- a/src/test/java/org/opensearch/search/asynchronous/utils/TestClientUtils.java +++ b/src/test/java/org/opensearch/search/asynchronous/utils/TestClientUtils.java @@ -16,8 +16,8 @@ import org.opensearch.search.asynchronous.response.AcknowledgedResponse; import org.opensearch.search.asynchronous.response.AsynchronousSearchResponse; import org.opensearch.search.asynchronous.service.AsynchronousSearchPersistenceService; -import org.opensearch.action.ActionFuture; -import org.opensearch.action.ActionListener; +import org.opensearch.common.action.ActionFuture; +import org.opensearch.core.action.ActionListener; import org.opensearch.action.bulk.BackoffPolicy; import org.opensearch.action.get.GetRequest; import org.opensearch.action.get.GetResponse; diff --git a/src/test/java/org/opensearch/search/asynchronous/utils/TestUtils.java b/src/test/java/org/opensearch/search/asynchronous/utils/TestUtils.java index ad76c683..75acd9cb 100644 --- a/src/test/java/org/opensearch/search/asynchronous/utils/TestUtils.java +++ b/src/test/java/org/opensearch/search/asynchronous/utils/TestUtils.java @@ -13,10 +13,9 @@ import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.cluster.node.DiscoveryNodes; import org.opensearch.cluster.service.ClusterService; -import org.opensearch.common.bytes.BytesReference; +import org.opensearch.core.common.bytes.BytesReference; import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Settings; -import org.opensearch.common.xcontent.XContentHelper; import org.opensearch.threadpool.ThreadPool; import java.io.IOException; @@ -49,7 +48,8 @@ public static ClusterService createClusterService(Settings settings, ThreadPool public static Map getResponseAsMap(SearchResponse searchResponse) throws IOException { if (searchResponse != null) { - BytesReference response = XContentHelper.toXContent(searchResponse, Requests.INDEX_CONTENT_TYPE, true); + BytesReference response = org.opensearch.core.xcontent.XContentHelper.toXContent( + searchResponse, Requests.INDEX_CONTENT_TYPE, true); if (response == null) { return emptyMap(); }